...
SourceCodeSetup@1470003 : Record 242;
CustLedgEntry@1470007 : Record 21;
PrepaidAmount@1470000 : Decimal;
PrepaidAmountLCY@1470005 : Decimal;
InvoiceAmount@1470009 : Decimal;
BEGIN
IF LinkedAdvanceEntry.ISEMPTY THEN
EXIT;
CustLedgEntry.SETRANGE("Customer No.",SalesInvHeader."Bill-to Customer No.");
...
...
SourceCodeSetup@1470003 : Record 242;
CustLedgEntry@1470007 : Record 21;
PrepaidAmount@1470000 : Decimal;
PrepaidAmountLCY@1470005 : Decimal;
InvoiceAmount@1470009 : Decimal;
//Add the following line.
PostedDocDim@1470015 : Record 359;
BEGIN
IF LinkedAdvanceEntry.ISEMPTY THEN
EXIT;
CustLedgEntry.SETRANGE("Customer No.",SalesInvHeader."Bill-to Customer No.");
...
...
PrepaidAmountLCY := PrepaidAmountLCY + GenJnlLine."Amount (LCY)";
GenJnlLine."Applies-to Doc. Type" := LinkedAdvanceEntry."Document Type";
GenJnlLine."Applies-to Doc. No." := LinkedAdvanceEntry."Document No.";
TempJnlLineDim.DELETEALL;
//Delete the following lines.
LedgEntryDim.SETRANGE("Table ID",DATABASE::"Cust. Ledger Entry");
LedgEntryDim.SETRANGE("Entry No.",LinkedAdvanceEntry."Entry No.");
DimMgt.CopyLedgEntryDimToJnlLineDim(LedgEntryDim,TempJnlLineDim);
//End of the deleted lines.
GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim);
UNTIL LinkedAdvanceEntry.NEXT = 0;
// Post Payment
GenJnlLine.INIT;
...
...
PrepaidAmountLCY := PrepaidAmountLCY + GenJnlLine."Amount (LCY)";
GenJnlLine."Applies-to Doc. Type" := LinkedAdvanceEntry."Document Type";
GenJnlLine."Applies-to Doc. No." := LinkedAdvanceEntry."Document No.";
TempJnlLineDim.DELETEALL;
//Add the following lines.
PostedDocDim.SETRANGE("Table ID",DATABASE::"Sales Invoice Header");
PostedDocDim.SETRANGE("Document No.",SalesInvHeader."No.");
MoveDocDimtoJnlLineDim(PostedDocDim,TempJnlLineDim,DATABASE::"Cust. Ledger Entry");
GenJnlLine."Shortcut Dimension 1 Code" := TempJnlLineDim.GetDimValueCode(GLSetup."Global Dimension 1 Code");
GenJnlLine."Shortcut Dimension 2 Code" := TempJnlLineDim.GetDimValueCode(GLSetup."Global Dimension 2 Code");
//End of the added lines.
GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim);
UNTIL LinkedAdvanceEntry.NEXT = 0;
// Post Payment
GenJnlLine.INIT;
...
...
GenJnlLine.VALIDATE("Currency Code",SalesInvHeader."Currency Code");
GenJnlLine.VALIDATE(Amount,-PrepaidAmount);
GenJnlLine.VALIDATE("Amount (LCY)",-PrepaidAmountLCY);
GenJnlLine."Applies-to Doc. Type" := GenJnlLine."Applies-to Doc. Type"::Invoice;
GenJnlLine."Applies-to Doc. No." := SalesInvHeader."No.";
GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim2);
END;
PROCEDURE PostVATReverse@1470029(VAR Rec@1470000 : Record 26585) : Boolean;
VAR
...
...
GenJnlLine.VALIDATE("Currency Code",SalesInvHeader."Currency Code");
GenJnlLine.VALIDATE(Amount,-PrepaidAmount);
GenJnlLine.VALIDATE("Amount (LCY)",-PrepaidAmountLCY);
GenJnlLine."Applies-to Doc. Type" := GenJnlLine."Applies-to Doc. Type"::Invoice;
GenJnlLine."Applies-to Doc. No." := SalesInvHeader."No.";
// Add the following lines.
GenJnlLine."Shortcut Dimension 1 Code" := TempJnlLineDim2.GetDimValueCode(GLSetup."Global Dimension 1 Code");
GenJnlLine."Shortcut Dimension 2 Code" := TempJnlLineDim2.GetDimValueCode(GLSetup."Global Dimension 2 Code");
// End of the added lines.
GenJnlPostLine.RunWithCheck(GenJnlLine,TempJnlLineDim2);
END;
PROCEDURE PostVATReverse@1470029(VAR Rec@1470000 : Record 26585) : Boolean;
VAR
...