...
CustLedgEntry.LOCKTABLE;
// Post the application
CustLedgEntry.CALCFIELDS(
Amount,"Amount (LCY)","Remaining Amount","Remaining Amt. (LCY)",
"Original Amount","Original Amt. (LCY)");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,TRUE);
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,FALSE);
CustLedgEntry.MODIFY;
IF (CustLedgEntry."Document Type" = CustLedgEntry."Document Type"::Dishonored) THEN
ApplyBill(CustLedgEntry,OldCustLedgEntry);
PostDtldCustLedgEntries(
...
...
CustLedgEntry.LOCKTABLE;
// Post the application
// Add the following lines.
IF VATEntry.Closed THEN BEGIN
ERROR(Text12100, VATEntry."VAT Period");
END ELSE BEGIN
// End of the added lines.
CustLedgEntry.CALCFIELDS(
Amount,"Amount (LCY)","Remaining Amount","Remaining Amt. (LCY)",
"Original Amount","Original Amt. (LCY)");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,TRUE);
ApplyCustLedgEntry(
CVLedgEntryBuf,DtldCVLedgEntryBuf,GenJnlLine,GLSetup."Appln. Rounding Precision");
TransferCustLedgEntry(CVLedgEntryBuf,CustLedgEntry,FALSE);
CustLedgEntry.MODIFY;
IF (CustLedgEntry."Document Type" = CustLedgEntry."Document Type"::Dishonored) THEN
ApplyBill(CustLedgEntry,OldCustLedgEntry);
// Add the following line.
END;
PostDtldCustLedgEntries(
...