This article applies to Microsoft Dynamics NAV for the East European (ee) language locale.
Symptoms
Assume that you create a cash receipt journal for a payment or a refund in the East European version of Microsoft Dynamics NAV 2009 R2. You post the cash receipt journal as a prepayment. In this situation, when you run the Unapply Entries function on the applied payment or refund, you receive the following error message:
Prepayment must be No in Cust. Ledger Entry Entry No.='XXXX'.
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, but 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, follow these steps:
-
Change the code in the UnapplyCustLedgEntry function in the Gen. Jnl.-Post Line codeunit (12) as follows:
Existing code 1...
NextDtldLedgEntryEntryNo := DtldCustLedgEntry2."Entry No." + 1;
DtldCustLedgEntry2.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
DtldCustLedgEntry2.SETRANGE("Transaction No.",GenJnlLine."Prepmt. Appl. Transaction No.",DtldCustLedgEntry."Transaction No.")
ELSE
DtldCustLedgEntry2.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.");
DtldCustLedgEntry2.SETRANGE("Customer No.",DtldCustLedgEntry."Customer No.");
DtldCustLedgEntry2.SETRANGE("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
DtldCustLedgEntry2.FINDSET;
...Replacement code 1
...
NextDtldLedgEntryEntryNo := DtldCustLedgEntry2."Entry No." + 1;
DtldCustLedgEntry2.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
// Add the following line.
IF GenJnlLine."Prepmt. Appl. Transaction No." < DtldCustLedgEntry."Transaction No." THEN
DtldCustLedgEntry2.SETRANGE("Transaction No.",GenJnlLine."Prepmt. Appl. Transaction No.",DtldCustLedgEntry."Transaction No.")
// Add the following lines.
ELSE
DtldCustLedgEntry2.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.",GenJnlLine."Prepmt. Appl. Transaction No.")
// End of the lines.
ELSE
DtldCustLedgEntry2.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.");
DtldCustLedgEntry2.SETRANGE("Customer No.",DtldCustLedgEntry."Customer No.");
DtldCustLedgEntry2.SETRANGE("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
DtldCustLedgEntry2.FINDSET;
...Existing code 2
...
IF DtldCustLedgEntry2."Entry Type" = DtldCustLedgEntry2."Entry Type"::Application THEN
PrepareAdvCustUnapply(
DtldCustLedgEntry2."Cust. Ledger Entry No.",TempCustLedgEntryForAppln,
UnapplyAdvVATEntries,ReverseAdvVATTransNo,ApplCustLedgEntryNo,CurrencyCode);
...Replacement code 2
...
IF DtldCustLedgEntry2."Entry Type" = DtldCustLedgEntry2."Entry Type"::Application THEN
// Add the following line.
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
PrepareAdvCustUnapply(
DtldCustLedgEntry2."Cust. Ledger Entry No.",TempCustLedgEntryForAppln,
UnapplyAdvVATEntries,ReverseAdvVATTransNo,ApplCustLedgEntryNo,CurrencyCode);
...Existing code 3
...
NegativeLCYAppAmt := NegativeLCYAppAmt + DtldCVLedgEntryBuf."Amount (LCY)";
NegativeACYAppAmt :=
NegativeACYAppAmt + DtldCVLedgEntryBuf."Additional-Currency Amount";
END;
IF GenJnlLine."Prepmt. Appl. Transaction No." = 0 THEN BEGIN
CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
IF DtldCVLedgEntryBuf.Advance AND (CustLedgEntry."Document Type" = CustLedgEntry."Document Type"::Payment) THEN
SalesPostAdvances.InsertTempApplnAdvanceLink(DtldCVLedgEntryBuf."Entry No.")
END;
END;
...Replacement code 3
...
NegativeLCYAppAmt := NegativeLCYAppAmt + DtldCVLedgEntryBuf."Amount (LCY)";
NegativeACYAppAmt :=
NegativeACYAppAmt + DtldCVLedgEntryBuf."Additional-Currency Amount";
END;
IF GenJnlLine."Prepmt. Appl. Transaction No." = 0 THEN BEGIN
CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
IF DtldCVLedgEntryBuf.Advance AND (CustLedgEntry."Document Type" = CustLedgEntry."Document Type"::Payment) THEN
SalesPostAdvances.InsertTempApplnAdvanceLink(DtldCVLedgEntryBuf."Entry No.")
END;
END;
... -
Change the code in the AutoEntrForDtldCustLedgEntries function in the Gen. Jnl.-Post Line codeunit (12) as follows:
Existing code...
CASE DtldCVLedgEntryBuf."Entry Type" OF
DtldCVLedgEntryBuf."Entry Type"::"Initial Entry":;
DtldCVLedgEntryBuf."Entry Type"::Application:
IF MultiplePostingGrApplied THEN BEGIN
InitGLEntry(AccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
InsertGLEntry(TRUE);
END;
DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
...Replacement code
...
CASE DtldCVLedgEntryBuf."Entry Type" OF
DtldCVLedgEntryBuf."Entry Type"::"Initial Entry":;
DtldCVLedgEntryBuf."Entry Type"::Application:
// Add the following line.
BEGIN
IF MultiplePostingGrApplied THEN BEGIN
InitGLEntry(AccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
InsertGLEntry(TRUE);
// Add the following lines.
END;
SalesPostAdvances.InsertApplnAdvanceLink(DtldCVLedgEntryBuf); // EAST0001
// End of the lines.
END;
DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
... -
Change the code in the UnapplyVendLedgEntry function in the Gen. Jnl.-Post Line codeunit (12) as follows:
Existing code 1...
DtldVendLedgEntry2.SETCURRENTKEY("Transaction No.","Vendor No.","Entry Type");
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
DtldVendLedgEntry2.SETRANGE(
"Transaction No.",GenJnlLine."Prepmt. Appl. Transaction No.",DtldVendLedgEntry."Transaction No.")
ELSE
DtldVendLedgEntry2.SETRANGE("Transaction No.",DtldVendLedgEntry."Transaction No.");
DtldVendLedgEntry2.SETRANGE("Vendor No.",DtldVendLedgEntry."Vendor No.");
...Replacement code 1
...
DtldVendLedgEntry2.SETCURRENTKEY("Transaction No.","Vendor No.","Entry Type");
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
// Add the following line.
IF GenJnlLine."Prepmt. Appl. Transaction No." < DtldVendLedgEntry."Transaction No." THEN
DtldVendLedgEntry2.SETRANGE(
"Transaction No.",GenJnlLine."Prepmt. Appl. Transaction No.",DtldVendLedgEntry."Transaction No.")
ELSE
// Add the following lines.
DtldVendLedgEntry2.SETRANGE(
"Transaction No.", DtldVendLedgEntry."Transaction No.", GenJnlLine."Prepmt. Appl. Transaction No.")
ELSE
// End of the lines.
DtldVendLedgEntry2.SETRANGE("Transaction No.",DtldVendLedgEntry."Transaction No.");
DtldVendLedgEntry2.SETRANGE("Vendor No.",DtldVendLedgEntry."Vendor No.");
...Existing code 2
...
IF DtldVendLedgEntry2."Entry Type" = DtldVendLedgEntry2."Entry Type"::Application THEN
PrepareAdvVendUnapply(
DtldVendLedgEntry2."Vendor Ledger Entry No.",TempVendLedgEntryForAppln,
UnapplyAdvVATEntries,ReverseAdvVATTransNo,ApplVendLedgEntryNo,CurrencyCode);
UNTIL DtldVendLedgEntry2.NEXT = 0;
...Replacement code 2
...
IF DtldVendLedgEntry2."Entry Type" = DtldVendLedgEntry2."Entry Type"::Application THEN
// Add the following line.
IF GenJnlLine."Prepmt. Appl. Transaction No." <> 0 THEN
PrepareAdvVendUnapply(
DtldVendLedgEntry2."Vendor Ledger Entry No.",TempVendLedgEntryForAppln,
UnapplyAdvVATEntries,ReverseAdvVATTransNo,ApplVendLedgEntryNo,CurrencyCode);
UNTIL DtldVendLedgEntry2.NEXT = 0;
...Existing code 3
...
NegativeACYAppAmt :=
NegativeACYAppAmt + DtldCVLedgEntryBuf."Additional-Currency Amount";
END;
END;
IF NOT SkipCollectAmount THEN
IF NOT (DtldCVLedgEntryBuf."Entry Type" IN [
...Replacement code
...
NegativeACYAppAmt :=
NegativeACYAppAmt + DtldCVLedgEntryBuf."Additional-Currency Amount";
END;
// Add the following lines.
IF GenJnlLine."Prepmt. Appl. Transaction No." = 0 THEN BEGIN
VendLedgEntry.GET(DtldVendLedgEntry2."Vendor Ledger Entry No.");
IF DtldCVLedgEntryBuf.Advance AND (VendLedgEntry."Document Type" = VendLedgEntry."Document Type"::Payment) THEN
PurchPostAdvances.InsertTempApplnAdvanceLink(DtldCVLedgEntryBuf."Entry No.")
END;
// End of the lines.
END;
IF NOT SkipCollectAmount THEN
IF NOT (DtldCVLedgEntryBuf."Entry Type" IN [
... -
Change the code in the AutoEntrForDtldVendLedgEntries function in the Gen. Jnl.-Post Line codeunit (12) as follows:
Existing code...
CASE DtldCVLedgEntryBuf."Entry Type" OF
DtldCVLedgEntryBuf."Entry Type"::"Initial Entry":;
DtldCVLedgEntryBuf."Entry Type"::Application:
IF MultiplePostingGrApplied THEN BEGIN
InitGLEntry(AccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
InsertGLEntry(TRUE);
END;
DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
...Replacement code
...
CASE DtldCVLedgEntryBuf."Entry Type" OF
DtldCVLedgEntryBuf."Entry Type"::"Initial Entry":;
DtldCVLedgEntryBuf."Entry Type"::Application:
// Add the following line.
BEGIN
IF MultiplePostingGrApplied THEN BEGIN
InitGLEntry(AccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
InsertGLEntry(TRUE);
// Add the following lines.
END;
PurchPostAdvances.InsertApplnAdvanceLink(DtldCVLedgEntryBuf);
// End of the lines.
END;
DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
... -
Change the code in the PostUnApplyCustomer function in the CustEntry-Apply Posted Entries codeunit (226) as follows:
Existing code 1...
DtldCustLedgEntry.LOCKTABLE;
CustLedgEntry.LOCKTABLE;
CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
// Delete the following line.
CustLedgEntry.TESTFIELD(Prepayment,FALSE); // EAST0001
CheckPostingDate(PostingDate,'',0);
IF PostingDate < DtldCustLedgEntry2."Posting Date" THEN
ERROR(Text003,
...Replacement code 1
...
DtldCustLedgEntry.LOCKTABLE;
CustLedgEntry.LOCKTABLE;
CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
CheckPostingDate(PostingDate,'',0);
IF PostingDate < DtldCustLedgEntry2."Posting Date" THEN
ERROR(Text003,
...Existing code 2
...
CustLedgEntry.TABLECAPTION,
DtldCustLedgEntry."Cust. Ledger Entry No.",
CustLedgEntry.FIELDCAPTION("Transaction No."));
// Delete the following line.
DtldCustLedgEntry.TESTFIELD(Advance,FALSE);
GetPrepmtApplTransNo(DtldCustLedgEntry."Cust. Ledger Entry No.",GenJnlLine."Prepmt. Appl. Transaction No.");
END;
UNTIL DtldCustLedgEntry.NEXT = 0;
...Replacement code 2
...
CustLedgEntry.TABLECAPTION,
DtldCustLedgEntry."Cust. Ledger Entry No.",
CustLedgEntry.FIELDCAPTION("Transaction No."));
// Add the following line.
DtldCustLedgEntry.TESTFIELD(Advance,CustLedgEntry.Prepayment);
GetPrepmtApplTransNo(DtldCustLedgEntry."Cust. Ledger Entry No.",GenJnlLine."Prepmt. Appl. Transaction No.");
END;
UNTIL DtldCustLedgEntry.NEXT = 0;
... -
Change the code in the GetPrepmtApplTransNo function in the CustEntry-Apply Posted Entries codeunit (226) as follows:
Existing code...
CustLedgEntry.GET(CustLedgEntryNo);
// Delete the following lines.
IF NOT CustLedgEntry.Prepayment AND
(CustLedgEntry."Prepayment Type" = CustLedgEntry."Prepayment Type"::Advance)
THEN BEGIN
TransactionNo := CustLedgEntry."Transaction No." - 1;
END;
// End of the lines.
...Replacement code
...
CustLedgEntry.GET(CustLedgEntryNo);
// Add the following lines.
IF CustLedgEntry."Prepayment Type" = CustLedgEntry."Prepayment Type"::Advance THEN
IF CustLedgEntry.Prepayment THEN BEGIN
CustLedgEntry.SETCURRENTKEY("Transaction No.");
CustLedgEntry.SETRANGE("Transaction No.",CustLedgEntry."Transaction No." + 1);
IF CustLedgEntry.FINDFIRST THEN
IF NOT CustLedgEntry.Prepayment AND (CustLedgEntry."Prepayment Type" = CustLedgEntry."Prepayment Type"::Advance) THEN
TransactionNo := CustLedgEntry."Transaction No.";
END ELSE
TransactionNo := CustLedgEntry."Transaction No." - 1;
// End of the lines.
... -
Change the code in the PostUnApplyVendor function in the VendEntry-Apply Posted Entries codeunit (227) as follows:
Existing code...
DtldVendLedgEntry."Vendor Ledger Entry No.",
VendLedgEntry.FIELDCAPTION("Transaction No."));
// Delete the following line.
DtldVendLedgEntry.TESTFIELD(Advance,FALSE);
GetPrepmtApplTransNo(DtldVendLedgEntry."Vendor Ledger Entry No.",GenJnlLine."Prepmt. Appl. Transaction No.");
END;
UNTIL DtldVendLedgEntry.NEXT = 0;
...Replacement code
...
DtldVendLedgEntry."Vendor Ledger Entry No.",
VendLedgEntry.FIELDCAPTION("Transaction No."));
// Add the following line.
DtldVendLedgEntry.TESTFIELD(Advance, VendLedgEntry.Prepayment);
GetPrepmtApplTransNo(DtldVendLedgEntry."Vendor Ledger Entry No.",GenJnlLine."Prepmt. Appl. Transaction No.");
END;
UNTIL DtldVendLedgEntry.NEXT = 0;
... -
Change the code in the GetPrepmtApplTransNo function in the VendEntry-Apply Posted Entries codeunit (227) as follows:
Existing code...
// Delete the following lines.
VendLedgEntry.GET(VendLedgEntryNo);
IF NOT VendLedgEntry.Prepayment AND
(VendLedgEntry."Prepayment Type" = VendLedgEntry."Prepayment Type"::Advance)
THEN BEGIN
TransactionNo := VendLedgEntry."Transaction No." - 1;
END;
// End of the lines.
...Replacement code
...
// Add the following lines.
VendLedgEntry.GET(VendLedgEntryNo);
IF VendLedgEntry."Prepayment Type" = VendLedgEntry."Prepayment Type"::Advance THEN
IF VendLedgEntry.Prepayment THEN BEGIN
VendLedgEntry.SETCURRENTKEY("Transaction No.");
VendLedgEntry.SETRANGE("Transaction No.", VendLedgEntry."Transaction No." + 1);
IF VendLedgEntry.FINDFIRST THEN
IF NOT VendLedgEntry.Prepayment AND (VendLedgEntry."Prepayment Type" = VendLedgEntry."Prepayment Type"::Advance) THEN
TransactionNo := VendLedgEntry."Transaction No.";
END ELSE
TransactionNo := VendLedgEntry."Transaction No." - 1;
// End of the lines.
... -
Add a new global variable in the Purchase-Post Advances codeunit (26586), and then specify the variable as follows:
-
Name: TempAdvanceLink
-
DataType: Record
-
Subtype: Advance Link
-
-
Create the InsertTempApplnAdvanceLink function in the Purchase-Post Advances codeunit (26586) as follows:
PROCEDURE InsertTempApplnAdvanceLink@1470034(DtldEntryBufEntryNo@1470002 : Integer);
BEGIN
TempAdvanceLink.INIT;
TempAdvanceLink."Entry No." := DtldEntryBufEntryNo;
TempAdvanceLink.INSERT;
END; -
Create the InsertApplnAdvanceLink function in the Purchase-Post Advances codeunit (26586) as follows:
PROCEDURE InsertApplnAdvanceLink@140049(DtldCVLedgEntryBuf@1102601000 : Record 383);
VAR
AdvanceLink@1470001 : Record 26590;
BEGIN
WITH AdvanceLink DO BEGIN
IF TempAdvanceLink.GET(DtldCVLedgEntryBuf."Entry No.") THEN BEGIN
IF FINDLAST THEN
NextLinkEntryNo := AdvanceLink."Entry No." + 1
ELSE
NextLinkEntryNo := 1;
INIT;
"Entry No." := NextLinkEntryNo;
"Entry Type" := "Entry Type"::Application;
"Document No." := DtldCVLedgEntryBuf."Document No.";
"CV Ledger Entry No." := DtldCVLedgEntryBuf."Cust. Ledger Entry No.";
Amount := DtldCVLedgEntryBuf.Amount;
"Amount (LCY)" := DtldCVLedgEntryBuf."Amount (LCY)";
INSERT;
TempAdvanceLink.DELETE;
END;
END;
END;
Prerequisites
You must have the East European version of Microsoft Dynamics NAV 2009 R2 installed to apply this hotfix.
Removal information
You cannot remove this hotfix.
More Information
For more information about hotfix 2543219, click the following article number to view the article in the Microsoft Knowledge Base:
2543219 You cannot process overpaid prepayment as expected in the Eastern European version of Microsoft Dynamics NAV 2009 R2
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.