mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 667c64a8-eb36-4440-bc41-6a97d8fb5542 Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
38 lines
1.1 KiB
AL
38 lines
1.1 KiB
AL
query 50252 "Perf Sample BOM Cost"
|
|
{
|
|
QueryType = Normal;
|
|
|
|
elements
|
|
{
|
|
dataitem(ProductionBOMLine; "Production BOM Line")
|
|
{
|
|
column(ProductionBOMNo; "Production BOM No.") { }
|
|
column(VersionCode; "Version Code") { }
|
|
column(QuantityPer; "Quantity per") { }
|
|
|
|
dataitem(Item; Item)
|
|
{
|
|
DataItemLink = "No." = ProductionBOMLine."No.";
|
|
DataItemTableFilter = "Costing Method" = const(Standard);
|
|
SqlJoinType = InnerJoin;
|
|
|
|
column(StandardCost; "Standard Cost") { }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
codeunit 50254 "Perf Sample NPlus1 Good"
|
|
{
|
|
procedure SumStdCost(BOMNo: Code[20]; BOMVersionCode: Code[20]) TotalCost: Decimal
|
|
var
|
|
BOMCost: Query "Perf Sample BOM Cost";
|
|
begin
|
|
BOMCost.SetRange(ProductionBOMNo, BOMNo);
|
|
BOMCost.SetRange(VersionCode, BOMVersionCode);
|
|
BOMCost.Open();
|
|
while BOMCost.Read() do
|
|
TotalCost += BOMCost.StandardCost * BOMCost.QuantityPer;
|
|
BOMCost.Close();
|
|
end;
|
|
}
|