...
SalesLine.INSERT;
CopyDim(SalesLine,SalesCorrLine);
END;
PROCEDURE InitSalesLineOnCharge@1360001(VAR SalesLine@1360000 : Record 37;SalesCorrLine@1360001 : Record 14536;QtyOnSalesLine@1360002 : Decimal);
BEGIN
InitSalesLine(SalesCorrLine,SalesLine);
SalesLine.Type := SalesLine.Type::"Charge (Item)";
SalesLine."No." := SalesCorrType."Item Charge Code";
SalesLine.VALIDATE("Unit of Measure Code",'');
...
...
SalesLine.INSERT;
CopyDim(SalesLine,SalesCorrLine);
END;
PROCEDURE InitSalesLineOnCharge@1360001(VAR SalesLine@1360000 : Record 37;SalesCorrLine@1360001 : Record 14536;QtyOnSalesLine@1360002 : Decimal);
// Add the following lines.
VAR
SalesInvHeader@1360003 : Record 112;
// End of the added lines.
BEGIN
InitSalesLine(SalesCorrLine,SalesLine);
SalesLine.Type := SalesLine.Type::"Charge (Item)";
SalesLine."No." := SalesCorrType."Item Charge Code";
SalesLine.VALIDATE("Unit of Measure Code",'');
...
...
InitSalesLine(SalesCorrLine,SalesLine);
SalesLine.Type := SalesLine.Type::"Charge (Item)";
SalesLine."No." := SalesCorrType."Item Charge Code";
SalesLine.VALIDATE("Unit of Measure Code",'');
SalesLine.VALIDATE(Quantity,QtyOnSalesLine);
SalesLine.VALIDATE("Unit Price",SalesCorrLine."Unit Price");
IF SalesLine.Quantity <> 0 THEN
SalesLine.VALIDATE("Line Discount %",SalesCorrLine."Line Discount %");
SalesLine.UpdateAmounts;
SalesLine.VALIDATE("Unit Cost (LCY)",0);
...
...
InitSalesLine(SalesCorrLine,SalesLine);
SalesLine.Type := SalesLine.Type::"Charge (Item)";
SalesLine."No." := SalesCorrType."Item Charge Code";
SalesLine.VALIDATE("Unit of Measure Code",'');
SalesLine.VALIDATE(Quantity,QtyOnSalesLine);
// Add the following lines.
IF (SalesCorrLine."Before/ After correction" = SalesCorrLine."Before/ After correction"::Before) AND
(SalesInvHeader.GET(SalesCorrLine."Source Document No.")) AND
(SalesHeader."Prices Including VAT" <> SalesInvHeader."Prices Including VAT")
THEN BEGIN
IF SalesHeader."Prices Including VAT" THEN
SalesLine.VALIDATE("Unit Price",SalesCorrLine."Amount Including VAT" / SalesCorrLine.Quantity)
ELSE
SalesLine.VALIDATE("Unit Price",SalesCorrLine."VAT Base Amount" / SalesCorrLine.Quantity);
END ELSE
// End of the added lines.
SalesLine.VALIDATE("Unit Price",SalesCorrLine."Unit Price");
IF SalesLine.Quantity <> 0 THEN
SalesLine.VALIDATE("Line Discount %",SalesCorrLine."Line Discount %");
SalesLine.UpdateAmounts;
SalesLine.VALIDATE("Unit Cost (LCY)",0);
...