GenJnlLine := GenJnlLinePostApply;
GenJnlLine."Source Currency Code" := CustLedgEntryPostApply."Currency Code";
GenJnlLine."Applies-to ID" := CustLedgEntryPostApply."Applies-to ID";
CustLedgEntry.TRANSFERFIELDS(CustLedgEntryPostApply);
...
GenJnlLine := GenJnlLinePostApply;
GenJnlLine."Source Currency Code" := CustLedgEntryPostApply."Currency Code";
GenJnlLine."Applies-to ID" := CustLedgEntryPostApply."Applies-to ID";
//Add the following lines.
IF GenJnlLine."Document Type" = GenJnlLine."Document Type"::Payment THEN BEGIN
GenJnlLine."Document Type to Close" := CustLedgEntryPostApply."Document Type to Close";
GenJnlLine."Document No. to Close" := CustLedgEntryPostApply."Document No. to Close";
END;
//End of the lines.
CustLedgEntry.TRANSFERFIELDS(CustLedgEntryPostApply);
...
...
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,FALSE);
CustLedgEntry.MODIFY;
...
...
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,FALSE);
//Add the following lines.
IF CVLedgEntryBuf."Document Type" = CVLedgEntryBuf."Document Type"::Dishonored THEN BEGIN
CustLedgEntry."Document Type to Close" := CVLedgEntryBuf."Document Type to Close";
CustLedgEntry."Document No. to Close" := CVLedgEntryBuf."Document No. to Close";
END;
//End of the lines.
CustLedgEntry.MODIFY;
...