...
AdjustDueDate.SalesAdjustDueDate(
"Due Date","Document Date",PaymentTerms.CalculateMaxDueDate("Document Date"),"Bill-to Customer No.");
"Pmt. Discount Date" := CALCDATE(PaymentTerms."Discount Date Calculation","Document Date");
GLSetup.GET;
IF GLSetup."Payment Discount Type" = GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines" THEN
// Delete the following lines.
VALIDATE("Payment Discount %",0)
ELSE BEGIN
IF NOT UpdateDocumentDate THEN
VALIDATE("Payment Discount %",PaymentTerms."Discount %");
END;
// End of the deleted lines.
END;
END ELSE BEGIN
VALIDATE("Due Date","Document Date");
IF NOT UpdateDocumentDate THEN BEGIN
VALIDATE("Pmt. Discount Date",0D);
...
AdjustDueDate.SalesAdjustDueDate(
"Due Date","Document Date",PaymentTerms.CalculateMaxDueDate("Document Date"),"Bill-to Customer No.");
"Pmt. Discount Date" := CALCDATE(PaymentTerms."Discount Date Calculation","Document Date");
GLSetup.GET;
IF GLSetup."Payment Discount Type" = GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines" THEN
// Add the following lines.
VALIDATE("Prepmt. Payment Discount %",0)
ELSE IF NOT UpdateDocumentDate THEN
VALIDATE("Prepmt. Payment Discount %",PaymentTerms."Discount %");
IF NOT UpdateDocumentDate THEN
VALIDATE("Payment Discount %",PaymentTerms."Discount %");
// End of the added lines.
END;
END ELSE BEGIN
VALIDATE("Due Date","Document Date");
IF NOT UpdateDocumentDate THEN BEGIN
VALIDATE("Pmt. Discount Date",0D);
...