mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Correct performance knowledge guidance
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 667c64a8-eb36-4440-bc41-6a97d8fb5542
This commit is contained in:
parent
7a678d1aff
commit
3f0b6a41db
31 changed files with 279 additions and 261 deletions
|
|
@ -1,15 +1,38 @@
|
|||
codeunit 50252 "Perf Sample NPlus1 Good"
|
||||
query 50252 "Perf Sample BOM Cost"
|
||||
{
|
||||
procedure SumStdCost(var BOMLine: Record "BOM Component") TotalCost: Decimal
|
||||
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
|
||||
Item: Record Item;
|
||||
BOMCost: Query "Perf Sample BOM Cost";
|
||||
begin
|
||||
Item.SetLoadFields("Costing Method", "Standard Cost");
|
||||
if BOMLine.FindSet() then
|
||||
repeat
|
||||
if Item.Get(BOMLine."No.") then
|
||||
if Item."Costing Method" = Item."Costing Method"::Standard then
|
||||
TotalCost += Item."Standard Cost" * BOMLine."Quantity per";
|
||||
until BOMLine.Next() = 0;
|
||||
BOMCost.SetRange(ProductionBOMNo, BOMNo);
|
||||
BOMCost.SetRange(VersionCode, BOMVersionCode);
|
||||
BOMCost.Open();
|
||||
while BOMCost.Read() do
|
||||
TotalCost += BOMCost.StandardCost * BOMCost.QuantityPer;
|
||||
BOMCost.Close();
|
||||
end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue