pageextension 50005 SalesOrderSubformExt extends "Sales Order Subform"
{
layout
{
addafter(Quantity)
{
field(Due; Due)
{
ApplicationArea = all;
}
}
modify("Total Amount Incl. VAT")
{
visible = false;
}
addafter("Total VAT Amount")
{
field("Total Amount Incl. VAT1"; TotalSalesLine."Amount Including VAT" + DueAmt)
{
ApplicationArea = Basic, Suite;
AutoFormatExpression = Currency.Code;
AutoFormatType = 1;
CaptionClass = DocumentTotals.GetTotalInclVATCaption(Currency.Code);
Caption = 'Total Amount Incl. VAT';
Editable = false;
ToolTip = 'Specifies the sum of the value in the Line Amount Incl. VAT field on all lines in the document minus any discount amount in the Invoice Discount Amount field.';
}
}
}
trigger OnAfterGetRecord()
begin
Clear(DueAmt);
SL.Reset();
SL.SetRange(SL."Document No.", Rec."Document No.");
if Sl.FindSet() then
repeat
DueAmt := SL.Due;
until SL.Next = 0;
end;
var
SL: Record "Sales Line";
DueAmt: Decimal;
}