...
FIELDERROR("Unit Price",STRSUBSTNO(Text047,FIELDCAPTION("Prepayment %")));
END;
IF SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice THEN BEGIN
"Prepayment VAT Difference" := 0;
// Delete the following lines.
IF "Quantity Invoiced" = 0 THEN BEGIN
"Prepmt. Line Amount" := ROUND("Line Amount" * "Prepayment %" / 100,Currency."Amount Rounding Precision");
IF "Prepmt. Line Amount" < "Prepmt. Amt. Inv." THEN
FIELDERROR("Prepmt. Line Amount",STRSUBSTNO(Text049,"Prepmt. Amt. Inv."));
END ELSE BEGIN
IF "Prepayment %" <> 0 THEN
"Prepmt. Line Amount" := "Prepmt. Amt. Inv." +
ROUND("Line Amount" * (Quantity - "Quantity Invoiced") / Quantity * "Prepayment %" / 100,
Currency."Amount Rounding Precision")
ELSE
"Prepmt. Line Amount" := ROUND("Line Amount" * "Prepayment %" / 100,Currency."Amount Rounding Precision");
IF "Prepmt. Line Amount" > "Line Amount" THEN
FIELDERROR("Prepmt. Line Amount",STRSUBSTNO(Text049,"Prepmt. Line Amount"));
END;
// End of the lines.
END;
InitOutstandingAmount;
IF (CurrFieldNo <> 0) AND
NOT ((Type = Type::Item) AND (CurrFieldNo = FIELDNO("No.")) AND (Quantity <> 0) AND
...
...
FIELDERROR("Unit Price",STRSUBSTNO(Text047,FIELDCAPTION("Prepayment %")));
END;
IF SalesHeader."Document Type" <> SalesHeader."Document Type"::Invoice THEN BEGIN
"Prepayment VAT Difference" := 0;
// Add the following lines.
"Prepmt. Line Amount" := ROUND("Line Amount" * "Prepayment %" / 100,Currency."Amount Rounding Precision");
IF "Prepmt. Line Amount" < "Prepmt. Amt. Inv." THEN
FIELDERROR("Prepmt. Line Amount",STRSUBSTNO(Text049,"Prepmt. Amt. Inv."));
// End of the lines.
END;
InitOutstandingAmount;
IF (CurrFieldNo <> 0) AND
NOT ((Type = Type::Item) AND (CurrFieldNo = FIELDNO("No.")) AND (Quantity <> 0) AND
...