...
// Threshold crossed
IF Buffer1365M.FINDSET THEN
REPEAT
// Delete the following lines.
IF NOT IsThresholdCrossed(Buffer1365M."VAT Amount",ThresholdAmount) THEN BEGIN
IF PartnerType = PartnerType::Customer THEN BEGIN
Buffer1365M.VALIDATE("1365M-01",FALSE);
END ELSE BEGIN
Buffer1365M.VALIDATE("1365M-02",FALSE);
Buffer1365M.VALIDATE("1365M",TRUE);
END;
Buffer1365M.MODIFY(TRUE);
END;
UNTIL Buffer1365M.NEXT = 0;
END;
UNTIL PartnerBuff.NEXT = 0;
// End of the deleted lines.
...
...
// Threshold crossed
IF Buffer1365M.FINDSET THEN
REPEAT
// Add the following lines.
IF NOT IsThresholdCrossed(Buffer1365M."VAT Amount",ThresholdAmount) THEN
IF PartnerType = PartnerType::Customer THEN
Buffer1365M.VALIDATE("1365M-01",FALSE)
ELSE BEGIN
Buffer1365M.VALIDATE("1365M-02",FALSE);
Buffer1365M.VALIDATE("1365M",TRUE);
END
ELSE
IF Buffer1365M."Document Type" = Buffer1365M."Document Type"::"Credit Memo" THEN
IF PartnerType = PartnerType::Customer THEN
Buffer1365M.VALIDATE("1365M-01",FALSE)
ELSE
Buffer1365M.VALIDATE("1365M-02",FALSE);
Buffer1365M.MODIFY(TRUE);
UNTIL Buffer1365M.NEXT = 0;
END;
UNTIL PartnerBuff.NEXT = 0;
// End of the added lines.
...