在意大利版本的 Microsoft Dynamics NAV 中过帐发票时,并非所有从发票生成的客户账本条目都会关闭

应用对象
Dynamics NAV 2009 Service Pack 1 Dynamics NAV 2009 Microsoft Dynamics NAV 5.0 Service Pack 1

快速发布的文章直接从Microsoft支持组织内部提供信息。 此处包含的信息是针对新出现或唯一主题创建的,或旨在补充其他知识库信息。

本文适用于) 语言区域设置的意大利语 (的 Microsoft Dynamics NAV。

症状

假设你有一张使用多个费率的发票,并且发票的付款方式使用意大利版 Microsoft Dynamics NAV 中的余额帐号。 使用自动付款过帐发票时,Microsoft Dynamics NAV 为发票创建多行,为付款创建一行。 但是,仅应用并关闭第一张发票。 其他发票仍处于打开状态。

以下产品中会出现此问题:

  • Microsoft Dynamics NAV 2009 Service Pack 1 的意大利版本
  • Microsoft Dynamics NAV 2009 的意大利版本
  • Microsoft Dynamics NAV 5.0 Service Pack 1 的意大利版本

解决方法

修补程序信息

Microsoft现在提供了受支持的修补程序。 但是,它仅用于更正本文中所述的问题。 仅将其应用于遇到此特定问题的系统。 此修补程序可能会收到其他测试。 因此,如果你没有受到此问题的严重影响,我们建议你等待下一个Microsoft Dynamics NAV Service Pack 或包含此修补程序的下一Microsoft Dynamics NAV 版本。

注意 在特殊情况下,如果 Microsoft Dynamics 和相关产品的技术支持专业人员确定特定更新将解决你的问题,则通常由支持呼叫产生的费用可能会被取消。 对于相关特定升级无法解决的其他支持问题和事项,将照常收取支持费用。

            
          

安装信息

Microsoft 的编程示例仅用于说明,不做任何明示或暗示的保证。 这包括但不限于特定用途的适销性或适用性的隐含保证。 本文假定你熟悉所演示的编程语言以及用于创建和调试过程的工具。 Microsoft 支持工程师可以帮助解释特定过程的功能,但他们不会修改这些示例以提供新增功能或构建步骤以满足你的特定需要。

注意 在安装此修补程序之前,请验证所有 Microsoft Navision 客户端用户是否已从系统注销。 这包括 Microsoft Navision Application Services (NAS) 客户端用户。 实现此修补程序时,应是唯一登录的客户端用户。

若要实现此修补程序,必须具有开发人员许可证。

建议为 Windows 登录窗口或数据库登录名窗口中的用户帐户分配“SUPER”角色 ID。 如果无法为用户帐户分配“SUPER”角色 ID,则必须验证该用户帐户是否具有以下权限:

  • 要更改的 对象的“修改”权限。
  • 系统对象 ID 5210 对象和系统对象 ID 9015 对象的 Execute 权限。

                
注意 除非必须执行数据修复,否则您不必拥有数据存储的权限。

代码更改

注意 在将修补程序应用到生产计算机之前,始终在受控环境中测试代码修复。
若要应用此修补程序,请执行以下步骤:

  1. 更改 Cust.账本条目表中的键 (21) 如下所示:
    现有

    • Enabled:Yes
    • 文档类型、文档编号、文档匹配项
    • SumIndexFields

    替换一个

    • Enabled:Yes
    • 文档类型、文档编号、文档匹配项
    • SumIndexFields剩余的 Pmt.光盘。可能
  2. 更改供应商账本条目表中的键 (25) ,如下所示:
    现有

    • Enabled:Yes
    • 文档类型、文档编号、文档发生项、供应商编号。
    • SumIndexFields

    替换一个

    • Enabled:Yes
    • 文档类型、文档编号、文档发生项、供应商编号。
    • SumIndexFields剩余的 Pmt.光盘。可能
  3. 在 Gen 中的 ApplyCustLedgEntry 函数中添加局部变量。 Jnl.-Post Line codeunit (12) ,然后指定变量,如下所示:

    • 名称:PaymentTerms
    • DataTypeRecord
    • 子类型付款条款
  4. 更改 Gen 中的 ApplyCustLedgEntry 函数中的代码。 Jnl.-Post Line codeunit (12) 如下所示:
    现有代码 1

    ...
    END ELSE
        ApplnRoundingPrecision := GLSetup."Appln. Rounding Precision";
    ApplyingDate := GenJnlLine."Posting Date";
    
    IF GenJnlLine."Applies-to Doc. No." <> '' THEN BEGIN
      // Find the entry to be applied to
    ...
    
    

    替换代码 1

    ...
    END ELSE
        ApplnRoundingPrecision := GLSetup."Appln. Rounding Precision";
    ApplyingDate := GenJnlLine."Posting Date";
    // Add the following lines.
    Cust.GET(GenJnlLine."Account No.");    
    IF Cust."Payment Terms Code" <> '' THEN BEGIN  
      PaymentTerms.GET(Cust."Payment Terms Code"); 
      PaymentTerms.CALCFIELDS("Payment Nos.");
    END;  
    // End of the added lines.
    
    IF GenJnlLine."Applies-to Doc. No." <> '' THEN BEGIN
      // Find the entry to be applied to
    ...
    
    

    现有代码 2

    ...
         (OldCustLedgEntry.COUNT=1)
      THEN
        GenJnlLine."Applies-to Occurrence No." := 1;
    
    // Delete the following line.
      OldCustLedgEntry.SETRANGE("Document Occurrence",GenJnlLine."Applies-to Occurrence No.");
    
      OldCustLedgEntry.SETRANGE(Open,TRUE);
    
      // Delete the following lines.
      OldCustLedgEntry.FINDFIRST;
      OldCustLedgEntry.TESTFIELD("Bank Receipt Issued", FALSE);  
      OldCustLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
      IF OldCustLedgEntry."Posting Date" > ApplyingDate THEN
        ApplyingDate := OldCustLedgEntry."Posting Date";
      GenJnlApply.CheckAgainstApplnCurrency(  
        NewCVLedgEntryBuf."Currency Code",
        OldCustLedgEntry."Currency Code", 
        GenJnlLine."Account Type"::Customer,
        TRUE);
      TempOldCustLedgEntry := OldCustLedgEntry;
      TempOldCustLedgEntry.INSERT;
    // End of the deleted lines.
    
    END ELSE BEGIN
      // Find the first old entry (Invoice) which the new entry (Payment) should apply to
    ...
    
    

    替换代码 2

    ...
         (OldCustLedgEntry.COUNT=1)
      THEN
        GenJnlLine."Applies-to Occurrence No." := 1;
      OldCustLedgEntry.SETRANGE(Open,TRUE);
    
      // Add the following lines.
      IF OldCustLedgEntry.FINDSET THEN
        REPEAT
          OldCustLedgEntry.TESTFIELD("Bank Receipt Issued", FALSE); 
          OldCustLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
          IF OldCustLedgEntry."Posting Date" > ApplyingDate THEN
            ApplyingDate := OldCustLedgEntry."Posting Date";  
            GenJnlApply.CheckAgainstApplnCurrency( 
            NewCVLedgEntryBuf."Currency Code", 
            OldCustLedgEntry."Currency Code", 
            GenJnlLine."Account Type"::Customer,
            TRUE);             
           TempOldCustLedgEntry := OldCustLedgEntry; 
           TempOldCustLedgEntry.INSERT;
         UNTIL OldCustLedgEntry.NEXT = 0;  
      IF NOT TempOldCustLedgEntry.FINDSET THEN
        EXIT;   
    // End of the added lines.
    
    END ELSE BEGIN
      // Find the first old entry (Invoice) which the new entry (Payment) should apply to
    ...
    
    

    现有代码 3

    ...
      TempOldCustLedgEntry.DELETE;
    
        // Find the next old entry for application of the new entry
    
    // Delete the following line.
      IF GenJnlLine."Applies-to Doc. No." <> '' THEN
    
        Completed := TRUE
    ...
    
    

    替换代码 3

    ...
      TempOldCustLedgEntry.DELETE;
    
        // Find the next old entry for application of the new entry
    
    // Add the following line.
      IF (GenJnlLine."Applies-to Doc. No." <> '') AND (PaymentTerms."Payment Nos." <= 1) THEN
    
        Completed := TRUE
    ...
    
    
  5. 在 Gen 中的 ApplyVendLedgEntry 函数中添加局部变量。 Jnl.-Post Line codeunit (12) ,然后指定变量,如下所示:

    • 名称:PaymentTerms
    • DataTypeRecord
    • 子类型付款条款
  6. 更改 Gen 中的 ApplyVendLedgEntry 函数中的代码。 Jnl.-Post Line codeunit (12) 如下所示:
    现有代码 1

    ...
    ApplyingDate := GenJnlLine."Posting Date";
    
    IF GenJnlLine."Applies-to Doc. No." <> '' THEN BEGIN
      // Find the entry to be applied to
    ...
    
    

    替换代码 1

    ...
    ApplyingDate := GenJnlLine."Posting Date";
    // Add the following lines.
    Vend.GET(GenJnlLine."Account No.");   
    IF Vend."Payment Terms Code" <> '' THEN BEGIN  
      PaymentTerms.GET(Vend."Payment Terms Code"); 
      PaymentTerms.CALCFIELDS("Payment Nos.");
    END;  
    // End of the added lines.
    
    IF GenJnlLine."Applies-to Doc. No." <> '' THEN BEGIN
      // Find the entry to be applied to
    ...
    
    

    现有代码 2

    ...
        GenJnlLine."Applies-to Occurrence No." := 1;
    
    // Delete the following line.  
    OldVendLedgEntry.SETRANGE("Document Occurrence",GenJnlLine."Applies-to Occurrence No.");
    
      OldVendLedgEntry.SETRANGE(Open,TRUE);
      OldVendLedgEntry.SETRANGE("On Hold",'');
    
     // Delete the following lines.  
      OldVendLedgEntry.FINDFIRST;
      OldVendLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive); 
      IF OldVendLedgEntry."Posting Date" > ApplyingDate THEN 
        ApplyingDate := OldVendLedgEntry."Posting Date"; 
      GenJnlApply.CheckAgainstApplnCurrency( 
        NewCVLedgEntryBuf."Currency Code",  
        OldVendLedgEntry."Currency Code",  
        GenJnlLine."Account Type"::Vendor, 
        TRUE);  
      TempOldVendLedgEntry := OldVendLedgEntry;
      TempOldVendLedgEntry.INSERT;
     // End of the deleted lines.
    
    END ELSE BEGIN
      // Find the first old entry (Invoice) which the new entry (Payment) should apply to
    ...
    
    

    替换代码 2

    ...
        GenJnlLine."Applies-to Occurrence No." := 1;
    
      OldVendLedgEntry.SETRANGE(Open,TRUE);
      OldVendLedgEntry.SETRANGE("On Hold",'');
    
     // Add the following lines.
      IF OldVendLedgEntry.FINDSET THEN  
        REPEAT  
          OldVendLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
          IF OldVendLedgEntry."Posting Date" > ApplyingDate THEN  
            ApplyingDate := OldVendLedgEntry."Posting Date"; 
          GenJnlApply.CheckAgainstApplnCurrency(
            NewCVLedgEntryBuf."Currency Code",
            OldVendLedgEntry."Currency Code", 
            GenJnlLine."Account Type"::Vendor,
            TRUE);
          TempOldVendLedgEntry := OldVendLedgEntry;
          TempOldVendLedgEntry.INSERT;
        UNTIL OldVendLedgEntry.NEXT = 0; 
      IF NOT TempOldVendLedgEntry.FINDSET THEN 
        EXIT; 
     // End of the added lines.
    
    END ELSE BEGIN
      // Find the first old entry (Invoice) which the new entry (Payment) should apply to
    ...
    
    

    现有代码 3

    ...
      TempOldVendLedgEntry.DELETE;
    
      // Find the next old entry to apply to the new entry
    
    // Delete the following line.
      IF GenJnlLine."Applies-to Doc. No." <> '' THEN 
    
        Completed := TRUE
    ...
    
    

    替换代码 3

    ...
      TempOldVendLedgEntry.DELETE;
    
      // Find the next old entry to apply to the new entry
    
    // Add the following line.
      IF (GenJnlLine."Applies-to Doc. No." <> '') AND (PaymentTerms."Payment Nos." <= 1)  THEN
    
        Completed := TRUE
    ...
    
    
  7. 在 Sales-Post codeunit (80) 的 OnRun 触发器中添加局部变量,然后指定变量,如下所示:

    • 名称:TotalRemainPmtDiscPossible
    • DataTypeDecimal
  8. 更改 Sales-Post codeunit (80) OnRun 触发器中的代码,如下所示:
    现有代码 1

    ...
        // Balancing account
        IF "Bal. Account No." <> '' THEN BEGIN
          Window.UPDATE(5,1);
          CustLedgEntry.FINDLAST;
          GenJnlLine.INIT;
    ...
    
    

    替换代码 1

    ...
        // Balancing account
        IF "Bal. Account No." <> '' THEN BEGIN
          Window.UPDATE(5,1);
    
    // Add the following lines.
          CustLedgEntry.RESET;
          CustLedgEntry.SETCURRENTKEY("Document Type","Document No.");
          CustLedgEntry.SETRANGE("Document Type","Document Type");
          CustLedgEntry.SETRANGE("Document No.",GenJnlLineDocNo);
          CustLedgEntry.CALCSUMS("Remaining Pmt. Disc. Possible"); 
          TotalRemainPmtDiscPossible := CustLedgEntry."Remaining Pmt. Disc. Possible"; 
    // End of the added lines.
    
          CustLedgEntry.FINDLAST;
          GenJnlLine.INIT;
    ...
    
    

    现有代码 2

    ...
          GenJnlLine."Currency Code" := "Currency Code";
          GenJnlLine.Amount :=
    
    // Delete the following line.
            TotalSalesLine."Amount Including VAT" + CustLedgEntry."Remaining Pmt. Disc. Possible";
    
          GenJnlLine."Source Currency Code" := "Currency Code";
          GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
    ...
    
    

    替换代码 2

    ...
          GenJnlLine."Currency Code" := "Currency Code";
          GenJnlLine.Amount :=
    
    // Add the following line.
            TotalSalesLine."Amount Including VAT" + TotalRemainPmtDiscPossible;
    
          GenJnlLine."Source Currency Code" := "Currency Code";
          GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
    ...
    
    
  9. 在 Purch.-Post codeunti (90) 的 OnRun 触发器中添加局部变量,然后指定变量,如下所示:

    • 名称:TotalRemainPmtDiscPossible
    • DataTypeDecimal
  10. 在 90) 的Purch.-Post codeunti (OnRun 触发器中更改代码,如下所示:
    现有代码 1

    ...
        GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim);
    
        // Balancing account
        IF "Bal. Account No." <> '' THEN BEGIN
          IF GUIALLOWED THEN
            Window.UPDATE(5,1);
          VendLedgEntry.FINDLAST;
          GenJnlLine.INIT;
          GenJnlLine."Posting Date" := "Posting Date";
    ...
    
    

    替换代码 1

    ...
        GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim);
    
        // Balancing account
        IF "Bal. Account No." <> '' THEN BEGIN
          IF GUIALLOWED THEN
            Window.UPDATE(5,1);
    
    // Add the following lines.
          VendLedgEntry.RESET;  
          VendLedgEntry.SETCURRENTKEY("Document Type","Document No.");
          VendLedgEntry.SETRANGE("Document Type","Document Type"); 
          VendLedgEntry.SETRANGE("Document No.",GenJnlLineDocNo); 
          VendLedgEntry.CALCSUMS("Remaining Pmt. Disc. Possible"); 
          TotalRemainPmtDiscPossible := VendLedgEntry."Remaining Pmt. Disc. Possible";
    // End of the added lines.
    
          VendLedgEntry.FINDLAST;
          GenJnlLine.INIT;
          GenJnlLine."Posting Date" := "Posting Date";
    
    ...
    
    

    现有代码 2

    ...
          GenJnlLine."Currency Code" := "Currency Code";
          GenJnlLine.Amount := TotalPurchLine."Amount Including VAT" +
    
    // Delete the following line.
            VendLedgEntry."Remaining Pmt. Disc. Possible"; 
    
          GenJnlLine.Correction := Correction;
          GenJnlLine."Source Currency Code" := "Currency Code";
    ...
    
    

    替换代码 2

    ...
          GenJnlLine."Currency Code" := "Currency Code";
          GenJnlLine.Amount := TotalPurchLine."Amount Including VAT" +
    
    // Add the following line.
            TotalRemainPmtDiscPossible;
    
          GenJnlLine.Correction := Correction;
          GenJnlLine."Source Currency Code" := "Currency Code";
    ...
    
    

先决条件

必须安装以下产品之一才能应用此修补程序:

  • Microsoft Dynamics NAV 2009 Service Pack 1 的意大利版本
  • Microsoft Dynamics NAV 2009 的意大利版本
  • Microsoft Dynamics NAV 5.0 Service Pack 1 的意大利版本

              

删除信息

无法删除此修补程序。

状态

Microsoft 已确认在 "适用于" 部分中所列的 Microsoft 产品中存在问题。

MICROSOFT和/或其供应商不就此网站上发布的文档和相关图形中包含的信息的适用性、可靠性或准确性作出任何声明或保证, (“材料”) 出于任何目的。

这些材料可能包含技术不准确或排版错误,可随时修订,不另行通知。 在适用法律允许的最大范围内,MICROSOFT和/或其供应商否认并排除所有明示、默示或法定的陈述、保证和条件,包括但不限于与材料有关的所有权、不侵权、令人满意的条件或质量、适销性和特定用途适用性的陈述、保证或条件。