diff --git a/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcFeatureFlagHandler.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcFeatureFlagHandler.Codeunit.al new file mode 100644 index 0000000000..b370d0fa6d --- /dev/null +++ b/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcFeatureFlagHandler.Codeunit.al @@ -0,0 +1,20 @@ +// ------------------------------------------------------------------------------------------------ +// 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; + +using Microsoft.Manufacturing.Setup; + +codeunit 99001569 "Subc. Feature Flag Handler" +{ + procedure IsSubcontractingEnabled(): Boolean + var + ManufacturingSetup: Record "Manufacturing Setup"; + begin + ManufacturingSetup.SetLoadFields("Legacy Subcontracting"); + if not ManufacturingSetup.Get() then + exit(false); + exit(not ManufacturingSetup."Legacy Subcontracting"); + end; +} diff --git a/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcSessionState.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcSessionState.Codeunit.al index b206e3137b..580dc51b41 100644 --- a/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcSessionState.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/General/Codeunit/SubcSessionState.Codeunit.al @@ -9,12 +9,15 @@ codeunit 99001500 "Subc. Session State" SingleInstance = true; var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; CodeDictionary: Dictionary of [Text, Code[1024]]; DateDictionary: Dictionary of [Text, Date]; RecordIDDictionary: Dictionary of [Text, RecordId]; procedure ClearAllDictionariesForKey(StoredKey: Text) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if CodeDictionary.ContainsKey(StoredKey) then CodeDictionary.Remove(StoredKey); @@ -28,6 +31,9 @@ codeunit 99001500 "Subc. Session State" procedure SetCode(KeyToStore: Text; CodeToStore: Code[1024]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if CodeDictionary.ContainsKey(KeyToStore) then CodeDictionary.Set(KeyToStore, CodeToStore) else @@ -36,6 +42,9 @@ codeunit 99001500 "Subc. Session State" procedure SetDate(KeyToStore: Text; DateToStore: Date) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if DateDictionary.ContainsKey(KeyToStore) then DateDictionary.Set(KeyToStore, DateToStore) else @@ -44,6 +53,9 @@ codeunit 99001500 "Subc. Session State" procedure SetRecordID(KeyToStore: Text; RecordIDToStore: RecordId) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if RecordIDDictionary.ContainsKey(KeyToStore) then RecordIDDictionary.Set(KeyToStore, RecordIDToStore) else @@ -52,18 +64,27 @@ codeunit 99001500 "Subc. Session State" procedure GetCode(StoredKey: Text): Code[1024] begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if CodeDictionary.ContainsKey(StoredKey) then exit(CodeDictionary.Get(StoredKey)); end; procedure GetDate(StoredKey: Text): Date begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if DateDictionary.ContainsKey(StoredKey) then exit(DateDictionary.Get(StoredKey)); end; procedure GetRecordID(StoredKey: Text; var ReturnRecordID: RecordId) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + Clear(ReturnRecordID); if RecordIDDictionary.ContainsKey(StoredKey) then ReturnRecordID := RecordIDDictionary.Get(StoredKey); diff --git a/src/Apps/W1/Subcontracting/App/src/Install/SubcUpgradeTagDefExt.al b/src/Apps/W1/Subcontracting/App/src/Install/SubcUpgradeTagDefExt.al new file mode 100644 index 0000000000..f3a788f4f7 --- /dev/null +++ b/src/Apps/W1/Subcontracting/App/src/Install/SubcUpgradeTagDefExt.al @@ -0,0 +1,21 @@ +// ------------------------------------------------------------------------------------------------ +// 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; +using System.Upgrade; + +codeunit 99001570 "Subc. Upgrade Tag Def. Ext." +{ + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] + local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) + begin + PerCompanyUpgradeTags.Add(GetSubcontractingUpgradeTag()); + end; + + + internal procedure GetSubcontractingUpgradeTag(): Code[250] + begin + exit('MS-406123-Subcontracting-20260601'); + end; +} \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Install/SubcontractingInstall.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Install/SubcontractingInstall.Codeunit.al index 7845d04d9e..c36d7ed11e 100644 --- a/src/Apps/W1/Subcontracting/App/src/Install/SubcontractingInstall.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Install/SubcontractingInstall.Codeunit.al @@ -3,6 +3,9 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ namespace Microsoft.Manufacturing.Subcontracting; +using Microsoft.Manufacturing.Setup; +using System.Upgrade; +using Microsoft.Upgrade; codeunit 99001501 "Subcontracting Install" { @@ -36,6 +39,7 @@ codeunit 99001501 "Subcontracting Install" SubcontractingCompInit: Codeunit "Subcontracting Comp. Init."; begin SubcontractingCompInit.CreateBasicSubcontractingMgtSetup(); + SetSubcontractingFeatureOnInstall(); end; local procedure HandleReinstallPerCompany() @@ -52,4 +56,20 @@ codeunit 99001501 "Subcontracting Install" local procedure HandleReinstallPerDatabase() begin end; + + local procedure SetSubcontractingFeatureOnInstall() + var + ManufacturingSetup: Record "Manufacturing Setup"; + UpgradeTag: Codeunit "Upgrade Tag"; + SubcApplicationAreaHandler: Codeunit "Subc. Application Area Handler"; + SubcUpgradeTagDefExt: Codeunit "Subc. Upgrade Tag Def. Ext."; + UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions"; + begin + if UpgradeTag.HasUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag()) then + exit; + + SubcApplicationAreaHandler.UpdateApplicationArea(); + + UpgradeTag.SetUpgradeTag(SubcUpgradeTagDefExt.GetSubcontractingUpgradeTag()); + end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcBOMTreeExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcBOMTreeExt.Codeunit.al index d485657d71..be596ba329 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcBOMTreeExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcBOMTreeExt.Codeunit.al @@ -20,7 +20,11 @@ codeunit 99001521 "Subc. Calc BOM Tree Ext." local procedure OnBeforeCalcRoutingLineCosts(var RoutingLine: Record "Routing Line"; var LotSize: Decimal; var ScrapPct: Decimal; ParentItem: Record Item) var SubcSessionState: Codeunit "Subc. Session State"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcSessionState.SetRecordID('OnBeforeCalcRoutingLineCosts', ParentItem.RecordId()); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcProdOrderExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcProdOrderExt.Codeunit.al index 9b5e761b7b..f89bebd3df 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcProdOrderExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcProdOrderExt.Codeunit.al @@ -10,12 +10,18 @@ using Microsoft.Manufacturing.Routing; codeunit 99001517 "Subc. Calc. Prod. Order Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Calculate Prod. Order", OnAfterTransferRoutingLine, '', false, false)] local procedure OnAfterTransferRoutingLine(var ProdOrderLine: Record "Prod. Order Line"; var RoutingLine: Record "Routing Line"; var ProdOrderRoutingLine: Record "Prod. Order Routing Line") var SubcPriceManagement: Codeunit "Subc. Price Management"; SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcontractingManagement.UpdateLinkedComponentsAfterRoutingTransfer(ProdOrderLine, RoutingLine, ProdOrderRoutingLine); SubcPriceManagement.ApplySubcontractorPricingToProdOrderRouting(ProdOrderLine, RoutingLine, ProdOrderRoutingLine); @@ -24,11 +30,17 @@ codeunit 99001517 "Subc. Calc. Prod. Order Ext." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Calculate Prod. Order", OnAfterTransferBOMComponent, '', false, false)] local procedure OnAfterTransferBOMComponent(var ProdOrderLine: Record "Prod. Order Line"; var ProductionBOMLine: Record "Production BOM Line"; var ProdOrderComponent: Record "Prod. Order Component"; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferSubcontractingFieldsBOMComponent(ProductionBOMLine, ProdOrderComponent); end; local procedure TransferSubcontractingFieldsBOMComponent(var ProductionBOMLine: Record "Production BOM Line"; var ProdOrderComponent: Record "Prod. Order Component") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderComponent."Subc. Original Location Code" := ProdOrderComponent."Location Code"; ProdOrderComponent."Subc. Orig. Bin Code" := ProdOrderComponent."Bin Code"; ProdOrderComponent."Component Supply Method" := ProductionBOMLine."Component Supply Method"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcSubcontractsExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcSubcontractsExt.Codeunit.al index bb36b3cb75..1b18ebdf87 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcSubcontractsExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCalcSubcontractsExt.Codeunit.al @@ -15,7 +15,11 @@ codeunit 99001529 "Subc. Calc Subcontracts Ext." local procedure OnAfterTransferProdOrderRoutingLine(var RequisitionLine: Record "Requisition Line"; ProdOrderRoutingLine: Record "Prod. Order Routing Line") var WorkCenter: Record "Work Center"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if RequisitionLine."Description 2" = '' then begin WorkCenter.SetLoadFields("Name 2"); if WorkCenter.Get(ProdOrderRoutingLine."Work Center No.") then diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCarryOutActionExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCarryOutActionExt.Codeunit.al index 406d3aa6a8..dcf82623e7 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCarryOutActionExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcCarryOutActionExt.Codeunit.al @@ -18,7 +18,12 @@ codeunit 99001523 "Subc. Carry Out Action Ext." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Carry Out Action", OnAfterTransferPlanningComp, '', false, false)] #endif local procedure OnAfterTransferPlanningComp(var PlanningComponent: Record "Planning Component"; var ProdOrderComponent: Record "Prod. Order Component") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderComponent."Component Supply Method" := PlanningComponent."Component Supply Method"; ProdOrderComponent."Subc. Original Location Code" := PlanningComponent."Orig. Location Code"; ProdOrderComponent."Subc. Orig. Bin Code" := PlanningComponent."Orig. Bin Code"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningCompExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningCompExt.Codeunit.al index dd6f3b20f5..395f1b663b 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningCompExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningCompExt.Codeunit.al @@ -12,9 +12,15 @@ using Microsoft.Purchases.Vendor; codeunit 99001522 "Subc. Planning Comp. Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Routing Link Code", false, false)] local procedure OnAfterValidateRoutingLinkCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; HandleRoutingLinkCodeValidation(Rec, xRec); @@ -23,6 +29,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterTransferFromComponent, '', false, false)] local procedure OnAfterTransferFromComponent(var PlanningComponent: Record "Planning Component"; var ProdOrderComp: Record "Prod. Order Component") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PlanningComponent."Component Supply Method" := ProdOrderComp."Component Supply Method"; PlanningComponent."Orig. Location Code" := ProdOrderComp."Subc. Original Location Code"; PlanningComponent."Orig. Bin Code" := ProdOrderComp."Subc. Orig. Bin Code"; @@ -31,6 +40,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Location Code", false, false)] local procedure OnAfterValidateLocationCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; if Rec."Location Code" <> xRec."Location Code" then @@ -40,6 +52,9 @@ codeunit 99001522 "Subc. Planning Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterValidateEvent, "Bin Code", false, false)] local procedure OnAfterValidateBinCode(var Rec: Record "Planning Component"; var xRec: Record "Planning Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; if Rec."Bin Code" <> xRec."Bin Code" then diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningLineMgmtExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningLineMgmtExt.Codeunit.al index 7de4f2fc5c..e1f5c20a93 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningLineMgmtExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcPlanningLineMgmtExt.Codeunit.al @@ -14,6 +14,8 @@ using Microsoft.Manufacturing.Routing; codeunit 99001518 "Subc. Planning Line Mgmt Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; #if not CLEAN27 #pragma warning disable AL0432 [EventSubscriber(ObjectType::Codeunit, Codeunit::"Planning Line Management", OnAfterTransferRtngLine, '', false, false)] @@ -25,12 +27,18 @@ codeunit 99001518 "Subc. Planning Line Mgmt Ext." var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcPriceManagement.ApplySubcontractorPricingToPlanningRouting(ReqLine, RoutingLine, PlanningRoutingLine); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Planning Line Management", OnTransferBOMOnBeforeUpdatePlanningComp, '', false, false)] local procedure IgnorePurchaseComponentsFromSubcontracting_OnTransferBOMOnBeforeUpdatePlanningComp(var ProductionBOMLine: Record "Production BOM Line"; var UpdateCondition: Boolean; var IsHandled: Boolean; var ReqQty: Decimal) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProductionBOMLine."Component Supply Method" = "Component Supply Method"::"Vendor-Supplied" then IsHandled := true; end; @@ -38,12 +46,18 @@ codeunit 99001518 "Subc. Planning Line Mgmt Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnAfterFilterLinesWithItemToPlan, '', false, false)] local procedure ProdOrderComponent_OnAfterFilterLinesWithItemToPlan(var ProdOrderComponent: Record "Prod. Order Component"; var Item: Record Item; IncludeFirmPlanned: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderComponent.SetFilter("Component Supply Method", '<>%1', "Component Supply Method"::"Vendor-Supplied"); end; [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnAfterFilterLinesWithItemToPlan, '', false, false)] local procedure TransferLine_OnAfterFilterLinesWithItemToPlan(var Sender: Record "Transfer Line"; var Item: Record Item; IsReceipt: Boolean; IsSupplyForPlanning: Boolean; var TransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferLine.SetRange("Transfer WIP Item", false); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrdCompRes.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrdCompRes.Codeunit.al index 980b04292e..edfd598e42 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrdCompRes.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrdCompRes.Codeunit.al @@ -21,7 +21,12 @@ codeunit 99001530 "Subc. Prod. Ord. Comp. Res." /// [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Comp.-Reserve", OnVerifyChangeOnBeforeHasError, '', false, false)] local procedure "Prod. Order Comp.-Reserve_OnVerifyChangeOnBeforeHasError"(NewProdOrderComp: Record "Prod. Order Component"; OldProdOrderComp: Record "Prod. Order Component"; var HasError: Boolean; var ShowError: Boolean) + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + HasError := false; end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderCompExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderCompExt.Codeunit.al index 1b8d358748..c17c105a32 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderCompExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcProdOrderCompExt.Codeunit.al @@ -16,6 +16,7 @@ using System.Utilities; codeunit 99001524 "Subc. Prod. Order Comp. Ext." { var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; ExistingPostedTransferLineQst: Label 'The component has already been assigned to the posted subcontracting transfer order %1.\\Do you want to continue?', Comment = '%1=Transfer Order No'; ExistingPurchLineErr: Label 'You cannot change this field because the component is already assigned to subcontracting purchase order %1.\\Updating the quantity is only allowed through the purchase order.', Comment = '%1=Document No'; ExistingTransferLineQst: Label 'The component has already been assigned to the subcontracting transfer order %1.\\The quantity may only be updated via the purchase order and processing of the stock transfer.', Comment = '%1=Transfer Order No'; @@ -24,12 +25,18 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Comp.-Reserve", OnAfterInitFromProdOrderComp, '', false, false)] local procedure OnAfterInitFromProdOrderComp(ProdOrderComponent: Record "Prod. Order Component") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ValidateSubcontractingReservationConstraints(ProdOrderComponent); end; [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnAfterValidateEvent, "Bin Code", false, false)] local procedure OnAfterValidateBinCode(var Rec: Record "Prod. Order Component"; var xRec: Record "Prod. Order Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; SetOriginalBinCode(Rec, xRec); @@ -38,6 +45,9 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnAfterValidateEvent, "Location Code", false, false)] local procedure OnAfterValidateLocationCode(var Rec: Record "Prod. Order Component"; var xRec: Record "Prod. Order Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; SetOriginalLocationCode(Rec, xRec); @@ -46,6 +56,9 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnAfterValidateEvent, "Routing Link Code", false, false)] local procedure OnAfterValidateRoutingLinkCode(var Rec: Record "Prod. Order Component"; var xRec: Record "Prod. Order Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; HandleRoutingLinkCodeValidation(Rec, xRec); @@ -54,6 +67,9 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnBeforeValidateEvent, "Location Code", false, false)] local procedure OnBeforeValidateLocationCode(var Rec: Record "Prod. Order Component"; var xRec: Record "Prod. Order Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; CheckExistingSubcontractingTransferOrder(Rec, xRec, CurrFieldNo); @@ -62,6 +78,9 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Component", OnBeforeValidateEvent, "Quantity per", false, false)] local procedure OnBeforeValidateQuantityPer(var Rec: Record "Prod. Order Component"; var xRec: Record "Prod. Order Component"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; CheckExistingDocumentsForSubcontracting(Rec, xRec, CurrFieldNo); 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 e4a8723910..43f2c3262a 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 @@ -10,9 +10,15 @@ using Microsoft.Manufacturing.WorkCenter; codeunit 99001520 "Subc. Prod. Order Rtng. Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Table, Database::"Prod. Order Routing Line", OnAfterDeleteEvent, '', false, false)] local procedure OnAfterDeleteProdOrderRtngLine(var Rec: Record "Prod. Order Routing Line"; RunTrigger: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -27,6 +33,9 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." var SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -37,6 +46,9 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." [EventSubscriber(ObjectType::Table, Database::"Prod. Order Routing Line", OnAfterValidateEvent, "Routing Link Code", false, false)] local procedure OnAfterValidateRoutingLinkCode(var Rec: Record "Prod. Order Routing Line"; var xRec: Record "Prod. Order Routing Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; HandleRoutingLinkCodeValidation(Rec, xRec); @@ -47,6 +59,9 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; SubcPriceManagement.GetSubcPriceList(Rec); @@ -57,12 +72,18 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcPriceManagement.GetSubcPriceList(ProdOrderRoutingLine); end; [EventSubscriber(ObjectType::Table, Database::"Prod. Order Routing Line", OnAfterCopyFromRoutingLine, '', false, false)] local procedure OnAfterCopyFromRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; RoutingLine: Record "Routing Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderRoutingLine."Transfer WIP Item" := RoutingLine."Transfer WIP Item"; ProdOrderRoutingLine."Transfer Description" := RoutingLine."Transfer Description"; ProdOrderRoutingLine."Transfer Description 2" := RoutingLine."Transfer Description 2"; @@ -71,6 +92,9 @@ codeunit 99001520 "Subc. Prod. Order Rtng. Ext." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Route Management", OnCalculateOnBeforeProdOrderRtngLineLoopIteration, '', false, false)] local procedure CheckSubcontractingOnCalculateOnBeforeProdOrderRtngLineLoopIteration(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; var ProdOrderLine: Record "Prod. Order Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderRoutingLine.CheckForSubcontractingPurchaseLineTypeMismatch(); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcReqWkshMakeOrd.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcReqWkshMakeOrd.Codeunit.al index 55b9d6c0ef..c79b4a5881 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcReqWkshMakeOrd.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcReqWkshMakeOrd.Codeunit.al @@ -10,9 +10,15 @@ using Microsoft.Purchases.Document; codeunit 99001516 "Subc. Req. Wksh. Make Ord." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Req. Wksh.-Make Order", OnAfterInsertPurchOrderLine, '', false, false)] local procedure OnAfterInsertPurchOrderLine(var PurchOrderLine: Record "Purchase Line"; var NextLineNo: Integer; var RequisitionLine: Record "Requisition Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + HandleSubcontractingAfterPurchOrderLineInsert(PurchOrderLine, RequisitionLine); end; @@ -22,6 +28,9 @@ codeunit 99001516 "Subc. Req. Wksh. Make Ord." PurchaseLineWithService: Record "Purchase Line"; SubcPurchaseOrderCreator: Codeunit "Subc. Purchase Order Creator"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if RequisitionLine."Prod. Order No." = '' then exit; PurchaseLineWithService."Document Type" := PurchaseHeader."Document Type"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcWorkCenterExtension.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcWorkCenterExtension.Codeunit.al index ede288117e..ac25ab08b1 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcWorkCenterExtension.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Manufacturing/SubcWorkCenterExtension.Codeunit.al @@ -12,7 +12,11 @@ codeunit 99001519 "Subc. Work Center Extension" local procedure OnAfterDeleteWorkCenter(var Rec: Record "Work Center"; RunTrigger: Boolean) var SubcontractorPrice: Record "Subcontractor Price"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcItemExtension.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcItemExtension.Codeunit.al index e3350534d9..f72e8b024b 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcItemExtension.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcItemExtension.Codeunit.al @@ -12,7 +12,11 @@ codeunit 99001532 "Subc. Item Extension" local procedure OnAfterDeleteItem(var Rec: Record Item; RunTrigger: Boolean) var SubcontractorPrice: Record "Subcontractor Price"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcVendorExtension.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcVendorExtension.Codeunit.al index 9234be45a0..2a2cac0c45 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcVendorExtension.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/MasterData/SubcVendorExtension.Codeunit.al @@ -12,7 +12,11 @@ codeunit 99001531 "Subc. Vendor Extension" local procedure OnAfterDeleteVendor(var Rec: Record Vendor; RunTrigger: Boolean) var SubcontractorPrice: Record "Subcontractor Price"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcItemChargeAssPurchExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcItemChargeAssPurchExt.Codeunit.al index 2233deac15..2888494d3d 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcItemChargeAssPurchExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcItemChargeAssPurchExt.Codeunit.al @@ -11,7 +11,12 @@ codeunit 99001536 "Subc. ItemChargeAssPurchExt" { [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Charge Assgnt. (Purch.)", OnBeforeCreateRcptChargeAssgnt, '', false, false)] local procedure "Item Charge Assgnt. (Purch.)_OnBeforeCreateRcptChargeAssgnt"(var FromPurchRcptLine: Record "Purch. Rcpt. Line"; ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var IsHandled: Boolean) + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + IsHandled := true; CreateRcptChargeAssgnt(FromPurchRcptLine, ItemChargeAssignmentPurch); end; 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 6af5392a0f..1995b5aedd 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 @@ -17,15 +17,24 @@ using Microsoft.Purchases.History; using Microsoft.Purchases.Posting; codeunit 99001535 "Subc. Purch. Post Ext" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnBeforeItemJnlPostLine, '', false, false)] local procedure "Purch.-Post_OnBeforeItemJnlPostLine"(var ItemJournalLine: Record "Item Journal Line"; TempItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + FillItemJnlLineForSubcontractingItemCharge(ItemJournalLine, TempItemChargeAssignmentPurch); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Mfg. Purch.-Post", OnAfterPostItemJnlLineCopyProdOrder, '', false, false)] local procedure MfgPurchPostOnAfterPostItemJnlLineCopyProdOrder(var ItemJnlLine: Record "Item Journal Line"; PurchLine: Record "Purchase Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ItemJnlLine."Subc. Purch. Order No." := PurchLine."Document No."; ItemJnlLine."Subc. Purch. Order Line No." := PurchLine."Line No."; ItemJnlLine."Subc. Operation No." := PurchLine."Operation No."; @@ -34,6 +43,9 @@ codeunit 99001535 "Subc. Purch. Post Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnPostItemChargePerRcptOnAfterCalcDistributeCharge, '', false, false)] local procedure "Purch.-Post_OnPostItemChargePerRcptOnAfterCalcDistributeCharge"(PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var PurchRcptLine: Record "Purch. Rcpt. Line"; var TempItemLedgEntry: Record "Item Ledger Entry" temporary; var DistributeCharge: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SetQuantityBaseOnSubcontractingServiceLine(PurchLine, PurchRcptLine); end; @@ -94,6 +106,9 @@ codeunit 99001535 "Subc. Purch. Post Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnPostItemJnlLineOnAfterPostItemJnlLineJobConsumption, '', false, false)] local procedure ProcessLastOperationWarehouseTracking_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 not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if PurchaseLine."Subc. Purchase Line Type" = "Subc. Purchase Line Type"::LastOperation then CreateTempWhseSplitSpecificationForLastOperationSubcontracting(PurchaseLine, ItemJnlPostLine, TrackingSpecification, TempWhseTrackingSpecification); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseHeaderExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseHeaderExt.Codeunit.al index 182be307a3..fadbedc783 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseHeaderExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Purchase/SubcPurchaseHeaderExt.Codeunit.al @@ -12,23 +12,33 @@ using Microsoft.Utilities; codeunit 99001533 "Subc. Purchase Header Ext" { var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; SubcSynchronizeManagement: Codeunit "Subc. Synchronize Management"; [EventSubscriber(ObjectType::Table, Database::"Purchase Header", OnAfterCopyBuyFromVendorFieldsFromVendor, '', false, false)] local procedure OnAfterCopyBuyFromVendorFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; xPurchaseHeader: Record "Purchase Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseHeader."Subc. Location Code" := Vendor."Subc. Location Code"; end; [EventSubscriber(ObjectType::Table, Database::"Purchase Header", OnAfterValidateEvent, "Buy-from Vendor No.", false, false)] local procedure OnAfterValidateEventBuyFromVendorNo(var Rec: Record "Purchase Header"; var xRec: Record "Purchase Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcSynchronizeManagement.DeleteEnhancedDocumentsByChangeOfVendorNo(Rec, xRec); end; [EventSubscriber(ObjectType::Table, Database::"Purchase Header", OnBeforeDeleteEvent, '', false, false)] local procedure CheckTransferOrderOnBeforeDeleteEvent(var Rec: Record "Purchase Header"; RunTrigger: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; if not RunTrigger then @@ -41,6 +51,9 @@ codeunit 99001533 "Subc. Purchase Header Ext" PurchaseHeader: Record "Purchase Header"; TransferHeader: Record "Transfer Header"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseHeader.Get(TransferOrderErrorInfo.RecordId); TransferHeader.SetRange("Subcontr. Purch. Order No.", PurchaseHeader."No."); if TransferHeader.Count() = 1 then begin @@ -53,6 +66,9 @@ codeunit 99001533 "Subc. Purchase Header Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Copy Document Mgt.", OnAfterCopyPurchHeaderDone, '', false, false)] local procedure ClearSubcLocationCodeOnAfterCopyPurchHeaderDone(var ToPurchaseHeader: Record "Purchase Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ToPurchaseHeader."Subc. Location Code" := ''; end; } 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 242a1ac8b2..ee36aae2d7 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 @@ -14,6 +14,7 @@ using Microsoft.Warehouse.Document; codeunit 99001534 "Subc. Purchase Line Ext" { var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; SubcSynchronizeManagement: Codeunit "Subc. Synchronize Management"; QtyMismatchTitleLbl: Label 'Quantity Mismatch'; QtyMismatchErr: 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.', @@ -28,6 +29,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterDeleteEvent, '', false, false)] local procedure OnAfterDeleteEvent(var Rec: Record "Purchase Line"; RunTrigger: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; @@ -40,6 +44,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterValidateEvent, "Expected Receipt Date", false, false)] local procedure OnAfterValidateExpectedReceiptDate(var Rec: Record "Purchase Line"; var xRec: Record "Purchase Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -50,6 +57,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterValidateEvent, Quantity, false, false)] local procedure OnAfterValidateQuantity(var Rec: Record "Purchase Line"; var xRec: Record "Purchase Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -60,6 +70,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterValidateEvent, "Unit of Measure Code", false, false)] local procedure OnAfterValidateUnitOfMeasureCode(var Rec: Record "Purchase Line"; var xRec: Record "Purchase Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -70,6 +83,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnBeforeUpdateDirectUnitCost, '', false, false)] local procedure OnBeforeUpdateDirectUnitCost(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; CalledByFieldNo: Integer; CurrFieldNo: Integer; var Handled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if PurchLine."Prod. Order No." <> '' then begin Handled := true; PurchLine.UpdateAmounts(); @@ -82,6 +98,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnValidateVariantCodeOnBeforeDropShipmentError, '', false, false)] local procedure OnValidateVariantCodeOnBeforeDropShipmentError(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if PurchaseLine."Prod. Order No." <> '' then Error(ChangeVariantNoNotAllowedErr, PurchaseLine.FieldCaption(PurchaseLine."Variant Code"), PurchaseLine."Prod. Order No."); end; @@ -97,6 +116,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" [EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnBeforeOpenItemTrackingLines, '', false, false)] local procedure OpenProdOrderLineItemTrackingOnBeforeOpenItemTrackingLines(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if OpenItemTrackingOfProdOrderLine(PurchaseLine, false) then IsHandled := true; end; @@ -180,6 +202,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" PurchaseLine: Record "Purchase Line"; PageManagement: Codeunit "Page Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseLine.SetLoadFields("Prod. Order No."); PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); ProductionOrder.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No."); @@ -192,6 +217,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" PurchaseLine: Record "Purchase Line"; ProdOrderLine: Record "Prod. Order Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseLine.SetLoadFields(Type, "No.", "Prod. Order No.", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", Quantity, "Qty. to Receive", "Qty. to Receive (Base)", "Qty. Rounding Precision", "Outstanding Quantity"); PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); ProdOrderLine.Get("Production Order Status"::Released, PurchaseLine."Prod. Order No.", PurchaseLine."Prod. Order Line No."); @@ -208,6 +236,9 @@ codeunit 99001534 "Subc. Purchase Line Ext" PurchaseLine: Record "Purchase Line"; ProdOrderLine: Record "Prod. Order Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseLine.SetLoadFields(Type, "No.", "Prod. Order No.", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", "Qty. to Receive", "Qty. to Receive (Base)", "Qty. Rounding Precision", "Outstanding Quantity"); PurchaseLine.Get(OverDeliveryErrorInfo.RecordId); ProdOrderLine.SetLoadFields(SystemId); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcCalcStandardCostExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcCalcStandardCostExt.Codeunit.al index f5a1de8a3c..7e110f0e82 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcCalcStandardCostExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcCalcStandardCostExt.Codeunit.al @@ -10,11 +10,17 @@ using Microsoft.Manufacturing.StandardCost; codeunit 99001514 "Subc. Calc.StandardCost Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Calculate Standard Cost", OnAfterCalcRtngLineCost, '', false, false)] local procedure OnAfterCalcRtngLineCost(RoutingLine: Record "Routing Line"; MfgItemQtyBase: Decimal; var SLSub: Decimal) var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcPriceManagement.CalcStandardCostOnAfterCalcRtngLineCost(RoutingLine, MfgItemQtyBase, SLSub); end; @@ -23,6 +29,9 @@ codeunit 99001514 "Subc. Calc.StandardCost Ext." var SubcSessionState: Codeunit "Subc. Session State"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcSessionState.SetRecordID('OnCalcMfgItemOnBeforeCalcRtngCost', Item.RecordId()); end; @@ -31,6 +40,9 @@ codeunit 99001514 "Subc. Calc.StandardCost Ext." var SubcSessionState: Codeunit "Subc. Session State"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcSessionState.SetDate('OnAfterSetProperties', NewCalculationDate); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcItemJnlPostLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcItemJnlPostLineExt.Codeunit.al index ab66a998e9..dc4d8f425a 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcItemJnlPostLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcItemJnlPostLineExt.Codeunit.al @@ -13,15 +13,24 @@ using Microsoft.Manufacturing.Document; codeunit 99001515 "Subc. ItemJnlPostLine Ext" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", OnAfterInitItemLedgEntry, '', false, false)] local procedure OnAfterInitItemLedgEntry(var NewItemLedgEntry: Record "Item Ledger Entry"; ItemJournalLine: Record "Item Journal Line"; var ItemLedgEntryNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + UpdateNewItemLedgerEntry(NewItemLedgEntry, ItemJournalLine); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", OnBeforeInsertCapLedgEntry, '', false, false)] local procedure OnBeforeInsertCapLedgEntry(var CapLedgEntry: Record "Capacity Ledger Entry"; ItemJournalLine: Record "Item Journal Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + UpdateCapLedgerEntry(CapLedgEntry, ItemJournalLine); end; @@ -34,12 +43,18 @@ codeunit 99001515 "Subc. ItemJnlPostLine Ext" #endif local procedure OnAfterPostOutput(var ItemLedgerEntry: Record "Item Ledger Entry"; var ProdOrderLine: Record "Prod. Order Line"; var ItemJournalLine: Record "Item Journal Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + UpdateProdOrderRoutingLine(ProdOrderLine, ItemJournalLine); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", OnBeforeInsertCapValueEntry, '', false, false)] local procedure "Item Jnl.-Post Line_OnBeforeInsertCapValueEntry"(var ValueEntry: Record "Value Entry"; ItemJnlLine: Record "Item Journal Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ClearInvoicedQuantityForItemChargeSubAssign(ValueEntry, ItemJnlLine); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReportingTriggersExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReportingTriggersExt.Codeunit.al index 9c37237ef3..b4200f967f 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReportingTriggersExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReportingTriggersExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001512 "Subc. Reporting Triggers Ext" { [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers", SubstituteReport, '', false, false)] local procedure SubstituteDetailedCalculation(ReportId: Integer; var NewReportId: Integer) + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ReportId = Report::"Subc. Detailed Calculation" then NewReportId := Report::"Subc. Detailed Calculation"; end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReqLineExtension.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReqLineExtension.Codeunit.al index 737e559de5..db31663278 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReqLineExtension.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/SubcReqLineExtension.Codeunit.al @@ -8,17 +8,26 @@ using Microsoft.Inventory.Requisition; codeunit 99001513 "Subc. Req.Line Extension" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Table, Database::"Requisition Line", OnAfterGetDirectCost, '', false, false)] local procedure OnAfterGetDirectCost(var RequisitionLine: Record "Requisition Line"; CalledByFieldNo: Integer) var SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SubcontractingManagement.UpdateSubcontractorPriceForRequisitionLine(RequisitionLine); end; [EventSubscriber(ObjectType::Table, Database::"Requisition Line", OnAfterValidateEvent, "Vendor No.", false, false)] local procedure OnAfterValidateVendorNo(var Rec: Record "Requisition Line"; var xRec: Record "Requisition Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -29,6 +38,9 @@ codeunit 99001513 "Subc. Req.Line Extension" [EventSubscriber(ObjectType::Table, Database::"Requisition Line", OnAfterValidateEvent, Quantity, false, false)] local procedure OnAfterValidateQuantity(var Rec: Record "Requisition Line"; var xRec: Record "Requisition Line"; CurrFieldNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -39,6 +51,9 @@ codeunit 99001513 "Subc. Req.Line Extension" [EventSubscriber(ObjectType::Table, Database::"Req. Wksh. Template", 'OnAfterValidateEvent', 'Recurring', true, false)] local procedure ReqWkshTemplateOnAfterValidateRecurring(var Rec: Record "Req. Wksh. Template") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not Rec.Recurring then case Rec.Type of Rec.Type::Subcontracting: diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcDirectTransferLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcDirectTransferLineExt.Codeunit.al index 70c35a14ff..0921284bf2 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcDirectTransferLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcDirectTransferLineExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001548 "Subc. DirectTransferLine Ext." { [EventSubscriber(ObjectType::Table, Database::"Direct Trans. Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure OnAfterCopyFromTransferLine_T5745(var DirectTransLine: Record "Direct Trans. Line"; TransferLine: Record "Transfer Line") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + DirectTransLine."Subcontr. Purch. Order No." := TransferLine."Subc. Purch. Order No."; DirectTransLine."Subcontr. PO Line No." := TransferLine."Subc. Purch. Order Line No."; DirectTransLine."Prod. Order No." := TransferLine."Subc. Prod. Order No."; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostRcptExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostRcptExt.Codeunit.al index d4e0f452c2..f6c015cca5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostRcptExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostRcptExt.Codeunit.al @@ -11,9 +11,15 @@ using Microsoft.Manufacturing.Document; codeunit 99001540 "Subc. TransOrderPostRcpt Ext" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Receipt", OnBeforePostItemJournalLine, '', false, false)] local procedure OnBeforePostItemJournalLine(var ItemJournalLine: Record "Item Journal Line"; TransferLine: Record "Transfer Line"; TransferReceiptHeader: Record "Transfer Receipt Header"; TransferReceiptLine: Record "Transfer Receipt Line"; CommitIsSuppressed: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ItemJournalLine."Subc. Prod. Order No." := TransferReceiptLine."Subc. Prod. Order No."; ItemJournalLine."Subc. Prod. Order Line No." := TransferReceiptLine."Subc. Prod. Order Line No."; ItemJournalLine."Source No." := TransferReceiptHeader."Source ID"; @@ -27,6 +33,9 @@ codeunit 99001540 "Subc. TransOrderPostRcpt Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Receipt", OnBeforeInsertTransRcptLine, '', false, false)] local procedure OnBeforeInsertTransRcptLine(var TransRcptLine: Record "Transfer Receipt Line"; TransLine: Record "Transfer Line"; CommitIsSuppressed: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransRcptLine."Subc. Purch. Order No." := TransLine."Subc. Purch. Order No."; TransRcptLine."Subc. Purch. Order Line No." := TransLine."Subc. Purch. Order Line No."; TransRcptLine."Subc. Prod. Order No." := TransLine."Subc. Prod. Order No."; @@ -42,6 +51,9 @@ codeunit 99001540 "Subc. TransOrderPostRcpt Ext" var ProdOrderComponent: Record "Prod. Order Component"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if (TransferLine."Subc. Prod. Order No." = '') or (TransferLine."Subc. Prod. Order Line No." = 0) or (TransferLine."Subc. Prod. Ord. Comp Line No." = 0) then exit; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostShptExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostShptExt.Codeunit.al index e5c0f7f060..b7410d8dcc 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostShptExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostShptExt.Codeunit.al @@ -9,9 +9,15 @@ using Microsoft.Inventory.Transfer; codeunit 99001539 "Subc. TransOrderPostShpt Ext" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Shipment", OnAfterCreateItemJnlLine, '', false, false)] local procedure OnAfterCreateItemJnlLine(var ItemJournalLine: Record "Item Journal Line"; TransferLine: Record "Transfer Line"; TransferShipmentHeader: Record "Transfer Shipment Header"; TransferShipmentLine: Record "Transfer Shipment Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ItemJournalLine."Subc. Prod. Order No." := TransferShipmentLine."Subc. Prod. Order No."; ItemJournalLine."Subc. Prod. Order Line No." := TransferShipmentLine."Subc. Prod. Order Line No."; ItemJournalLine."Source No." := TransferShipmentHeader."Source ID"; @@ -25,6 +31,9 @@ codeunit 99001539 "Subc. TransOrderPostShpt Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Shipment", OnBeforeInsertTransShptLine, '', false, false)] local procedure OnBeforeInsertTransShptLine(var TransShptLine: Record "Transfer Shipment Line"; TransLine: Record "Transfer Line"; CommitIsSuppressed: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransShptLine."Subc. Purch. Order No." := TransLine."Subc. Purch. Order No."; TransShptLine."Subc. Purch. Order Line No." := TransLine."Subc. Purch. Order Line No."; TransShptLine."Subc. Prod. Order No." := TransLine."Subc. Prod. Order No."; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostTransExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostTransExt.Codeunit.al index 2e736d6611..d13c1c4b2b 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostTransExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransOrderPostTransExt.Codeunit.al @@ -14,9 +14,15 @@ using Microsoft.Manufacturing.Document; codeunit 99001547 "Subc. TransOrderPostTrans Ext" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Transfer", OnAfterCreateItemJnlLine, '', false, false)] local procedure OnAfterCreateItemJnlLine(var ItemJnlLine: Record "Item Journal Line"; TransLine: Record "Transfer Line"; DirectTransHeader: Record "Direct Trans. Header"; DirectTransLine: Record "Direct Trans. Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ItemJnlLine."Subc. Prod. Order No." := DirectTransLine."Prod. Order No."; ItemJnlLine."Subc. Prod. Order Line No." := DirectTransLine."Prod. Order Line No."; ItemJnlLine."Prod. Order Comp. Line No." := DirectTransLine."Prod. Order Comp. Line No."; @@ -28,6 +34,9 @@ codeunit 99001547 "Subc. TransOrderPostTrans Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Transfer", OnInsertDirectTransHeaderOnBeforeGetNextNo, '', false, false)] local procedure OnInsertDirectTransHeaderOnBeforeGetNextNo(var DirectTransHeader: Record "Direct Trans. Header"; TransferHeader: Record "Transfer Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + DirectTransHeader."Source Type" := TransferHeader."Subc. Source Type"; DirectTransHeader."Source ID" := TransferHeader."Source ID"; DirectTransHeader."Source Ref. No." := TransferHeader."Source Ref. No."; @@ -41,6 +50,9 @@ codeunit 99001547 "Subc. TransOrderPostTrans Ext" var ProdOrderComponent: Record "Prod. Order Component"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if (TransferLine."Subc. Prod. Order No." = '') or (TransferLine."Subc. Prod. Order Line No." = 0) or (TransferLine."Subc. Prod. Ord. Comp Line No." = 0) then exit; @@ -54,6 +66,9 @@ codeunit 99001547 "Subc. TransOrderPostTrans Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Receipt", OnAfterPostItemJnlLine, '', false, false)] local procedure OnAfterPostItemJnlLineReceipt(ItemJnlLine: Record "Item Journal Line"; var TransLine3: Record "Transfer Line"; var TransRcptHeader2: Record "Transfer Receipt Header"; var TransRcptLine2: Record "Transfer Receipt Line"; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not ItemJnlLine."Direct Transfer" then exit; @@ -63,6 +78,9 @@ codeunit 99001547 "Subc. TransOrderPostTrans Ext" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Transfer", OnAfterPostItemJnlLine, '', false, false)] local procedure OnAfterPostItemJnlLineDirectTransfer(var TransferLine3: Record "Transfer Line"; DirectTransHeader2: Record "Direct Trans. Header"; DirectTransLine2: Record "Direct Trans. Line"; ItemJournalLine: Record "Item Journal Line"; var ItemJnlPostLine: Codeunit "Item Jnl.-Post Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + HandleDirectTransferReservationAndTracking(TransferLine3, ItemJnlPostLine); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransRcptHeaderExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransRcptHeaderExt.Codeunit.al index 0750593954..9d10d9eae0 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransRcptHeaderExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransRcptHeaderExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001542 "Subc. Trans Rcpt Header Ext" { [EventSubscriber(ObjectType::Table, Database::"Transfer Receipt Header", OnAfterCopyFromTransferHeader, '', false, false)] local procedure OnAfterCopyFromTransferHeader(var TransferReceiptHeader: Record "Transfer Receipt Header"; TransferHeader: Record "Transfer Header") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferReceiptHeader."Subc. Source Type" := TransferHeader."Subc. Source Type"; TransferReceiptHeader."Source Subtype" := TransferHeader."Source Subtype"; TransferReceiptHeader."Source ID" := TransferHeader."Source ID"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransShptHeaderExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransShptHeaderExt.Codeunit.al index 610f2eabcd..9735f1c3bd 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransShptHeaderExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransShptHeaderExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001543 "Subc. Trans Shpt Header Ext" { [EventSubscriber(ObjectType::Table, Database::"Transfer Shipment Header", OnAfterCopyFromTransferHeader, '', false, false)] local procedure OnAfterCopyFromTransferHeader(var TransferShipmentHeader: Record "Transfer Shipment Header"; TransferHeader: Record "Transfer Header") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferShipmentHeader."Subc. Source Type" := TransferHeader."Subc. Source Type"; TransferShipmentHeader."Source Subtype" := TransferHeader."Source Subtype"; TransferShipmentHeader."Source ID" := TransferHeader."Source ID"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferLineExt.Codeunit.al index 11524bfc08..99ba8aab10 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferLineExt.Codeunit.al @@ -8,9 +8,15 @@ using Microsoft.Inventory.Transfer; codeunit 99001544 "Subc. Transfer Line Ext." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnAfterGetTransHeader, '', false, false)] local procedure OnAfterGetTransHeader(var TransferLine: Record "Transfer Line"; TransferHeader: Record "Transfer Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferLine."Subc. Return Order" := TransferHeader."Subc. Return Order"; end; @@ -19,6 +25,9 @@ codeunit 99001544 "Subc. Transfer Line Ext." var SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary then exit; @@ -31,6 +40,9 @@ codeunit 99001544 "Subc. Transfer Line Ext." [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnValidateItemNoOnCopyFromTempTransLine, '', false, false)] local procedure OnValidateItemNoOnCopyFromTempTransLine_TransferLine(var TransferLine: Record "Transfer Line"; TempTransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + CopySubFieldsFromTempTransferLineToTransferLine(TransferLine, TempTransferLine); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferRcptLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferRcptLineExt.Codeunit.al index 3d2f0049dc..8c7f455441 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferRcptLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferRcptLineExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001538 "Subc. Transfer Rcpt Line Ext." { [EventSubscriber(ObjectType::Table, Database::"Transfer Receipt Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure OnAfterCopyFromTransferLine_T5745(var TransferReceiptLine: Record "Transfer Receipt Line"; TransferLine: Record "Transfer Line") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferReceiptLine."Subc. Purch. Order No." := TransferLine."Subc. Purch. Order No."; TransferReceiptLine."Subc. Purch. Order Line No." := TransferLine."Subc. Purch. Order Line No."; TransferReceiptLine."Subc. Prod. Order No." := TransferLine."Subc. Prod. Order No."; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferShptLineExt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferShptLineExt.Codeunit.al index 1c0cab70a2..4ecb81b8bb 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferShptLineExt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/Extensions/Transfer/SubcTransferShptLineExt.Codeunit.al @@ -10,7 +10,12 @@ codeunit 99001537 "Subc. Transfer Shpt Line Ext." { [EventSubscriber(ObjectType::Table, Database::"Transfer Shipment Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure OnAfterCopyFromTransferLine_T5745(var TransferShipmentLine: Record "Transfer Shipment Line"; TransferLine: Record "Transfer Line") + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferShipmentLine."Subc. Purch. Order No." := TransferLine."Subc. Purch. Order No."; TransferShipmentLine."Subc. Purch. Order Line No." := TransferLine."Subc. Purch. Order Line No."; TransferShipmentLine."Subc. Prod. Order No." := TransferLine."Subc. Prod. Order No."; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcCompFactboxMgmt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcCompFactboxMgmt.Codeunit.al index d0c02b08b7..ee7ae68181 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcCompFactboxMgmt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcCompFactboxMgmt.Codeunit.al @@ -10,6 +10,9 @@ using Microsoft.Purchases.Document; codeunit 99001562 "Subc. Comp. Factbox Mgmt." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + /// /// Returns the total consumption quantity posted for the given production order component via its linked routing operation. /// @@ -20,6 +23,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ItemLedgerEntry: Record "Item Ledger Entry"; ProdOrderRoutingLine: Record "Prod. Order Routing Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent); ItemLedgerEntry.SetCurrentKey(ItemLedgerEntry."Order Type", ItemLedgerEntry."Order No.", ItemLedgerEntry."Order Line No.", ItemLedgerEntry."Entry Type", ItemLedgerEntry."Prod. Order Comp. Line No."); @@ -43,6 +49,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ItemLedgerEntry: Record "Item Ledger Entry"; ProdOrderRoutingLine: Record "Prod. Order Routing Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent); ItemLedgerEntry.SetCurrentKey(ItemLedgerEntry."Order Type", ItemLedgerEntry."Order No.", ItemLedgerEntry."Order Line No.", ItemLedgerEntry."Entry Type", ItemLedgerEntry."Prod. Order Comp. Line No."); @@ -65,6 +74,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ProdOrderRoutingLine: Record "Prod. Order Routing Line"; PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if ProdOrderComponent."Routing Link Code" = '' then exit(0); if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then @@ -92,6 +104,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ProdOrderRoutingLine: Record "Prod. Order Routing Line"; PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderComponent."Routing Link Code" = '' then exit; if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then @@ -119,6 +134,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ProdOrderRoutingLine: Record "Prod. Order Routing Line"; PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if ProdOrderComponent."Routing Link Code" = '' then exit(0); if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then @@ -146,6 +164,9 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt." ProdOrderRoutingLine: Record "Prod. Order Routing Line"; PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderComponent."Routing Link Code" = '' then exit; if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcNotificationMgmt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcNotificationMgmt.Codeunit.al index e8d23b2817..77934e31f5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcNotificationMgmt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcNotificationMgmt.Codeunit.al @@ -13,30 +13,41 @@ codeunit 99001506 "Subc. Notification Mgmt." ProdOrdNotificationNameLbl: Label 'Show Created Production Orders'; SubcOrdNotificationDescriptionTxt: Label 'Show a notification if Subcontracting Orders were created for Subcontracting.'; SubcOrdNotificationNameLbl: Label 'Show Created Subcontracting Orders'; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; procedure ShowCreatedProductionOrderConfirmationMessageCode(): Code[50] begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); exit(UpperCase(GetShowCreatedProductionOrderCode())); end; procedure ShowCreatedSubcontractingOrderConfirmationMessageCode(): Code[50] begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); exit(UpperCase(GetShowCreatedSubContPurchOrderCode())); end; procedure GetShowCreatedProductionOrderCode(): Code[50] begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); exit('Show Created Production Orders'); end; procedure GetShowCreatedSubContPurchOrderCode(): Code[50] begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); exit('Show Created Subcontracting Orders'); end; [EventSubscriber(ObjectType::Page, Page::"My Notifications", OnInitializingNotificationWithDefaultState, '', false, false)] local procedure InitializeSubcontractingNotifications() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; RegisterSubcontrProductionOrderCreatedNotification(); RegisterSubcontrPurchOrderCreatedNotification(); end; @@ -60,17 +71,23 @@ codeunit 99001506 "Subc. Notification Mgmt." MyNotifications: Record "My Notifications"; PageMyNotifications: Page "My Notifications"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; PageMyNotifications.InitializeNotificationsWithDefaultState(); MyNotifications.Disable(NotificationVar.Id()); end; procedure GetGuidProductionOrderCreatedNotification(): Guid begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; exit('{5d564aca-ce60-4345-ba68-e1e50976a346}'); end; procedure GetGuidSubcontractingPOCreatedNotification(): Guid begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; exit('{f7b10c9e-071a-4455-a048-d17b29ef764c}'); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPriceManagement.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPriceManagement.Codeunit.al index fc811d7af5..a742492638 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPriceManagement.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPriceManagement.Codeunit.al @@ -22,12 +22,16 @@ codeunit 99001508 "Subc. Price Management" { var ManufacturingSetup: Record "Manufacturing Setup"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; procedure ApplySubcontractorPricingToProdOrderRouting(var ProdOrderLine: Record "Prod. Order Line"; var RoutingLine: Record "Routing Line"; var ProdOrderRoutingLine: Record "Prod. Order Routing Line") var SubcontractorPrice: Record "Subcontractor Price"; WorkCenter: Record "Work Center"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not ManufacturingSetup.Get() then exit; @@ -67,6 +71,9 @@ codeunit 99001508 "Subc. Price Management" SubcontractorPrice: Record "Subcontractor Price"; WorkCenter: Record "Work Center"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not ManufacturingSetup.Get() then exit; @@ -121,6 +128,9 @@ codeunit 99001508 "Subc. Price Management" UnitCost: Decimal; UnitCostCalculationType: Enum "Unit Cost Calculation Type"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if RoutingLine.Type <> "Capacity Type Routing"::"Work Center" then exit; @@ -206,6 +216,9 @@ codeunit 99001508 "Subc. Price Management" WorkCenter: Record "Work Center"; VendorNo: Code[20]; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if (ProdOrderRoutingLine.Type <> "Capacity Type"::"Work Center") then exit; @@ -262,6 +275,9 @@ codeunit 99001508 "Subc. Price Management" PriceListQty: Decimal; PriceListQtyPerUOM: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PriceListQtyPerUOM := 0; PriceListQty := 0; PriceListCost := 0; @@ -342,6 +358,9 @@ codeunit 99001508 "Subc. Price Management" procedure ConvertPriceToUOM(ProdUOM: Code[10]; ProdQtyPerUoM: Decimal; PriceListUOM: Code[10]; PriceListQtyPerUOM: Decimal; PriceListCost: Decimal; var DirectCost: Decimal) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdUOM <> PriceListUOM then begin DirectCost := PriceListCost / PriceListQtyPerUOM; DirectCost := DirectCost * ProdQtyPerUoM; @@ -407,6 +426,9 @@ codeunit 99001508 "Subc. Price Management" PriceListQty: Decimal; PriceListQtyPerUOM: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + OrderDate := RequisitionLine."Order Date"; if OrderDate = 0D then OrderDate := WorkDate(); @@ -462,6 +484,9 @@ codeunit 99001508 "Subc. Price Management" OrderDate: Date; DirectCost, PriceListCost, PriceListQty, PriceListQtyPerUOM : Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + OrderDate := PurchaseLine."Order Date"; if OrderDate = 0D then OrderDate := WorkDate(); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcProdOFactboxMgmt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcProdOFactboxMgmt.Codeunit.al index 056de67a1c..9f6c1f8e76 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcProdOFactboxMgmt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcProdOFactboxMgmt.Codeunit.al @@ -14,6 +14,9 @@ using System.Reflection; codeunit 99001559 "Subc. ProdO. Factbox Mgmt." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + /// /// Opens the appropriate Production Order page (Released or Finished) for the production order linked to the given variant record. /// @@ -28,6 +31,9 @@ codeunit 99001559 "Subc. ProdO. Factbox Mgmt." RoutingNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not SetProdOrderInformationByVariant(RecRelatedVariant, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo) then exit; ProductionOrder.SetFilter(Status, '>=%1', ProductionOrder.Status::Released); @@ -65,6 +71,9 @@ codeunit 99001559 "Subc. ProdO. Factbox Mgmt." RoutingNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not SetProdOrderInformationByVariant(RecRelatedVariant, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo) then exit; SetFilterProductionOrderRouting(ProdOrderRoutingLine, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo); @@ -87,6 +96,9 @@ codeunit 99001559 "Subc. ProdO. Factbox Mgmt." RoutingNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not SetProdOrderInformationByVariant(RecRelatedVariant, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo) then exit; SetFilterProductionOrderRouting(ProdOrderRoutingLine, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo); @@ -115,6 +127,9 @@ codeunit 99001559 "Subc. ProdO. Factbox Mgmt." RoutingNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not SetProdOrderInformationByVariant(RecRelatedVariant, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo) then exit; SetFilterProductionOrderComponents(ProdOrderComponent, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo); @@ -134,6 +149,9 @@ codeunit 99001559 "Subc. ProdO. Factbox Mgmt." RoutingNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not SetProdOrderInformationByVariant(RecRelatedVariant, ProdOrderNo, ProdOrderLineNo, RoutingNo, OperationNo) then exit(0); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.al index e62f88d95c..b67e8f0ae9 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.al @@ -19,6 +19,7 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." var MultipleLbl: Label 'Multiple', MaxLength = 20; NoTransferExistsMsg: Label 'No transfer order exists for this purchase order.'; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; /// /// Opens the Purchase Order page for the subcontracting purchase order linked to the given variant record. @@ -31,6 +32,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." PurchOrderNo: Code[20]; PurchOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not GetPurchaseOrderNoByVariant(RecRelatedVariant, PurchOrderNo, PurchOrderLineNo) then exit; PurchaseHeader.Reset(); @@ -50,6 +54,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." PurchOrderNo: Code[20]; PurchOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not GetPurchaseOrderNoByVariant(RecRelatedVariant, PurchOrderNo, PurchOrderLineNo) then exit(0); @@ -71,6 +78,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." NoOfTransferOrders: Integer; PurchOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); + if not GetPurchaseOrderNoByVariant(RecRelatedVariant, PurchOrderNo, PurchOrderLineNo) then exit(''); @@ -101,6 +111,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." PurchOrderNo: Code[20]; PurchOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); + if not GetPurchaseOrderNoByVariant(RecRelatedVariant, PurchOrderNo, PurchOrderLineNo) then exit(''); @@ -128,6 +141,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." PurchOrderNo: Code[20]; PurchOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not GetPurchaseOrderNoByVariant(RecRelatedVariant, PurchOrderNo, PurchOrderLineNo) then exit(0); @@ -164,6 +180,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." PurchOrderNo: Code[20]; ProdOrderLineNo: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); + if not RecRelatedVariant.IsRecord() then exit(false); @@ -238,6 +257,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." RecRef: RecordRef; NoOfTransferHeaders: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not RecRelatedVariant.IsRecord() then exit(0); @@ -330,6 +352,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." /// The count of matching subcontractor price entries, or 0 if the line is not an item line. procedure CalcNoOfPurchasePrices(var PurchaseLine: Record "Purchase Line"): Integer begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if IsItemLine(PurchaseLine) then exit(CountPriceOnPurchItemLine(PurchaseLine)); end; @@ -342,6 +367,9 @@ codeunit 99001560 "Subc. Purch. Factbox Mgmt." var SubcontractorPrice: Record "Subcontractor Price"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + FilterSubContractorPriceForPurchLine(SubcontractorPrice, PurchaseLine); Page.Run(Page::"Subcontractor Prices", SubcontractorPrice); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchaseOrderCreator.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchaseOrderCreator.Codeunit.al index 7371ab2720..84df4e8f68 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchaseOrderCreator.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcPurchaseOrderCreator.Codeunit.al @@ -27,6 +27,7 @@ codeunit 99001557 "Subc. Purchase Order Creator" ManufacturingSetup: Record "Manufacturing Setup"; PageManagement: Codeunit "Page Management"; UnitofMeasureManagement: Codeunit "Unit of Measure Management"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; HasManufacturingSetup: Boolean; OperationNo: Code[10]; RoutingReferenceNo: Integer; @@ -45,6 +46,9 @@ codeunit 99001557 "Subc. Purchase Order Creator" BaseQtyToPurch: Decimal; QtyToPurch: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + GetManufacturingSetup(); ManufacturingSetup.TestField("Subcontracting Template Name"); ManufacturingSetup.TestField("Subcontracting Batch Name"); @@ -74,6 +78,9 @@ codeunit 99001557 "Subc. Purchase Order Creator" ProdOrderLine: Record "Prod. Order Line"; PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + GetManufacturingSetup(); if not HasManufacturingSetup then @@ -113,6 +120,9 @@ codeunit 99001557 "Subc. Purchase Order Creator" SubContractorWorkCenterNo: Code[20]; DimensionSetIDArr: array[10] of Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + GetManufacturingSetup(); ProdOrderRoutingLine.SetLoadFields("Work Center No.", Status, "Prod. Order No.", "Routing Link Code"); if ProdOrderRoutingLine.Get("Production Order Status"::Released, RequisitionLine."Prod. Order No.", RequisitionLine."Routing Reference No.", RequisitionLine."Routing No.", RequisitionLine."Operation No.") then begin @@ -173,6 +183,9 @@ codeunit 99001557 "Subc. Purchase Order Creator" SubcNotificationMgmt: Codeunit "Subc. Notification Mgmt."; IsHandled: Boolean; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + OnBeforeShowCreatedPurchaseOrder(ProdOrderNo, NoOfCreatedPurchOrder, IsHandled); if IsHandled then exit; @@ -211,21 +224,33 @@ codeunit 99001557 "Subc. Purchase Order Creator" internal procedure SetOperationNoForCreatedPurchaseOrder(OperationNoToSet: Code[10]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + OperationNo := OperationNoToSet; end; internal procedure ClearOperationNoForCreatedPurchaseOrder() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + Clear(OperationNo); end; internal procedure SetRoutingReferenceNoForCreatedPurchaseOrder(RoutingReferenceNoToSet: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + RoutingReferenceNo := RoutingReferenceNoToSet; end; internal procedure ClearRoutingReferenceNoForCreatedPurchaseOrder() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + Clear(RoutingReferenceNo); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcRoutingFactboxMgmt.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcRoutingFactboxMgmt.Codeunit.al index 8c709389da..c16fdb0860 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcRoutingFactboxMgmt.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcRoutingFactboxMgmt.Codeunit.al @@ -13,6 +13,9 @@ using Microsoft.Purchases.Vendor; codeunit 99001561 "Subc. Routing Factbox Mgmt." { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + /// /// Returns the subcontractor vendor number for the work center on the given production order routing line. /// @@ -22,6 +25,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var WorkCenter: Record "Work Center"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); + if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::"Machine Center" then exit(''); WorkCenter.SetLoadFields("Subcontractor No."); @@ -38,6 +44,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." Vendor: Record Vendor; WorkCenter: Record "Work Center"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::"Work Center" then begin WorkCenter.Get(ProdOrderRoutingLine."Work Center No."); if Vendor.Get(WorkCenter."Subcontractor No.") then @@ -54,6 +63,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + PurchaseLine.SetRange(PurchaseLine."Document Type", PurchaseLine."Document Type"::Order); PurchaseLine.SetRange(PurchaseLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchaseLine.SetRange(PurchaseLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); @@ -70,6 +82,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchaseLine: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseLine.SetRange(PurchaseLine."Document Type", PurchaseLine."Document Type"::Order); PurchaseLine.SetRange(PurchaseLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchaseLine.SetRange(PurchaseLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); @@ -87,6 +102,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchRcptLine: Record "Purch. Rcpt. Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + PurchRcptLine.SetRange(PurchRcptLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchRcptLine.SetRange(PurchRcptLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); PurchRcptLine.SetRange(PurchRcptLine."Operation No.", ProdOrderRoutingLine."Operation No."); @@ -102,6 +120,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchRcptLine: Record "Purch. Rcpt. Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchRcptLine.SetRange(PurchRcptLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchRcptLine.SetRange(PurchRcptLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); PurchRcptLine.SetRange(PurchRcptLine."Operation No.", ProdOrderRoutingLine."Operation No."); @@ -118,6 +139,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchInvLine: Record "Purch. Inv. Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + PurchInvLine.SetRange(PurchInvLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchInvLine.SetRange(PurchInvLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); PurchInvLine.SetRange(PurchInvLine."Operation No.", ProdOrderRoutingLine."Operation No."); @@ -133,6 +157,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var PurchInvLine: Record "Purch. Inv. Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchInvLine.SetCurrentKey(PurchInvLine.Type, PurchInvLine."Prod. Order No.", PurchInvLine."Prod. Order Line No."); PurchInvLine.SetRange(PurchInvLine."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); PurchInvLine.SetRange(PurchInvLine."Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); @@ -150,6 +177,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var TransferLine: Record "Transfer Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + TransferLine.SetCurrentKey(TransferLine."Subc. Prod. Order No.", TransferLine."Subc. Prod. Order Line No.", TransferLine."Subc. Routing Reference No.", TransferLine."Subc. Routing No.", TransferLine."Subc. Operation No."); TransferLine.SetRange(TransferLine."Subc. Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); TransferLine.SetRange(TransferLine."Subc. Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); @@ -169,6 +199,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var TransferLine: Record "Transfer Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + TransferLine.SetCurrentKey(TransferLine."Subc. Prod. Order No.", TransferLine."Subc. Prod. Order Line No.", TransferLine."Subc. Routing Reference No.", TransferLine."Subc. Operation No."); TransferLine.SetRange(TransferLine."Subc. Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); TransferLine.SetRange(TransferLine."Subc. Routing Reference No.", 0); @@ -186,6 +219,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var TransferLine: Record "Transfer Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferLine.SetCurrentKey(TransferLine."Subc. Prod. Order No.", TransferLine."Subc. Prod. Order Line No.", TransferLine."Subc. Routing Reference No.", TransferLine."Subc. Routing No.", TransferLine."Subc. Operation No."); TransferLine.SetRange(TransferLine."Subc. Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); TransferLine.SetRange(TransferLine."Subc. Routing Reference No.", ProdOrderRoutingLine."Routing Reference No."); @@ -203,6 +239,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var TransferLine: Record "Transfer Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferLine.SetCurrentKey(TransferLine."Subc. Prod. Order No.", TransferLine."Subc. Prod. Order Line No.", TransferLine."Subc. Routing Reference No.", TransferLine."Subc. Operation No."); TransferLine.SetRange(TransferLine."Subc. Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); TransferLine.SetRange(TransferLine."Subc. Routing Reference No.", 0); @@ -220,6 +259,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var ProdOrderComponent: Record "Prod. Order Component"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if ProdOrderRoutingLine."Routing Link Code" = '' then exit(0); ProdOrderComponent.SetRange(ProdOrderComponent.Status, ProdOrderRoutingLine.Status); @@ -237,6 +279,9 @@ codeunit 99001561 "Subc. Routing Factbox Mgmt." var ProdOrderComponent: Record "Prod. Order Component"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderComponent.SetRange(ProdOrderComponent.Status, ProdOrderRoutingLine.Status); ProdOrderComponent.SetRange(ProdOrderComponent."Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); ProdOrderComponent.SetRange(ProdOrderComponent."Prod. Order Line No.", ProdOrderRoutingLine."Routing Reference No."); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcSynchronizeManagement.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcSynchronizeManagement.Codeunit.al index 7aaf0e7d60..d1e45b6445 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcSynchronizeManagement.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcSynchronizeManagement.Codeunit.al @@ -16,6 +16,7 @@ using Microsoft.Purchases.Document; codeunit 99001511 "Subc. Synchronize Management" { var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; CannotDeleteSubcOrderTitleLbl: Label 'Transfer Order Exists'; CannotDeleteSubcOrderWithTransferOrderErr: Label 'You cannot delete Subcontracting Order %1 because Transfer Order %2 is associated with it. Delete or receive the Transfer Order first.', Comment = '%1=Subcontracting Order No., %2=Transfer Order No.'; CannotDeleteSubcOrderWithTransferOrdersErr: Label 'You cannot delete Subcontracting Order %1 because Transfer Orders are associated with it. Delete or receive all Transfer Orders first.', Comment = '%1=Subcontracting Order No.'; @@ -25,6 +26,9 @@ codeunit 99001511 "Subc. Synchronize Management" var ProductionOrder: Record "Production Order"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not IsSubcontractingLine(PurchaseLine) then exit; @@ -55,6 +59,9 @@ codeunit 99001511 "Subc. Synchronize Management" UnitofMeasureManagement: Codeunit "Unit of Measure Management"; PurchLineBaseQuantity: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not IsSubcontractingLine(PurchaseLine) then exit; @@ -109,6 +116,9 @@ codeunit 99001511 "Subc. Synchronize Management" PurchaseLine, PurchaseLine2, PurchaseLineModify : Record "Purchase Line"; TransferHeader: Record "Transfer Header"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + PurchaseLine.SetRange("Document Type", PurchaseHeader."Document Type"); PurchaseLine.SetRange("Document No.", PurchaseHeader."No."); PurchaseLine.SetRange(Type, "Purchase Line Type"::Item); @@ -180,6 +190,9 @@ codeunit 99001511 "Subc. Synchronize Management" TransferHeader: Record "Transfer Header"; TransferOrderErrorInfo: ErrorInfo; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferHeader.SetRange("Subcontr. Purch. Order No.", PurchaseHeader."No."); if TransferHeader.IsEmpty() then exit; @@ -202,6 +215,9 @@ codeunit 99001511 "Subc. Synchronize Management" ProductionOrder: Record "Production Order"; PurchaseLine2: Record "Purchase Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if not IsSubcontractingLine(PurchaseLine) then exit; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcWorksheetHandler.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcWorksheetHandler.Codeunit.al index 04119e7e06..f29f4dcf41 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcWorksheetHandler.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcWorksheetHandler.Codeunit.al @@ -9,7 +9,12 @@ codeunit 99001558 "Subc. Worksheet Handler" { [EventSubscriber(ObjectType::Codeunit, Codeunit::ReqJnlManagement, OnOpenJnlBatchOnBeforeTemplateSelection, '', false, false)] local procedure OnOpenJnlBatchOnBeforeTemplateSelection(var RequisitionWkshName: Record "Requisition Wksh. Name"; var ReqWorksheetTemplateTypeList: List of [Enum Microsoft.Inventory.Requisition."Req. Worksheet Template Type"]) + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ReqWorksheetTemplateTypeList.Add(Enum::"Req. Worksheet Template Type"::Subcontracting); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcontractingManagement.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcontractingManagement.Codeunit.al index f47dddd041..064c7bd21c 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcontractingManagement.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcontractingManagement.Codeunit.al @@ -26,6 +26,7 @@ codeunit 99001505 "Subcontracting Management" var ManufacturingSetup: Record "Manufacturing Setup"; TempGlobalReservationEntry: Record "Reservation Entry" temporary; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; RoutingLinkUpdConfQst: Label 'If you change the Work Center, you will also change the default location for components with Routing Link Code=%1.\Do you want to continue anyway?', Comment = '%1=Routing Link Code'; SuccessfullyUpdatedMsg: Label 'Successfully updated.'; UpdateIsCancelledErr: Label 'Update cancelled.'; @@ -36,6 +37,9 @@ codeunit 99001505 "Subcontracting Management" procedure CalcReceiptDateFromProdCompDueDateWithCompTransferLeadTime(ProdOrderComponent: Record "Prod. Order Component") ReceiptDate: Date begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + GetManufacturingSetup(); if not HasManufacturingSetup or (Format(ManufacturingSetup."Subc. Comp. Transfer Lead Time") = '') then exit(ProdOrderComponent."Due Date"); @@ -47,6 +51,9 @@ codeunit 99001505 "Subcontracting Management" procedure ChangeLocationOnProdOrderComponent(var ProdOrderComponent: Record "Prod. Order Component"; VendorSubcontrLocation: Code[10]; OriginalLocationCode: Code[10]; OriginalBinCode: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + case ProdOrderComponent."Component Supply Method" of "Component Supply Method"::"Consignment at Vendor", "Component Supply Method"::"Vendor-Supplied": @@ -70,6 +77,9 @@ codeunit 99001505 "Subcontracting Management" procedure ChangeLocationOnPlanningComponent(var PlanningComponent: Record "Planning Component"; VendorSubcontrLocation: Code[10]; OriginalLocationCode: Code[10]; OriginalBinCode: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + case PlanningComponent."Component Supply Method" of "Component Supply Method"::"Consignment at Vendor", "Component Supply Method"::"Vendor-Supplied": @@ -93,6 +103,9 @@ codeunit 99001505 "Subcontracting Management" procedure CheckDirectTransferIsAllowedForTransferHeader(TransferHeader: Record "Transfer Header") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TransferHeader.CheckDirectTransferPosting(); end; @@ -104,6 +117,8 @@ codeunit 99001505 "Subcontracting Management" ConfirmManagement: Codeunit "Confirm Management"; PlanningGetParameters: Codeunit "Planning-Get Parameters"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; ProdOrderComponent.SetRange(Status, ProdOrderRoutingLine.Status); ProdOrderComponent.SetRange("Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); @@ -137,6 +152,9 @@ codeunit 99001505 "Subcontracting Management" WorkCenter: Record "Work Center"; HasSubcontractor, IsHandled : Boolean; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); + OnBeforeGetSubcontractor(WorkCenterNo, Vendor, HasSubcontractor, IsHandled);//DO NOT DELETE if IsHandled then exit(HasSubcontractor); @@ -155,6 +173,9 @@ codeunit 99001505 "Subcontracting Management" procedure UpdateSubcontractorPriceForRequisitionLine(var RequisitionLine: Record "Requisition Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if IsSubcontracting(RequisitionLine."Work Center No.") then RequisitionLine.UpdateSubcontractorPrice(); end; @@ -163,6 +184,9 @@ codeunit 99001505 "Subcontracting Management" var WorkCenter: Record "Work Center"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderRoutingLine.Type <> "Capacity Type"::"Work Center" then exit; @@ -183,6 +207,9 @@ codeunit 99001505 "Subcontracting Management" TempReservationEntry: Record "Reservation Entry" temporary; ProdOrderCompReserve: Codeunit "Prod. Order Comp.-Reserve"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TempGlobalReservationEntry.Reset(); TempGlobalReservationEntry.DeleteAll(); @@ -215,6 +242,9 @@ codeunit 99001505 "Subcontracting Management" procedure ComponentHasExcessReservations(ProdOrderComponent: Record "Prod. Order Component"; MaxQtyBase: Decimal): Boolean begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); + exit(GetComponentReservedQtyBase(ProdOrderComponent) > MaxQtyBase); end; @@ -224,6 +254,9 @@ codeunit 99001505 "Subcontracting Management" ProdOrderCompReserve: Codeunit "Prod. Order Comp.-Reserve"; TotalReservedQtyBase: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); + if not ProdOrderCompReserve.FindReservEntry(ProdOrderComponent, ReservationEntry) then exit(0); @@ -243,6 +276,9 @@ codeunit 99001505 "Subcontracting Management" TempTrackingSpecification: Record "Tracking Specification" temporary; CreateReservEntry: Codeunit "Create Reserv. Entry"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + TempGlobalReservationEntry.SetRange("Reservation Status", TempGlobalReservationEntry."Reservation Status"::Reservation); if not TempGlobalReservationEntry.FindSet() then exit; @@ -297,6 +333,9 @@ codeunit 99001505 "Subcontracting Management" TempTrackingSpecification: Record "Tracking Specification" temporary; ProdOrderCompReserve: Codeunit "Prod. Order Comp.-Reserve"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if (TransferReceiptLine."Subc. Prod. Order No." = '') or (TransferReceiptLine."Subc. Operation No." = '') then exit; if not ProdOrderComponent.Get("Production Order Status"::Released, TransferReceiptLine."Subc. Prod. Order No.", TransferReceiptLine."Subc. Prod. Order Line No.", TransferReceiptLine."Subc. Prod. Ord. Comp Line No.") then @@ -347,6 +386,9 @@ codeunit 99001505 "Subcontracting Management" var ProdOrderComponent: Record "Prod. Order Component"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderComponent.Get("Production Order Status"::Released, TransferLine."Subc. Prod. Order No.", TransferLine."Subc. Prod. Order Line No.", TransferLine."Subc. Prod. Ord. Comp Line No.") then if ProdOrderComponent."Subc. Original Location Code" <> '' then begin ChangeLocationOnProdOrderComponent(ProdOrderComponent, '', ProdOrderComponent."Subc. Original Location Code", ProdOrderComponent."Subc. Orig. Bin Code"); @@ -364,6 +406,9 @@ codeunit 99001505 "Subcontracting Management" OrigLocationCode, VendorSubcontractingLocationCode : Code[10]; OrigBinCode: Code[20]; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if PlanningComponent."Routing Link Code" = '' then exit; @@ -401,6 +446,9 @@ codeunit 99001505 "Subcontracting Management" OrigBinCode: Code[20]; PurchOrderNo: Code[20]; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if ProdOrderComponent."Routing Link Code" = '' then exit; @@ -457,6 +505,9 @@ codeunit 99001505 "Subcontracting Management" OrigLocationCode, VendorSubcontractingLocationCode : Code[10]; OrigBinCode: Code[20]; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProdOrderComponent.SetRange(Status, ProdOrderRoutingLine.Status); ProdOrderComponent.SetRange("Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); ProdOrderComponent.SetRange("Prod. Order Line No.", ProdOrderRoutingLine."Routing Reference No."); @@ -497,6 +548,9 @@ codeunit 99001505 "Subcontracting Management" CompanyInformation: Record "Company Information"; ComponentsLocationCode: Code[10]; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(''); + GetManufacturingSetup(); ManufacturingSetup.TestField("Subc. Default Comp. Location"); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrder.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrder.PageExt.al index 8cf9c48442..3b85ef5725 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrder.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrder.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001548 "Subc. Finished Prod. Order" extends "Finished Production { action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrders.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrders.PageExt.al index cbe322253d..242c985061 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrders.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcFinishedProdOrders.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001543 "Subc. Finished Prod. Orders" extends "Finished Productio { action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningComp.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningComp.PageExt.al index bd11101a75..0d33f17d31 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningComp.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningComp.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001511 "Subc. Planning Comp" extends "Planning Components" { field("Component Supply Method"; Rec."Component Supply Method") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningRouting.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningRouting.PageExt.al index 98508750df..af42fcec58 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningRouting.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcPlanningRouting.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001515 "Subc. Planning Routing" extends "Planning Routing" { field("Routing Link Code"; Rec."Routing Link Code") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies the routing link code.'; Visible = false; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMLines.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMLines.PageExt.al index 9da96efdeb..bca0cf31e7 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMLines.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMLines.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001510 "Subc. Prod BOM Lines" extends "Production BOM Lines" { field("Component Supply Method"; Rec."Component Supply Method") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMVersionLines.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMVersionLines.PageExt.al index 0d8a035ef1..ae14805545 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMVersionLines.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdBOMVersionLines.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001514 "Subc. ProdBOMVersionLines" extends "Production BOM Versi { field("Component Supply Method"; Rec."Component Supply Method") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies how components are supplied to the subcontractor for the production BOM line.'; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderComp.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderComp.PageExt.al index 92e4cc2a10..bcecc24cef 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderComp.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderComp.PageExt.al @@ -14,23 +14,23 @@ pageextension 99001512 "Subc. Prod Order Comp" extends "Prod. Order Components" { field("Subc. Qty.on TransOrder (Base)"; Rec."Subc. Qty.on TransOrder (Base)") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; } field("Subc. Qty. in Transit (Base)"; Rec."Subc. Qty. in Transit (Base)") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Visible = false; } field("Subc. Qty. transf. to Subcontractor"; Rec."Subc. Qty. transf. to Subcontr") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } } addlast(Control1) { field("Component Supply Method"; Rec."Component Supply Method") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies how components are supplied to the subcontractor for the production component.'; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderCompLine.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderCompLine.PageExt.al index 96b3a2c82f..d6783838b2 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderCompLine.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderCompLine.PageExt.al @@ -14,12 +14,12 @@ pageextension 99001513 "Subc. ProdOrderCompLine" extends "Prod. Order Comp. Line { field("Component Supply Method"; Rec."Component Supply Method") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies how components are supplied to the subcontractor for the production component.'; } field("Subc. Routing Link Code"; Rec."Routing Link Code") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the routing link code when you calculate the production order.'; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderRtng.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderRtng.PageExt.al index 2c204afe2f..51d4e5aec1 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderRtng.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcProdOrderRtng.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -15,6 +15,8 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { trigger OnAfterValidate() begin + if not SubcontractingEnabled then + exit; UpdateWIPEnabled(); end; } @@ -22,6 +24,8 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { trigger OnAfterValidate() begin + if not SubcontractingEnabled then + exit; UpdateWIPEnabled(); end; } @@ -29,32 +33,32 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { field(Subcontracting; Rec.Subcontracting) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = TransferWIPItemEnabled; } field("Transfer Description"; Rec."Transfer Description") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = Rec."Transfer WIP Item"; } field("Transfer Description 2"; Rec."Transfer Description 2") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = Rec."Transfer WIP Item"; Visible = false; } field("WIP Qty. (Base) at Subc."; Rec."WIP Qty. (Base) at Subc.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } field("WIP Qty. (Base) in Transit"; Rec."WIP Qty. (Base) in Transit") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } @@ -62,7 +66,7 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { part("Subc. Routing Info Factbox"; "Subc. Routing Info Factbox") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; SubPageLink = "Prod. Order No." = field("Prod. Order No."), "Routing No." = field("Routing No."), "Routing Reference No." = field("Routing Reference No."), "Operation No." = field("Operation No."); } } @@ -73,7 +77,7 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { action("Subcontracting Purchase Lines") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Purchase Order Lines'; Image = SubcontractingWorksheet; RunObject = page "Purchase Lines"; @@ -82,7 +86,7 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" } action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; @@ -98,7 +102,7 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" { action("WIP Adjustment") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'WIP Adjustment'; Image = AdjustEntries; ToolTip = 'Manually adjust the WIP quantity for the selected prod. order routing line.'; @@ -116,7 +120,7 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" } action(CreateSubcontracting) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Subcontracting Order'; Image = CreateDocument; Enabled = CreateSubcontractingEnabled; @@ -160,6 +164,8 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" } } var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; TransferWIPItemEnabled: Boolean; CreateSubcontractingEnabled: Boolean; CreateSubcontractingVisible: Boolean; @@ -169,6 +175,10 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" var StatusFilter: Text; begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + if not SubcontractingEnabled then + exit; + StatusFilter := Rec.GetFilter(Rec.Status); if StatusFilter.Contains(Format("Production Order Status"::Released)) then CreateSubcontractingVisible := true @@ -178,11 +188,17 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" trigger OnAfterGetRecord() begin + if not SubcontractingEnabled then + exit; + UpdateWIPEnabled(); end; trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + UpdateWIPEnabled(); CreateSubcontractingEnabled := Rec.Subcontracting and (Rec.Status = "Production Order Status"::Released); end; @@ -191,5 +207,5 @@ pageextension 99001503 "Subc. Prod. Order Rtng." extends "Prod. Order Routing" begin Rec.Calcfields(Subcontracting); TransferWIPItemEnabled := Rec.Subcontracting; - end; + end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrder.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrder.PageExt.al index bb0f6e7516..5dcce61556 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrder.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrder.PageExt.al @@ -15,7 +15,7 @@ pageextension 99001504 "Subc. Rel. Prod. Order" extends "Released Production Ord { action("Subcontracting Purchase Lines") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Order Lines'; Image = SubcontractingWorksheet; RunObject = page "Purchase Lines"; @@ -27,7 +27,7 @@ pageextension 99001504 "Subc. Rel. Prod. Order" extends "Released Production Ord { action("Subc. Transfer Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Transfer Entries'; Image = ItemLedger; RunObject = page "Item Ledger Entries"; @@ -38,7 +38,7 @@ pageextension 99001504 "Subc. Rel. Prod. Order" extends "Released Production Ord } action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; @@ -50,7 +50,7 @@ pageextension 99001504 "Subc. Rel. Prod. Order" extends "Released Production Ord { action("WIP Adjustment") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'WIP Adjustment'; Image = AdjustEntries; ToolTip = 'Manually adjust the WIP quantities for all routing operations of this production order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrders.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrders.PageExt.al index 24c7b1c189..765da6d2e8 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrders.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRelProdOrders.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001505 "Subc. Rel. Prod. Orders" extends "Released Production Or { action("Subcontracting Purchase Lines") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Order Lines'; Image = SubcontractingWorksheet; RunObject = page "Purchase Lines"; @@ -26,7 +26,7 @@ pageextension 99001505 "Subc. Rel. Prod. Orders" extends "Released Production Or { action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRoutingLines.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRoutingLines.PageExt.al index dfe00a02da..180432e5f2 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRoutingLines.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRoutingLines.PageExt.al @@ -14,6 +14,8 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" { trigger OnAfterValidate() begin + if not SubcontractingEnabled then + exit; UpdateWIPEnabled(); end; } @@ -21,6 +23,8 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" { trigger OnAfterValidate() begin + if not SubcontractingEnabled then + exit; UpdateWIPEnabled(); end; } @@ -28,17 +32,17 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = TransferWIPItemEnabled; } field("Transfer Description"; Rec."Transfer Description") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = Rec."Transfer WIP Item"; } field("Transfer Description 2"; Rec."Transfer Description 2") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Enabled = Rec."Transfer WIP Item"; } } @@ -49,7 +53,7 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" { action("Subc. Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Prices'; Image = Price; ToolTip = 'View the related subcontracting prices.'; @@ -62,17 +66,30 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" } } + trigger OnOpenPage() + begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + end; + trigger OnAfterGetRecord() begin + if not SubcontractingEnabled then + exit; + UpdateWIPEnabled(); end; trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + UpdateWIPEnabled(); end; var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; TransferWIPItemEnabled: Boolean; local procedure UpdateWIPEnabled() @@ -85,6 +102,9 @@ pageextension 99001508 "Subc. Routing Lines" extends "Routing Lines" var SubcontractorPrice: Record "Subcontractor Price"; begin + if not SubcontractingEnabled then + exit; + Rec.TestField(Type, Rec.Type::"Work Center"); SubcontractorPrice.SetRange("Work Center No.", Rec."No."); if Rec."Standard Task Code" <> '' then diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterCard.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterCard.PageExt.al index bb841efc1d..64ad12be85 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterCard.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterCard.PageExt.al @@ -19,7 +19,7 @@ pageextension 99001506 "Subc. Work Center Card" extends "Work Center Card" action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Enabled = IsSubcontractingWorkCenter; Image = Price; @@ -34,7 +34,7 @@ pageextension 99001506 "Subc. Work Center Card" extends "Work Center Card" { action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; @@ -47,11 +47,22 @@ pageextension 99001506 "Subc. Work Center Card" extends "Work Center Card" Enabled = IsSubcontractingWorkCenter; } } + + trigger OnOpenPage() + begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + end; + trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + IsSubcontractingWorkCenter := Rec."Subcontractor No." <> ''; end; var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; IsSubcontractingWorkCenter: Boolean; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterList.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterList.PageExt.al index d95d8facfb..f4a1e77e91 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterList.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcWorkCenterList.PageExt.al @@ -18,7 +18,7 @@ pageextension 99001507 "Subc. Work Center List" extends "Work Center List" Image = SubcontractingWorksheet; action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Enabled = IsSubcontractingWorkCenter; Image = Price; @@ -35,7 +35,7 @@ pageextension 99001507 "Subc. Work Center List" extends "Work Center List" } action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; @@ -46,11 +46,21 @@ pageextension 99001507 "Subc. Work Center List" extends "Work Center List" } } + trigger OnOpenPage() + begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + end; + trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + IsSubcontractingWorkCenter := Rec."Subcontractor No." <> ''; end; var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; IsSubcontractingWorkCenter: Boolean; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemCard.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemCard.PageExt.al index ae96ba5ddb..5d99d33d23 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemCard.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemCard.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001518 "Subc. Item Card" extends "Item Card" { action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Image = Price; RunObject = page "Subcontractor Prices"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemList.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemList.PageExt.al index e49a53e95e..8e233b9ec0 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemList.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcItemList.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001519 "Subc. Item List" extends "Item List" { action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Image = Price; RunObject = page "Subcontractor Prices"; @@ -27,7 +27,7 @@ pageextension 99001519 "Subc. Item List" extends "Item List" { action("WIP Ledger Entries") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Image = LedgerEntries; RunObject = page "Subc. WIP Ledger Entries"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorCard.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorCard.PageExt.al index 2dc3b01762..325df0b7f5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorCard.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorCard.PageExt.al @@ -14,17 +14,17 @@ pageextension 99001516 "Subc. Vendor Card" extends "Vendor Card" { field("Subcr. Location Code"; Rec."Subc. Location Code") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the subcontracting location where items from the vendor must be received by default after having performed an outside work.'; } field("Subc. Linked to Work Center"; Rec."Subc. Linked to Work Center") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies if a work center is related to the vendor.'; } field("Subc. Work Center No."; Rec."Subc. Work Center No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the work center for purchase provision related to the vendor.'; } } @@ -35,7 +35,7 @@ pageextension 99001516 "Subc. Vendor Card" extends "Vendor Card" { action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Image = Price; RunObject = page "Subcontractor Prices"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorList.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorList.PageExt.al index 870ddc8720..00ac3b4e54 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorList.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/MasterData/SubcVendorList.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001517 "Subc. Vendor List" extends "Vendor List" { action("Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; Image = Price; RunObject = page "Subcontractor Prices"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPOSubform.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPOSubform.PageExt.al index 29d83b4b7b..7c7ce47516 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPOSubform.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPOSubform.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } @@ -28,7 +28,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -39,7 +39,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -50,7 +50,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -61,7 +61,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" } action("Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Transfer Order'; Image = TransferOrder; ToolTip = 'View the related transfer order.'; @@ -72,7 +72,7 @@ pageextension 99001524 "Subc. PO Subform" extends "Purchase Order Subform" } action("Return Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Return Transfer Order'; Image = ReturnRelated; ToolTip = 'View the related return transfer order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrder.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrder.PageExt.al index 4840c2858c..4d3f5b01f9 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrder.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrder.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,11 +14,11 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" { field("Subc. Order"; Rec."Subc. Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } field("Subc. Location Code"; Rec."Subc. Location Code") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; } } @@ -26,7 +26,7 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" { part(" Sub Purchase Line Factbox"; "Subc. Purchase Line Factbox") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Provider = PurchLines; SubPageLink = "Document Type" = field("Document Type"), "Document No." = field("Document No."), "Line No." = field("Line No."); Visible = ShowSubcontractingFactBox; @@ -39,7 +39,7 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" { action(CreateTransfOrdToSubcontractor) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Transf. Ord. to Subcontractor'; Image = NewDocument; ToolTip = 'Create a transfer order to send to the subcontractor.'; @@ -55,7 +55,7 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" } action(CreateReturnFromSubcontractor) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Return from Subcontractor'; Image = ReturnRelated; ToolTip = 'Create a return document from the subcontractor.'; @@ -71,7 +71,7 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" } action(PrintSubcDispatchingList) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Print Subcontractor Dispatching List'; Image = Print; ToolTip = 'Print the dispatching list for the subcontractor.'; @@ -88,15 +88,24 @@ pageextension 99001523 "Subc. Purch. Order" extends "Purchase Order" } } var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; ShowSubcontractingFactBox: Boolean; trigger OnOpenPage() begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + if not SubcontractingEnabled then + exit; + ShowSubcontractingFactBox := SubcontractingInLines(); end; trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + ShowSubcontractingFactBox := SubcontractingInLines(); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrderList.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrderList.PageExt.al index cb427147b2..8933060e6e 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrderList.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Purchase/SubcPurchOrderList.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ pageextension 99001525 "Subc. PurchOrderList" extends "Purchase Order List" { field("Subc. Location Code"; Rec."Subc. Location Code") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; } } @@ -25,7 +25,7 @@ pageextension 99001525 "Subc. PurchOrderList" extends "Purchase Order List" { action(CreateTransfOrdToSubcontractor) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Transf. Ord. to Subcontractor'; Image = NewDocument; ToolTip = 'Create a transfer order to send to the subcontractor.'; @@ -41,7 +41,7 @@ pageextension 99001525 "Subc. PurchOrderList" extends "Purchase Order List" } action(CreateReturnFromSubcontractor) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Return from Subcontractor'; Image = ReturnRelated; ToolTip = 'Create a return document from the subcontractor.'; @@ -57,7 +57,7 @@ pageextension 99001525 "Subc. PurchOrderList" extends "Purchase Order List" } action(PrintSubcDispatchingList) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Print Subcontractor Dispatching List'; Image = Print; ToolTip = 'Print the dispatching list for the subcontractor.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcCapLEntries.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcCapLEntries.PageExt.al index 2df74c8705..e9f796b6da 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcCapLEntries.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcCapLEntries.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -17,19 +17,19 @@ pageextension 99001502 "Subc. CapLEntries" extends "Capacity Ledger Entries" { field("Subc. Purch. Order No."; Rec."Subc. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subc. Purch. Order Line No."; Rec."Subc. Purch. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; } field("Subc. Subcontractor No."; Rec."Subc. Subcontractor No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related subcontractor.'; Visible = false; } @@ -45,7 +45,7 @@ pageextension 99001502 "Subc. CapLEntries" extends "Capacity Ledger Entries" action(ShowDocument) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Show Document'; Image = Document; ToolTip = 'View the document related to this capacity ledger entry. Shows the posted purchase receipt or invoice if available, otherwise shows the purchase order.'; @@ -79,13 +79,12 @@ pageextension 99001502 "Subc. CapLEntries" extends "Capacity Ledger Entries" if CapacityLedgerEntry."Subc. Purch. Order No." <> '' then if PurchaseHeader.Get(PurchaseHeader."Document Type"::Order, CapacityLedgerEntry."Subc. Purch. Order No.") then begin PageManagement.PageRun(PurchaseHeader); - exit; + exit; end; // No document found Message(NoDocumentFoundMsg); end; - - var + var NoDocumentFoundMsg: Label 'No related document could be found for this entry.'; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcILEntries.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcILEntries.PageExt.al index ca7a537ff9..260fe4b050 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcILEntries.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/SubcILEntries.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,25 +14,25 @@ pageextension 99001501 "Subc. ILEntries" extends "Item Ledger Entries" { field("Subc. Purch. Order No."; Rec."Subc. Purch. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subc. Purch. Order Line No."; Rec."Subc. Purch. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; } field("Prod. Order No."; Rec."Subc. Prod. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production order.'; Visible = false; } field("Prod. Order Line No."; Rec."Subc. Prod. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production order line.'; Visible = false; } @@ -47,7 +47,7 @@ pageextension 99001501 "Subc. ILEntries" extends "Item Ledger Entries" Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -58,7 +58,7 @@ pageextension 99001501 "Subc. ILEntries" extends "Item Ledger Entries" } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -69,7 +69,7 @@ pageextension 99001501 "Subc. ILEntries" extends "Item Ledger Entries" } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -80,7 +80,7 @@ pageextension 99001501 "Subc. ILEntries" extends "Item Ledger Entries" } action("Purchase Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Purchase Order'; Image = Order; ToolTip = 'View the related subcontracting purchase order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTrans.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTrans.PageExt.al index 922eaf72b1..e5feed5595 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTrans.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTrans.PageExt.al @@ -14,42 +14,42 @@ pageextension 99001531 "Subc. Pstd. Direct Trans." extends "Posted Direct Transf { field(SourceType; Rec."Source Type") { - ApplicationArea = All; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies for which source type the transfer order is related to.'; Visible = false; } field(SourceID; Rec."Source ID") { - ApplicationArea = All; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies which source ID the transfer order is related to.'; Visible = false; } field(SourceRefNo; Rec."Source Ref. No.") { - ApplicationArea = All; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies a reference number for the line, which the transfer order is related to.'; Visible = false; } field("Return Order"; Rec."Return Order") { - ApplicationArea = All; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies whether the existing transfer order is a return of the subcontractor.'; Visible = false; } field("Subcontr. Purch. Order No."; Rec."Subcontr. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subcontr. PO Line No."; Rec."Subcontr. PO Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTransfSub.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTransfSub.PageExt.al index ef932f9d61..4dc52dcc85 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTransfSub.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdDirectTransfSub.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,61 +14,61 @@ pageextension 99001532 "Subc. PstdDirectTransfSub" extends "Posted Direct Transf { field("Subcontr. Purch. Order No."; Rec."Subcontr. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subcontr. PO Line No."; Rec."Subcontr. PO Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; } field("Prod. Order No."; Rec."Prod. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production order.'; Visible = false; } field("Prod. Order Line No."; Rec."Prod. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production order line.'; Visible = false; } field("Prod. Order. Comp. Line No."; Rec."Prod. Order Comp. Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the line number of the related production order component line.'; Visible = false; } field("Routing No."; Rec."Routing No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production routing.'; Visible = false; } field("Routing Reference No."; Rec."Routing Reference No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production routing reference no.'; Visible = false; } field("WorkCenter No."; Rec."Work Center No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production work center.'; Visible = false; } field("Operation No."; Rec."Operation No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related production operation no.'; Visible = false; } field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } @@ -82,7 +82,7 @@ pageextension 99001532 "Subc. PstdDirectTransfSub" extends "Posted Direct Transf Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -93,7 +93,7 @@ pageextension 99001532 "Subc. PstdDirectTransfSub" extends "Posted Direct Transf } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -104,7 +104,7 @@ pageextension 99001532 "Subc. PstdDirectTransfSub" extends "Posted Direct Transf } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -115,7 +115,7 @@ pageextension 99001532 "Subc. PstdDirectTransfSub" extends "Posted Direct Transf } action("Purchase Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Purchase Order'; Image = Order; ToolTip = 'View the related subcontracting purchase order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferRcpt.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferRcpt.PageExt.al index 36918fb29e..42d33edd4c 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferRcpt.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferRcpt.PageExt.al @@ -14,49 +14,49 @@ pageextension 99001528 "Subc. Pstd. Transfer Rcpt" extends "Posted Transfer Rece { field("Subc. Source Type"; Rec."Subc. Source Type") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies for which source type the transfer order is related to.'; Visible = false; } field(SourceSubtype; Rec."Source Subtype") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies which source subtype the transfer order is related to.'; Visible = false; } field(SourceID; Rec."Source ID") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies which source ID the transfer order is related to.'; Visible = false; } field(SourceRefNo; Rec."Source Ref. No.") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies a reference number for the line, which the transfer order is related to.'; Visible = false; } field("Subc. Return Order"; Rec."Subc. Return Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies whether the existing transfer order is a return of the subcontractor.'; Visible = false; } field("Subcontr. Purch. Order No."; Rec."Subcontr. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subcontr. PO Line No."; Rec."Subcontr. PO Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferShpt.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferShpt.PageExt.al index b871b1103d..aad43991c5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferShpt.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcPstdTransferShpt.PageExt.al @@ -14,43 +14,43 @@ pageextension 99001527 "Subc. Pstd. Transfer Shpt" extends "Posted Transfer Ship { field("Subc. Source Type"; Rec."Subc. Source Type") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field(SourceSubtype; Rec."Source Subtype") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field(SourceID; Rec."Source ID") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field(SourceRefNo; Rec."Source Ref. No.") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Return Order"; Rec."Subc. Return Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subcontr. Purch. Order No."; Rec."Subcontr. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subcontr. PO Line No."; Rec."Subcontr. PO Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransOrderSub.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransOrderSub.PageExt.al index 9781ace437..3799aff98b 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransOrderSub.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransOrderSub.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,62 +14,62 @@ pageextension 99001529 "Subc. Trans. Order Sub." extends "Transfer Order Subform { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; } } addafter("Receipt Date") { field("Subc. Purch. Order No."; Rec."Subc. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Purch. Order Line No."; Rec."Subc. Purch. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Prod. Order No."; Rec."Subc. Prod. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Prod. Order Line No."; Rec."Subc. Prod. Order Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Prod. Ord. Comp. Line No."; Rec."Subc. Prod. Ord. Comp Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Routing No."; Rec."Subc. Routing No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Routing Reference No."; Rec."Subc. Routing Reference No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. WorkCenter No."; Rec."Subc. Work Center No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Subc. Operation No."; Rec."Subc. Operation No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } @@ -104,7 +104,7 @@ pageextension 99001529 "Subc. Trans. Order Sub." extends "Transfer Order Subform Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -115,7 +115,7 @@ pageextension 99001529 "Subc. Trans. Order Sub." extends "Transfer Order Subform } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -126,7 +126,7 @@ pageextension 99001529 "Subc. Trans. Order Sub." extends "Transfer Order Subform } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -137,7 +137,7 @@ pageextension 99001529 "Subc. Trans. Order Sub." extends "Transfer Order Subform } action("Purchase Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Purchase Order'; Image = Order; ToolTip = 'View the related subcontracting purchase order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferLines.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferLines.PageExt.al index a39073152c..0841fd4d42 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferLines.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferLines.PageExt.al @@ -14,13 +14,13 @@ pageextension 99001530 "Subc. Transfer Lines" extends "Transfer Lines" { field("Subc. Return Order"; Rec."Subc. Return Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; Visible = false; } field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferOrder.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferOrder.PageExt.al index 0fbc77695d..2239163ac3 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferOrder.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Transfer/SubcTransferOrder.PageExt.al @@ -18,48 +18,48 @@ pageextension 99001526 "Subc. Transfer Order" extends "Transfer Order" { field("Subc. Source Type"; Rec."Subc. Source Type") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies for which source type the transfer order is related to.'; Visible = false; } field(SourceSubtype; Rec."Source Subtype") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies which source subtype the transfer order is related to.'; Visible = false; } field(SourceID; Rec."Source ID") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies which source ID the transfer order is related to.'; Visible = false; } field(SourceRefNo; Rec."Source Ref. No.") { - ApplicationArea = Location; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies a reference number for the line, which the transfer order is related to.'; Visible = false; } field("Subc. Return Order"; Rec."Subc. Return Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Editable = false; ToolTip = 'Specifies whether the existing transfer order is a return of the subcontractor.'; Visible = false; } field("Subcontr. Purch. Order No."; Rec."Subcontr. Purch. Order No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order.'; Visible = false; } field("Subcontr. PO Line No."; Rec."Subcontr. PO Line No.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of the related purchase order line.'; Visible = false; } @@ -68,7 +68,7 @@ pageextension 99001526 "Subc. Transfer Order" extends "Transfer Order" { part("Subc. Transfer Line Factbox"; "Subc. Transfer Line Factbox") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Provider = TransferLines; SubPageLink = "Document No." = field("Document No."), "Line No." = field("Line No."); Visible = ShowSubcontractingFactBox; @@ -80,20 +80,32 @@ pageextension 99001526 "Subc. Transfer Order" extends "Transfer Order" var ShowSubcontractingFactBox: Boolean; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + SubcontractingEnabled: Boolean; trigger OnOpenPage() begin + SubcontractingEnabled := SubcFeatureFlagHandler.IsSubcontractingEnabled(); + if not SubcontractingEnabled then + exit; + ShowSubcontractingFactBox := Rec."Subc. Source Type" = Rec."Subc. Source Type"::Subcontracting; EsEnableTransferFields := not IsPartiallyShipped(); end; trigger OnAfterGetCurrRecord() begin + if not SubcontractingEnabled then + exit; + ShowSubcontractingFactBox := Rec."Subc. Source Type" = Rec."Subc. Source Type"::Subcontracting; end; trigger OnAfterGetRecord() begin + if not SubcontractingEnabled then + exit; + EsEnableTransferFields := not IsPartiallyShipped(); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseRcptSub.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseRcptSub.PageExt.al index 1cd17dcc52..8495965e7a 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseRcptSub.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseRcptSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001545 "Subc. Pstd. Whse Rcpt Sub" extends "Posted Whse. Receipt { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseShipmSub.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseShipmSub.PageExt.al index 0ce6b9381e..9a13e3168f 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseShipmSub.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcPstdWhseShipmSub.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001546 "Subc. Pstd. Whse Shipm Sub" extends "Posted Whse. Shipme { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptLinesExt.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptLinesExt.PageExt.al index aa69113fa3..06be6e6c90 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptLinesExt.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptLinesExt.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } @@ -29,7 +29,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -41,7 +41,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -53,7 +53,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -65,7 +65,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines } action("Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Transfer Order'; Image = TransferOrder; ToolTip = 'View the related transfer order.'; @@ -77,7 +77,7 @@ pageextension 99001534 "Subc. Whse Rcpt Lines Ext." extends "Whse. Receipt Lines } action("Return Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Return Transfer Order'; Image = ReturnRelated; ToolTip = 'View the related return transfer order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptSubformExt.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptSubformExt.PageExt.al index 5229aaa512..9892ed621c 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptSubformExt.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseRcptSubformExt.PageExt.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } @@ -33,7 +33,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub Caption = 'Production'; action("Production Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order'; Image = Production; ToolTip = 'View the related production order.'; @@ -45,7 +45,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub } action("Production Order Routing") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Routing'; Image = Route; ToolTip = 'View the related production order routing.'; @@ -57,7 +57,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub } action("Production Order Components") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Production Order Components'; Image = Components; ToolTip = 'View the related production order components.'; @@ -69,7 +69,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub } action("Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Transfer Order'; Image = TransferOrder; ToolTip = 'View the related transfer order.'; @@ -81,7 +81,7 @@ pageextension 99001533 "Subc. Whse Rcpt Subform Ext." extends "Whse. Receipt Sub } action("Return Transfer Order") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Return Transfer Order'; Image = ReturnRelated; ToolTip = 'View the related return transfer order.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseShipmSubformExt.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseShipmSubformExt.PageExt.al index 8737758e04..792ed60d43 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseShipmSubformExt.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Warehouse/SubcWhseShipmSubformExt.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001547 "Subc. Whse Shipm. Subform Ext." extends "Whse. Shipment { field("Transfer WIP Item"; Rec."Transfer WIP Item") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Visible = false; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcProdOrderComponents.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcProdOrderComponents.Page.al index e4ecb9f97b..f7482c07c6 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcProdOrderComponents.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcProdOrderComponents.Page.al @@ -8,7 +8,7 @@ using Microsoft.Manufacturing.Document; page 99001503 "Subc. Prod. Order Components" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Prod. Order Comp. Line List'; Editable = false; PageType = List; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcPurchaseLineFactbox.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcPurchaseLineFactbox.Page.al index e27ea61397..8297924093 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcPurchaseLineFactbox.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcPurchaseLineFactbox.Page.al @@ -8,7 +8,7 @@ using Microsoft.Purchases.Document; page 99001518 "Subc. Purchase Line Factbox" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Details'; Editable = false; PageType = CardPart; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcRoutingInfoFactbox.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcRoutingInfoFactbox.Page.al index ebe1809606..9b19c32709 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcRoutingInfoFactbox.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcRoutingInfoFactbox.Page.al @@ -8,7 +8,7 @@ using Microsoft.Manufacturing.Document; page 99001502 "Subc. Routing Info Factbox" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Routing Details'; Editable = false; PageType = CardPart; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcSubcontractingWorksheet.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcSubcontractingWorksheet.Page.al index 1440ebbf11..ff7aeb6fc5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcSubcontractingWorksheet.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcSubcontractingWorksheet.Page.al @@ -13,7 +13,7 @@ using System.Security.User; page 99001504 "Subc. Subcontracting Worksheet" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; AutoSplitKey = true; Caption = 'Subcontracting Worksheets'; DataCaptionFields = "Journal Batch Name"; @@ -29,7 +29,6 @@ page 99001504 "Subc. Subcontracting Worksheet" { field(CurrentJnlBatchName; CurrentJnlBatchName) { - ApplicationArea = Manufacturing; Caption = 'Name'; Lookup = true; ToolTip = 'Specifies the name of the journal batch of the subcontracting worksheet.'; @@ -52,7 +51,6 @@ page 99001504 "Subc. Subcontracting Worksheet" ShowCaption = false; field(Type; Rec.Type) { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the type of requisition worksheet line you are creating.'; trigger OnValidate() @@ -62,7 +60,6 @@ page 99001504 "Subc. Subcontracting Worksheet" } field("No."; Rec."No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.'; trigger OnValidate() @@ -76,43 +73,35 @@ page 99001504 "Subc. Subcontracting Worksheet" } field("Accept Action Message"; Rec."Accept Action Message") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies whether to accept the action message proposed for the line.'; } field("Action Message"; Rec."Action Message") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies an action to take to rebalance the demand-supply situation.'; } field("Prod. Order No."; Rec."Prod. Order No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number of the related production order.'; } field("Operation No."; Rec."Operation No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the operation number for this routing line.'; } field("Work Center No."; Rec."Work Center No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the work center number of the journal line.'; } field(Description; Rec.Description) { - ApplicationArea = Manufacturing; ToolTip = 'Specifies text that describes the entry.'; } field("Description 2"; Rec."Description 2") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies additional text describing the entry, or a remark about the requisition worksheet line.'; Visible = false; } field("Variant Code"; Rec."Variant Code") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the variant of the item on the line.'; Visible = false; ShowMandatory = VariantCodeMandatory; @@ -145,17 +134,14 @@ page 99001504 "Subc. Subcontracting Worksheet" } field(Quantity; Rec.Quantity) { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number of units of the item.'; } field("Unit of Measure Code"; Rec."Unit of Measure Code") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies how each unit of the item or resource is measured, such as in pieces or hours. By default, the value in the Base Unit of Measure field on the item or resource card is inserted.'; } field("Vendor No."; Rec."Vendor No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number of the vendor who will ship the items in the purchase order.'; trigger OnValidate() @@ -165,30 +151,25 @@ page 99001504 "Subc. Subcontracting Worksheet" } field("Order Address Code"; Rec."Order Address Code") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the order address of the related vendor.'; Visible = false; } field("Vendor Item No."; Rec."Vendor Item No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number that the vendor uses for this item.'; } field("Sell-to Customer No."; Rec."Sell-to Customer No.") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the number of the customer.'; Visible = false; } field("Ship-to Code"; Rec."Ship-to Code") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies a code for an alternate shipment address if you want to ship to another address than the one that has been entered automatically. This field is also used in case of drop shipment.'; Visible = false; } field("Currency Code"; Rec."Currency Code") { - ApplicationArea = Manufacturing; AssistEdit = true; ToolTip = 'Specifies the currency code for the requisition lines.'; Visible = false; @@ -206,63 +187,52 @@ page 99001504 "Subc. Subcontracting Worksheet" } field("Direct Unit Cost"; Rec."Direct Unit Cost") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the cost of one unit of the selected item or resource.'; } field("Line Discount %"; Rec."Line Discount %") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the discount percentage used to calculate the purchase line discount.'; Visible = false; } field("Order Date"; Rec."Order Date") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the order date that will apply to the requisition worksheet line.'; Visible = false; } field("Due Date"; Rec."Due Date") { - ApplicationArea = Manufacturing; ToolTip = 'Specifies the date when you can expect to receive the items.'; } field("Requester ID"; Rec."Requester ID") { - ApplicationArea = Manufacturing; LookupPageID = "User Lookup"; ToolTip = 'Specifies the ID of the user who is ordering the items on the line.'; Visible = false; } field(Confirmed; Rec.Confirmed) { - ApplicationArea = Manufacturing; ToolTip = 'Specifies whether the items on the line have been approved for purchase.'; Visible = false; } field("Subc. Standard Task Code"; Rec."Subc. Standard Task Code") { - ApplicationArea = Manufacturing; } field("Subc. Pricelist Cost"; Rec."Subc. Pricelist Cost") { - ApplicationArea = Manufacturing; Visible = false; } field("Subc. UoM for Pricelist"; Rec."Subc. UoM for Pricelist") { - ApplicationArea = Manufacturing; Visible = false; } field("PL UM Qty/Base UM Qty"; Rec."PL UM Qty/Base UM Qty") { AutoFormatType = 0; - ApplicationArea = Manufacturing; Visible = false; } field("Base UM Qty/PL UM Qty"; Rec."Base UM Qty/PL UM Qty") { AutoFormatType = 0; - ApplicationArea = Manufacturing; Visible = false; } } @@ -277,7 +247,6 @@ page 99001504 "Subc. Subcontracting Worksheet" Caption = 'Description'; field(Description2; Description2) { - ApplicationArea = Manufacturing; Editable = false; ShowCaption = false; ToolTip = 'Specifies an additional part of the worksheet description.'; @@ -288,7 +257,6 @@ page 99001504 "Subc. Subcontracting Worksheet" Caption = 'Buy-from Vendor Name'; field(BuyFromVendorName; BuyFromVendorName) { - ApplicationArea = Manufacturing; Caption = 'Buy-from Vendor Name'; Editable = false; ToolTip = 'Specifies the vendor''s name.'; @@ -322,7 +290,6 @@ page 99001504 "Subc. Subcontracting Worksheet" Image = Line; action(Card) { - ApplicationArea = Manufacturing; Caption = 'Card'; Image = EditLines; RunObject = Codeunit "Req. Wksh.-Show Card"; @@ -367,7 +334,6 @@ page 99001504 "Subc. Subcontracting Worksheet" Image = "Action"; action("Calculate Subcontracts") { - ApplicationArea = Manufacturing; Caption = 'Calculate Subcontracts'; Ellipsis = true; Image = Calculate; @@ -383,7 +349,6 @@ page 99001504 "Subc. Subcontracting Worksheet" } action(CarryOutActionMessage) { - ApplicationArea = Manufacturing; Caption = 'Carry Out Action Message'; Ellipsis = true; Image = CarryOutActionMessage; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcTransferLineFactbox.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcTransferLineFactbox.Page.al index f6da4b964a..4448ef9ad3 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcTransferLineFactbox.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcTransferLineFactbox.Page.al @@ -8,7 +8,7 @@ using Microsoft.Inventory.Transfer; page 99001501 "Subc. Transfer Line Factbox" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Details'; Editable = false; PageType = CardPart; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcontractorPrices.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcontractorPrices.Page.al index 0d8026e5e1..6b451c5ed5 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcontractorPrices.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Pages/SubcontractorPrices.Page.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ using System.Text; page 99001500 "Subcontractor Prices" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; DataCaptionExpression = GetCaption(); DelayedInsert = true; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCalculateSubcontracts.Report.al b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCalculateSubcontracts.Report.al index 2fe0e65a29..f35c9c3f31 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCalculateSubcontracts.Report.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCalculateSubcontracts.Report.al @@ -12,11 +12,13 @@ using Microsoft.Inventory.Item.Catalog; using Microsoft.Inventory.Requisition; using Microsoft.Manufacturing.Document; using Microsoft.Manufacturing.Setup; +using Microsoft.Manufacturing.Subcontracting; using Microsoft.Manufacturing.WorkCenter; using Microsoft.Purchases.Document; report 99001505 "Subc. Calculate Subcontracts" { + ApplicationArea = Subcontracting; Caption = 'Calculate Subcontracts'; ProcessingOnly = true; @@ -80,7 +82,11 @@ report 99001505 "Subc. Calculate Subcontracts" } trigger OnInitReport() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + CurrReport.Quit(); MfgSetup.Get(); end; @@ -110,6 +116,7 @@ report 99001505 "Subc. Calculate Subcontracts" ItemVariant: Record "Item Variant"; TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; MfgCostCalcMgt: Codeunit "Mfg. Cost Calculation Mgt."; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; UOMMgt: Codeunit "Unit of Measure Management"; Window: Dialog; BaseQtyToPurch: Decimal; @@ -123,6 +130,8 @@ report 99001505 "Subc. Calculate Subcontracts" procedure SetWkShLine(NewReqLine: Record "Requisition Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; ReqLine := NewReqLine; end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateSubCReturnOrder.Report.al b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateSubCReturnOrder.Report.al index 82d7d19d36..e3bdf358cf 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateSubCReturnOrder.Report.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateSubCReturnOrder.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -14,7 +14,7 @@ using Microsoft.Purchases.Vendor; report 99001502 "Subc. Create SubCReturnOrder" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Subcontracting Return Order'; ProcessingOnly = true; UsageCategory = Tasks; @@ -61,6 +61,13 @@ report 99001502 "Subc. Create SubCReturnOrder" } } + trigger OnInitReport() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + CurrReport.Quit(); + end; var TransferHeader: Record "Transfer Header"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateTransfOrder.Report.al b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateTransfOrder.Report.al index fb50f94383..977794c64f 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateTransfOrder.Report.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcCreateTransfOrder.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -15,7 +15,7 @@ using Microsoft.Purchases.Vendor; report 99001501 "Subc. Create Transf. Order" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Create Subcontracting Transfer Order'; ProcessingOnly = true; UsageCategory = Tasks; @@ -59,6 +59,13 @@ report 99001501 "Subc. Create Transf. Order" end; } } + trigger OnInitReport() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + CurrReport.Quit(); + end; var TransferHeader: Record "Transfer Header"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDetailedCalculation.Report.al b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDetailedCalculation.Report.al index c0b586b781..3d6c6e1c46 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDetailedCalculation.Report.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDetailedCalculation.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -16,7 +16,7 @@ using System.Utilities; report 99001500 "Subc. Detailed Calculation" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Detailed Calculation'; DefaultLayout = RDLC; RDLCLayout = 'src\Process\Reports\Rep99001500.SubcDetailedCalculation.rdl'; @@ -422,7 +422,7 @@ report 99001500 "Subc. Detailed Calculation" Caption = 'Options'; field(CalculationDate; CalculateDate) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Calculation Date'; ToolTip = 'Specifies the specific date for which to get the cost list. The standard entry in this field is the working date.'; } @@ -438,7 +438,11 @@ report 99001500 "Subc. Detailed Calculation" end; } trigger OnInitReport() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + CurrReport.Quit(); ManufacturingSetup.Get(); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDispatchingList.Report.al b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDispatchingList.Report.al index 89dc8ddd23..ce6d8fcec8 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDispatchingList.Report.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Reports/SubcDispatchingList.Report.al @@ -1,4 +1,4 @@ -// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // ------------------------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ using System.Utilities; report 99001504 "Subc. Dispatching List" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor - Dispatch List'; DefaultLayout = Word; PreviewMode = PrintLayout; @@ -1570,33 +1570,33 @@ report 99001504 "Subc. Dispatching List" Caption = 'Options'; field(ArchiveDocument; ShouldArchiveDocument) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Archive Document'; ToolTip = 'Specifies whether to archive the order.'; Visible = false; } field(LogInteraction; ShouldLogInteraction) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Log Interaction'; Enabled = LogInteractionEnable; ToolTip = 'Specifies if you want to log this interaction.'; } field(SubcPrintAddressLine; PrintAddressLine) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Show Address Line'; ToolTip = 'Specifies if the address line is shown.'; } field(SubcPrintFooterLine; PrintFooterLine) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Show Footer Line'; ToolTip = 'Specifies if the footer line is shown.'; } field(SubcPrintBarCode; PrintBarCode) { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Show Bar Code'; ToolTip = 'Specifies if the Barcode is shown.'; } @@ -1615,7 +1615,11 @@ report 99001504 "Subc. Dispatching List" end; } trigger OnInitReport() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + CurrReport.Quit(); GLSetup.Get(); CompanyInformation.Get(); PurchasesPayablesSetup.Get(); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcPlanningCompExt.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcPlanningCompExt.TableExt.al index 923e11f465..33d9b84d73 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcPlanningCompExt.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcPlanningCompExt.TableExt.al @@ -22,8 +22,11 @@ tableextension 99001503 "Subc. Planning Comp Ext." extends "Planning Component" trigger OnValidate() var Item: Record Item; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Component Supply Method" = "Component Supply Method"::"Transfer to Vendor" then if "Item No." <> '' then begin Item.Get("Item No."); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdBOMLineExt.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdBOMLineExt.TableExt.al index c9a1d0ce43..f57d0e668a 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdBOMLineExt.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdBOMLineExt.TableExt.al @@ -20,7 +20,10 @@ tableextension 99001531 "Subc. Prod BOM Line Ext." extends "Production BOM Line" trigger OnValidate() var Item: Record Item; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Component Supply Method" = "Component Supply Method"::"Transfer to Vendor" then if (Type = Type::Item) and ("No." <> '') then begin Item.Get("No."); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderCompExt.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderCompExt.TableExt.al index 350b508c7c..9e247e3a8e 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderCompExt.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderCompExt.TableExt.al @@ -25,8 +25,11 @@ tableextension 99001502 "Subc. Prod Order Comp Ext." extends "Prod. Order Compon trigger OnValidate() var Item: Record Item; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; SubcontractingManagement: Codeunit "Subcontracting Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Component Supply Method" = "Component Supply Method"::"Transfer to Vendor" then if "Item No." <> '' then begin Item.Get("Item No."); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderRtngLineExt.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderRtngLineExt.TableExt.al index 2aabbb1127..f5af73099f 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderRtngLineExt.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcProdOrderRtngLineExt.TableExt.al @@ -19,7 +19,11 @@ tableextension 99001506 "Subc. ProdOrderRtngLine Ext." extends "Prod. Order Rout modify(Type) { trigger OnAfterValidate() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if Type = xRec.Type then exit; @@ -32,7 +36,10 @@ tableextension 99001506 "Subc. ProdOrderRtngLine Ext." extends "Prod. Order Rout trigger OnAfterValidate() var WorkCenter: Record "Work Center"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "No." = xRec."No." then exit; if Type <> "Capacity Type"::"Work Center" then begin @@ -163,7 +170,10 @@ tableextension 99001506 "Subc. ProdOrderRtngLine Ext." extends "Prod. Order Rout var ProdOrderLine: Record "Prod. Order Line"; PurchLine: Record "Purchase Line"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if Status <> "Production Order Status"::Released then exit; @@ -198,7 +208,10 @@ tableextension 99001506 "Subc. ProdOrderRtngLine Ext." extends "Prod. Order Rout ProdOrderLine: Record "Prod. Order Line"; PurchLine: Record "Purchase Line"; PrevProdOrderRoutingLine: Record "Prod. Order Routing Line"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if Status <> "Production Order Status"::Released then exit; ProdOrderLine.SetLoadFields(SystemId); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcRoutingLine.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcRoutingLine.TableExt.al index 3b705bbd8b..8f062be155 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcRoutingLine.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Manufacturing/SubcRoutingLine.TableExt.al @@ -16,7 +16,12 @@ tableextension 99001560 "Subc. Routing Line" extends "Routing Line" modify(Type) { trigger OnAfterValidate() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Type = xRec.Type then exit; @@ -29,7 +34,10 @@ tableextension 99001560 "Subc. Routing Line" extends "Routing Line" trigger OnAfterValidate() var WorkCenter: Record "Work Center"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "No." = xRec."No." then exit; if Type <> "Capacity Type"::"Work Center" then begin @@ -59,7 +67,11 @@ tableextension 99001560 "Subc. Routing Line" extends "Routing Line" ToolTip = 'Specifies whether the production order parent item (WIP item) is transferred to the subcontractor for this operation.'; trigger OnValidate() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Transfer WIP Item" then begin CalcFields(Subcontracting); TestField(Subcontracting, true); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/MasterData/SubcVendor.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/MasterData/SubcVendor.TableExt.al index 3d38f760fa..9c0c215ccc 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/MasterData/SubcVendor.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/MasterData/SubcVendor.TableExt.al @@ -21,8 +21,11 @@ tableextension 99001507 "Subc. Vendor" extends Vendor trigger OnValidate() var Location: Record Location; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; ErrorInfo: ErrorInfo; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Subc. Location Code" = '' then exit; Location.Get("Subc. Location Code"); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcPurchaseLine.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcPurchaseLine.TableExt.al index 4609112c37..1270d861dc 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcPurchaseLine.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcPurchaseLine.TableExt.al @@ -21,6 +21,9 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" { trigger OnBeforeValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SetSubcontractingLineType(); end; } @@ -28,6 +31,9 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" { trigger OnAfterValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + SetSubcontractingLineType(); end; } @@ -110,11 +116,15 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" { key(SubcPurchLineKey; "Subc. Purchase Line Type") { } } + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; procedure GetQuantityPerUOM(): Decimal var ItemUnitofMeasure: Record "Item Unit of Measure"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); ItemUnitofMeasure.SetLoadFields("Qty. per Unit of Measure"); ItemUnitofMeasure.Get("No.", "Unit of Measure Code"); exit(ItemUnitofMeasure."Qty. per Unit of Measure"); @@ -124,6 +134,8 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" var ItemUnitofMeasure: Record "Item Unit of Measure"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); ItemUnitofMeasure.SetLoadFields("Qty. per Unit of Measure"); ItemUnitofMeasure.Get("No.", "Unit of Measure Code"); exit(Round(Quantity * ItemUnitofMeasure."Qty. per Unit of Measure", 0.00001)); @@ -143,6 +155,8 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" UOMMgt: Codeunit "Unit of Measure Management"; QtyPerUoM: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); Testfield(Type, "Purchase Line Type"::Item); Item.Get(Rec."No."); QtyPerUoM := UOMMgt.GetQtyPerUnitOfMeasure(Item, Rec."Unit of Measure Code"); @@ -160,6 +174,8 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" ProdOrderRoutingLine: Record "Prod. Order Routing Line"; IsValidLine: Boolean; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); if Rec."Operation No." = '' then exit(false); ProductionOrder.SetLoadFields("Source Type"); @@ -180,6 +196,8 @@ tableextension 99001512 "Subc. Purchase Line" extends "Purchase Line" ProdOrderRoutingLine: Record "Prod. Order Routing Line"; IsValidLine: Boolean; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); ProdOrderRoutingLine.SetLoadFields("Next Operation No."); IsValidLine := ProdOrderRoutingLine.Get("Production Order Status"::Released, Rec."Prod. Order No.", Rec."Routing Reference No.", Rec."Routing No.", Rec."Operation No."); IsValidLine := IsValidLine and (ProdOrderRoutingLine."Next Operation No." = ''); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcRequisitionLine.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcRequisitionLine.TableExt.al index 9e27f3b678..a5189b4d03 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcRequisitionLine.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Purchase/SubcRequisitionLine.TableExt.al @@ -24,6 +24,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" ToolTip = 'Specifies the code that is assigned to the standard task.'; trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if (Type = Type::Item) and ("No." <> '') and ("Prod. Order No." <> '') and @@ -51,6 +53,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" ToolTip = 'Specifies the quantity of the price list unit of measure or the base unit of measure.'; trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if (CurrFieldNo = FieldNo("PL UM Qty/Base UM Qty")) and ("Prod. Order No." <> '') and (Type = Type::Item) and @@ -69,6 +73,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" ToolTip = 'Specifies the unit of measure for the price list that is on the subcontracting worksheet.'; trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if (CurrFieldNo = FieldNo("Subc. UoM for Pricelist")) and ("Prod. Order No." <> '') and (Type = Type::Item) @@ -104,10 +110,15 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" end; } } + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + procedure GetQuantityForUOM(): Decimal var ItemUnitofMeasure: Record "Item Unit of Measure"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); ItemUnitofMeasure.Get("No.", "Unit of Measure Code"); exit(ItemUnitofMeasure."Qty. per Unit of Measure"); end; @@ -116,6 +127,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" var ItemUnitofMeasure: Record "Item Unit of Measure"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); ItemUnitofMeasure.Get("No.", "Unit of Measure Code"); exit(Round(Quantity * ItemUnitofMeasure."Qty. per Unit of Measure", 0.00001)); end; @@ -124,6 +137,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if (Type = Type::Item) and ("No." <> '') and ("Prod. Order No." <> '') then SubcPriceManagement.GetSubcPriceForReqLine(Rec, ''); end; @@ -132,6 +147,8 @@ tableextension 99001510 "Subc. RequisitionLine" extends "Requisition Line" var SubcPriceManagement: Codeunit "Subc. Price Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if (Type = Type::Item) and ("No." <> '') and ("Prod. Order No." <> '') then SubcPriceManagement.GetSubcPriceForReqLine(Rec, "Subc. UoM for Pricelist"); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcDirectTransHeaderExt.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcDirectTransHeaderExt.TableExt.al index c762c6d59f..ea018dcc6a 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcDirectTransHeaderExt.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcDirectTransHeaderExt.TableExt.al @@ -29,7 +29,11 @@ tableextension 99001524 "Subc. DirectTransHeader Ext." extends "Direct Trans. He Caption = 'Source ID'; DataClassification = CustomerContent; trigger OnLookup() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; HandleSubcontractingSourceLookup(Rec); end; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferHeader.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferHeader.TableExt.al index 967110530d..49e23d884a 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferHeader.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferHeader.TableExt.al @@ -38,7 +38,11 @@ tableextension 99001520 "Subc. Transfer Header" extends "Transfer Header" Caption = 'Source ID'; DataClassification = CustomerContent; trigger OnLookup() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; HandleSubcontractingSourceLookup(Rec); end; } @@ -91,7 +95,11 @@ tableextension 99001520 "Subc. Transfer Header" extends "Transfer Header" end; procedure CheckDirectTransferPosting() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TestField("Transfer-to Code"); end; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferLine.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferLine.TableExt.al index 83c3e9ed72..4936aee578 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferLine.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferLine.TableExt.al @@ -102,6 +102,8 @@ tableextension 99001517 "Subc. Transfer Line" extends "Transfer Line" Item: Record Item; UnitOfMeasureManagement: Codeunit "Unit of Measure Management"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Transfer WIP Item" then begin CheckForExistingReservationsOrItemTracking(); "Qty. per Unit of Measure" := 0; @@ -163,6 +165,9 @@ tableextension 99001517 "Subc. Transfer Line" extends "Transfer Line" key(Key99001504; "Subc. Prod. Order No.", "Subc. Prod. Order Line No.", "Subc. Prod. Ord. Comp Line No.", "Subc. Purch. Order No.", "Subc. Return Order") { } } + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + internal procedure CheckForExistingReservationsOrItemTracking() var ReservationEntry: Record "Reservation Entry"; @@ -170,6 +175,8 @@ tableextension 99001517 "Subc. Transfer Line" extends "Transfer Line" ExistingItemTrackingErr: Label 'There is existing item tracking for this transfer line. Please remove the item tracking before changing the line to/from a WIP item transfer.'; ExistingReservationEntriesErr: Label 'There are existing reservation entries for this transfer line. Please remove the reservation entries before changing the line to/from a WIP item transfer.'; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; Rec.SetReservationFilters(ReservationEntry, "Transfer Direction"::Outbound); ReservationEntry.SetRange("Reservation Status", "Reservation Status"::Reservation); if not ReservationEntry.IsEmpty() then @@ -198,6 +205,8 @@ tableextension 99001517 "Subc. Transfer Line" extends "Transfer Line" UnitOfMeasureManagement: Codeunit "Unit of Measure Management"; QtyPerUoM: Decimal; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; Item.SetLoadFields("Base Unit of Measure"); Item.Get("Item No."); QtyPerUoM := UnitOfMeasureManagement.GetQtyPerUnitOfMeasure(Item, "Unit of Measure Code"); @@ -208,6 +217,8 @@ tableextension 99001517 "Subc. Transfer Line" extends "Transfer Line" var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if Rec."Transfer WIP Item" then if ProdOrderRoutingLine.Get("Production Order Status"::Released, "Subc. Prod. Order No.", "Subc. Routing Reference No.", "Subc. Routing No.", "Subc. Operation No.") then begin Rec.Description := ProdOrderRoutingLine."Transfer Description"; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/Tables/SubcontractorPrice.Table.al b/src/Apps/W1/Subcontracting/App/src/Process/Tables/SubcontractorPrice.Table.al index 1212e33347..39127996f3 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/Tables/SubcontractorPrice.Table.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/Tables/SubcontractorPrice.Table.al @@ -30,6 +30,8 @@ table 99001500 "Subcontractor Price" var Vendor: Record Vendor; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if Vendor.Get("Vendor No.") then "Currency Code" := Vendor."Currency Code"; end; @@ -42,6 +44,8 @@ table 99001500 "Subcontractor Price" trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if "Item No." <> xRec."Item No." then begin "Unit of Measure Code" := ''; "Variant Code" := ''; @@ -69,6 +73,8 @@ table 99001500 "Subcontractor Price" Caption = 'Starting Date'; trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if ("Starting Date" > "Ending Date") and ("Ending Date" <> 0D) then Error(InvalidStartingDateErr, FieldCaption("Starting Date"), FieldCaption("Ending Date")); end; @@ -109,6 +115,8 @@ table 99001500 "Subcontractor Price" Caption = 'Ending Date'; trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; Validate("Starting Date"); end; } @@ -143,23 +151,30 @@ table 99001500 "Subcontractor Price" } trigger OnInsert() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TestField("Vendor No."); TestField("Item No."); end; trigger OnRename() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TestField("Vendor No."); TestField("Item No."); end; var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; InvalidStartingDateErr: Label '%1 cannot be after %2', Comment = '%1=Field Caption for starting date, %2=Field Caption for ending date'; procedure CopySubcontractorPriceToVendorsSubcontractorPrice(var SubcontractorPrice: Record "Subcontractor Price"; VendNo: Code[20]; WorkCenterNo: Code[20]) var NewSubcontractorPrice: Record "Subcontractor Price"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if SubcontractorPrice.FindSet() then repeat NewSubcontractorPrice := SubcontractorPrice; @@ -171,6 +186,8 @@ table 99001500 "Subcontractor Price" internal procedure DeletePricesForVendor(VendorNo: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; SetCurrentKey("Vendor No."); SetRange("Vendor No.", VendorNo); if not IsEmpty() then @@ -179,6 +196,8 @@ table 99001500 "Subcontractor Price" internal procedure DeletePricesForWorkCenter(WorkCenterNo: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; SetCurrentKey("Work Center No."); SetRange("Work Center No.", WorkCenterNo); if not IsEmpty() then @@ -187,6 +206,8 @@ table 99001500 "Subcontractor Price" internal procedure DeletePricesForItem(ItemNo: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; SetCurrentKey("Item No."); SetRange("Item No.", ItemNo); if not IsEmpty() then diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewBinding.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewBinding.Codeunit.al index bfc09eb401..00bc06e9f3 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewBinding.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewBinding.Codeunit.al @@ -8,6 +8,8 @@ using Microsoft.Finance.GeneralLedger.Preview; codeunit 99001565 "Subc. Posting Preview Binding" { + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Preview", OnAfterBindSubscription, '', true, false)] local procedure BindPostPrevEventHandlerOnAfterBindSubscription() @@ -25,6 +27,8 @@ codeunit 99001565 "Subc. Posting Preview Binding" var SubcPostingPreviewHandler: Codeunit "Subc. Pst. Prev. Event Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; SubcPostingPreviewHandler.DeleteAll(); exit(BindSubscription(SubcPostingPreviewHandler)); end; @@ -33,6 +37,8 @@ codeunit 99001565 "Subc. Posting Preview Binding" var SubcPostingPreviewHandler: Codeunit "Subc. Pst. Prev. Event Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; exit(UnbindSubscription(SubcPostingPreviewHandler)); end; } diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewSubscr.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewSubscr.Codeunit.al index 56d694f37e..a9af7b0bf0 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewSubscr.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPostingPreviewSubscr.Codeunit.al @@ -12,10 +12,13 @@ codeunit 99001566 "Subc. Posting Preview Subscr." var TempSubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry" temporary; PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Posting Preview Event Handler", OnGetEntries, '', true, false)] local procedure GetEntriesOnGetEntries(TableNo: Integer; var RecRef: RecordRef) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; GetAllTables(); case TableNo of Database::"Subcontractor WIP Ledger Entry": @@ -26,6 +29,8 @@ codeunit 99001566 "Subc. Posting Preview Subscr." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Posting Preview Event Handler", OnAfterShowEntries, '', true, false)] local procedure ShowEntriesOnAfterShowEntries(TableNo: Integer) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; GetAllTables(); case TableNo of Database::"Subcontractor WIP Ledger Entry": @@ -36,6 +41,8 @@ codeunit 99001566 "Subc. Posting Preview Subscr." [EventSubscriber(ObjectType::Codeunit, Codeunit::"Posting Preview Event Handler", OnAfterFillDocumentEntry, '', true, false)] local procedure FillDocumentEntryOnAfterFillDocumentEntry(var DocumentEntry: Record "Document Entry") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; GetAllTables(); PostingPreviewEventHandler.InsertDocumentEntry(TempSubcontractorWIPLedgerEntry, DocumentEntry); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPstPrevEventHandler.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPstPrevEventHandler.Codeunit.al index 8d3e2d8ad8..27493e8513 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPstPrevEventHandler.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/Posting Preview/SubcPstPrevEventHandler.Codeunit.al @@ -12,10 +12,14 @@ codeunit 99001567 "Subc. Pst. Prev. Event Handler" var TempSubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry" temporary; DocumentMaskTok: Label '***', Locked = true; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; [EventSubscriber(ObjectType::Table, Database::"Subcontractor WIP Ledger Entry", OnAfterInsertEvent, '', false, false)] local procedure OnInsertWIPEntry(var Rec: Record "Subcontractor WIP Ledger Entry") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + if Rec.IsTemporary() then exit; @@ -29,12 +33,16 @@ codeunit 99001567 "Subc. Pst. Prev. Event Handler" procedure DeleteAll() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TempSubcontractorWIPLedgerEntry.Reset(); TempSubcontractorWIPLedgerEntry.DeleteAll(); end; procedure GetTempSubcontractorWIPLedgerEntry(var OutTempSubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry" temporary) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; OutTempSubcontractorWIPLedgerEntry.Copy(TempSubcontractorWIPLedgerEntry, true); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeProdOrderStatus.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeProdOrderStatus.Codeunit.al index 9ec3e75028..597b017a5d 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeProdOrderStatus.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeProdOrderStatus.Codeunit.al @@ -11,9 +11,14 @@ codeunit 99001549 "Subc. Change Prod.Order Status" { Permissions = TableData "Subcontractor WIP Ledger Entry" = RIMD; + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + [EventSubscriber(ObjectType::Page, Page::"Change Status on Prod. Order", OnAfterSet, '', false, false)] local procedure SetSubcontractingProductionOrderOnAfterSetSubcontractingWIPEntriesAffected(var Sender: Page "Change Status on Prod. Order"; ProdOrder: Record "Production Order"; var PostingDate: Date; var ReqUpdUnitCost: Boolean; var ProductionOrderStatus: Record "Production Order"; var FirmPlannedStatusEditable: Boolean; var ReleasedStatusEditable: Boolean; var FinishedStatusEditable: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; Sender.SubcSetOrder(ProdOrder); end; @@ -26,6 +31,8 @@ codeunit 99001549 "Subc. Change Prod.Order Status" NewPostingDate: Date; NewStatus: Enum "Production Order Status"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if ChangeStatusOnProdOrder.ReturnSubWIPQuantityCleanUp() then begin ChangeStatusOnProdOrder.ReturnPostingInfo(NewStatus, NewPostingDate, NewUpdateUnitCost, FinishOrderWithoutOutput); SubcTransferWIPPosting.CreateAdjustmentWIPEntriesOnFinishProdOrder(ChangeStatusOnProdOrder.SubcGetOrder(), NewPostingDate); @@ -35,18 +42,24 @@ codeunit 99001549 "Subc. Change Prod.Order Status" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Status Management", OnAfterTransferRelatedTablesToReleasedProdOrder, '', false, false)] local procedure ReopenWIPEntriesOnAfterTransferRelatedTablesToReleasedProdOrder(ProductionOrder: Record "Production Order") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; ReopenWIPEntries(ProductionOrder); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Status Management", OnBeforeChangeStatusOnProdOrder, '', false, false)] local procedure CheckForOpenTransferOrdersOnBeforeChangeStatusOnProdOrder(var ProductionOrder: Record "Production Order"; NewStatus: Option; var IsHandled: Boolean; NewPostingDate: Date; NewUpdateUnitCost: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; CheckForOpenTransferOrders(ProductionOrder); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Status Management", OnAfterChangeStatusOnProdOrder, '', false, false)] local procedure UpdateWIPLedgerEntryProdOrderRelationOnAfterChangeStatus(var ProdOrder: Record "Production Order"; var ToProdOrder: Record "Production Order"; NewStatus: Enum "Production Order Status"; NewPostingDate: Date; NewUpdateUnitCost: Boolean; var SuppressCommit: Boolean; xProductionOrder: Record "Production Order") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; UpdateWIPLedgerEntryProdOrderRelation(xProductionOrder, ToProdOrder, NewStatus); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeStatusProdOrder.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeStatusProdOrder.PageExt.al index b2d4d08165..4c2860a163 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeStatusProdOrder.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcChangeStatusProdOrder.PageExt.al @@ -1,76 +1,89 @@ -// ------------------------------------------------------------------------------------------------ -// 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; - -using Microsoft.Manufacturing.Document; -pageextension 99001544 "Subc.Change Status Prod. Order" extends "Change Status on Prod. Order" -{ - layout - { - addafter("Finish Order without Output") - { - field("WIP Quantity Clean Up"; WIPQuantityCleanUp) - { - ApplicationArea = Manufacturing; - Enabled = WIPQuantityCleanUpEnabled; - Visible = WIPQuantityCleanUpVisible; - Caption = 'WIP Quantity Clean Up'; - ToolTip = 'Specifies whether the WIP quantity on the production order should be set to zero. When enabled, the WIP quantity on the production order will be set to zero. This is used when the production order is finished but there is still WIP quantity that needs to be cleaned up.'; - } - } - } - - trigger OnOpenPage() - begin - WIPQuantityCleanUp := true; - end; - - trigger OnAfterGetCurrRecord() - begin - SetControlProperties(); - end; - - protected var - WIPQuantityCleanUp: Boolean; - - var - ProductionOrder: Record "Production Order"; - WIPQuantityCleanUpEnabled, WIPQuantityCleanUpVisible : Boolean; - - procedure ReturnSubWIPQuantityCleanUp(): Boolean - begin - exit(WIPQuantityCleanUp); - end; - - procedure SubcSetOrder(var ProductionOrderForStatusChange: Record "Production Order") - begin - ProductionOrder := ProductionOrderForStatusChange; - SetControlProperties(); - end; - - procedure SubcGetOrder() ProductionOrderForStatusChange: Record "Production Order" - begin - ProductionOrderForStatusChange := ProductionOrder; - end; - - local procedure SetControlProperties() - var - SubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry"; - begin - if ProductionOrder.Status <> "Production Order Status"::Released then begin - WIPQuantityCleanUpEnabled := false; - WIPQuantityCleanUpVisible := false; - WIPQuantityCleanUp := false; - exit; - end; - SubcontractorWIPLedgerEntry.SetCurrentKey("Prod. Order No.", "Prod. Order Status", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", "Location Code"); - SubcontractorWIPLedgerEntry.SetRange("Prod. Order No.", ProductionOrder."No."); - SubcontractorWIPLedgerEntry.SetRange("Prod. Order Status", "Production Order Status"::Released); - WIPQuantityCleanUpEnabled := not SubcontractorWIPLedgerEntry.IsEmpty(); - WIPQuantityCleanUpVisible := WIPQuantityCleanUpEnabled; - if not WIPQuantityCleanUpEnabled then - WIPQuantityCleanUp := false; - end; +// ------------------------------------------------------------------------------------------------ +// 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; + +using Microsoft.Manufacturing.Document; +pageextension 99001544 "Subc.Change Status Prod. Order" extends "Change Status on Prod. Order" +{ + layout + { + addafter("Finish Order without Output") + { + field("WIP Quantity Clean Up"; WIPQuantityCleanUp) + { + ApplicationArea = Subcontracting; + Enabled = WIPQuantityCleanUpEnabled; + Visible = WIPQuantityCleanUpVisible; + Caption = 'WIP Quantity Clean Up'; + ToolTip = 'Specifies whether the WIP quantity on the production order should be set to zero. When enabled, the WIP quantity on the production order will be set to zero. This is used when the production order is finished but there is still WIP quantity that needs to be cleaned up.'; + } + } + } + + trigger OnOpenPage() + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + + WIPQuantityCleanUp := true; + end; + + trigger OnAfterGetCurrRecord() + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + + SetControlProperties(); + end; + + protected var + WIPQuantityCleanUp: Boolean; + + var + ProductionOrder: Record "Production Order"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + WIPQuantityCleanUpEnabled, WIPQuantityCleanUpVisible : Boolean; + + procedure ReturnSubWIPQuantityCleanUp(): Boolean + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(false); + exit(WIPQuantityCleanUp); + end; + + procedure SubcSetOrder(var ProductionOrderForStatusChange: Record "Production Order") + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; + ProductionOrder := ProductionOrderForStatusChange; + SetControlProperties(); + end; + + procedure SubcGetOrder() ProductionOrderForStatusChange: Record "Production Order" + begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(ProductionOrder); + ProductionOrderForStatusChange := ProductionOrder; + end; + + local procedure SetControlProperties() + var + SubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry"; + begin + if ProductionOrder.Status <> "Production Order Status"::Released then begin + WIPQuantityCleanUpEnabled := false; + WIPQuantityCleanUpVisible := false; + WIPQuantityCleanUp := false; + exit; + end; + SubcontractorWIPLedgerEntry.SetCurrentKey("Prod. Order No.", "Prod. Order Status", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", "Location Code"); + SubcontractorWIPLedgerEntry.SetRange("Prod. Order No.", ProductionOrder."No."); + SubcontractorWIPLedgerEntry.SetRange("Prod. Order Status", "Production Order Status"::Released); + WIPQuantityCleanUpEnabled := not SubcontractorWIPLedgerEntry.IsEmpty(); + WIPQuantityCleanUpVisible := WIPQuantityCleanUpEnabled; + if not WIPQuantityCleanUpEnabled then + WIPQuantityCleanUp := false; + end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcTransferWIPPosting.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcTransferWIPPosting.Codeunit.al index 79524e31e6..e459b59698 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcTransferWIPPosting.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcTransferWIPPosting.Codeunit.al @@ -24,10 +24,13 @@ codeunit 99001541 "Subc. Transfer WIP Posting" var WIPLedgEntryNo: Integer; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; [EventSubscriber(ObjectType::Table, Database::"Transfer Header", OnUpdateTransLinesOnAfterUpdateFromDirectTransfer, '', false, false)] local procedure OnUpdateTransLinesOnAfterUpdateFromDirectTransfer(var TransferLine: Record "Transfer Line"; TempTransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TempTransferLine."Transfer WIP Item" then begin TransferLine.Validate("Transfer WIP Item", TempTransferLine."Transfer WIP Item"); TransferLine.UpdateDescriptions(); @@ -39,6 +42,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" var TransferRoute: Record "Transfer Route"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if not Rec."Direct Transfer" and xRec."Direct Transfer" then TransferRoute.GetTransferRoute( Rec."Transfer-from Code", Rec."Transfer-to Code", Rec."In-Transit Code", @@ -49,6 +54,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnBeforeValidateQuantityShipIsBalanced, '', false, false)] local procedure HandleWipTransferOnBeforeValidateQuantityShipIsBalanced(var TransferLine: Record "Transfer Line"; xTransferLine: Record "Transfer Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TransferLine."Transfer WIP Item" then IsHandled := true; end; @@ -56,6 +63,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnBeforeValidateQuantityReceiveIsBalanced, '', false, false)] local procedure HandleWipTransferOnBeforeValidateQuantityReceiveIsBalanced(var TransferLine: Record "Transfer Line"; xTransferLine: Record "Transfer Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TransferLine."Transfer WIP Item" then IsHandled := true; end; @@ -63,6 +72,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Codeunit, Codeunit::"TransferOrder-Post Shipment", OnBeforeCheckItemInInventory, '', false, false)] local procedure HandleWipTransferOnBeforeCheckItemInInventory(TransferLine: Record "Transfer Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TransferLine."Transfer WIP Item" then IsHandled := true; end; @@ -73,6 +84,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" TransferLine: Record "Transfer Line"; CannotPostTheseLinesErr: Label 'You cannot post these lines because you have not entered a quantity on one or more of the lines. '; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if ItemJnlLine."Order Type" <> "Inventory Order Type"::Transfer then exit; TransferLine.SetLoadFields("Transfer WIP Item"); @@ -90,6 +103,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Shipment Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure HandleWipTransferShipmentLineOnAfterCopyFromTransferLine(var TransferShipmentLine: Record "Transfer Shipment Line"; TransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TransferShipmentLine."Transfer WIP Item" := TransferLine."Transfer WIP Item"; CreateWIPLedgerEntryForShipment(TransferShipmentLine, TransferLine); end; @@ -97,6 +112,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Receipt Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure HandleWipTransferReceiptLineOnAfterCopyFromTransferLine(var TransferReceiptLine: Record "Transfer Receipt Line"; TransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TransferReceiptLine."Transfer WIP Item" := TransferLine."Transfer WIP Item"; CreateWIPLedgerEntryForReceive(TransferReceiptLine, TransferLine); end; @@ -104,6 +121,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Direct Trans. Line", OnAfterCopyFromTransferLine, '', false, false)] local procedure HandleWipDirectTransLineOnAfterCopyFromTransferLine(var DirectTransLine: Record "Direct Trans. Line"; TransferLine: Record "Transfer Line") begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; DirectTransLine."Transfer WIP Item" := TransferLine."Transfer WIP Item"; CreateWIPLedgerEntryForDirectTransfer(DirectTransLine, TransferLine); end; @@ -111,6 +130,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Undo Transfer Shipment", OnNoItemLedgerEntriesCheckIsNeeded, '', false, false)] local procedure HandleWipTransferOnNoItemLedgerEntriesCheckIsNeeded(TransShptLine: Record "Transfer Shipment Line"; var NoCheckNeeded: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TransShptLine."Transfer WIP Item" then NoCheckNeeded := true; end; @@ -118,6 +139,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnBeforeShowReservation, '', false, false)] local procedure HandleWipTransferOnBeforeShowReservation(var TransferLine: Record "Transfer Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TransferLine.TestField("Transfer WIP Item", false); end; @@ -126,6 +149,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" var TransferLine: Record "Transfer Line"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if SourceRecRef.Number = Database::"Transfer Line" then begin SourceRecRef.SetTable(TransferLine); TransferLine.CheckForExistingReservationsOrItemTracking(); @@ -135,6 +160,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Table, Database::"Transfer Line", OnBeforeOpenItemTrackingLines, '', false, false)] local procedure HandleWipTransferOnBeforeOpenItemTrackingLines(var TransferLine: Record "Transfer Line"; var IsHandled: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; TransferLine.TestField("Transfer WIP Item", false); end; @@ -143,6 +170,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" var Location: Record Location; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if TransferLine."Transfer WIP Item" then begin TransferLine.CalcFields("Whse. Inbnd. Otsdg. Qty"); if Location.GetLocationSetup(TransferLine."Transfer-to Code", Location) then @@ -159,6 +188,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" [EventSubscriber(ObjectType::Codeunit, Codeunit::"Transfer Warehouse Mgt.", OnTransLine2ReceiptLineOnAfterInitNewLine, '', false, false)] local procedure HandleWipTransferOnTransLine2ReceiptLineOnAfterInitNewLine(var WarehouseReceiptLine: Record "Warehouse Receipt Line"; WarehouseReceiptHeader: Record "Warehouse Receipt Header"; TransferLine: Record "Transfer Line"; var QtyOnRcptLineSet: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; WarehouseReceiptLine."Transfer WIP Item" := TransferLine."Transfer WIP Item"; if WarehouseReceiptLine."Transfer WIP Item" then begin WarehouseReceiptLine.Validate(WarehouseReceiptLine."Qty. Received", TransferLine."Quantity Received"); @@ -276,6 +307,8 @@ codeunit 99001541 "Subc. Transfer WIP Posting" var SubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; SubcontractorWIPLedgerEntry.SetProductionOrderFilter(ProductionOrder, false); SearchForAllWIPLedgerEntryCombinationAndCreateAdjustmentEntryToBalanceTheQuantities(SubcontractorWIPLedgerEntry, PostingDate); end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPAdjustment.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPAdjustment.Page.al index 015f5e4e59..68702af478 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPAdjustment.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPAdjustment.Page.al @@ -8,7 +8,7 @@ using Microsoft.Inventory.Item; page 99001561 "Subc. WIP Adjustment" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'WIP Adjustment'; PageType = StandardDialog; SourceTable = "Subcontractor WIP Ledger Entry"; @@ -112,6 +112,8 @@ page 99001561 "Subc. WIP Adjustment" trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; NewQuantities.Set(Rec."Entry No.", NewQuantityBase); UpdateQuantityStyle(); end; @@ -202,6 +204,8 @@ page 99001561 "Subc. WIP Adjustment" trigger OnValidate() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; NewQuantities.Set(Rec."Entry No.", NewQuantityBase); UpdateQuantityStyle(); end; @@ -226,12 +230,16 @@ page 99001561 "Subc. WIP Adjustment" trigger OnAfterGetRecord() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; NewQuantities.Get(Rec."Entry No.", NewQuantityBase); UpdateQuantityStyle(); end; trigger OnOpenPage() begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; PostingDate := WorkDate(); DocumentType := DocumentType::"Adjustment (Manual)"; @@ -241,6 +249,8 @@ page 99001561 "Subc. WIP Adjustment" trigger OnQueryClosePage(CloseAction: Action): Boolean begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(true); if CloseAction in [ACTION::OK, ACTION::LookupOK] then CreateAdjustmentEntries(); exit(true); @@ -248,6 +258,7 @@ page 99001561 "Subc. WIP Adjustment" var Item: Record Item; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; NewQuantities: Dictionary of [Integer, Decimal]; PostingDate: Date; DocumentType: Enum "WIP Document Type"; @@ -268,6 +279,8 @@ page 99001561 "Subc. WIP Adjustment" var EntrySeq: Integer; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; EntrySeq := 1; if not Rec.IsEmpty() then @@ -317,6 +330,8 @@ page 99001561 "Subc. WIP Adjustment" procedure SetDocumentNo(DocNo: Code[20]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; DocumentNo := DocNo; end; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPItemLedgFindEntry.Codeunit.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPItemLedgFindEntry.Codeunit.al index f1345c3c55..c1626663df 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPItemLedgFindEntry.Codeunit.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPItemLedgFindEntry.Codeunit.al @@ -12,11 +12,14 @@ codeunit 99001564 "Subc. WIP Item Ledg Find Entry" var [SecurityFiltering(SecurityFilter::Filtered)] SubcontractorWIPLedgerEntry: Record "Subcontractor WIP Ledger Entry"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; [EventSubscriber(ObjectType::Page, Page::Navigate, OnAfterFindLedgerEntries, '', false, false)] local procedure OnFindWIPLedgerEntries(var DocumentEntry: Record "Document Entry"; DocNoFilter: Text; PostingDateFilter: Text) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; FindWIPItemEntries(DocumentEntry, DocNoFilter, PostingDateFilter); end; @@ -41,6 +44,8 @@ codeunit 99001564 "Subc. WIP Item Ledg Find Entry" [EventSubscriber(ObjectType::Page, Page::Navigate, OnAfterShowRecords, '', false, false)] local procedure OnShowWIPLedgerEntries(var Sender: Page Navigate; var DocumentEntry: Record "Document Entry"; DocNoFilter: Text; PostingDateFilter: Text; ItemTrackingSearch: Boolean; ContactType: Enum "Navigate Contact Type"; ContactNo: Code[250]; ExtDocNo: Code[250]) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if DocumentEntry."Table ID" = Database::"Subcontractor WIP Ledger Entry" then begin FilterWIPLedgerEntries(DocNoFilter, PostingDateFilter); Page.Run(0, SubcontractorWIPLedgerEntry); diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPLedgerEntries.Page.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPLedgerEntries.Page.al index 48509d93fc..9fc76a1c1c 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPLedgerEntries.Page.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcWIPLedgerEntries.Page.al @@ -6,7 +6,7 @@ namespace Microsoft.Manufacturing.Subcontracting; page 99001560 "Subc. WIP Ledger Entries" { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting WIP Entries'; Editable = false; PageType = List; @@ -108,7 +108,7 @@ page 99001560 "Subc. WIP Ledger Entries" { action("WIP Adjustment") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'WIP Adjustment'; Image = AdjustEntries; ToolTip = 'Manually adjust the WIP quantity for the selected WIP ledger entry.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcontractorWIPLedgerEntry.Table.al b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcontractorWIPLedgerEntry.Table.al index e72f595b2a..6ef9946ed4 100644 --- a/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcontractorWIPLedgerEntry.Table.al +++ b/src/Apps/W1/Subcontracting/App/src/Process/WIP Item/SubcontractorWIPLedgerEntry.Table.al @@ -186,12 +186,16 @@ table 99001560 "Subcontractor WIP Ledger Entry" key(Key5; "Document No.", "Posting Date") { } } + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; /// /// Filters the record set to WIP entries for the given production order. /// When SetKey is true, the sort key is aligned to Key3 before applying the filters. /// procedure SetProductionOrderFilter(ProductionOrder: Record "Production Order"; SetKey: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if SetKey then SetCurrentKey("Prod. Order No.", "Prod. Order Status", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", "Location Code"); SetRange("Prod. Order No.", ProductionOrder."No."); @@ -204,6 +208,8 @@ table 99001560 "Subcontractor WIP Ledger Entry" /// procedure SetProductionOrderRoutingFilter(ProdOrderRoutingLine: Record "Prod. Order Routing Line"; SetKey: Boolean) begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; if SetKey then SetCurrentKey("Prod. Order No.", "Prod. Order Status", "Prod. Order Line No.", "Routing Reference No.", "Routing No.", "Operation No.", "Location Code"); SetRange("Prod. Order No.", ProdOrderRoutingLine."Prod. Order No."); @@ -220,6 +226,8 @@ table 99001560 "Subcontractor WIP Ledger Entry" var SequenceNoMgt: Codeunit "Sequence No. Mgt."; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit(0); exit(SequenceNoMgt.GetNextSeqNo(DATABASE::"Subcontractor WIP Ledger Entry")); end; } \ No newline at end of file diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcManufacturingManagerRC.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcManufacturingManagerRC.PageExt.al index 300dfacf7a..21600c2ebe 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcManufacturingManagerRC.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcManufacturingManagerRC.PageExt.al @@ -17,14 +17,14 @@ pageextension 99001536 "Subc. Manufacturing Manager RC" extends "Manufacturing M Caption = 'Subcontracting'; action("Subc. Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = page "Subc. Subcontracting Worksheet"; ToolTip = 'Calculate the needed production supply, find the production orders that have material ready to send to a subcontractor, and automatically create purchase orders for subcontracted operations from production order routings.'; } action("Subc. Subcontractor Prices") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontractor Prices'; RunObject = page "Subcontractor Prices"; ToolTip = 'View and maintain the prices that subcontractors charge for the operations they perform.'; diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerActivities.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerActivities.PageExt.al index 327cfcac6b..c072d2ab93 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerActivities.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerActivities.PageExt.al @@ -19,31 +19,31 @@ pageextension 99001537 "Subc. Prod. Planner Activities" extends "Production Plan Caption = 'Subcontracting'; field("Subcontracting Purchase Orders"; Rec."Subcontracting Purchase Orders") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Purchase Order List"; ToolTip = 'Specifies the number of open purchase orders that are subcontracting orders.'; } field("Subc. Purch. Lines Outstd."; Rec."Subc. Purch. Lines Outstd.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of outstanding subcontracting purchase order lines that have not yet been fully received.'; Visible = false; } field("Subc. Purch. Lines Total"; Rec."Subc. Purch. Lines Total") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the total number of subcontracting purchase order lines.'; Visible = false; } field("Transfers to Subcontractor"; Rec."Transfers to Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders to subcontractors.'; } field("Returns from Subcontractor"; Rec."Returns from Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders that are returns from subcontractors.'; } @@ -56,7 +56,7 @@ pageextension 99001537 "Subc. Prod. Planner Activities" extends "Production Plan { action("Subc. Edit Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Edit Subcontracting Worksheet'; RunObject = Page "Subc. Subcontracting Worksheet"; ToolTip = 'Plan outsourcing of operation on released production orders.'; diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerRoleCenter.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerRoleCenter.PageExt.al index b7cc2b31f1..9e8b98d057 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerRoleCenter.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcProdPlannerRoleCenter.PageExt.al @@ -20,7 +20,7 @@ pageextension 99001538 "Subc. Prod. Planner RoleCenter" extends "Production Plan Caption = 'Subcontracting'; action("Subc. Subcontracting Worksheets") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = Page "Req. Wksh. Names"; RunPageView = where("Template Type" = const(Subcontracting), @@ -29,7 +29,7 @@ pageextension 99001538 "Subc. Prod. Planner RoleCenter" extends "Production Plan } action("Subc. Subcontracting Purch. Orders") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Purchase Orders'; RunObject = Page "Purchase Order List"; RunPageView = where("Document Type" = const(Order), @@ -38,7 +38,7 @@ pageextension 99001538 "Subc. Prod. Planner RoleCenter" extends "Production Plan } action("Subc. Subcontracting Transfers") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Transfers'; RunObject = Page "Transfer Orders"; RunPageView = where("Subc. Source Type" = const(Subcontracting), @@ -51,7 +51,7 @@ pageextension 99001538 "Subc. Prod. Planner RoleCenter" extends "Production Plan { action("Subc. Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheet'; Image = SubcontractingWorksheet; RunObject = Page "Subc. Subcontracting Worksheet"; diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchAgentRoleCenter.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchAgentRoleCenter.PageExt.al index 157e6fa83f..c9384ca10d 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchAgentRoleCenter.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchAgentRoleCenter.PageExt.al @@ -15,7 +15,7 @@ pageextension 99001541 "Subc. Purch. Agent Role Center" extends "Purchasing Agen { action("Subc. Subcontracting Worksheets") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = Page "Req. Wksh. Names"; RunPageView = where("Template Type" = const(Subcontracting), diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchasingManagerRC.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchasingManagerRC.PageExt.al index 6aaa23d8c4..0d209e1456 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchasingManagerRC.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcPurchasingManagerRC.PageExt.al @@ -14,7 +14,7 @@ pageextension 99001535 "Subc. Purchasing Manager RC" extends "Purchasing Manager { action("Subc. Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = page "Subc. Subcontracting Worksheet"; ToolTip = 'Calculate the needed production supply, find the production orders that have material ready to send to a subcontractor, and automatically create purchase orders for subcontracted operations from production order routings.'; diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSMfgFoundation.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSMfgFoundation.PageExt.al index 1ec5e9206f..330544c53a 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSMfgFoundation.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSMfgFoundation.PageExt.al @@ -15,7 +15,7 @@ pageextension 99001539 "Subc. Shop S. Mfg Foundation" extends "Shop Supervisor M { action("Subc. Subcontracting Worksheets") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = Page "Req. Wksh. Names"; RunPageView = where("Template Type" = const(Subcontracting), diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperActivities.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperActivities.PageExt.al index e2454a6bd3..ac3f18d320 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperActivities.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperActivities.PageExt.al @@ -19,31 +19,31 @@ pageextension 99001549 "Subc. Shop Super. Activities" extends "Shop Supervisor A Caption = 'Subcontracting'; field("Subcontracting Purchase Orders"; Rec."Subcontracting Purchase Orders") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Purchase Order List"; ToolTip = 'Specifies the number of open purchase orders that are subcontracting orders.'; } field("Subc. Purch. Lines Outstd."; Rec."Subc. Purch. Lines Outstd.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of outstanding subcontracting purchase order lines that have not yet been fully received.'; Visible = false; } field("Subc. Purch. Lines Total"; Rec."Subc. Purch. Lines Total") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the total number of subcontracting purchase order lines.'; Visible = false; } field("Transfers to Subcontractor"; Rec."Transfers to Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders to subcontractors.'; } field("Returns from Subcontractor"; Rec."Returns from Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders that are returns from subcontractors.'; } @@ -56,7 +56,7 @@ pageextension 99001549 "Subc. Shop Super. Activities" extends "Shop Supervisor A { action("Subc. Edit Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Edit Subcontracting Worksheet'; RunObject = Page "Subc. Subcontracting Worksheet"; ToolTip = 'Plan outsourcing of operation on released production orders.'; diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperRoleCenter.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperRoleCenter.PageExt.al index 152ffc6f0f..4f1d0f60b5 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperRoleCenter.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperRoleCenter.PageExt.al @@ -15,7 +15,7 @@ pageextension 99001540 "Subc. Shop Super. Role Center" extends "Shop Supervisor { action("Subc. Subcontracting Worksheets") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Subcontracting Worksheets'; RunObject = Page "Req. Wksh. Names"; RunPageView = where("Template Type" = const(Subcontracting), diff --git a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperbasicActivity.PageExt.al b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperbasicActivity.PageExt.al index 27fb9eb730..6b9a33a974 100644 --- a/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperbasicActivity.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/RoleCenters/SubcShopSuperbasicActivity.PageExt.al @@ -19,31 +19,31 @@ pageextension 99001550 "Subc. ShopSuperbasicActivity" extends "Shop Super. basic Caption = 'Subcontracting'; field("Subcontracting Purchase Orders"; Rec."Subcontracting Purchase Orders") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Purchase Order List"; ToolTip = 'Specifies the number of open purchase orders that are subcontracting orders.'; } field("Subc. Purch. Lines Outstd."; Rec."Subc. Purch. Lines Outstd.") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the number of outstanding subcontracting purchase order lines that have not yet been fully received.'; Visible = false; } field("Subc. Purch. Lines Total"; Rec."Subc. Purch. Lines Total") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the total number of subcontracting purchase order lines.'; Visible = false; } field("Transfers to Subcontractor"; Rec."Transfers to Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders to subcontractors.'; } field("Returns from Subcontractor"; Rec."Returns from Subcontractor") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; DrillDownPageId = "Transfer Orders"; ToolTip = 'Specifies the number of transfer orders that are returns from subcontractors.'; } @@ -56,7 +56,7 @@ pageextension 99001550 "Subc. ShopSuperbasicActivity" extends "Shop Super. basic { action("Subc. Edit Subcontracting Worksheet") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; Caption = 'Edit Subcontracting Worksheet'; RunObject = Page "Subc. Subcontracting Worksheet"; ToolTip = 'Plan outsourcing of operation on released production orders.'; diff --git a/src/Apps/W1/Subcontracting/App/src/Setup/Codeunits/SubcApplicationAreaHandler.al b/src/Apps/W1/Subcontracting/App/src/Setup/Codeunits/SubcApplicationAreaHandler.al new file mode 100644 index 0000000000..c4a7427833 --- /dev/null +++ b/src/Apps/W1/Subcontracting/App/src/Setup/Codeunits/SubcApplicationAreaHandler.al @@ -0,0 +1,34 @@ +// ------------------------------------------------------------------------------------------------ +// 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; + +using Microsoft.Foundation.Company; +using Microsoft.Manufacturing.Setup; +using System.Environment.Configuration; + +codeunit 99001568 "Subc. Application Area Handler" +{ + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Application Area Mgmt. Facade", OnGetPremiumExperienceAppAreas, '', false, false)] + local procedure OnGetPremiumExperienceAppAreasSubscriber(var TempApplicationAreaSetup: Record "Application Area Setup") + begin + SetApplicationArea(TempApplicationAreaSetup); + end; + + local procedure SetApplicationArea(var TempApplicationAreaSetup: Record "Application Area Setup") + var + ManufacturingSetup: Record "Manufacturing Setup"; + begin + ManufacturingSetup.SetLoadFields("Legacy Subcontracting"); + if ManufacturingSetup.Get() then + TempApplicationAreaSetup."Subcontracting" := not ManufacturingSetup."Legacy Subcontracting"; + end; + + internal procedure UpdateApplicationArea() + var + ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade"; + begin + ApplicationAreaMgmtFacade.RefreshExperienceTierCurrentCompany(); + end; +} diff --git a/src/Apps/W1/Subcontracting/App/src/Setup/Pages/SubcManufacturingSetup.PageExt.al b/src/Apps/W1/Subcontracting/App/src/Setup/Pages/SubcManufacturingSetup.PageExt.al index 1368651532..a2e7a4a145 100644 --- a/src/Apps/W1/Subcontracting/App/src/Setup/Pages/SubcManufacturingSetup.PageExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Setup/Pages/SubcManufacturingSetup.PageExt.al @@ -21,27 +21,27 @@ pageextension 99001542 "Subc. Manufacturing Setup" extends "Manufacturing Setup" Caption = 'General'; field("Create Prod. Order Info Line"; Rec."Create Prod. Order Info Line") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies whether an additional Information Line of the Production Order Line will be created in a Subcontracting Purchase Order.'; } field("Subc. Comp. Transfer Lead Time"; Rec."Subc. Comp. Transfer Lead Time") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the lead time for transferring components to the subcontractor. This time is subtracted from the production component due date to calculate the transfer order receipt date.'; } field("Subcontracting Template Name"; Rec."Subcontracting Template Name") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the name of the subcontracting journal template to be used for the direct creation of subcontracting orders from a released routing.'; } field("Subcontracting Batch Name"; Rec."Subcontracting Batch Name") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the name of the subcontracting journal batch to be used for the direct creation of subcontracting orders from a released routing.'; } field("Component Direct Unit Cost"; Rec."Component Direct Unit Cost") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies which Direct Unit Cost of a Prod. Order Component is to be used in the subcontracting purchase order. Standard: Standard pricing is used when procuring the component. Prod. Order Component: The calculated Direct Unit Cost of the Prod. Order Component Line is transferred to the subcontracting purchase order.'; } } @@ -50,7 +50,7 @@ pageextension 99001542 "Subc. Manufacturing Setup" extends "Manufacturing Setup" Caption = 'Purchase Provision'; field("Subc. Default Comp. Location"; Rec."Subc. Default Comp. Location") { - ApplicationArea = Manufacturing; + ApplicationArea = Subcontracting; ToolTip = 'Specifies the source used to determine the default location code for production order components in purchase provision. Purchase: the location code from the purchase order line is used. Company: the location code from the company information is used. Manufacturing: the location code from the manufacturing setup is used.'; } } diff --git a/src/Apps/W1/Subcontracting/App/src/Setup/Tables/SubcManufacturingSetup.TableExt.al b/src/Apps/W1/Subcontracting/App/src/Setup/Tables/SubcManufacturingSetup.TableExt.al index 7c49881a50..73502c2c22 100644 --- a/src/Apps/W1/Subcontracting/App/src/Setup/Tables/SubcManufacturingSetup.TableExt.al +++ b/src/Apps/W1/Subcontracting/App/src/Setup/Tables/SubcManufacturingSetup.TableExt.al @@ -59,7 +59,10 @@ tableextension 99001501 "Subc. Manufacturing Setup" extends "Manufacturing Setup var CompanyInformation: Record "Company Information"; ManufacturingSetup: Record "Manufacturing Setup"; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; begin + if not SubcFeatureFlagHandler.IsSubcontractingEnabled() then + exit; case "Subc. Default Comp. Location" of "Subc. Default Comp. Location"::Company: begin diff --git a/src/Apps/W1/Subcontracting/Test/src/Codeunits/Tests/SubcFeatureFlagTest.Codeunit.al b/src/Apps/W1/Subcontracting/Test/src/Codeunits/Tests/SubcFeatureFlagTest.Codeunit.al new file mode 100644 index 0000000000..ae1b13eb67 --- /dev/null +++ b/src/Apps/W1/Subcontracting/Test/src/Codeunits/Tests/SubcFeatureFlagTest.Codeunit.al @@ -0,0 +1,251 @@ +// ------------------------------------------------------------------------------------------------ +// 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.Test; + +using Microsoft.Manufacturing.Setup; +using Microsoft.Manufacturing.Subcontracting; +using Microsoft.Purchases.Vendor; +using System.Environment.Configuration; + +codeunit 139993 "Subc. Feature Flag Test" +{ + Subtype = Test; + TestPermissions = Disabled; + + trigger OnRun() + begin + // [FEATURE] Subcontracting] [Feature Toggle] + Initialized := false; + end; + + var + Assert: Codeunit Assert; + LibraryTestInitialize: Codeunit "Library - Test Initialize"; + LibraryApplicationArea: Codeunit "Library - Application Area"; + LibraryPurchase: Codeunit "Library - Purchase"; + Initialized: Boolean; + + [Test] + [Scope('OnPrem')] + procedure AppAreaSetWhenSubcontractingEnabled() + var + ApplicationAreaSetup: Record "Application Area Setup"; + ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade"; + begin + // [SCENARIO] ApplicationAreaSetup."Subcontracting" is true when Legacy Subcontracting toggle is disabled (Subcontracting enabled) + Initialize(); + + // [GIVEN] ManufacturingSetup."Legacy Subcontracting" = false (Subcontracting app is active) + SetLegacySubcontracting(false); + + // [WHEN] Application areas are reloaded + RefreshApplicationAreas(); + + // [THEN] ApplicationAreaSetup."Subcontracting" = true + ApplicationAreaSetup.Get(CompanyName()); + Assert.IsTrue(ApplicationAreaSetup."Subcontracting", 'Subcontracting application area should be true when Legacy Subcontracting flag is disabled.'); + Assert.IsTrue(ApplicationAreaMgmtFacade.GetApplicationAreaSetup().Contains('#Subcontracting'), 'Subcontracting string should be present in application area setup when enabled and on premium tier.'); + end; + + [Test] + [Scope('OnPrem')] + procedure AppAreaClearedWhenSubcontractingDisabled() + var + ApplicationAreaSetup: Record "Application Area Setup"; + ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade"; + begin + // [SCENARIO] ApplicationAreaSetup."Subcontracting" is false when Legacy Subcontracting toggle is enabled (Subcontracting disabled) + Initialize(); + + // [GIVEN] ManufacturingSetup."Legacy Subcontracting" = true (Legacy mode active, Subcontracting app inactive) + SetLegacySubcontracting(true); + + // [WHEN] Application areas are reloaded + RefreshApplicationAreas(); + + // [THEN] ApplicationAreaSetup."Subcontracting" = false + ApplicationAreaSetup.Get(CompanyName()); + Assert.IsFalse(ApplicationAreaSetup."Subcontracting", 'Subcontracting application area should be false when Legacy Subcontracting is enabled.'); + Assert.IsFalse(ApplicationAreaMgmtFacade.GetApplicationAreaSetup().Contains('#Subcontracting'), 'Subcontracting string must not be present when disabled.'); + end; + + [Test] + [Scope('OnPrem')] + procedure AppAreaNotSetForEssentialExperienceTier() + var + ApplicationAreaSetup: Record "Application Area Setup"; + ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade"; + begin + // [SCENARIO] ApplicationAreaSetup."Subcontracting" is NOT set for Essential tier even when Legacy Subcontracting is disabled + // The subscriber only fires for OnGetPremiumExperienceAppAreas, not for Essential + Initialize(); + + // [GIVEN] ManufacturingSetup."Legacy Subcontracting" = false (Subcontracting would be active for Premium) + SetLegacySubcontracting(false); + + // [WHEN] Essential experience tier is activated + LibraryApplicationArea.EnableEssentialSetup(); + + // [THEN] ApplicationAreaSetup."Subcontracting" = false (subscriber does not fire for Essential) + ApplicationAreaSetup.Get(CompanyName()); + Assert.IsFalse(ApplicationAreaSetup."Subcontracting", 'Subcontracting app area must not be set for Essential experience tier.'); + Assert.IsFalse(ApplicationAreaMgmtFacade.GetApplicationAreaSetup().Contains('#Subcontracting'), 'Subcontracting string must not be present when on essential tier.'); + + // Restore to Premium Setup + LibraryApplicationArea.EnablePremiumSetup(); + end; + + [Test] + [Scope('OnPrem')] + procedure GuardReturnsTrueWhenEnabled() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + begin + // [SCENARIO] IsSubcontractingEnabled returns true when Legacy Subcontracting toggle is OFF + Initialize(); + + // [GIVEN] ManufacturingSetup."Legacy Subcontracting" = false + SetLegacySubcontracting(false); + + // [WHEN] Call IsSubcontractingEnabled + // [THEN] Returns true + Assert.IsTrue(SubcFeatureFlagHandler.IsSubcontractingEnabled(), 'Guard should return true when Legacy Subcontracting is disabled.'); + end; + + [Test] + [Scope('OnPrem')] + procedure GuardReturnsFalseWhenDisabled() + var + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + begin + // [SCENARIO] IsSubcontractingEnabled returns false when Legacy Subcontracting toggle is ON + Initialize(); + + // [GIVEN] ManufacturingSetup."Legacy Subcontracting" = true + SetLegacySubcontracting(true); + + // [WHEN] Call IsSubcontractingEnabled + // [THEN] Returns false + Assert.IsFalse(SubcFeatureFlagHandler.IsSubcontractingEnabled(), 'Guard should return false when Legacy Subcontracting is enabled.'); + end; + + [Test] + [Scope('OnPrem')] + procedure GuardReturnsFalseWhenSetupNotExists() + var + ManufacturingSetup: Record "Manufacturing Setup"; + ManufacturingSetupBackup: Record "Manufacturing Setup" temporary; + SubcFeatureFlagHandler: Codeunit "Subc. Feature Flag Handler"; + begin + // [SCENARIO] IsSubcontractingEnabled returns false when no ManufacturingSetup record exists + Initialize(); + + if ManufacturingSetup.Get() then begin + ManufacturingSetupBackup.Copy(ManufacturingSetup); + ManufacturingSetup.Delete(); + end; + + // [WHEN] Call IsSubcontractingEnabled + // [THEN] Returns false + Assert.IsFalse(SubcFeatureFlagHandler.IsSubcontractingEnabled(), 'Guard should return false when ManufacturingSetup does not exist.'); + + // Restore ManufacturingSetup + ManufacturingSetup.Init(); + ManufacturingSetup.Copy(ManufacturingSetupBackup); + ManufacturingSetup.Insert(); + Commit(); + end; + + [Test] + [Scope('OnPrem')] + procedure VendorCardSubcFieldsVisibleWhenEnabled() + var + Vendor: Record Vendor; + VendorCard: TestPage "Vendor Card"; + begin + // [SCENARIO] Subcontracting fields on Vendor Card are visible when Subcontracting app area is active + Initialize(); + + // [GIVEN] Legacy Subcontracting is disabled (Subcontracting enabled) and Premium experience is activated + SetLegacySubcontracting(false); + RefreshApplicationAreas(); + + // [GIVEN] A vendor exists + LibraryPurchase.CreateVendor(Vendor); + + // [WHEN] Open the Vendor Card + VendorCard.OpenEdit(); + VendorCard.GotoRecord(Vendor); + + // [THEN] Subcontracting fields are visible + Assert.IsTrue(VendorCard."Subcr. Location Code".Visible(), '"Subcr. Location Code" should be visible when Subcontracting is enabled.'); + Assert.IsTrue(VendorCard."Subc. Linked to Work Center".Visible(), '"Subc. Linked to Work Center" should be visible when Subcontracting is enabled.'); + Assert.IsTrue(VendorCard."Subc. Work Center No.".Visible(), '"Subc. Work Center No." should be visible when Subcontracting is enabled.'); + + VendorCard.Close(); + end; + + [Test] + [Scope('OnPrem')] + procedure VendorCardSubcFieldsNotVisibleWhenDisabled() + var + Vendor: Record Vendor; + VendorCard: TestPage "Vendor Card"; + begin + // [SCENARIO] Subcontracting fields on Vendor Card are NOT accessible when Subcontracting app area is inactive + Initialize(); + + // [GIVEN] Legacy Subcontracting is enabled (Subcontracting disabled) and Premium experience is activated + SetLegacySubcontracting(true); + RefreshApplicationAreas(); + + // [GIVEN] A vendor exists + LibraryPurchase.CreateVendor(Vendor); + + // [WHEN] Open the Vendor Card + VendorCard.OpenEdit(); + VendorCard.GotoRecord(Vendor); + + // [THEN] Subcontracting fields are not accessible (accessing them raises an error) + asserterror Assert.IsFalse(VendorCard."Subcr. Location Code".Visible(), '"Subcr. Location Code" should not be visible when Subcontracting is disabled.'); + asserterror Assert.IsFalse(VendorCard."Subc. Linked to Work Center".Visible(), '"Subc. Linked to Work Center" should not be visible when Subcontracting is disabled.'); + asserterror Assert.IsFalse(VendorCard."Subc. Work Center No.".Visible(), '"Subc. Work Center No." should not be visible when Subcontracting is disabled.'); + + VendorCard.Close(); + end; + + local procedure Initialize() + begin + LibraryTestInitialize.OnTestInitialize(Codeunit::"Subc. Feature Flag Test"); + + if Initialized then + exit; + + LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Subc. Feature Flag Test"); + LibraryApplicationArea.EnablePremiumSetup(); + Initialized := true; + Commit(); + LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Subc. Feature Flag Test"); + end; + + local procedure SetLegacySubcontracting(Enabled: Boolean) + var + ManufacturingSetup: Record "Manufacturing Setup"; + begin + if not ManufacturingSetup.Get() then begin + ManufacturingSetup.Init(); + ManufacturingSetup.Insert(); + end; + ManufacturingSetup."Legacy Subcontracting" := Enabled; + ManufacturingSetup.Modify(); + end; + + local procedure RefreshApplicationAreas() + var + ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade"; + begin + ApplicationAreaMgmtFacade.RefreshExperienceTierCurrentCompany(); + end; +}