...
END;
QtyType::Invoicing:
BEGIN
CASE TRUE OF
// Delete the following lines.
("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice]) AND
(NOT SalesHeader.Ship) AND SalesHeader.Invoice AND (NOT "Prepayment Line"):
BEGIN
IF "Shipment No." = '' THEN BEGIN
QtyToHandle := GetAbsMin("Qty. to Invoice","Qty. Shipped Not Invoiced");
VATAmountLine.Quantity :=
VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Qty. Shipped Not Invd. (Base)");
END ELSE BEGIN
QtyToHandle := "Qty. to Invoice";
VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
END;
END;
("Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"]) AND
(NOT SalesHeader.Receive) AND SalesHeader.Invoice:
// End of the lines.
BEGIN
QtyToHandle := GetAbsMin("Qty. to Invoice","Return Qty. Rcd. Not Invd.");
VATAmountLine.Quantity :=
VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Ret. Qty. Rcd. Not Invd.(Base)");
END;
// Delete the following lines.
ELSE
BEGIN
// End of the lines.
QtyToHandle := "Qty. to Invoice";
VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
END;
END;
...
...
END;
QtyType::Invoicing:
BEGIN
CASE TRUE OF
// Add the following lines.
("Document Type" IN ["Document Type"::Order,"Document Type"::Invoice]) AND
(NOT SalesHeader.Ship) AND SalesHeader.Invoice AND (NOT "Prepayment Line") AND
("Shipment No." = ''):
BEGIN
QtyToHandle := GetAbsMin("Qty. to Invoice","Qty. Shipped Not Invoiced");
VATAmountLine.Quantity :=
VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Qty. Shipped Not Invd. (Base)");
END;
("Document Type" IN ["Document Type"::"Return Order","Document Type"::"Credit Memo"]) AND
(NOT SalesHeader.Receive) AND SalesHeader.Invoice AND ("Return Receipt No." = ''):
// End of the lines.
BEGIN
QtyToHandle := GetAbsMin("Qty. to Invoice","Return Qty. Rcd. Not Invd.");
VATAmountLine.Quantity :=
VATAmountLine.Quantity + GetAbsMin("Qty. to Invoice (Base)","Ret. Qty. Rcd. Not Invd.(Base)");
END;
// Add the following line.
ELSE BEGIN
QtyToHandle := "Qty. to Invoice";
VATAmountLine.Quantity := VATAmountLine.Quantity + "Qty. to Invoice (Base)";
END;
END;
...