Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions Prototyping/src/PVSCaseListExt.PageExt.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pageextension 50100 "PVS Case List Ext" extends "PVS Case List"
{
layout
{
addlast(Control1)
{
field(QuotedPriceTotal; QuotedPriceTotal)
{
ApplicationArea = All;
Caption = 'Quoted Price';
ToolTip = 'Specifies the total quoted price, calculated as the sum of all active job entries linked to this case with status Quote.';
Editable = false;
BlankZero = true;
}
field(OrderedPriceTotal; OrderedPriceTotal)
{
ApplicationArea = All;
Caption = 'Ordered Price';
ToolTip = 'Specifies the total ordered price, calculated as the sum of all active job entries linked to this case with status Order.';
Editable = false;
BlankZero = true;
}
}
}

trigger OnAfterGetRecord()
begin
CalcQuotedPrice();
CalcOrderedPrice();
end;

var
QuotedPriceTotal: Decimal;
OrderedPriceTotal: Decimal;

local procedure CalcQuotedPrice()
var
PVSJob: Record "PVS Job";
begin
QuotedPriceTotal := 0;
PVSJob.SetRange(ID, Rec.ID);
PVSJob.SetRange(Status, PVSJob.Status::Quote);
PVSJob.SetRange(Active, true);
PVSJob.CalcSums("Quoted Price");
QuotedPriceTotal := PVSJob."Quoted Price";
end;

local procedure CalcOrderedPrice()
var
PVSJob: Record "PVS Job";
begin
OrderedPriceTotal := 0;
PVSJob.SetRange(ID, Rec.ID);
PVSJob.SetRange(Status, PVSJob.Status::Order);
PVSJob.SetRange(Active, true);
PVSJob.CalcSums("Quoted Price");
OrderedPriceTotal := PVSJob."Quoted Price";
end;
}
Loading