diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderRtngExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderRtngExt.Codeunit.al index cc5ca19ce6..2b1d322db2 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderRtngExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderRtngExt.Codeunit.al @@ -47,6 +47,12 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." SubcPriceManagement.GetSubcPriceList(ProdOrderRoutingLine); end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Route Management", OnCalculateOnBeforeProdOrderRtngLineLoopIteration, '', false, false)] + local procedure "Prod. Order Route Management_OnCalculateOnBeforeProdOrderRtngLineLoopIteration"(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; var ProdOrderLine: Record "Prod. Order Line"; var IsHandled: Boolean) + begin + ProdOrderRoutingLine.CheckForSubcontractingPurchaseLineTypeMismatch(); + end; + local procedure HandleRoutingLinkCodeValidation(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; var xProdOrderRoutingLine: Record "Prod. Order Routing Line") var ProdOrderRoutingLine2: Record "Prod. Order Routing Line"; @@ -80,10 +86,9 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." begin if RunTrigger then if ProdOrderRoutingLine.Status = ProdOrderRoutingLine.Status::Released then - if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::"Work Center" then begin - WorkCenter.Get(ProdOrderRoutingLine."No."); - if (ProdOrderRoutingLine."Routing Link Code" <> '') and (WorkCenter."Subcontractor No." <> '') then - SubcontractingManagement.DelLocationLinkedComponents(ProdOrderRoutingLine, false); - end; + if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::"Work Center" then + if WorkCenter.Get(ProdOrderRoutingLine."No.") then + if (ProdOrderRoutingLine."Routing Link Code" <> '') and (WorkCenter."Subcontractor No." <> '') then + SubcontractingManagement.DelLocationLinkedComponents(ProdOrderRoutingLine, false); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchPostExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchPostExt.Codeunit.al index 4e9cbe6eb0..a830f9e761 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchPostExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchPostExt.Codeunit.al @@ -9,6 +9,8 @@ using Microsoft.Foundation.UOM; using Microsoft.Inventory.Item; using Microsoft.Inventory.Journal; using Microsoft.Inventory.Ledger; +using Microsoft.Inventory.Posting; +using Microsoft.Inventory.Tracking; using Microsoft.Manufacturing.Capacity; using Microsoft.Purchases.Document; using Microsoft.Purchases.History; @@ -85,4 +87,29 @@ codeunit 99001535 "Subc. Purch. Post Ext" ItemJournalLine."Inventory Posting Group" := Item."Inventory Posting Group"; ItemJournalLine."Item Charge Sub. Assign." := true; end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnPostItemJnlLineOnAfterPostItemJnlLineJobConsumption, '', false, false)] + local procedure "Purch.-Post_OnPostItemJnlLineOnAfterPostItemJnlLineJobConsumption"(var ItemJournalLine: Record "Item Journal Line"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; OriginalItemJnlLine: Record "Item Journal Line"; var TempReservationEntry: Record "Reservation Entry" temporary; var TrackingSpecification: Record "Tracking Specification" temporary; QtyToBeInvoiced: Decimal; QtyToBeReceived: Decimal; var PostJobConsumptionBeforePurch: Boolean; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line"; var TempWhseTrackingSpecification: Record "Tracking Specification" temporary) + begin + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::LastOperation then + CreateTempWhseSplitSpecificationForLastOperationSubcontracting(PurchaseLine, ItemJnlPostLine, TrackingSpecification, TempWhseTrackingSpecification); + end; + + local procedure CreateTempWhseSplitSpecificationForLastOperationSubcontracting(PurchLine: Record "Purchase Line"; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line"; var TempHandlingSpecification: Record "Tracking Specification" temporary; var TempWhseSplitSpecification: Record "Tracking Specification" temporary) + begin + if ItemJnlPostLine.CollectTrackingSpecification(TempHandlingSpecification) then begin + TempWhseSplitSpecification.Reset(); + TempWhseSplitSpecification.DeleteAll(); + if TempHandlingSpecification.FindSet() then + repeat + TempWhseSplitSpecification := TempHandlingSpecification; + TempWhseSplitSpecification."Source Type" := DATABASE::"Purchase Line"; + TempWhseSplitSpecification."Source Subtype" := PurchLine."Document Type".AsInteger(); + TempWhseSplitSpecification."Source ID" := PurchLine."Document No."; + TempWhseSplitSpecification."Source Ref. No." := PurchLine."Line No."; + TempWhseSplitSpecification.Insert(); + until TempHandlingSpecification.Next() = 0; + end; + end; + } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseLineExt.Codeunit.al index 5cc58c903d..e93dc81892 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseLineExt.Codeunit.al @@ -4,7 +4,12 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Manufacturing.Subcontracting; +using Microsoft.Inventory.Item; +using Microsoft.Inventory.Tracking; +using Microsoft.Manufacturing.Document; using Microsoft.Purchases.Document; +using Microsoft.Utilities; +using Microsoft.Warehouse.Document; codeunit 99001534 "Subc. Purchase Line Ext" { @@ -68,4 +73,128 @@ codeunit 99001534 "Subc. Purchase Line Ext" if (PurchaseLine.Type = PurchaseLine.Type::Item) and (PurchaseLine."No." <> '') and (PurchaseLine."Prod. Order No." <> '') and (PurchaseLine."Operation No." <> '') then SubcPriceManagement.GetSubcPriceForPurchLine(PurchaseLine); end; + + [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnBeforeOpenItemTrackingLines, '', false, false)] + local procedure "Purchase Line_OnBeforeOpenItemTrackingLines"(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean) + begin + OpenItemTrackingOfProdOrderLine(PurchaseLine, false); + IsHandled := true; + end; + + local procedure CheckItem(PurchaseLine: Record "Purchase Line") + var + Item: Record Item; + ItemTrackingCode: Record "Item Tracking Code"; + begin + PurchaseLine.TestField(Type, "Purchase Line Type"::Item); + PurchaseLine.TestField("No."); + Item.SetLoadFields("Item Tracking Code"); + Item.Get(PurchaseLine."No."); + Item.TestField("Item Tracking Code"); + ItemTrackingCode.Get(Item."Item Tracking Code"); + end; + + local procedure CheckOverDeliveryQty(PurchaseLine: Record "Purchase Line"; ProdOrderLine: Record "Prod. Order Line") + var + QtyMismatchTitleLbl: Label 'Quantity Mismatch'; + QtyMessageLbl: Label 'The quantity (%1) in %2 is greater than the specified quantity (%3) in %4. In order to open item tracking lines, first adjust the quantity on %2 to at least match the quantity on %4. You can adjust the quantity from %5 to %6 by using the action below.', + Comment = '%1 = PurchaseLine Outstanding Qty, %2 = Tablecaption PurchaseLine, %3 = ProdOrderLine Remaining Qty, %4 = Tablecaption ProdOrderLine, %5 = Current ProdOrderLine Qty, %6 = New PurchaseLine Qty'; + ShowProductionOrderActionLbl: Label 'Show Prod. Order'; + AdjustQtyActionLbl: Label 'Adjust Quantity'; + OpenItemTrackingAnywayActionLbl: Label 'Open anyway'; + CannotInvoiceErrorInfo: ErrorInfo; + begin + if PurchaseLine.Quantity > ProdOrderLine.Quantity then begin + CannotInvoiceErrorInfo.Title := QtyMismatchTitleLbl; + CannotInvoiceErrorInfo.Message := StrSubstNo(QtyMessageLbl, PurchaseLine."Outstanding Quantity", PurchaseLine.TableCaption(), ProdOrderLine."Remaining Quantity", ProdOrderLine.TableCaption(), ProdOrderLine.Quantity, PurchaseLine.Quantity); + + CannotInvoiceErrorInfo.RecordId := PurchaseLine.RecordId; + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(AdjustQtyActionLbl), + Codeunit::"Subc. Purchase Line Ext", + 'AdjustProdOrderLineQuantity' + ); + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(ShowProductionOrderActionLbl), + Codeunit::"Subc. Purchase Line Ext", + 'ShowProductionOrder' + ); + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(OpenItemTrackingAnywayActionLbl), + Codeunit::"Subc. Purchase Line Ext", + 'OpenItemTrackingWithoutAdjustment' + ); + Error(CannotInvoiceErrorInfo); + end; + end; + + local procedure OpenItemTrackingOfProdOrderLine(var PurchaseLine: Record "Purchase Line"; SkipOverDeliveryCheck: Boolean) + var + ProdOrderLine: Record "Prod. Order Line"; + TrackingSpecification: Record "Tracking Specification"; + ProdOrderLineReserve: Codeunit "Prod. Order Line-Reserve"; + ItemTrackingLines: Page "Item Tracking Lines"; + NotLastOperationLineErr: Label 'Item tracking lines can only be viewed for subcontracting purchase lines which are linked to a routing line which is the last operation.'; + SecondSourceQtyArray: array[3] of Decimal; + begin + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::None then + exit; + CheckItem(PurchaseLine); + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation then + Error(NotLastOperationLineErr); + if PurchaseLine."Subc. Purchase Line Type" <> "Subc. Purchase Line Type"::LastOperation then + exit; + if not PurchaseLine.IsSubcontractingLineWithLastOperation(ProdOrderLine) then + exit; + + SecondSourceQtyArray[1] := Database::"Warehouse Receipt Line"; + SecondSourceQtyArray[2] := PurchaseLine.CalcBaseQtyFromQuantity(PurchaseLine."Qty. to Receive", PurchaseLine.FieldCaption("Qty. Rounding Precision"), PurchaseLine.FieldCaption("Qty. to Receive"), PurchaseLine.FieldCaption("Qty. to Receive (Base)")); + SecondSourceQtyArray[3] := 0; + + if not SkipOverDeliveryCheck then + CheckOverDeliveryQty(PurchaseLine, ProdOrderLine); + + ProdOrderLineReserve.InitFromProdOrderLine(TrackingSpecification, ProdOrderLine); + ItemTrackingLines.SetSourceSpec(TrackingSpecification, ProdOrderLine."Due Date"); + ItemTrackingLines.SetSecondSourceQuantity(SecondSourceQtyArray); + ItemTrackingLines.RunModal(); + end; + + internal procedure ShowProductionOrder(OverDeliveryErrorInfo: ErrorInfo) + var + ProductionOrder: Record "Production Order"; + PurchaseLine: Record "Purchase Line"; + PageManagement: Codeunit "Page Management"; + CannotOpenProductionOrderErr: Label 'Cannot open Production Order %1.', Comment = '%1=Production Order No.'; + begin + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProductionOrder.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No."); + if not PageManagement.PageRun(ProductionOrder) then + Error(CannotOpenProductionOrderErr, ProductionOrder."No."); + end; + + internal procedure AdjustProdOrderLineQuantity(OverDeliveryErrorInfo: ErrorInfo) + var + PurchaseLine: Record "Purchase Line"; + ProdOrderLine: Record "Prod. Order Line"; + begin + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProdOrderLine.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No.", PurchaseLine."Prod. Order Line No."); + if PurchaseLine.Quantity > ProdOrderLine.Quantity then begin + ProdOrderLine.Validate(Quantity, PurchaseLine.Quantity); + ProdOrderLine.Modify(); + Commit(); + end; + OpenItemTrackingOfProdOrderLine(PurchaseLine, true); + end; + + internal procedure OpenItemTrackingWithoutAdjustment(OverDeliveryErrorInfo: ErrorInfo) + var + PurchaseLine: Record "Purchase Line"; + ProdOrderLine: Record "Prod. Order Line"; + begin + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProdOrderLine.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No.", PurchaseLine."Prod. Order Line No."); + OpenItemTrackingOfProdOrderLine(PurchaseLine, true); + end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Warehouse/SubcWhsePostReceiptExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Warehouse/SubcWhsePostReceiptExt.Codeunit.al index 10dfc27d51..b3c8ab4a25 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Warehouse/SubcWhsePostReceiptExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Warehouse/SubcWhsePostReceiptExt.Codeunit.al @@ -4,10 +4,31 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.Manufacturing.Subcontracting; +using Microsoft.Foundation.UOM; +using Microsoft.Inventory.Tracking; + using Microsoft.Inventory.Transfer; +using Microsoft.Manufacturing.Document; +using Microsoft.Purchases.Document; +using Microsoft.Utilities; +using Microsoft.Warehouse.Document; +using Microsoft.Warehouse.History; +using Microsoft.Warehouse.Journal; codeunit 99001551 "Subc. WhsePostReceipt Ext" { + [EventSubscriber(ObjectType::Table, Database::"Warehouse Receipt Line", OnBeforeOpenItemTrackingLines, '', false, false)] + local procedure "Warehouse Receipt Line_OnBeforeOpenItemTrackingLines"(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; var IsHandled: Boolean; CallingFieldNo: Integer) + var + NotLastOperationLineErr: Label 'Item tracking lines can only be viewed for subcontracting purchase lines which are linked to a routing line which is the last operation.'; + begin + if WarehouseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::None then + exit; + if WarehouseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation then + Error(NotLastOperationLineErr); + CheckOverDelivery(WarehouseReceiptLine); + end; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Receipt", OnAfterTransRcptLineModify, '', false, false)] local procedure OnAfterTransRcptLineModify(var TransferReceiptLine: Record "Transfer Receipt Line"; TransferLine: Record "Transfer Line"; CommitIsSuppressed: Boolean) var @@ -15,4 +36,235 @@ codeunit 99001551 "Subc. WhsePostReceipt Ext" begin SubcontractingManagement.TransferReservationEntryFromPstTransferLineToProdOrderComp(TransferReceiptLine); end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purchases Warehouse Mgt.", OnAfterGetQuantityRelatedParameter, '', false, false)] + local procedure "Purchases Warehouse Mgt._OnAfterGetQuantityRelatedParameter"(PurchaseLine: Record Microsoft.Purchases.Document."Purchase Line"; var QtyPerUoM: Decimal; var QtyBasePurchaseLine: Decimal) + var + Item: Record Microsoft.Inventory.Item.Item; + UOMMgt: Codeunit "Unit of Measure Management"; + begin + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::LastOperation then begin + Item.Get(PurchaseLine."No."); + QtyPerUoM := UOMMgt.GetQtyPerUnitOfMeasure(Item, PurchaseLine."Unit of Measure Code"); + QtyBasePurchaseLine := PurchaseLine.CalcBaseQtyFromQuantity(PurchaseLine.Quantity, PurchaseLine.FieldCaption("Qty. Rounding Precision"), PurchaseLine.FieldCaption("Quantity"), PurchaseLine.FieldCaption("Quantity (Base)")); + end; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purchases Warehouse Mgt.", OnPurchLine2ReceiptLineOnAfterInitNewLine, '', false, false)] + local procedure "Purchases Warehouse Mgt._OnPurchLine2ReceiptLineOnAfterInitNewLine"(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; WarehouseReceiptHeader: Record "Warehouse Receipt Header"; PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean) + begin + WarehouseReceiptLine."Subc. Purchase Line Type" := PurchaseLine."Subc. Purchase Line Type"; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purchases Warehouse Mgt.", OnBeforeCheckIfPurchLine2ReceiptLine, '', false, false)] + local procedure "Purchases Warehouse Mgt._OnBeforeCheckIfPurchLine2ReceiptLine"(var PurchaseLine: Record "Purchase Line"; var ReturnValue: Boolean; var IsHandled: Boolean) + var + OutstandingQtyBase: Decimal; + WhseOutstandingQtyBase: Decimal; + begin + case PurchaseLine."Subc. Purchase Line Type" of + "Subc. Purchase Line Type"::None: + exit; + "Subc. Purchase Line Type"::LastOperation, + "Subc. Purchase Line Type"::NotLastOperation: + begin + PurchaseLine.CalcFields("Whse. Outstanding Quantity"); + OutstandingQtyBase := PurchaseLine.CalcBaseQtyFromQuantity(PurchaseLine."Outstanding Quantity", PurchaseLine.FieldCaption("Qty. Rounding Precision"), PurchaseLine.FieldCaption("Outstanding Quantity"), PurchaseLine.FieldCaption("Outstanding Qty. (Base)")); + WhseOutstandingQtyBase := PurchaseLine.CalcBaseQtyFromQuantity(PurchaseLine."Whse. Outstanding Quantity", PurchaseLine.FieldCaption("Qty. Rounding Precision"), PurchaseLine.FieldCaption("Whse. Outstanding Quantity"), PurchaseLine.FieldCaption("Whse. Outstanding Qty. (Base)")); + ReturnValue := (Abs(OutstandingQtyBase) > Abs(WhseOutstandingQtyBase)); + IsHandled := true; + end; + end; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Purch. Release", OnReleaseOnBeforeCreateWhseRequest, '', false, false)] + local procedure "Whse.-Purch. Release_OnReleaseOnBeforeCreateWhseRequest"(var PurchaseLine: Record "Purchase Line"; var DoCreateWhseRequest: Boolean) + begin + DoCreateWhseRequest := DoCreateWhseRequest or PurchaseLine.IsInventoriableItem(); + end; + + [EventSubscriber(ObjectType::Table, Database::"Warehouse Receipt Line", OnBeforeCalcBaseQty, '', false, false)] + local procedure "Warehouse Receipt Line_OnBeforeCalcBaseQty"(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; var Qty: Decimal; FromFieldName: Text; ToFieldName: Text; var SuppressQtyPerUoMTestfield: Boolean) + begin + SuppressQtyPerUoMTestfield := WarehouseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation; + end; + + [EventSubscriber(ObjectType::Table, Database::"Warehouse Receipt Line", OnValidateQtyToReceiveOnBeforeUOMMgtValidateQtyIsBalanced, '', false, false)] + local procedure "Warehouse Receipt Line_OnValidateQtyToReceiveOnBeforeUOMMgtValidateQtyIsBalanced"(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; xWarehouseReceiptLine: Record "Warehouse Receipt Line"; var IsHandled: Boolean) + begin + if (WarehouseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation) then + IsHandled := true; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", OnBeforePostWhseJnlLine, '', false, false)] + local procedure "Whse.-Post Receipt_OnBeforePostWhseJnlLine"(var PostedWhseReceiptHeader: Record "Posted Whse. Receipt Header"; var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; var WhseReceiptLine: Record "Warehouse Receipt Line"; var TempTrackingSpecification: Record "Tracking Specification" temporary; var IsHandled: Boolean) + begin + if PostedWhseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation then + IsHandled := true; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", OnPostWhseJnlLineOnAfterInsertWhseItemEntryRelation, '', false, false)] + local procedure "Whse.-Post Receipt_OnPostWhseJnlLineOnAfterInsertWhseItemEntryRelation"(var PostedWhseRcptHeader: Record "Posted Whse. Receipt Header"; var PostedWhseRcptLine: Record "Posted Whse. Receipt Line"; var TempWhseSplitSpecification: Record "Tracking Specification" temporary; var IsHandled: Boolean; ReceivingNo: Code[20]; PostingDate: Date; var TempWhseJnlLine: Record "Warehouse Journal Line" temporary) + begin + if PostedWhseRcptLine."Subc. Purchase Line Type" <> "Subc. Purchase Line Type"::None then + IsHandled := true; + end; + + [EventSubscriber(ObjectType::Table, Database::"Warehouse Receipt Line", OnBeforeOpenItemTrackingLineForPurchLine, '', false, false)] + local procedure "Warehouse Receipt Line_OnBeforeOpenItemTrackingLineForPurchLine"(PurchaseLine: Record "Purchase Line"; SecondSourceQtyArray: array[3] of Decimal; var SkipCallItemTracking: Boolean) + var + ProdOrderLine: Record "Prod. Order Line"; + begin + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::LastOperation then + if PurchaseLine.IsSubcontractingLineWithLastOperation(ProdOrderLine) then begin + OpenItemTrackingOfProdOrderLine(SecondSourceQtyArray, ProdOrderLine); + SkipCallItemTracking := true; + end; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", OnCreatePostedRcptLineOnBeforePutAwayProcessing, '', false, false)] + local procedure "Whse.-Post Receipt_OnIsReceiptForSubcontracting"(var PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; var SkipPutAwayProcessing: Boolean) + begin + if SkipPutAwayProcessing then + exit; + SkipPutAwayProcessing := PostedWhseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Whse.-Post Receipt", OnBeforeCreatePutAwayLine, '', false, false)] + local procedure "Whse.-Post Receipt_OnIsReceiptIsForSubcontractingNotLastOperation"(PostedWhseReceiptLine: Record "Posted Whse. Receipt Line"; var SkipPutAwayCreationForLine: Boolean) + begin + if PostedWhseReceiptLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::NotLastOperation then + SkipPutAwayCreationForLine := true; + end; + + local procedure OpenItemTrackingOfProdOrderLine(var SecondSourceQtyArray: array[3] of Decimal; var ProdOrderLine: Record "Prod. Order Line") + var + TrackingSpecification: Record "Tracking Specification"; + ProdOrderLineReserve: Codeunit "Prod. Order Line-Reserve"; + ItemTrackingLines: Page "Item Tracking Lines"; + begin + ProdOrderLineReserve.InitFromProdOrderLine(TrackingSpecification, ProdOrderLine); + ItemTrackingLines.SetSourceSpec(TrackingSpecification, ProdOrderLine."Due Date"); + ItemTrackingLines.SetSecondSourceQuantity(SecondSourceQtyArray); + ItemTrackingLines.RunModal(); + end; + + local procedure CheckOverDelivery(var WarehouseReceiptLine: Record "Warehouse Receipt Line") + var + PurchaseLine: Record "Purchase Line"; + ProdOrderLine: Record "Prod. Order Line"; + QtyMismatchTitleLbl: Label 'Quantity Mismatch'; + QtyMessageLbl: Label 'The quantity (%1) in %2 is greater than the remaining quantity (%3) in %4. In order to open item tracking lines, first adjust the quantity on %4 to at least match the quantity on %2. You can adjust the quantity from %5 to %6 by using the action below.', + Comment = '%1 = Warehouse Receipt Line Quantity, %2 = Tablecaption WarehouseReceiptLine, %3 = ProdOrderLine Remaining Qty, %4 = Tablecaption ProdOrderLine, %5 = Current ProdOrderLine Quantity, %6 = WarehouseReceiptLine Quantity'; + ShowProductionOrderActionLbl: Label 'Show Prod. Order'; + AdjustQtyActionLbl: Label 'Adjust Quantity'; + OpenItemTrackingAnywayActionLbl: Label 'Open anyway'; + CannotInvoiceErrorInfo: ErrorInfo; + CustomDimensions: Dictionary of [Text, Text]; + begin + if not PurchaseLine.Get(WarehouseReceiptLine."Source Subtype", WarehouseReceiptLine."Source No.", WarehouseReceiptLine."Source Line No.") then + exit; + if PurchaseLine."Subc. Purchase Line Type" <> "Subc. Purchase Line Type"::LastOperation then + exit; + if not PurchaseLine.IsSubcontractingLineWithLastOperation(ProdOrderLine) then + exit; + if ProdOrderLine.Quantity < WarehouseReceiptLine.Quantity then begin + CannotInvoiceErrorInfo.Title := QtyMismatchTitleLbl; + CannotInvoiceErrorInfo.Message := StrSubstNo(QtyMessageLbl, WarehouseReceiptLine.Quantity, WarehouseReceiptLine.TableCaption(), ProdOrderLine."Remaining Quantity", ProdOrderLine.TableCaption(), ProdOrderLine.Quantity, WarehouseReceiptLine.Quantity); + + CannotInvoiceErrorInfo.RecordId := PurchaseLine.RecordId; + CustomDimensions.Add(GetWarehouseReceiptLineSystemIdCustomDimensionLbl(), WarehouseReceiptLine.SystemId); + CannotInvoiceErrorInfo.CustomDimensions(CustomDimensions); + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(AdjustQtyActionLbl), + Codeunit::"Subc. WhsePostReceipt Ext", + 'AdjustProdOrderLineQuantity' + ); + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(ShowProductionOrderActionLbl), + Codeunit::"Subc. WhsePostReceipt Ext", + 'ShowProductionOrder' + ); + CannotInvoiceErrorInfo.AddAction( + StrSubstNo(OpenItemTrackingAnywayActionLbl), + Codeunit::"Subc. Purchase Line Ext", + 'OpenItemTrackingWithoutAdjustment' + ); + Error(CannotInvoiceErrorInfo); + end; + end; + + internal procedure ShowProductionOrder(OverDeliveryErrorInfo: ErrorInfo) + var + ProductionOrder: Record "Production Order"; + PurchaseLine: Record "Purchase Line"; + PageManagement: Codeunit "Page Management"; + CannotOpenProductionOrderErr: Label 'Cannot open Production Order %1.', Comment = '%1=Production Order No.'; + begin + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProductionOrder.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No."); + if not PageManagement.PageRun(ProductionOrder) then + Error(CannotOpenProductionOrderErr, ProductionOrder."No."); + end; + + internal procedure AdjustProdOrderLineQuantity(OverDeliveryErrorInfo: ErrorInfo) + var + PurchaseLine: Record "Purchase Line"; + ProdOrderLine: Record "Prod. Order Line"; + WarehouseReceiptLine: Record "Warehouse Receipt Line"; + SecondSourceQtyArray: array[3] of Decimal; + CustomDimensions: Dictionary of [Text, Text]; + WarehouseReceiptLineSystemId: Guid; + begin + CustomDimensions := OverDeliveryErrorInfo.CustomDimensions(); + if CustomDimensions.ContainsKey(GetWarehouseReceiptLineSystemIdCustomDimensionLbl()) then + if not Evaluate(WarehouseReceiptLineSystemId, CustomDimensions.Get(GetWarehouseReceiptLineSystemIdCustomDimensionLbl())) then + exit; + if not WarehouseReceiptLine.GetBySystemId(WarehouseReceiptLineSystemId) then + exit; + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProdOrderLine.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No.", PurchaseLine."Prod. Order Line No."); + if WarehouseReceiptLine.Quantity > ProdOrderLine.Quantity then begin + ProdOrderLine.Validate(Quantity, WarehouseReceiptLine.Quantity); + ProdOrderLine.Modify(); + Commit(); + end; + SecondSourceQtyArray[1] := Database::"Warehouse Receipt Line"; + SecondSourceQtyArray[2] := WarehouseReceiptLine."Qty. to Receive (Base)"; + SecondSourceQtyArray[3] := 0; + + OpenItemTrackingOfProdOrderLine(SecondSourceQtyArray, ProdOrderLine); + end; + + internal procedure OpenItemTrackingWithoutAdjustment(OverDeliveryErrorInfo: ErrorInfo) + var + PurchaseLine: Record "Purchase Line"; + ProdOrderLine: Record "Prod. Order Line"; + WarehouseReceiptLine: Record "Warehouse Receipt Line"; + SecondSourceQtyArray: array[3] of Decimal; + CustomDimensions: Dictionary of [Text, Text]; + WarehouseReceiptLineSystemId: Guid; + begin + CustomDimensions := OverDeliveryErrorInfo.CustomDimensions(); + if CustomDimensions.ContainsKey(GetWarehouseReceiptLineSystemIdCustomDimensionLbl()) then + if not Evaluate(WarehouseReceiptLineSystemId, CustomDimensions.Get(GetWarehouseReceiptLineSystemIdCustomDimensionLbl())) then + exit; + if not WarehouseReceiptLine.GetBySystemId(WarehouseReceiptLineSystemId) then + exit; + PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); + ProdOrderLine.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No.", PurchaseLine."Prod. Order Line No."); + + SecondSourceQtyArray[1] := Database::"Warehouse Receipt Line"; + SecondSourceQtyArray[2] := WarehouseReceiptLine."Qty. to Receive (Base)"; + SecondSourceQtyArray[3] := 0; + + OpenItemTrackingOfProdOrderLine(SecondSourceQtyArray, ProdOrderLine); + end; + + procedure GetWarehouseReceiptLineSystemIdCustomDimensionLbl(): Text + var + WarehouseReceiptLineSystemIdCustomDimensionLbl: Label 'WarehouseReceiptLineSystemId', Locked = true; + begin + exit(WarehouseReceiptLineSystemIdCustomDimensionLbl); + end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Enumerations/SubcPurchaseLineType.Enum.al b/src/Apps/W1/Subcontracting/App/src/Process/Enumerations/SubcPurchaseLineType.Enum.al new file mode 100644 index 0000000000..70ba5b7ed7 --- /dev/null +++ b/src/Apps/W1/Subcontracting/App/src/Process/Enumerations/SubcPurchaseLineType.Enum.al @@ -0,0 +1,22 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.Manufacturing.Subcontracting; +enum 99001507 "Subc. Purchase Line Type" +{ + Extensible = true; + + value(0; None) + { + Caption = ' '; + } + value(1; LastOperation) + { + Caption = 'Last Operation'; + } + value(2; NotLastOperation) + { + Caption = 'Not Last Operation'; + } +} \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/Rep99001500.SubcDetailedCalculation.rdl b/src/Apps/W1/Subcontracting/App/src/Process/Reports/Rep99001500.SubcDetailedCalculation.rdl index f941688ff9..f0ad93b76b 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/Rep99001500.SubcDetailedCalculation.rdl +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/Rep99001500.SubcDetailedCalculation.rdl @@ -1,5957 +1,5957 @@ - - - 0 - - - - SQL - - - None - 76c8b53c-5c88-4136-be7b-4e803ebab26d - - - - - - - - - - - 1.16906cm - - - 1.40236cm - - - 2.22494cm - - - 1.45001cm - - - 1.5873cm - - - 1.12222cm - - - 1.65001cm - - - 1.95001cm - - - 1.7873cm - - - 1.5873cm - - - 0.95237cm - - - 1.26985cm - - - - - 0.35278cm - - - - - true - true - - - - - =First(Fields!ItemFilterCaption.Value) - - - - - - - Textbox1 - - - 12 - - - - - - - - - - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox2 - - - - - - - - true - true - - - - - - - - - - - - Textbox3 - - - - - - - - true - true - - - - - - - - - - - - Textbox4 - - - - - - - - true - true - - - - - - - - - - - - Textbox5 - - - - - - - - true - true - - - - - - - - - - - - Textbox6 - - - - - - - - true - true - - - - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox8 - - - - - - - - true - true - - - - - - - - - - - - Textbox9 - - - - - - - - true - true - - - - - - - - - - - - Textbox10 - - - - - - - - true - true - - - - - - - - - - - - Textbox11 - - - - - - - - true - true - - - - - - - - - - - - Textbox12 - - - - - - - - true - true - - - - - - - - - - - - Textbox13 - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Parameters!No_ItemCaption.Value - - - - - - - Textbox14 - - - 2 - - - - - - - true - true - - - - - - - - - - - - Textbox15 - - - - - - - - true - true - - - - - =Fields!No_Item.Value - - - - - - - Textbox16 - - - Bottom - 5pt - 5pt - - - 5 - - - - - - - - - - true - true - - - - - - - - - - - - Textbox17 - - - - - - - - true - true - - - - - - - - - - - - Textbox18 - - - - - - - - true - true - - - - - - - - - - - - Textbox19 - - - - - - - - true - true - - - - - - - - - - - - Textbox20 - - - - - - - - 0.4064cm - - - - - true - true - - - - - =Parameters!Description_ItemCaption.Value - - - - - - - Textbox21 - - - 3 - - - - - - - - true - true - - - - - =Fields!Description_Item.Value - - - - - - - Textbox22 - - - 6 - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox23 - - - - - - - - true - true - - - - - - - - - - - - Textbox24 - - - - - - - - true - true - - - - - - - - - - - - Textbox25 - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Parameters!ProductionBOMNo_ItemCaption.Value - - - - - - - Textbox26 - - - 3 - - - - - - - - true - true - - - - - =Fields!ProductionBOMNo_Item.Value - - - - - - - Textbox27 - - - 2 - - - - - - - true - true - - - - - =Fields!PBOMVersionCode1.Value - - - - - - - Textbox28 - - - 2 - - - - - - - true - true - - - - - - - - - - - - Textbox29 - - - - - - - - true - true - - - - - - - - - - - - Textbox30 - - - - - - - - true - true - - - - - - - - - - - - Textbox32 - - - - - - - - true - true - - - - - - - - - - - - Textbox34 - - - - - - - - true - true - - - - - - - - - - - - Textbox35 - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Parameters!LotSize_ItemCaption.Value - - - - - - - Textbox36 - - - 3 - - - - - - - - true - true - - - - - =Fields!LotSize_Item.Value - - - - - - - Textbox37 - - - 2 - - - - - - - true - true - - - - - =Fields!BaseUnitOfMeasure_Item.Value - - - - - - 2 - - - - - - - true - true - - - - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox40 - - - - - - - - true - true - - - - - - - - - - - - Textbox41 - - - - - - - - true - true - - - - - - - - - - - - Textbox42 - - - - - - - - true - true - - - - - - - - - - - - Textbox43 - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Parameters!RoutingNo_ItemCaption.Value - - - - - - - Textbox44 - - - 3 - - - - - - - - true - true - - - - - =Fields!RoutingNo_Item.Value - - - - - - - Textbox45 - - - 2 - - - - - - - true - true - - - - - =Fields!RtngVersionCode.Value - - - - - - - Textbox46 - - - 2 - - - - - - - true - true - - - - - - - - - - - - Textbox47 - - - - - - - - true - true - - - - - - - - - - - - Textbox48 - - - - - - - - true - true - - - - - - - - - - - - Textbox49 - - - - - - - - true - true - - - - - - - - - - - - Textbox50 - - - - - - - - true - true - - - - - - - - - - - - Textbox51 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox52 - - - 12 - - - - - - - - - - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Parameters!OperationNo_RtngLineCaption.Value - - - - - - - Textbox53 - - - 2 - - - - - - - true - true - - - - - =Parameters!Type_RtngLineCaption.Value - - - - - - - Textbox54 - - - - - - - - true - true - - - - - =Parameters!No_RtngLineCaption.Value - - - - - - - Textbox55 - - - - - - - - true - true - - - - - =Parameters!Description_ItemCaption.Value - - - - - - - Textbox56 - - - 2 - - - - - - - true - true - - - - - =Parameters!SetupTime_RtngLineCaption.Value - - - - - - - Textbox57 - - - - - - - - true - true - - - - - =Parameters!RunTime_RtngLineCaption.Value - - - - - - - Textbox58 - - - - - - - - true - true - - - - - =Fields!CostTimeCaption.Value - - - - - - - Textbox59 - - - - - - - - true - true - - - - - =Fields!UnitCostCaption.Value - - - - - - - Textbox60 - - - - - - - - true - true - - - - - =Fields!TotalCostCaption.Value - - - - - - - Textbox62 - - - 2 - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox63 - - - 12 - - - - - - - - - - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox64 - - - - - - Bottom - 5pt - - - 12 - - - - - - - - - - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Fields!TypeCaption.Value - - - - - - - Textbox65 - - - - - - - - true - true - - - - - =Fields!NoCaption.Value - - - - - - - Textbox66 - - - - - - - - true - true - - - - - =Fields!DescriptionCaption.Value - - - - - - - Textbox67 - - - 2 - - - - - - - true - true - - - - - =Fields!QuantityCaption.Value - - - - - - - Textbox68 - - - - - - - - true - true - - - - - =Fields!BaseUnitOfMeasureCaption.Value - - - - - - - Textbox69 - - - 2 - - - - - - - true - true - - - - - =Fields!UnitCostCaption.Value - - - - - - - Textbox70 - - - - - - - - true - true - - - - - =Fields!TotalCost1Caption.Value - - - - - - - Textbox71 - - - - - - - - true - true - - - - - - - - - - - - Textbox72 - - - - - - - - true - true - - - - - - - - - - - - Textbox73 - - - - - - - - true - true - - - - - - - - - - - - Textbox74 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox75 - - - 12 - - - - - - - - - - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox77 - - - - - - Bottom - 5pt - - - 12 - - - - - - - - - - - - - - - - - 0.35278cm - - - - - true - true - - - - - =Fields!OperationNo_RtngLine.Value - - - - - - - Textbox78 - - - 2 - - - - - - - true - true - - - - - =Fields!Type_RtngLine.Value - - - - - - - Textbox79 - - - - - - - - true - true - - - - - =Fields!No_RtngLine.Value - - - - - - - Textbox80 - - - - - - - - true - true - - - - - =Fields!Description_RtngLine.Value - - - - - - - Textbox81 - - - 2 - - - - - - - true - true - - - - - =Fields!SetupTime_RtngLine.Value - - - - - - - Textbox82 - - - - - - - - true - true - - - - - =Fields!RunTime_RtngLine.Value - - - - - - - Textbox83 - - - - - - - - true - true - - - - - =Fields!CostTime.Value - - - - - - - Textbox84 - - - - - - - - true - true - - - - - =Fields!ProdUnitCost.Value - - - - - - - Textbox85 - - - - - - - - true - true - - - - - =Fields!ProdTotalCost.Value - - - - - - - Textbox86 - - - 2 - - - - - - - 0.35278cm - - - - - true - true - - - - - =Fields!ProdBOMLineLevelType.Value - - - - - - - Textbox87 - - - - - - - - true - true - - - - - =Fields!ProdBOMLineLevelNo.Value - - - - - - - Textbox88 - - - - - - - - true - true - - - - - =Fields!ProdBOMLineLevelDesc.Value - - - - - - - Textbox89 - - - 2 - - - - - - - true - true - - - - - =Fields!ProdBOMLineLevelQuantity.Value - - - - - - - Textbox90 - - - - - - - - true - true - - - - - =Fields!CompItemBaseUOM.Value - - - - - - - Textbox91 - - - 2 - - - - - - - true - true - - - - - =Fields!CompItemUnitCost.Value - - - - - - - Textbox92 - - - - - - - - true - true - - - - - =Fields!CostTotal.Value - - - - - - - Textbox93 - - - - - - - - true - true - - - - - - - - - - - - Textbox94 - - - - - - - - true - true - - - - - - - - - - - - Textbox95 - - - - - - - - true - true - - - - - - - - - - - - Textbox96 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox97 - - - 12 - - - - - - - - - - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox98 - - - 8 - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox99 - - - - - - Top - 5pt - - - - - - - - true - true - - - - - - - - - - - - Textbox100 - - - 3 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox101 - - - - - - - - true - true - - - - - - - - - - - - Textbox102 - - - - - - - - true - true - - - - - - - - - - - - Textbox103 - - - - - - - - true - true - - - - - - - - - - - - Textbox104 - - - - - - - - true - true - - - - - - - - - - - - Textbox105 - - - - - - - - true - true - - - - - =Fields!TotalCost1Caption.Value - - - - - - - Textbox106 - - - 3 - - - - - - - - true - true - - - - - =Sum(Fields!CostTotal.Value) - - - - - - - Textbox107 - - - - - - - - true - true - - - - - - - - - Textbox108 - - - - - - - - true - true - - - - - - - - - - - - Textbox109 - - - - - - - - true - true - - - - - - - - - - - - Textbox110 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox111 - - - - - - - - true - true - - - - - - - - - - - - Textbox112 - - - - - - - - true - true - - - - - - - - - - - - Textbox113 - - - - - - - - true - true - - - - - - - - - - - - Textbox114 - - - - - - - - true - true - - - - - - - - - - - - Textbox115 - - - - - - - - true - true - - - - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox117 - - - - - - - - true - true - - - - - - - - - - - - Textbox118 - - - - - - - - true - true - - - - - - - - - - - - Textbox119 - - - - - - - - true - true - - - - - - - - - - - - Textbox120 - - - - - - - - true - true - - - - - - - - - - - - Textbox121 - - - - - - - - true - true - - - - - - - - - - - - Textbox122 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox123 - - - 11 - - - - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox124 - - - - - - Top - 5pt - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - Textbox125 - - - 7 - - - - - - - - - - - - true - true - - - - - =First(Fields!TotalCostCaption.Value) - - - - - - - Textbox126 - - - 4 - - - - - - - - - true - true - - - - - =Sum(Fields!ProdTotalCost.Value) - - - - - - - Textbox127 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - Textbox128 - - - 7 - - - - - - - - - - - - true - true - - - - - - - - - Textbox129 - - - - - - - - true - true - - - - - - - - - Textbox130 - - - - - - - - true - true - - - - - - - - - Textbox131 - - - - - - - - true - true - - - - - - - - - Textbox132 - - - - - - - - true - true - - - - - - - - - - - - Textbox133 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox134 - - - 7 - - - - - - - - - - - - true - true - - - - - =Last(Fields!CostOfProductionCaption.Value) - - - - - - - Textbox135 - - - 4 - - - - - - - - - true - true - - - - - =Sum(Fields!FooterProdTotalCost.Value) - - - - - - - Textbox136 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox137 - - - 7 - - - - - - - - - - - - true - true - - - - - =Last(Fields!CostOfComponentsCaption.Value) - - - - - - - Textbox138 - - - 4 - - - - - - - - - true - true - - - - - =Sum(Fields!FooterCostTotal.Value) - - - - - - - Textbox139 - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox140 - - - 7 - - - - - - - - - - - - true - true - - - - - =Last(Fields!SingleLevelMfgOverheadCostCaption.Value) - - - - - - - Textbox141 - - - 4 - - - - - - - - - true - true - - - - - =Sum(Fields!SingleLevelMfgOvhd.Value) - - - - - - - Textbox142 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox143 - - - 7 - - - - - - - - - - - - true - true - - - - - - - - - Textbox144 - - - - - - - - true - true - - - - - - - - - - - - Textbox145 - - - - - - - - true - true - - - - - - - - - Textbox146 - - - - - - - - true - true - - - - - - - - - Textbox147 - - - - - - - - true - true - - - - - - - - - - - - Textbox148 - - - - - - - - 0.17638cm - - - - - true - true - - - - - - - - - - - - Textbox149 - - - 11 - - - - - - - - - - - - - - - - true - true - - - - - - - - - - - - Textbox150 - - - - - - Top - 5pt - - - - - - - - 0.35278cm - - - - - true - true - - - - - - - - - - - - Textbox151 - - - 7 - - - - - - - - - - - - true - true - - - - - - - - - Textbox152 - - - - - - - - true - true - - - - - =Last(Fields!UnitCostCaption.Value) - - - - - - - Textbox153 - - - 3 - - - - - - - - true - true - - - - - =Sum(Fields!UnitCost_Item.Value) - - - - - - - Textbox154 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =iif(Fields!ItemFilter.Value = "",true,false) - - After - true - - - - =iif(Fields!ItemFilter.Value = "",true,false) - - After - true - - - - - =Fields!No_Item.Value - - - End - - - - - After - true - - - After - true - - - After - true - - - After - true - - - After - true - - - After - true - - - - - =Fields!InRouting.Value - - - - - - =iif(Fields!InRouting.Value,false,true) - - After - true - - - - =iif(Fields!InRouting.Value,false,true) - - After - true - - - - =iif(Fields!InRouting.Value,false,true) - - After - - - - - =Fields!InBOM.Value - - - - - - =iif(Fields!InBOM.Value,false,true) - - After - true - - - - =iif(Fields!InBOM.Value,false,true) - - After - true - - - - =iif(Fields!InBOM.Value,false,true) - - After - - - - Detail - - - - - =iif(Fields!OperationNo_RtngLine.Value = "",true,false) - - - - - =iif(Fields!ShowLine.Value,false,true) - - - - Detail_Collection - Output - true - - - - =iif(Fields!TotalCost1Caption.Value = "",true,false) - - Before - - - - =iif(Fields!TotalCost1Caption.Value = "",true,false) - - Before - - - - =iif(Fields!TotalCost1Caption.Value = "",true,false) - - Before - true - - - - =iif(Fields!TotalCostCaption.Value = "",true,false) - - Before - true - - - - =iif(Fields!TotalCostCaption.Value = "",true,false) - - Before - - - - - - =iif(First(Fields!TotalCostCaption.Value) = "",true,false) - - Before - true - - - - =iif(First(Fields!TotalCostCaption.Value) = "",true,false) - - Before - true - - - - - Before - true - - - Before - true - - - Before - true - - - Before - true - - - Before - - - Before - true - - - - - - DataSet_Result - 8.52024cm - 18.15273cm - - - - - - - true - - - - - =Fields!PageNoCaption.Value - - - - - - - 0.3595cm - 12.57817cm - 11pt - 5.10758cm - 1 - - - - true - - - - - =Fields!CalculateDate.Value - - - - - - - true - - - - - =Fields!CompanyName.Value - - - - - - - true - - - - - =Fields!TodayFormatted.Value - - - - - - - 12.50762cm - 11pt - 5.64511cm - 4 - - - - true - true - - - - - =User!UserID - - - - - - - 0.75075cm - 14.41376cm - 11pt - 3.73896cm - 5 - - =iif(Fields!DetailedCalculationCaption.Value = "",true,false) - - NoOutput - - - - - - - - 29.7cm - 21cm - 1.76389cm - 1.05833cm - 1.05833cm - 1.48167cm - 1.27cm - + + + + + + Textbox1 + + + 12 + + + + + + + + + + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox2 + + + + + + + + true + true + + + + + + + + + + + + Textbox3 + + + + + + + + true + true + + + + + + + + + + + + Textbox4 + + + + + + + + true + true + + + + + + + + + + + + Textbox5 + + + + + + + + true + true + + + + + + + + + + + + Textbox6 + + + + + + + + true + true + + + + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox8 + + + + + + + + true + true + + + + + + + + + + + + Textbox9 + + + + + + + + true + true + + + + + + + + + + + + Textbox10 + + + + + + + + true + true + + + + + + + + + + + + Textbox11 + + + + + + + + true + true + + + + + + + + + + + + Textbox12 + + + + + + + + true + true + + + + + + + + + + + + Textbox13 + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!No_ItemCaption.Value + + + + + + + Textbox14 + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox15 + + + + + + + + true + true + + + + + =Fields!No_Item.Value + + + + + + + Textbox16 + + + Bottom + 5pt + 5pt + + + 5 + + + + + + + + + + true + true + + + + + + + + + + + + Textbox17 + + + + + + + + true + true + + + + + + + + + + + + Textbox18 + + + + + + + + true + true + + + + + + + + + + + + Textbox19 + + + + + + + + true + true + + + + + + + + + + + + Textbox20 + + + + + + + + 0.4064cm + + + + + true + true + + + + + =Parameters!Description_ItemCaption.Value + + + + + + + Textbox21 + + + 3 + + + + + + + + true + true + + + + + =Fields!Description_Item.Value + + + + + + + Textbox22 + + + 6 + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox23 + + + + + + + + true + true + + + + + + + + + + + + Textbox24 + + + + + + + + true + true + + + + + + + + + + + + Textbox25 + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!ProductionBOMNo_ItemCaption.Value + + + + + + + Textbox26 + + + 3 + + + + + + + + true + true + + + + + =Fields!ProductionBOMNo_Item.Value + + + + + + + Textbox27 + + + 2 + + + + + + + true + true + + + + + =Fields!PBOMVersionCode1.Value + + + + + + + Textbox28 + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox29 + + + + + + + + true + true + + + + + + + + + + + + Textbox30 + + + + + + + + true + true + + + + + + + + + + + + Textbox32 + + + + + + + + true + true + + + + + + + + + + + + Textbox34 + + + + + + + + true + true + + + + + + + + + + + + Textbox35 + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!LotSize_ItemCaption.Value + + + + + + + Textbox36 + + + 3 + + + + + + + + true + true + + + + + =Fields!LotSize_Item.Value + + + + + + + Textbox37 + + + 2 + + + + + + + true + true + + + + + =Fields!BaseUnitOfMeasure_Item.Value + + + + + + 2 + + + + + + + true + true + + + + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox40 + + + + + + + + true + true + + + + + + + + + + + + Textbox41 + + + + + + + + true + true + + + + + + + + + + + + Textbox42 + + + + + + + + true + true + + + + + + + + + + + + Textbox43 + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!RoutingNo_ItemCaption.Value + + + + + + + Textbox44 + + + 3 + + + + + + + + true + true + + + + + =Fields!RoutingNo_Item.Value + + + + + + + Textbox45 + + + 2 + + + + + + + true + true + + + + + =Fields!RtngVersionCode.Value + + + + + + + Textbox46 + + + 2 + + + + + + + true + true + + + + + + + + + + + + Textbox47 + + + + + + + + true + true + + + + + + + + + + + + Textbox48 + + + + + + + + true + true + + + + + + + + + + + + Textbox49 + + + + + + + + true + true + + + + + + + + + + + + Textbox50 + + + + + + + + true + true + + + + + + + + + + + + Textbox51 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox52 + + + 12 + + + + + + + + + + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Parameters!OperationNo_RtngLineCaption.Value + + + + + + + Textbox53 + + + 2 + + + + + + + true + true + + + + + =Parameters!Type_RtngLineCaption.Value + + + + + + + Textbox54 + + + + + + + + true + true + + + + + =Parameters!No_RtngLineCaption.Value + + + + + + + Textbox55 + + + + + + + + true + true + + + + + =Parameters!Description_ItemCaption.Value + + + + + + + Textbox56 + + + 2 + + + + + + + true + true + + + + + =Parameters!SetupTime_RtngLineCaption.Value + + + + + + + Textbox57 + + + + + + + + true + true + + + + + =Parameters!RunTime_RtngLineCaption.Value + + + + + + + Textbox58 + + + + + + + + true + true + + + + + =Fields!CostTimeCaption.Value + + + + + + + Textbox59 + + + + + + + + true + true + + + + + =Fields!UnitCostCaption.Value + + + + + + + Textbox60 + + + + + + + + true + true + + + + + =Fields!TotalCostCaption.Value + + + + + + + Textbox62 + + + 2 + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox63 + + + 12 + + + + + + + + + + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox64 + + + + + + Bottom + 5pt + + + 12 + + + + + + + + + + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Fields!TypeCaption.Value + + + + + + + Textbox65 + + + + + + + + true + true + + + + + =Fields!NoCaption.Value + + + + + + + Textbox66 + + + + + + + + true + true + + + + + =Fields!DescriptionCaption.Value + + + + + + + Textbox67 + + + 2 + + + + + + + true + true + + + + + =Fields!QuantityCaption.Value + + + + + + + Textbox68 + + + + + + + + true + true + + + + + =Fields!BaseUnitOfMeasureCaption.Value + + + + + + + Textbox69 + + + 2 + + + + + + + true + true + + + + + =Fields!UnitCostCaption.Value + + + + + + + Textbox70 + + + + + + + + true + true + + + + + =Fields!TotalCost1Caption.Value + + + + + + + Textbox71 + + + + + + + + true + true + + + + + + + + + + + + Textbox72 + + + + + + + + true + true + + + + + + + + + + + + Textbox73 + + + + + + + + true + true + + + + + + + + + + + + Textbox74 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox75 + + + 12 + + + + + + + + + + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox77 + + + + + + Bottom + 5pt + + + 12 + + + + + + + + + + + + + + + + + 0.35278cm + + + + + true + true + + + + + =Fields!OperationNo_RtngLine.Value + + + + + + + Textbox78 + + + 2 + + + + + + + true + true + + + + + =Fields!Type_RtngLine.Value + + + + + + + Textbox79 + + + + + + + + true + true + + + + + =Fields!No_RtngLine.Value + + + + + + + Textbox80 + + + + + + + + true + true + + + + + =Fields!Description_RtngLine.Value + + + + + + + Textbox81 + + + 2 + + + + + + + true + true + + + + + =Fields!SetupTime_RtngLine.Value + + + + + + + Textbox82 + + + + + + + + true + true + + + + + =Fields!RunTime_RtngLine.Value + + + + + + + Textbox83 + + + + + + + + true + true + + + + + =Fields!CostTime.Value + + + + + + + Textbox84 + + + + + + + + true + true + + + + + =Fields!ProdUnitCost.Value + + + + + + + Textbox85 + + + + + + + + true + true + + + + + =Fields!ProdTotalCost.Value + + + + + + + Textbox86 + + + 2 + + + + + + + 0.35278cm + + + + + true + true + + + + + =Fields!ProdBOMLineLevelType.Value + + + + + + + Textbox87 + + + + + + + + true + true + + + + + =Fields!ProdBOMLineLevelNo.Value + + + + + + + Textbox88 + + + + + + + + true + true + + + + + =Fields!ProdBOMLineLevelDesc.Value + + + + + + + Textbox89 + + + 2 + + + + + + + true + true + + + + + =Fields!ProdBOMLineLevelQuantity.Value + + + + + + + Textbox90 + + + + + + + + true + true + + + + + =Fields!CompItemBaseUOM.Value + + + + + + + Textbox91 + + + 2 + + + + + + + true + true + + + + + =Fields!CompItemUnitCost.Value + + + + + + + Textbox92 + + + + + + + + true + true + + + + + =Fields!CostTotal.Value + + + + + + + Textbox93 + + + + + + + + true + true + + + + + + + + + + + + Textbox94 + + + + + + + + true + true + + + + + + + + + + + + Textbox95 + + + + + + + + true + true + + + + + + + + + + + + Textbox96 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox97 + + + 12 + + + + + + + + + + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox98 + + + 8 + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox99 + + + + + + Top + 5pt + + + + + + + + true + true + + + + + + + + + + + + Textbox100 + + + 3 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox101 + + + + + + + + true + true + + + + + + + + + + + + Textbox102 + + + + + + + + true + true + + + + + + + + + + + + Textbox103 + + + + + + + + true + true + + + + + + + + + + + + Textbox104 + + + + + + + + true + true + + + + + + + + + + + + Textbox105 + + + + + + + + true + true + + + + + =Fields!TotalCost1Caption.Value + + + + + + + Textbox106 + + + 3 + + + + + + + + true + true + + + + + =Sum(Fields!CostTotal.Value) + + + + + + + Textbox107 + + + + + + + + true + true + + + + + + + + + Textbox108 + + + + + + + + true + true + + + + + + + + + + + + Textbox109 + + + + + + + + true + true + + + + + + + + + + + + Textbox110 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox111 + + + + + + + + true + true + + + + + + + + + + + + Textbox112 + + + + + + + + true + true + + + + + + + + + + + + Textbox113 + + + + + + + + true + true + + + + + + + + + + + + Textbox114 + + + + + + + + true + true + + + + + + + + + + + + Textbox115 + + + + + + + + true + true + + + + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox117 + + + + + + + + true + true + + + + + + + + + + + + Textbox118 + + + + + + + + true + true + + + + + + + + + + + + Textbox119 + + + + + + + + true + true + + + + + + + + + + + + Textbox120 + + + + + + + + true + true + + + + + + + + + + + + Textbox121 + + + + + + + + true + true + + + + + + + + + + + + Textbox122 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox123 + + + 11 + + + + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox124 + + + + + + Top + 5pt + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + Textbox125 + + + 7 + + + + + + + + + + + + true + true + + + + + =First(Fields!TotalCostCaption.Value) + + + + + + + Textbox126 + + + 4 + + + + + + + + + true + true + + + + + =Sum(Fields!ProdTotalCost.Value) + + + + + + + Textbox127 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + Textbox128 + + + 7 + + + + + + + + + + + + true + true + + + + + + + + + Textbox129 + + + + + + + + true + true + + + + + + + + + Textbox130 + + + + + + + + true + true + + + + + + + + + Textbox131 + + + + + + + + true + true + + + + + + + + + Textbox132 + + + + + + + + true + true + + + + + + + + + + + + Textbox133 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox134 + + + 7 + + + + + + + + + + + + true + true + + + + + =Last(Fields!CostOfProductionCaption.Value) + + + + + + + Textbox135 + + + 4 + + + + + + + + + true + true + + + + + =Sum(Fields!FooterProdTotalCost.Value) + + + + + + + Textbox136 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox137 + + + 7 + + + + + + + + + + + + true + true + + + + + =Last(Fields!CostOfComponentsCaption.Value) + + + + + + + Textbox138 + + + 4 + + + + + + + + + true + true + + + + + =Sum(Fields!FooterCostTotal.Value) + + + + + + + Textbox139 + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox140 + + + 7 + + + + + + + + + + + + true + true + + + + + =Last(Fields!SingleLevelMfgOverheadCostCaption.Value) + + + + + + + Textbox141 + + + 4 + + + + + + + + + true + true + + + + + =Sum(Fields!SingleLevelMfgOvhd.Value) + + + + + + + Textbox142 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox143 + + + 7 + + + + + + + + + + + + true + true + + + + + + + + + Textbox144 + + + + + + + + true + true + + + + + + + + + + + + Textbox145 + + + + + + + + true + true + + + + + + + + + Textbox146 + + + + + + + + true + true + + + + + + + + + Textbox147 + + + + + + + + true + true + + + + + + + + + + + + Textbox148 + + + + + + + + 0.17638cm + + + + + true + true + + + + + + + + + + + + Textbox149 + + + 11 + + + + + + + + + + + + + + + + true + true + + + + + + + + + + + + Textbox150 + + + + + + Top + 5pt + + + + + + + + 0.35278cm + + + + + true + true + + + + + + + + + + + + Textbox151 + + + 7 + + + + + + + + + + + + true + true + + + + + + + + + Textbox152 + + + + + + + + true + true + + + + + =Last(Fields!UnitCostCaption.Value) + + + + + + + Textbox153 + + + 3 + + + + + + + + true + true + + + + + =Sum(Fields!UnitCost_Item.Value) + + + + + + + Textbox154 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =iif(Fields!ItemFilter.Value = "",true,false) + + After + true + + + + =iif(Fields!ItemFilter.Value = "",true,false) + + After + true + + + + + =Fields!No_Item.Value + + + End + + + + + After + true + + + After + true + + + After + true + + + After + true + + + After + true + + + After + true + + + + + =Fields!InRouting.Value + + + + + + =iif(Fields!InRouting.Value,false,true) + + After + true + + + + =iif(Fields!InRouting.Value,false,true) + + After + true + + + + =iif(Fields!InRouting.Value,false,true) + + After + + + + + =Fields!InBOM.Value + + + + + + =iif(Fields!InBOM.Value,false,true) + + After + true + + + + =iif(Fields!InBOM.Value,false,true) + + After + true + + + + =iif(Fields!InBOM.Value,false,true) + + After + + + + Detail + + + + + =iif(Fields!OperationNo_RtngLine.Value = "",true,false) + + + + + =iif(Fields!ShowLine.Value,false,true) + + + + Detail_Collection + Output + true + + + + =iif(Fields!TotalCost1Caption.Value = "",true,false) + + Before + + + + =iif(Fields!TotalCost1Caption.Value = "",true,false) + + Before + + + + =iif(Fields!TotalCost1Caption.Value = "",true,false) + + Before + true + + + + =iif(Fields!TotalCostCaption.Value = "",true,false) + + Before + true + + + + =iif(Fields!TotalCostCaption.Value = "",true,false) + + Before + + + + + + =iif(First(Fields!TotalCostCaption.Value) = "",true,false) + + Before + true + + + + =iif(First(Fields!TotalCostCaption.Value) = "",true,false) + + Before + true + + + + + Before + true + + + Before + true + + + Before + true + + + Before + true + + + Before + + + Before + true + + + + + + DataSet_Result + 8.52024cm + 18.15273cm + + + + + + + true + + + + + =Fields!PageNoCaption.Value + + + + + + + 0.3595cm + 12.57817cm + 11pt + 5.10758cm + 1 + + + + true + + + + + =Fields!CalculateDate.Value + + + + + + + true + + + + + =Fields!CompanyName.Value + + + + + + + true + + + + + =Fields!TodayFormatted.Value + + + + + + + 12.50762cm + 11pt + 5.64511cm + 4 + + + + true + true + + + + + =User!UserID + + + + + + + 0.75075cm + 14.41376cm + 11pt + 3.73896cm + 5 + + =iif(Fields!DetailedCalculationCaption.Value = "",true,false) + + NoOutput + + + + + + + + 29.7cm + 21cm + 1.76389cm + 1.05833cm + 1.05833cm + 1.48167cm + 1.27cm +