...
// Delete the following lines.
CASE TRUE OF
("Prepmt Amt to Deduct" <> 0) AND
("Prepmt Amt to Deduct" > ROUND(Fraction * "Line Amount",Currency."Amount Rounding Precision")):
FIELDERROR(
"Prepmt Amt to Deduct",
STRSUBSTNO(Text047,
ROUND(Fraction * "Line Amount",Currency."Amount Rounding Precision")));
("Prepmt. Amt. Inv." <> 0) AND
(ROUND((1 - Fraction) * "Line Amount",Currency."Amount Rounding Precision") <
ROUND(
ROUND(
ROUND("Unit Price" * (Quantity - "Quantity Invoiced" - "Qty. to Invoice"),Currency."Amount Rounding Precision") *
(1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
"Prepayment %" / 100,Currency."Amount Rounding Precision")):
FIELDERROR(
"Prepmt Amt to Deduct",
STRSUBSTNO(Text048,
ROUND(
"Prepmt. Amt. Inv." - "Prepmt Amt Deducted" - (1 - Fraction) * "Line Amount",
Currency."Amount Rounding Precision")));
END;
// End of the lines.
END ELSE
...
...
// Add the following lines.
IF "Prepayment %" <> 100 THEN
CASE TRUE OF
("Prepmt Amt to Deduct" <> 0) AND
("Prepmt Amt to Deduct" > ROUND(Fraction * "Line Amount",Currency."Amount Rounding Precision")):
FIELDERROR(
"Prepmt Amt to Deduct",
STRSUBSTNO(Text047,
ROUND(Fraction * "Line Amount",Currency."Amount Rounding Precision")));
("Prepmt. Amt. Inv." <> 0) AND
(ROUND((1 - Fraction) * "Line Amount",Currency."Amount Rounding Precision") <
ROUND(
ROUND(
ROUND("Unit Price" * (Quantity - "Quantity Invoiced" - "Qty. to Invoice"),Currency."Amount Rounding Precision") *
(1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") *
"Prepayment %" / 100,Currency."Amount Rounding Precision")):
FIELDERROR(
"Prepmt Amt to Deduct",
STRSUBSTNO(Text048,
ROUND(
"Prepmt. Amt. Inv." - "Prepmt Amt Deducted" - (1 - Fraction) * "Line Amount",
Currency."Amount Rounding Precision")));
END;
// End of the lines.
END ELSE
...
...
TempPrepmtSalesLine."Prepmt Amt to Deduct" := PrepmtAmtToDeduct;
TempPrepmtSalesLine.MODIFY;
...
...
TempPrepmtSalesLine."Prepmt Amt to Deduct" := PrepmtAmtToDeduct;
// Add the following lines.
IF "Prepayment %" < TempPrepmtSalesLine."Prepayment %" THEN
TempPrepmtSalesLine."Prepayment %" := "Prepayment %";
// End of the lines.
TempPrepmtSalesLine.MODIFY;
...
...
TempPrepmtSalesLine."Prepmt Amt to Deduct" := PrepmtAmtToDeduct;
TempPrepmtSalesLine."Prepayment Line" := TRUE;
...
...
TempPrepmtSalesLine."Prepmt Amt to Deduct" := PrepmtAmtToDeduct;
// Add the following line.
TempPrepmtSalesLine."Prepayment %" := "Prepayment %";
TempPrepmtSalesLine."Prepayment Line" := TRUE;
...