...
IF "Shipped Qty. Not Returned" = 0 THEN
// Delete the following lines.
ERROR(Text030,"Document Type","Document No.","Document Line No.");
FromSalesLineBuf := FromSalesLine;
IF -"Shipped Qty. Not Returned" < ABS(FromSalesLine."Quantity (Base)") THEN BEGIN
IF FromSalesLine."Quantity (Base)" > 0 THEN
FromSalesLineBuf."Quantity (Base)" := -"Shipped Qty. Not Returned"
ELSE
FromSalesLineBuf."Quantity (Base)" := "Shipped Qty. Not Returned";
IF FromSalesLineBuf."Qty. per Unit of Measure" = 0 THEN
FromSalesLineBuf.Quantity := FromSalesLineBuf."Quantity (Base)"
ELSE
FromSalesLineBuf.Quantity :=
ROUND(FromSalesLineBuf."Quantity (Base)" / FromSalesLineBuf."Qty. per Unit of Measure",0.00001);
END;
FromSalesLine."Quantity (Base)" := FromSalesLine."Quantity (Base)" - FromSalesLineBuf."Quantity (Base)";
FromSalesLine.Quantity := FromSalesLine.Quantity - FromSalesLineBuf.Quantity;
FromSalesLineBuf."Appl.-from Item Entry" := "Entry No.";
FromSalesLineBuf."Line No." := NextLineNo;
NextLineNo := NextLineNo + 1;
FromSalesLineBuf."Document No." := "Document No.";
IF GetSalesDocType(ItemLedgEntry) IN
[FromSalesLineBuf."Document Type"::Order,FromSalesLineBuf."Document Type"::"Return Order"]
THEN
FromSalesLineBuf."Shipment Line No." := 1;
IF NOT FromShptOrRcpt THEN
UpdateRevSalesLineAmount(
FromSalesLineBuf,OrgQtyBase,
FromSalesHeader."Prices Including VAT",ToSalesHeader."Prices Including VAT");
FromSalesLineBuf.INSERT;
// End of the lines.
UNTIL (NEXT = 0) OR (FromSalesLine."Quantity (Base)" = 0);
...
...
IF "Shipped Qty. Not Returned" = 0 THEN
// Add the following lines.
LinesApplied := TRUE;
IF "Shipped Qty. Not Returned" < 0 THEN BEGIN
FromSalesLineBuf := FromSalesLine;
IF -"Shipped Qty. Not Returned" < ABS(FromSalesLine."Quantity (Base)") THEN BEGIN
IF FromSalesLine."Quantity (Base)" > 0 THEN
FromSalesLineBuf."Quantity (Base)" := -"Shipped Qty. Not Returned"
ELSE
FromSalesLineBuf."Quantity (Base)" := "Shipped Qty. Not Returned";
IF FromSalesLineBuf."Qty. per Unit of Measure" = 0 THEN
FromSalesLineBuf.Quantity := FromSalesLineBuf."Quantity (Base)"
ELSE
FromSalesLineBuf.Quantity :=
ROUND(FromSalesLineBuf."Quantity (Base)" / FromSalesLineBuf."Qty. per Unit of Measure",0.00001);
END;
FromSalesLine."Quantity (Base)" := FromSalesLine."Quantity (Base)" - FromSalesLineBuf."Quantity (Base)";
FromSalesLine.Quantity := FromSalesLine.Quantity - FromSalesLineBuf.Quantity;
FromSalesLineBuf."Appl.-from Item Entry" := "Entry No.";
FromSalesLineBuf."Line No." := NextLineNo;
NextLineNo := NextLineNo + 1;
FromSalesLineBuf."Document No." := "Document No.";
IF GetSalesDocType(ItemLedgEntry) IN
[FromSalesLineBuf."Document Type"::Order,FromSalesLineBuf."Document Type"::"Return Order"]
THEN
FromSalesLineBuf."Shipment Line No." := 1;
IF NOT FromShptOrRcpt THEN
UpdateRevSalesLineAmount(
FromSalesLineBuf,OrgQtyBase,
FromSalesHeader."Prices Including VAT",ToSalesHeader."Prices Including VAT");
FromSalesLineBuf.INSERT;
END;
// End of the lines.
UNTIL (NEXT = 0) OR (FromSalesLine."Quantity (Base)" = 0);
...
...
MissingExCostRevLink := TRUE;
END;
...
...
MissingExCostRevLink := TRUE;
// Add the following line.
CheckUnappliedLines(LinesApplied,MissingExCostRevLink);
END;
...