Skip to content

[GB][Page][99000816][Production Order Statistics"] OnAfterSetProdOrderLineFilters event #29691

@JeremyOrgan-DC

Description

@JeremyOrgan-DC

Why do you need this change?

This will allows us to change the calculations on the standard "Production Order Statistics" by changing the filter on the "Prod. Order Line" to include other planning levels

Describe the request

[GB][Page][99000816][Production Order Statistics"]
[IntegrationEvent(false, false)]
local procedure OnAfterSetProdOrderLineFilters(var ProdOrderLine: Record "Prod. Order Line"; Rec: Record "Production Order")
begin
end;

trigger OnAfterGetRecord()
var
    CalendarMgt: Codeunit "Shop Calendar Management";
begin
    Clear(StdCost);
    Clear(ExpCost);
    Clear(ActCost);
    Clear(MfgCostCalcMgt);
    Clear(NonInvStdCost);
    Clear(NonInvExpCost);
    Clear(NonInvActCost);

    GLSetup.Get();

    ExpCapNeed := MfgCostCalcMgt.CalcProdOrderExpCapNeed(Rec, false) / CalendarMgt.TimeFactor(CapacityUoM);
    ActTimeUsed := MfgCostCalcMgt.CalcProdOrderActTimeUsed(Rec, false) / CalendarMgt.TimeFactor(CapacityUoM);
    ProdOrderLine.SetRange(Status, Rec.Status);
    ProdOrderLine.SetRange("Prod. Order No.", Rec."No.");
    ProdOrderLine.SetRange("Planning Level Code", 0);
    ProdOrderLine.SetFilter("Item No.", '<>%1', '');
    OnAfterSetProdOrderLineFilters(ProdOrderLine, Rec);  // New Event Call
    if ProdOrderLine.Find('-') then

For completeness the same event could be added to [GB][Report][99000791 ][Production Order Statistics"]
i imagine the changes are valid for [W1]
Internal work item: AB#621590

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions