在葡萄牙语版 Microsoft Dynamics NAV 2009 中同时过帐带发票和拒绝帐单的现金收据日记帐时,某些总帐条目过帐不正确

应用对象
Dynamics NAV 2009

本文适用于葡萄牙语 (pt) 语言区域设置的 Microsoft Dynamics NAV。

症状

在葡萄牙语版 Microsoft Dynamics NAV 2009 中同时过帐包含发票和拒绝帐单的现金收据日记帐时,将使用拒绝帐单帐户过帐所有已过帐的总帐条目。 但是,应将应收账款帐户用于发票,拒绝的帐单帐户应用于拒绝的文档。 以下产品中会出现此问题:

  • Microsoft Dynamics NAV 2009 R2 的葡萄牙语版本
  • Microsoft Dynamics NAV 2009 Service Pack 1 的葡萄牙语版本

解决方法

修补程序信息

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

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

代码更改

注意 在将修补程序应用到生产计算机之前,始终在受控环境中测试代码修复。
若要解决此问题,请更改 Gen 中的代码。 Jnl.-Post Line codeunit (12) 。 请按以下步骤完成此操作:

  1. 添加以下全局变量:

    TempRejCustLedgEntry@1100047 : TEMPORARY Record 21;
    
  2. 更改 PostCust 函数中的代码,如下所示:
    现有代码 1

    ...
              DiscRiskFactAmountLCY := 0;
              DiscUnriskFactAmountLCY := 0;
              CollFactAmountLCY := 0;
            //--------
    
              IF Cust."No." <> "Account No." THEN
                Cust.GET("Account No.");
              Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
    
              IF "Posting Group" = '' THEN BEGIN
    ...
    
    

    替换代码 1

    ...
              DiscRiskFactAmountLCY := 0;
              DiscUnriskFactAmountLCY := 0;
              CollFactAmountLCY := 0;
            //--------
    
    // Add the following lines. 
             TempRejCustLedgEntry.RESET;
             TempRejCustLedgEntry.DELETEALL;
    // End of the lines.
    
              IF Cust."No." <> "Account No." THEN
                Cust.GET("Account No.");
              Cust.CheckBlockedCustOnJnls(Cust,"Document Type",TRUE);
    
              IF "Posting Group" = '' THEN BEGIN
    ...
    
    

    现有代码 2

    ...
                END;
    
              // Post the application
              ApplyCustLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
    
    // Delete the following lines.
             IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
               GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
                  CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
    ...
    
    

    替换代码 2

    ...
                END;
    
              // Post the application
              ApplyCustLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
    
    // Add the following lines.
             IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
               "Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreateReceivableDoc(GenJnlLine,CVLedgEntryBuf);
                  CustLedgEntry."Document Situation" := CustLedgEntry."Document Situation"::Cartera;
    ...
    
    
  3. 更改 PostVend 函数中的代码,如下所示:
    现有代码

    ...
              // Post the application
              ApplyVendLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
                GLSetup."Appln. Rounding Precision");
    
    // Delete the following lines.
             IF GenJnlLine."Applies-to Doc. Type" = GenJnlLine."Applies-to Doc. Type"::" " THEN
               GenJnlLine."Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
                  VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
    ...
    
    

    替换代码

    ...
              // Post the application
              ApplyVendLedgEntry(
                CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,
                GLSetup."Appln. Rounding Precision");
    
    // Add the following lines.
             IF ("Applies-to ID" = '') AND ("Applies-to Doc. Type" = "Applies-to Doc. Type"::" ") THEN
               "Applies-to Doc. Type" := AppliesToDocType;
    // End of the lines.
    
              IF AppManagement.AccessToCartera AND NOT GenJnlLine.Prepayment THEN BEGIN
                IF "Document Type" = "Document Type"::Bill THEN BEGIN
                  DocPost.CreatePayableDoc(GenJnlLine,CVLedgEntryBuf);
                  VendLedgEntry."Document Situation" := VendLedgEntry."Document Situation"::Cartera;
    ...
    
    
  4. 更改 ApplyCustLedgEntry 函数中的代码,如下所示:
    现有代码

    ...
                    OldCustLedgEntry."Document Situation"::"Closed Documents",
                    OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
                    FromClosedDoc := TRUE
                  ELSE
                    FromClosedDoc := FALSE;
                  DocPost.UpdateReceivableDoc(
                    OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
                    DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
                    DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
                END;
    ...
    
    

    替换代码

    ...
                    OldCustLedgEntry."Document Situation"::"Closed Documents",
                    OldCustLedgEntry."Document Situation"::"Closed BG/PO"]) THEN
                    FromClosedDoc := TRUE
                  ELSE
                    FromClosedDoc := FALSE;
    
    // Add the following lines.
                 IF OldCustLedgEntry."Document Status" = OldCustLedgEntry."Document Status"::Rejected THEN BEGIN
                   TempRejCustLedgEntry := OldCustLedgEntry;
                   TempRejCustLedgEntry."Remaining Amount (LCY) stats." := AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY;
                   TempRejCustLedgEntry.INSERT;
                 END;
    // End of the lines.
    
                  DocPost.UpdateReceivableDoc(
                    OldCustLedgEntry,GenJnlLine,AppliedAmountLCY + DeltaUnrealAmount + DeltaAmountLCY,
                    DocAmountLCY,RejDocAmountLCY,DiscDocAmountLCY,CollDocAmountLCY,
                    DiscRiskFactAmountLCY,DiscUnriskFactAmountLCY,CollFactAmountLCY);
                END;
    ...
    
    
  5. 更改 PostDtldCustLedgEntries 函数中的代码,如下所示:
    现有代码

    ...
                  AccNo := CustPostingGr."Bills Account";
                END ELSE BEGIN
                  CustPostingGr.TESTFIELD("Receivables Account");
                  AccNo := CustPostingGr."Receivables Account";
                END;
    
    // Delete the following lines.
               IF DiscDocAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Discted. Bills Acc.");
                 AccNo := CustPostingGr."Discted. Bills Acc.";
               END;
               IF CollDocAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Bills on Collection Acc.");
                 AccNo := CustPostingGr."Bills on Collection Acc.";
               END;
               IF RejDocAmountLCY <> 0 THEN BEGIN
                 CASE GenJnlLine."Applies-to Doc. Type" OF
                   GenJnlLine."Applies-to Doc. Type"::Bill:
                     BEGIN
                       CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                       AccNo := CustPostingGr."Rejected Bills Acc.";
                     END;
                   GenJnlLine."Applies-to Doc. Type"::Invoice:
                     BEGIN
                       CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                       AccNo := CustPostingGr."Rejected Factoring Acc.";
                     END;
                   ELSE
                     IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
                       (OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
                       CASE OldCVLedgEntryBuf4."Document Type" OF
                         OldCVLedgEntryBuf4."Document Type"::Bill:
                           BEGIN
                             CustPostingGr.TESTFIELD("Receivables Account");
                             AccNo := CustPostingGr."Receivables Account";
                           END;
                         OldCVLedgEntryBuf4."Document Type"::Invoice:
                           BEGIN
                             CustPostingGr.TESTFIELD("Receivables Account");
                             AccNo := CustPostingGr."Receivables Account";
                           END;
                       END;
                     END;
                 END;
               END;
               IF (DiscRiskFactAmountLCY <> 0) OR (DiscUnriskFactAmountLCY <> 0) THEN BEGIN
                 CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
                 AccNo := CustPostingGr."Factoring for Discount Acc.";
               END;
               IF CollFactAmountLCY <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Factoring for Collection Acc.");
                 AccNo := CustPostingGr."Factoring for Collection Acc.";
               END;
    // End of the lines.
    
                ReceivableAccAmtLCY :=
                  TotalAmountLCY -
                  (DocAmountLCY + DiscDocAmountLCY +
                   CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
    ...
    
    

    替换代码

    ...
                  AccNo := CustPostingGr."Bills Account";
                END ELSE BEGIN
                  CustPostingGr.TESTFIELD("Receivables Account");
                  AccNo := CustPostingGr."Receivables Account";
                END;
    
                ReceivableAccAmtLCY :=
                  TotalAmountLCY -
                  (DocAmountLCY + DiscDocAmountLCY +
                   CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
    ...
    
    
  6. 更改 PostReceivableDocs 函数中的代码,如下所示:
    现有代码

    ...
              GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
              GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
              InsertGLEntry(TRUE);
            END;
            IF RejDocAmountLCY <> 0 THEN BEGIN
    
    // Delete the following lines.
             CASE GenJnlLine."Applies-to Doc. Type" OF
               GenJnlLine."Applies-to Doc. Type"::Bill:
                 BEGIN
                   CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                   InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                   GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                   GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                   InsertGLEntry(TRUE);
                 END;
               GenJnlLine."Applies-to Doc. Type"::Invoice:
                 BEGIN
                   CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                   InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                   GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                   GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                   InsertGLEntry(TRUE);
                 END;
               ELSE
                 IF (GenJnlLine."Document Type" IN [GenJnlLine."Document Type"::"Credit Memo",GenJnlLine."Document Type"::Payment]) AND
                   (OldCVLedgEntryBuf4."Applies-to ID" <> '') THEN BEGIN
                   CASE OldCVLedgEntryBuf4."Document Type" OF
                     OldCVLedgEntryBuf4."Document Type"::Bill:
                       BEGIN
                         CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                         InitGLEntry(CustPostingGr."Rejected Bills Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE);
                         GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                         GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                         InsertGLEntry(TRUE);
                       END;
                     OldCVLedgEntryBuf4."Document Type"::Invoice:
                       BEGIN
                         CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                         InitGLEntry(CustPostingGr."Rejected Factoring Acc.",RejDocAmountLCY,DocAmtCalcAddCurrency(RejDocAmountLCY),TRUE,TRUE
           );
    
                         GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                         GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                         InsertGLEntry(TRUE);
                       END;
                   END;
                 END;
    // End of the lines.
    
              END;
            END;
            IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
              CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
              InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
    ...
    
    

    替换代码

    ...
              GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
              GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
              InsertGLEntry(TRUE);
            END;
            IF RejDocAmountLCY <> 0 THEN BEGIN
    
    // Add the following lines.
             WITH TempRejCustLedgEntry DO BEGIN
               RESET;
               SETCURRENTKEY("Customer No.","Document Type","Document Situation","Document Status");
               SETRANGE("Document Type","Document Type"::Bill);
               CALCSUMS("Remaining Amount (LCY) stats.");
               IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Rejected Bills Acc.");
                 InitGLEntry(
                   CustPostingGr."Rejected Bills Acc.","Remaining Amount (LCY) stats.",
                   DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
                 GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                 GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                 InsertGLEntry(TRUE);
               END;
               SETRANGE("Document Type","Document Type"::Invoice);
               CALCSUMS("Remaining Amount (LCY) stats.");
               IF "Remaining Amount (LCY) stats." <> 0 THEN BEGIN
                 CustPostingGr.TESTFIELD("Rejected Factoring Acc.");
                 InitGLEntry(
                   CustPostingGr."Rejected Factoring Acc.","Remaining Amount (LCY) stats.",
                   DocAmtCalcAddCurrency("Remaining Amount (LCY) stats."),TRUE,TRUE);
                 GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
                 GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
                 InsertGLEntry(TRUE);
               END;
    // End of the lines.
    
              END;
            END;
            IF DiscRiskFactAmountLCY <> 0 THEN BEGIN
              CustPostingGr.TESTFIELD("Factoring for Discount Acc.");
              InitGLEntry(CustPostingGr."Factoring for Discount Acc.",
    ...
    
    

先决条件

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

  • Microsoft Dynamics NAV 2009 R2 的葡萄牙语版本
  • Microsoft Dynamics NAV 2009 Service Pack 1 的葡萄牙语版本

删除信息

无法删除此修补程序。

状态

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

注意这是一篇由 Microsoft 支持组织直接创建的“快速发布”文章。 本文所包含的信息是按原样提供的,以应对新出现的问题。 由于发布速度较快,这些材料可能包含印刷错误,无需通知即可随时修改。 有关其他注意事项,请参阅使用条款