Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You cannot process overpaid prepayment as expected in the Eastern European version of Microsoft Dynamics NAV 2009 R2


View products that this article applies to.

This article applies to Microsoft Dynamics NAV for the Eastern Europe (EE) region.

↑ Back to the top


Symptoms

You cannot process overpaid prepayment as expected in the Eastern European version of Microsoft Dynamics NAV 2009 R2. When you process an overpaid advance letter for a customer, you cannot post refunds as prepayment. Therefore, you cannot return money to the customer.

↑ Back to the top


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 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.

↑ Back to the top




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:
  1. Change the code in the Applies-to Doc. No. - OnLookup trigger in the Gen. Journal Line table (81) as follows:
    Existing code 1
    ...
    IF CustLedgEntry.FIND('-') THEN;
    CustLedgEntry.SETRANGE(Positive);
    END;
    ApplyCustEntries.SetGenJnlLine(Rec,GenJnlLine.FIELDNO("Applies-to Doc. No."));
    ApplyCustEntries.SETTABLEVIEW(CustLedgEntry);
    ApplyCustEntries.SETRECORD(CustLedgEntry);
    ...
    Replacement code 1
    ...
    IF CustLedgEntry.FIND('-') THEN;
    CustLedgEntry.SETRANGE(Positive);
    END;

    // Add the following lines.
    IF "Prepayment Type" = "Prepayment Type"::Advance THEN
    CustLedgEntry.SETRANGE("Prepayment Type","Prepayment Type"::Advance)
    ELSE
    CustLedgEntry.SETFILTER("Prepayment Type",'<>%1',GenJnlLine."Prepayment Type"::Advance);
    //End of the lines.

    ApplyCustEntries.SetGenJnlLine(Rec,GenJnlLine.FIELDNO("Applies-to Doc. No."));
    ApplyCustEntries.SETTABLEVIEW(CustLedgEntry);
    ApplyCustEntries.SETRECORD(CustLedgEntry);
    ...
    Existing code 2
    ...
    IF VendLedgEntry.FIND('-') THEN;
    VendLedgEntry.SETRANGE(Positive);
    END;
    ApplyVendEntries.SetGenJnlLine(Rec,GenJnlLine.FIELDNO("Applies-to Doc. No."));
    ApplyVendEntries.SETTABLEVIEW(VendLedgEntry);
    ApplyVendEntries.SETRECORD(VendLedgEntry);
    ...
    Replacement code 2
    ...
    IF VendLedgEntry.FIND('-') THEN;
    VendLedgEntry.SETRANGE(Positive);
    END;

    // Add the following lines.
    IF "Prepayment Type" = "Prepayment Type"::Advance THEN
    VendLedgEntry.SETRANGE("Prepayment Type","Prepayment Type"::Advance)
    ELSE
    VendLedgEntry.SETFILTER("Prepayment Type",'<>%1',GenJnlLine."Prepayment Type"::Advance);
    //End of the lines.

    ApplyVendEntries.SetGenJnlLine(Rec,GenJnlLine.FIELDNO("Applies-to Doc. No."));
    ApplyVendEntries.SETTABLEVIEW(VendLedgEntry);
    ApplyVendEntries.SETRECORD(VendLedgEntry);
    ...
  2. Change the code in the UpdatePrepmtType function in the Gen. Journal Line table (81) as follows:
    Existing code
    ...
    GLSetup.GET;
    GLSetup.TESTFIELD("Prepayment Type");
    "Prepayment Type" := GLSetup."Prepayment Type";
    END ELSE
    "Prepayment Type" := "Prepayment Type"::" ";
    ...
    Replacement code
    ...
    GLSetup.GET;
    GLSetup.TESTFIELD("Prepayment Type");
    "Prepayment Type" := GLSetup."Prepayment Type";

    // Add the following lines.
    IF NOT ("Document Type" IN ["Document Type"::Refund,"Document Type"::Payment]) THEN
    FIELDERROR(Prepayment);
    //End of the lines.

    END ELSE
    "Prepayment Type" := "Prepayment Type"::" ";
    ...
  3. Change the definition of the Entry Type field in the Advance Link table (26590) as follows:
    Existing definition
    ...
    OptionString=Initial Amount,Link To Letter
    ...
    Replacement definition
    ...
    OptionString=Initial Amount,Link To Letter,Application
    ...
  4. Delete the SourceTableView definition in the Apply Customer Entries form (232).
  5. Change the code in the SetApplyingCustLedgEntry function in the Apply Customer Entries form (232) as follows:
    Existing code
    ... 
    CalcApplnAmount;
    END;
    END;
    ...
    Replacement code
    ...
    CalcApplnAmount;
    END;
    END;

    // Add the following line.
    SetAdvanceFilter;
    ...
  6. Change the code in the FindApplyingEntry function in the Apply Customer Entries form (232) as follows:
    Existing code
    ...
    ApplyingAmount := CustLedgEntry."Remaining Amount";
    ApplnDate := CustLedgEntry."Posting Date";
    ApplnCurrencyCode := CustLedgEntry."Currency Code";
    END;
    CalcApplnAmount;
    ...
    Replacement code
    ...
    ApplyingAmount := CustLedgEntry."Remaining Amount";
    ApplnDate := CustLedgEntry."Posting Date";
    ApplnCurrencyCode := CustLedgEntry."Currency Code";

    // Add the following line.
    SetAdvanceFilter;

    END;
    CalcApplnAmount;
    ...
  7. Create a new function in the Apply Customer Entries form (232) as follows:
    LOCAL PROCEDURE SetAdvanceFilter@1470011();
    BEGIN
    IF ApplyingCustLedgEntry."Prepayment Type" = ApplyingCustLedgEntry."Prepayment Type"::Advance THEN
    SETRANGE("Prepayment Type","Prepayment Type"::Advance)
    ELSE
    SETFILTER("Prepayment Type",'<>%1',"Prepayment Type"::Advance);
    END;
  8. Delete the SourceTableView definition in the Apply Vendor Entries form (233).
  9. Change the code in the SetApplyingVendLedgEntry function in the Apply Vendor Entries form (233) as follows:
    Existing code
    ... 
    CalcApplnAmount;
    END;
    END;
    ...
    Replacement code
    ...
    CalcApplnAmount;
    END;
    END;

    // Add the following line.
    SetAdvanceFilter;
    ...
  10. Change the code in the FindApplyingEntry function in the Apply Vendor Entries form (233) as follows:
    Existing code
    ...
    ApplyingAmount := VendLedgEntry."Remaining Amount";
    ApplnDate := VendLedgEntry."Posting Date";
    ApplnCurrencyCode := VendLedgEntry."Currency Code";
    END;
    CalcApplnAmount;
    ...
    Replacement code
    ...
    ApplyingAmount := VendLedgEntry."Remaining Amount";
    ApplnDate := VendLedgEntry."Posting Date";
    ApplnCurrencyCode := VendLedgEntry."Currency Code";

    // Add the following line.
    SetAdvanceFilter;
    END;
    CalcApplnAmount;
    ...
  11. Create a new function in the Apply Vendor Entries form (233) as follows:
    LOCAL PROCEDURE SetAdvanceFilter@1470011();
    BEGIN
    IF ApplyingVendLedgEntry."Prepayment Type" = ApplyingVendLedgEntry."Prepayment Type"::Advance THEN
    SETRANGE("Prepayment Type","Prepayment Type"::Advance)
    ELSE
    SETFILTER("Prepayment Type",'<>%1',"Prepayment Type"::Advance);
    END;
  12. Delete the following global variable in the Gen. Jnl.-Post Line codeunit (12):
    • Name: Text26500
    • TextConst: 'ENU=Sales %1 %2 cannot be applied manually.'
  13. Change the code in the ApplyCustLedgEntry function in the Gen. Jnl.-Post Line codeunit (12) as follows:
    Existing code 1
    ...
    THEN
    EXIT;

    // Delete the following lines.
    IF NOT GenJnlLine."System-Created Entry" AND (GenJnlLine."Applies-to ID" <> '') AND
    (NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance)
    THEN
    ERROR(Text26500,NewCVLedgEntryBuf."Document Type",NewCVLedgEntryBuf."Document No.");
    // End of the lines.

    PmtTolAmtToBeApplied := 0;
    NewRemainingAmtBeforeAppln := NewCVLedgEntryBuf."Remaining Amount";
    NewCVLedgEntryBuf2 := NewCVLedgEntryBuf;
    ...
    Replacement code 1
    ...
    THEN
    EXIT;

    PmtTolAmtToBeApplied := 0;
    NewRemainingAmtBeforeAppln := NewCVLedgEntryBuf."Remaining Amount";
    NewCVLedgEntryBuf2 := NewCVLedgEntryBuf;
    ...
    Existing code 2
    ...
    OldCustLedgEntry.FINDFIRST;
    OldCustLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN

    // Delete the following lines.
    IF NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance THEN
    ERROR(Text26500,NewCVLedgEntryBuf."Document Type",NewCVLedgEntryBuf."Document No.");
    IF OldCustLedgEntry."Prepayment Type" = OldCustLedgEntry."Prepayment Type"::Advance THEN
    ERROR(Text26500,OldCustLedgEntry."Document Type",OldCustLedgEntry."Document No.");
    // End of the lines.

    END;
    IF OldCustLedgEntry."Posting Date" > ApplyingDate THEN
    ApplyingDate := OldCustLedgEntry."Posting Date";
    ...
    Replacement code 2
    ...
    OldCustLedgEntry.FINDFIRST;
    OldCustLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN

    // Add the following lines.
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    OldCustLedgEntry.TESTFIELD("Prepayment Type",OldCustLedgEntry."Prepayment Type"::Advance);
    IF OldCustLedgEntry."Prepayment Type" = OldCustLedgEntry."Prepayment Type"::Advance THEN
    GenJnlLine.TESTFIELD("Prepayment Type",GenJnlLine."Prepayment Type"::Advance);
    //End of the lines.

    END;
    IF OldCustLedgEntry."Posting Date" > ApplyingDate THEN
    ApplyingDate := OldCustLedgEntry."Posting Date";
    ...
    Existing code 3
    ...
    OldCustLedgEntry.SETRANGE("Currency Code",NewCVLedgEntryBuf."Currency Code");
    IF OldCustLedgEntry.FINDSET(FALSE,FALSE) THEN
    REPEAT

    // Delete the following lines.
    IF (OldCustLedgEntry."Prepayment Type" <> OldCustLedgEntry."Prepayment Type"::Advance) OR
    (OldCustLedgEntry."Applies-to ID" <> '')
    THEN
    // End of the lines.

    IF GenJnlApply.CheckAgainstApplnCurrency(
    NewCVLedgEntryBuf."Currency Code",
    OldCustLedgEntry."Currency Code",
    ...
    Replacement code 3
    ...
    OldCustLedgEntry.SETRANGE("Currency Code",NewCVLedgEntryBuf."Currency Code");
    IF OldCustLedgEntry.FINDSET(FALSE,FALSE) THEN
    REPEAT

    // Add the following lines.
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    OldCustLedgEntry.TESTFIELD("Prepayment Type",OldCustLedgEntry."Prepayment Type"::Advance);
    IF OldCustLedgEntry."Prepayment Type" = OldCustLedgEntry."Prepayment Type"::Advance THEN
    GenJnlLine.TESTFIELD("Prepayment Type",GenJnlLine."Prepayment Type"::Advance);
    END;
    //End of the lines.

    IF GenJnlApply.CheckAgainstApplnCurrency(
    NewCVLedgEntryBuf."Currency Code",
    OldCustLedgEntry."Currency Code",
    ...
  14. Add a new local variable in the CalcApplication function in the Gen. Jnl.-Post Line codeunit (12), and then specify the variable as follows:
    • Name: OldDtldCVLedgEntryBuf
    • DataType: Record
    • Subtype: Detailed CV Ledg. Entry Buffer (383)
  15. Change the code in the CalcApplication function in the Gen. Jnl.-Post Line codeunit (12) as follows:
    Existing code 1
    ...
    OldCVLedgEntryBuf."Open For Advance Letter" := FALSE;
    END ELSE
    AllApplied := FALSE;

    InitNewCVLedgEntry(DtldCVLedgEntryBuf,GenJnlLine);
    InitOldCVLedgEntry(DtldCVLedgEntryBuf,NewCVLedgEntryBuf);
    ...
    Replacement code 1
    ...
    OldCVLedgEntryBuf."Open For Advance Letter" := FALSE;
    END ELSE
    AllApplied := FALSE;

    // Add the following line.
    OldDtldCVLedgEntryBuf := DtldCVLedgEntryBuf;

    InitNewCVLedgEntry(DtldCVLedgEntryBuf,GenJnlLine);
    InitOldCVLedgEntry(DtldCVLedgEntryBuf,NewCVLedgEntryBuf);
    ...
    Existing code 2
    ...
    NewCVLedgEntryBuf.Prepayment AND (NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance);
    InsertDtldCVLedgEntry(DtldCVLedgEntryBuf,NewCVLedgEntryBuf,FALSE);

    // Delete the following line.
    NewCVLedgEntryBuf.Open := NewCVLedgEntryBuf."Remaining Amount" <> 0;

    IF NOT NewCVLedgEntryBuf.Open AND NOT AllApplied THEN BEGIN
    NewCVLedgEntryBuf."Closed by Entry No." := OldCVLedgEntryBuf."Entry No.";
    NewCVLedgEntryBuf."Closed at Date" := GenJnlLine."Posting Date";
    ...
    Replacement code 2
    ...
    NewCVLedgEntryBuf.Prepayment AND (NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance);
    InsertDtldCVLedgEntry(DtldCVLedgEntryBuf,NewCVLedgEntryBuf,FALSE);

    // Add the following lines.
    IF DtldCVLedgEntryBuf.Advance AND
    OldDtldCVLedgEntryBuf.Advance AND
    (NOT GenJnlLine."System-Created Entry" OR
    (GenJnlLine."System-Created Entry" AND
    (GenJnlLine."Applies-to Doc. No." = '')))
    THEN
    IF (NewCVLedgEntryBuf."Document Type" IN [DtldCVLedgEntryBuf."Document Type"::Refund,
    DtldCVLedgEntryBuf."Document Type"::Payment]) AND
    (OldCVLedgEntryBuf."Document Type" IN [DtldCVLedgEntryBuf."Document Type"::Refund,
    DtldCVLedgEntryBuf."Document Type"::Payment])
    THEN
    IF (DtldCVLedgEntryBuf."Document Type" = DtldCVLedgEntryBuf."Document Type"::Payment) THEN
    SalesPostAdvances.InsertTempApplnAdvanceLink(DtldCVLedgEntryBuf."Entry No.")
    ELSE
    SalesPostAdvances.InsertTempApplnAdvanceLink(OldDtldCVLedgEntryBuf."Entry No.");

    NewCVLedgEntryBuf.Open := NewCVLedgEntryBuf."Remaining Amount" <> 0;
    NewCVLedgEntryBuf."Open For Advance Letter" := NewCVLedgEntryBuf.Open;
    //End of the lines.

    IF NOT NewCVLedgEntryBuf.Open AND NOT AllApplied THEN BEGIN
    NewCVLedgEntryBuf."Closed by Entry No." := OldCVLedgEntryBuf."Entry No.";
    NewCVLedgEntryBuf."Closed at Date" := GenJnlLine."Posting Date";
    ...
    Existing code 3
    ...
    NewCVLedgEntryBuf."Closed by Amount (LCY)" := AppliedAmountLCY;
    NewCVLedgEntryBuf."Closed by Currency Code" := OldCVLedgEntryBuf."Currency Code";
    NewCVLedgEntryBuf."Closed by Currency Amount" := OldAppliedAmount;

    // Delete the following line.
    NewCVLedgEntryBuf."Open For Advance Letter" := FALSE;
    END;
    ...
    Replacement code 3
    ...
    NewCVLedgEntryBuf."Closed by Amount (LCY)" := AppliedAmountLCY;
    NewCVLedgEntryBuf."Closed by Currency Code" := OldCVLedgEntryBuf."Currency Code";
    NewCVLedgEntryBuf."Closed by Currency Amount" := OldAppliedAmount;
    END;
    ...
  16. Change the code in the PostDtldCustLedgEntries function in the Gen. Jnl.-Post Line codeunit (12) as follows:
    Existing code
    ...
    InitGLEntry(GLAccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
    InsertGLEntry(TRUE);
    END;
    END;
    DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
    BEGIN
    ...
    Replacement code
    ...
    InitGLEntry(GLAccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
    InsertGLEntry(TRUE);
    END;

    // Add the following line.
    SalesPostAdvances.InsertApplnAdvanceLink(DtldCVLedgEntryBuf);

    END;
    DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
    BEGIN
    ...
  17. Change the code in the ApplyVendLedgEntry function in the Gen. Jnl.-Post Line codeunit (12) as follows:
    Existing code 1
    ...
    THEN
    EXIT;

    // Delete the following lines.
    IF NOT GenJnlLine."System-Created Entry" AND (GenJnlLine."Applies-to ID" <> '') AND
    (NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance)
    THEN
    ERROR(Text26500,NewCVLedgEntryBuf."Document Type",NewCVLedgEntryBuf."Document No.");
    // End of the lines.

    PmtTolAmtToBeApplied := 0;
    NewRemainingAmtBeforeAppln := NewCVLedgEntryBuf."Remaining Amount";
    NewCVLedgEntryBuf2 := NewCVLedgEntryBuf;
    ...
    Replacement code 1
    ...
    THEN
    EXIT;

    PmtTolAmtToBeApplied := 0;
    NewRemainingAmtBeforeAppln := NewCVLedgEntryBuf."Remaining Amount";
    NewCVLedgEntryBuf2 := NewCVLedgEntryBuf;
    ...
    Existing code 2
    ...
    OldVendLedgEntry.FINDFIRST;
    OldVendLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN

    // Delete the following lines.
    IF NewCVLedgEntryBuf."Prepayment Type" = NewCVLedgEntryBuf."Prepayment Type"::Advance THEN
    ERROR(Text26500,NewCVLedgEntryBuf."Document Type",NewCVLedgEntryBuf."Document No.");
    IF OldVendLedgEntry."Prepayment Type" = OldVendLedgEntry."Prepayment Type"::Advance THEN
    ERROR(Text26500,OldVendLedgEntry."Document Type",OldVendLedgEntry."Document No.");
    // End of the lines.

    END;
    IF OldVendLedgEntry."Posting Date" > ApplyingDate THEN
    ApplyingDate := OldVendLedgEntry."Posting Date";
    ...
    Replacement code 2
    ...
    OldVendLedgEntry.FINDFIRST;
    OldVendLedgEntry.TESTFIELD(Positive,NOT NewCVLedgEntryBuf.Positive);
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN

    // Add the following lines.
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    OldVendLedgEntry.TESTFIELD("Prepayment Type",OldVendLedgEntry."Prepayment Type"::Advance);
    IF OldVendLedgEntry."Prepayment Type" = OldVendLedgEntry."Prepayment Type"::Advance THEN
    GenJnlLine.TESTFIELD("Prepayment Type",GenJnlLine."Prepayment Type"::Advance);
    // End of the lines.

    END;
    IF OldVendLedgEntry."Posting Date" > ApplyingDate THEN
    ApplyingDate := OldVendLedgEntry."Posting Date";
    ...
    Existing code 3
    ...
    OldVendLedgEntry.SETRANGE("Currency Code",NewCVLedgEntryBuf."Currency Code");
    IF OldVendLedgEntry.FINDSET(FALSE,FALSE) THEN
    REPEAT

    // Delete the following lines.
    IF (OldVendLedgEntry."Prepayment Type" <> OldVendLedgEntry."Prepayment Type"::Advance) OR
    (OldVendLedgEntry."Applies-to ID" <> '')
    THEN
    // End of the lines.

    IF GenJnlApply.CheckAgainstApplnCurrency(
    NewCVLedgEntryBuf."Currency Code",
    OldVendLedgEntry."Currency Code",
    ...
    Replacement code 3
    ...
    OldVendLedgEntry.SETRANGE("Currency Code",NewCVLedgEntryBuf."Currency Code");
    IF OldVendLedgEntry.FINDSET(FALSE,FALSE) THEN
    REPEAT

    // Add the following lines.
    IF NOT GenJnlLine."System-Created Entry" THEN BEGIN
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    OldVendLedgEntry.TESTFIELD("Prepayment Type",OldVendLedgEntry."Prepayment Type"::Advance);
    IF OldVendLedgEntry."Prepayment Type" = OldVendLedgEntry."Prepayment Type"::Advance THEN
    GenJnlLine.TESTFIELD("Prepayment Type",GenJnlLine."Prepayment Type"::Advance);
    END;
    //End of the lines.

    IF GenJnlApply.CheckAgainstApplnCurrency(
    NewCVLedgEntryBuf."Currency Code",
    OldVendLedgEntry."Currency Code",
    ...
  18. Change the code in the PostDtldVendLedgEntries function in the Gen. Jnl.-Post Line codeunit (12) as follows:
    Existing code
    ...
    InitGLEntry(GLAccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
    InsertGLEntry(TRUE);
    END;
    END;
    DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
    BEGIN
    ...
    Replacement code
    ...
    InitGLEntry(GLAccNo,DtldCVLedgEntryBuf."Amount (LCY)",0,FALSE,TRUE);
    InsertGLEntry(TRUE);
    END;

    // Add the following line.
    SalesPostAdvances.InsertApplnAdvanceLink(DtldCVLedgEntryBuf);

    END;
    DtldCVLedgEntryBuf."Entry Type"::"Unrealized Loss":
    BEGIN
    ...
  19. Change the code in the OnRun trigger in the Gen. Jnl.-Apply codeunit (225) as follows:
    Existing code 1
    ...
    CustLedgEntry.SETCURRENTKEY("Customer No.",Open,Positive);
    CustLedgEntry.SETRANGE("Customer No.",AccNo);
    CustLedgEntry.SETRANGE(Open,TRUE);
    IF "Cash Order Type" <> "Cash Order Type"::" " THEN
    CustLedgEntry.SETRANGE("Currency Code","Currency Code");
    IF "Applies-to ID" = '' THEN
    ...
    Replacement code 1
    ...
    CustLedgEntry.SETCURRENTKEY("Customer No.",Open,Positive);
    CustLedgEntry.SETRANGE("Customer No.",AccNo);
    CustLedgEntry.SETRANGE(Open,TRUE);

    // Add the following lines.
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    CustLedgEntry.SETRANGE("Prepayment Type",GenJnlLine."Prepayment Type"::Advance)
    ELSE
    CustLedgEntry.SETFILTER("Prepayment Type",'<>%1',GenJnlLine."Prepayment Type"::Advance);
    //End of the lines.

    IF "Cash Order Type" <> "Cash Order Type"::" " THEN
    CustLedgEntry.SETRANGE("Currency Code","Currency Code");
    IF "Applies-to ID" = '' THEN
    ...
    Existing code 2
    ...
    VendLedgEntry.SETCURRENTKEY("Vendor No.",Open,Positive);
    VendLedgEntry.SETRANGE("Vendor No.",AccNo);
    VendLedgEntry.SETRANGE(Open,TRUE);
    IF "Cash Order Type" <> "Cash Order Type"::" " THEN
    VendLedgEntry.SETRANGE("Currency Code","Currency Code");
    IF "Applies-to ID" = '' THEN
    ...
    Replacement code 2
    ...
    VendLedgEntry.SETCURRENTKEY("Vendor No.",Open,Positive);
    VendLedgEntry.SETRANGE("Vendor No.",AccNo);
    VendLedgEntry.SETRANGE(Open,TRUE);

    // Add the following lines.
    IF GenJnlLine."Prepayment Type" = GenJnlLine."Prepayment Type"::Advance THEN
    VendLedgEntry.SETRANGE("Prepayment Type",GenJnlLine."Prepayment Type"::Advance)
    ELSE
    VendLedgEntry.SETFILTER("Prepayment Type",'<>%1',GenJnlLine."Prepayment Type"::Advance);
    //End of the lines.

    IF "Cash Order Type" <> "Cash Order Type"::" " THEN
    VendLedgEntry.SETRANGE("Currency Code","Currency Code");
    IF "Applies-to ID" = '' THEN
    ...
  20. Change the code in the PostUnApplyCustomer function in the CustEntry-Apply Posted Entries codeunit (226) as follows:
    Existing code
    ...
    DtldCustLedgEntry.LOCKTABLE;
    CustLedgEntry.LOCKTABLE;
    CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
    CheckPostingDate(PostingDate,'',0);
    IF PostingDate < DtldCustLedgEntry2."Posting Date" THEN
    ERROR(Text003,
    ...
    Replacement code
    ...
    DtldCustLedgEntry.LOCKTABLE;
    CustLedgEntry.LOCKTABLE;
    CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");

    // Add the following line.
    CustLedgEntry.TESTFIELD(Prepayment,FALSE);

    CheckPostingDate(PostingDate,'',0);
    IF PostingDate < DtldCustLedgEntry2."Posting Date" THEN
    ERROR(Text003,
    ...
  21. Change the code in the PostUnApplyVendor function in the VendEntry-Apply Posted Entries codeunit (227) as follows:
    Existing code
    ...
    DtldVendLedgEntry.LOCKTABLE;
    VendLedgEntry.LOCKTABLE;
    VendLedgEntry.GET(DtldVendLedgEntry2."Vendor Ledger Entry No.");
    CheckPostingDate(PostingDate,'',0);
    IF PostingDate < DtldVendLedgEntry2."Posting Date" THEN
    ERROR(Text003,
    ...
    Replacement code
    ...
    DtldVendLedgEntry.LOCKTABLE;
    VendLedgEntry.LOCKTABLE;
    VendLedgEntry.GET(DtldVendLedgEntry2."Vendor Ledger Entry No.");

    // Add the following line.
    VendLedgEntry.TESTFIELD(Prepayment,FALSE);

    CheckPostingDate(PostingDate,'',0);
    IF PostingDate < DtldVendLedgEntry2."Posting Date" THEN
    ERROR(Text003,
    ...
  22. Change the code in the Code function in the Gen. Jnl.-Post codeunit (231) as follows:
    Existing code
    ...
    EXIT;

    TempJnlBatchName := "Journal Batch Name";

    GenJnlPostBatch.RUN(GenJnlLine);
    ...
    Replacement code
    ...
    EXIT;

    TempJnlBatchName := "Journal Batch Name";

    // Add the following lines.
    IF Prepayment THEN
    IF NOT ("Document Type" IN ["Document Type"::Payment,"Document Type"::Refund]) THEN
    FIELDERROR("Document Type");
    //End of the lines.

    GenJnlPostBatch.RUN(GenJnlLine);
    ...
  23. Add a new global variable in the Sales-Post Advances codeunit (26585), and then specify the variable as follows:
    • Name: TempAdvanceLink
    • DataType: TEMPORARY Record
    • Subtype: Advance Link (26590)
  24. Add a new local function in the Sales-Post Advances codeunit (26585) as follows:
    PROCEDURE InsertTempApplnAdvanceLink@1470048(DtldEntryBufEntryNo@1470002 : Integer);
    BEGIN
    TempAdvanceLink.INIT;
    TempAdvanceLink."Entry No." := DtldEntryBufEntryNo;
    TempAdvanceLink.INSERT;
    END;
  25. Add a new local function in the Sales-Post Advances codeunit (26585) 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 Eastern European version of Microsoft Dynamics NAV 2009 R2 installed to apply this hotfix.

Removal information

You cannot remove this hotfix.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


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.

↑ Back to the top


Keywords: kbqfe, kbmbsquickpub, kbmbspartner, kbmbsmigrate, kbsurveynew, kbnoloc, kbmbscodefix, kb

↑ Back to the top

Article Info
Article ID : 2543219
Revision : 4
Created on : 9/20/2018
Published on : 9/20/2018
Exists online : False
Views : 354