This article applies to Microsoft Dynamics NAV for the Portuguese (pt) language locale.
Symptoms
When you post a cash receipt journal with an invoice and a reject bill at the same time in the Portuguese version of Microsoft Dynamics NAV 2009, all the posted general ledger entries are posted by using the Reject Bills Account. However, the Receivables Account should be used for the invoice, and the Rejected Bills Account should be used for the rejected document. This problem occurs in the following products:
-
The Portuguese version of Microsoft Dynamics NAV 2009 R2
-
The Portuguese version of Microsoft Dynamics NAV 2009 Service Pack 1
Resolution
Hotfix information
A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV 2009 service pack or the next Microsoft Dynamics NAV version that contains this hotfix.
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
Installation information
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Note Before you install this hotfix, verify that all Microsoft Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. You should be the only client user who is logged on when you implement this hotfix.
To implement this hotfix, you must have a developer license.
We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions:
-
The Modify permission for the object that you will be changing.
-
The Execute permission for the System Object ID 5210 object and for the System Object ID 9015 object.
Note You do not have to have rights to the data stores unless you have to perform data repair.
Code changes
Note Always test code fixes in a controlled environment before you apply the fixes to your production computers.
To resolve this problem, change the code in the Gen. Jnl.-Post Line codeunit (12) . To do this, follow these steps:
-
Add the following global variable:
TempRejCustLedgEntry@1100047 : TEMPORARY Record 21;
-
Change the code in the PostCust function as follows:
Existing code 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
...Replacement code 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
...Existing code 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;
...Replacement code 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;
... -
Change the code in the PostVend function as follows:
Existing code...
// 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;
...Replacement code
...
// 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;
... -
Change the code in the ApplyCustLedgEntry function as follows:
Existing code...
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;
...Replacement code
...
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;
... -
Change the code in the PostDtldCustLedgEntries function as follows:
Existing code...
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 +
...Replacement code
...
AccNo := CustPostingGr."Bills Account";
END ELSE BEGIN
CustPostingGr.TESTFIELD("Receivables Account");
AccNo := CustPostingGr."Receivables Account";
END;
ReceivableAccAmtLCY :=
TotalAmountLCY -
(DocAmountLCY + DiscDocAmountLCY +
CollDocAmountLCY + RejDocAmountLCY + DiscRiskFactAmountLCY +
... -
Change the code in the PostReceivableDocs function as follows:
Existing code...
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.",
...Replacement code
...
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.",
...
Prerequisites
You must have one of the following products installed to apply this hotfix:
-
The Portuguese version of Microsoft Dynamics NAV 2009 R2
-
The Portuguese version of Microsoft Dynamics NAV 2009 Service Pack 1
Removal information
You cannot remove this hotfix.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.