diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGeneratRules.Page.al b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGeneratRules.Page.al index 6bd9ca62ec..00ccffa89a 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGeneratRules.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGeneratRules.Page.al @@ -5,7 +5,6 @@ namespace Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.GenerationRule.JobQueue; -using Microsoft.QualityManagement.Integration.Manufacturing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Warehouse; using Microsoft.QualityManagement.Setup.Setup; @@ -104,18 +103,6 @@ page 20405 "Qlty. In. Test Generat. Rules" field("Activation Trigger"; Rec."Activation Trigger") { } - field("Assembly Trigger"; Rec."Assembly Trigger") - { - Visible = ShowAssemblyTrigger; - Editable = EditAssemblyTrigger; - StyleExpr = AssemblyStyle; - } - field("Production Trigger"; Rec."Production Trigger") - { - Visible = ShowProductionTrigger; - Editable = EditProductionTrigger; - StyleExpr = ProductionStyle; - } field("Purchase Trigger"; Rec."Purchase Trigger") { Visible = ShowPurchaseTrigger; @@ -176,51 +163,9 @@ page 20405 "Qlty. In. Test Generat. Rules" actionref(CreateNewGenerationRuleForWhseWizard_Promoted; CreateNewGenerationRuleForWhseWizard) { } - actionref(CreateNewGenerationRuleForProdWizard_Promoted; CreateNewGenerationRuleForProdWizard) - { - } } area(Processing) { - action(CreateNewGenerationRuleForProdWizard) - { - Caption = 'Create Production Rule'; - ToolTip = 'Specifies to create a rule for production.'; - Image = Receipt; - ApplicationArea = Manufacturing; - - trigger OnAction() - var - RecQltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; - begin - RecQltyProdGenRuleWizard.RunModalWithGenerationRule(Rec); - CurrPage.Update(false); - end; - } - action(EditGenerationRuleForProdWizard) - { - ApplicationArea = Manufacturing; - Caption = 'Edit Production Rule'; - ToolTip = 'Edit a Rule for production.'; - Image = Receipt; - Scope = Repeater; - Visible = ShowEditWizardProductionRule; - - trigger OnAction() - var - QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; - PreviousEntryNo: Integer; - begin - PreviousEntryNo := Rec."Entry No."; - QltyProdGenRuleWizard.RunModalWithGenerationRule(Rec); - - CurrPage.Update(false); - Rec.Reset(); - Rec.SetRange("Entry No.", PreviousEntryNo); - if Rec.FindSet() then; - Rec.SetRange("Entry No."); - end; - } action(CreateNewGenerationRuleForRecWizard) { Caption = 'Create Receiving Rule'; @@ -359,17 +304,12 @@ page 20405 "Qlty. In. Test Generat. Rules" ShowSortAndTemplate: Boolean; ShowEditWizardMovementRule: Boolean; ShowEditWizardReceivingRule: Boolean; - ShowEditWizardProductionRule: Boolean; TemplateCode: Code[20]; - ShowAssemblyTrigger: Boolean; - ShowProductionTrigger: Boolean; ShowPurchaseTrigger: Boolean; ShowSalesReturnTrigger: Boolean; ShowTransferTrigger: Boolean; ShowWarehouseReceiveTrigger: Boolean; ShowWarehouseMovementTrigger: Boolean; - EditAssemblyTrigger: Boolean; - EditProductionTrigger: Boolean; EditPurchaseTrigger: Boolean; EditSalesReturnTrigger: Boolean; EditTransferTrigger: Boolean; @@ -377,16 +317,18 @@ page 20405 "Qlty. In. Test Generat. Rules" EditWarehouseMovementTrigger: Boolean; ShowJobQueueEntries: Boolean; AssemblyStyle: Text; - ProductionStyle: Text; PurchaseStyle: Text; SalesReturnStyle: Text; WhseReceiveStyle: Text; WhseMovementStyle: Text; TransferStyle: Text; - RowStyle: Option None,Standard,StandardAccent,Strong,StrongAccent,Attention,AttentionAccent,Favorable,Unfavorable,Ambiguous,Subordinate; GenerationRulesCaptionLbl: Label 'Quality Inspection Test Generation Rules'; GenerationRulesCaptionForTemplateLbl: Label 'Quality Inspection Test Generation Rules for %1', Comment = '%1=the template'; + protected var + RowStyle: Option None,Standard,StandardAccent,Strong,StrongAccent,Attention,AttentionAccent,Favorable,Unfavorable,Ambiguous,Subordinate; + + trigger OnInit() begin ShowSortAndTemplate := true; @@ -450,11 +392,8 @@ page 20405 "Qlty. In. Test Generat. Rules" Rec.InferGenerationRuleIntent(KnownOrInferredIntent, Certainty); if Certainty = Certainty::Maybe then begin - ShowEditWizardProductionRule := true; ShowEditWizardReceivingRule := true; ShowEditWizardMovementRule := true; - EditAssemblyTrigger := true; - EditProductionTrigger := true; EditPurchaseTrigger := true; EditSalesReturnTrigger := true; EditTransferTrigger := true; @@ -462,7 +401,6 @@ page 20405 "Qlty. In. Test Generat. Rules" EditWarehouseReceiveTrigger := true; AssemblyStyle := Format(RowStyle::Ambiguous); - ProductionStyle := Format(RowStyle::Ambiguous); PurchaseStyle := Format(RowStyle::Ambiguous); SalesReturnStyle := Format(RowStyle::Ambiguous); WhseReceiveStyle := Format(RowStyle::Ambiguous); @@ -472,18 +410,6 @@ page 20405 "Qlty. In. Test Generat. Rules" end; case KnownOrInferredIntent of - Rec.Intent::Assembly: - begin - ShowEditWizardProductionRule := true; - EditAssemblyTrigger := true; - AssemblyStyle := Format(RowStyle::Standard); - end; - Rec.Intent::Production: - begin - ShowEditWizardProductionRule := true; - EditProductionTrigger := true; - ProductionStyle := Format(RowStyle::Standard); - end; Rec.Intent::Purchase: begin ShowEditWizardReceivingRule := true; @@ -520,18 +446,13 @@ page 20405 "Qlty. In. Test Generat. Rules" local procedure ClearRowSpecificVisibleAndEditFlags() begin ShowEditWizardReceivingRule := false; - ShowEditWizardProductionRule := false; ShowEditWizardMovementRule := false; - EditProductionTrigger := false; - EditAssemblyTrigger := false; EditPurchaseTrigger := false; EditSalesReturnTrigger := false; EditTransferTrigger := false; EditWarehouseReceiveTrigger := false; EditWarehouseMovementTrigger := false; - AssemblyStyle := Format(RowStyle::Subordinate); - ProductionStyle := Format(RowStyle::Subordinate); PurchaseStyle := Format(RowStyle::Subordinate); SalesReturnStyle := Format(RowStyle::Subordinate); WhseReceiveStyle := Format(RowStyle::Subordinate); @@ -555,24 +476,12 @@ page 20405 "Qlty. In. Test Generat. Rules" QltyManagementSetup: Record "Qlty. Management Setup"; QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; begin - ShowAssemblyTrigger := false; - ShowProductionTrigger := false; ShowPurchaseTrigger := false; ShowSalesReturnTrigger := false; ShowTransferTrigger := false; ShowWarehouseReceiveTrigger := false; ShowWarehouseMovementTrigger := false; - QltyInTestGenerationRule.CopyFilters(Rec); - QltyInTestGenerationRule.SetLoadFields(Intent); - QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Assembly); - if not QltyInTestGenerationRule.IsEmpty() then - ShowAssemblyTrigger := true; - - QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Production); - if not QltyInTestGenerationRule.IsEmpty() then - ShowProductionTrigger := true; - QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Purchase); if not QltyInTestGenerationRule.IsEmpty() then ShowPurchaseTrigger := true; @@ -595,8 +504,6 @@ page 20405 "Qlty. In. Test Generat. Rules" QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Unknown); if not QltyInTestGenerationRule.IsEmpty() then begin - ShowAssemblyTrigger := true; - ShowProductionTrigger := true; ShowPurchaseTrigger := true; ShowSalesReturnTrigger := true; ShowTransferTrigger := true; @@ -606,10 +513,6 @@ page 20405 "Qlty. In. Test Generat. Rules" if not QltyManagementSetup.Get() then exit; - if QltyManagementSetup."Assembly Trigger" <> QltyManagementSetup."Assembly Trigger"::NoTrigger then - ShowAssemblyTrigger := true; - if QltyManagementSetup."Production Trigger" <> QltyManagementSetup."Production Trigger"::NoTrigger then - ShowProductionTrigger := true; if QltyManagementSetup."Purchase Trigger" <> QltyManagementSetup."Purchase Trigger"::NoTrigger then ShowPurchaseTrigger := true; if QltyManagementSetup."Sales Return Trigger" <> QltyManagementSetup."Sales Return Trigger"::NoTrigger then diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGenerationRule.Table.al b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGenerationRule.Table.al index 21743f5554..43f7f26e0a 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGenerationRule.Table.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/GenerationRule/QltyInTestGenerationRule.Table.al @@ -10,12 +10,9 @@ using Microsoft.Inventory.Item; using Microsoft.Inventory.Journal; using Microsoft.Inventory.Ledger; using Microsoft.Inventory.Transfer; -using Microsoft.Manufacturing.Document; using Microsoft.Purchases.Document; using Microsoft.QualityManagement.Configuration.GenerationRule.JobQueue; using Microsoft.QualityManagement.Configuration.Template; -using Microsoft.QualityManagement.Integration.Assembly; -using Microsoft.QualityManagement.Integration.Manufacturing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Warehouse; using Microsoft.QualityManagement.Setup.Setup; @@ -213,34 +210,6 @@ table 20404 "Qlty. In. Test Generation Rule" QltyNotificationMgmt.Notify(StrSubstNo(RuleCurrentlyDisabledLbl, Rec."Sort Order", Rec."Template Code", Rec."Transfer Trigger")); end; } - field(26; "Production Trigger"; Enum "Qlty. Production Trigger") - { - Caption = 'Production Trigger'; - ToolTip = 'Specifies whether the generation rule should be used to automatically create tests based on a production trigger.'; - - trigger OnValidate() - var - QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; - begin - ConfirmUpdateManualTriggerStatus(); - if (Rec."Activation Trigger" = Rec."Activation Trigger"::Disabled) and (Rec."Template Code" <> '') and (Rec."Production Trigger" <> Rec."Production Trigger"::NoTrigger) and GuiAllowed() then - QltyNotificationMgmt.Notify(StrSubstNo(RuleCurrentlyDisabledLbl, Rec."Sort Order", Rec."Template Code", Rec."Production Trigger")); - end; - } - field(27; "Assembly Trigger"; Enum "Qlty. Assembly Trigger") - { - Caption = 'Assembly Trigger'; - ToolTip = 'Specifies whether the generation rule should be used to automatically create tests based on an assembly trigger.'; - - trigger OnValidate() - var - QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; - begin - ConfirmUpdateManualTriggerStatus(); - if (Rec."Activation Trigger" = Rec."Activation Trigger"::Disabled) and (Rec."Template Code" <> '') and (Rec."Assembly Trigger" <> Rec."Assembly Trigger"::NoTrigger) and GuiAllowed() then - QltyNotificationMgmt.Notify(StrSubstNo(RuleCurrentlyDisabledLbl, Rec."Sort Order", Rec."Template Code", Rec."Assembly Trigger")); - end; - } field(28; "Warehouse Movement Trigger"; Enum "Qlty. Warehouse Trigger") { Caption = 'Warehouse Movement Trigger'; @@ -438,10 +407,6 @@ table 20404 "Qlty. In. Test Generation Rule" SetDefaultTriggerValuesToNoTrigger(); if Rec."Activation Trigger" in [Rec."Activation Trigger"::"Manual or Automatic", Rec."Activation Trigger"::"Automatic only"] then case InferredIntent of - InferredIntent::Assembly: - Rec."Assembly Trigger" := QltyManagementSetup."Assembly Trigger"; - InferredIntent::Production: - Rec."Production Trigger" := QltyManagementSetup."Production Trigger"; InferredIntent::Purchase: Rec."Purchase Trigger" := QltyManagementSetup."Purchase Trigger"; InferredIntent::"Sales Return": @@ -452,20 +417,31 @@ table 20404 "Qlty. In. Test Generation Rule" Rec."Warehouse Movement Trigger" := QltyManagementSetup."Warehouse Trigger"; InferredIntent::"Warehouse Receipt": Rec."Warehouse Receive Trigger" := QltyManagementSetup."Warehouse Receive Trigger"; + else + OnSetIntentAndDefaultTriggerValuesFromSetupElseCase(Rec, QltyManagementSetup, InferredIntent); end; end; end; - local procedure ConfirmUpdateManualTriggerStatus() + /// + /// Confirms and updates the activation trigger if needed when an automatic trigger is set + /// + internal procedure ConfirmUpdateManualTriggerStatus() + var + IsNoTrigger: Boolean; begin - if (Rec."Activation Trigger" = Rec."Activation Trigger"::"Manual only") and GuiAllowed() then - if not ((Rec."Assembly Trigger" = Rec."Assembly Trigger"::NoTrigger) and (Rec."Transfer Trigger" = Rec."Transfer Trigger"::NoTrigger) and - (Rec."Production Trigger" = Rec."Production Trigger"::NoTrigger) and (Rec."Purchase Trigger" = Rec."Purchase Trigger"::NoTrigger) and + if (Rec."Activation Trigger" = Rec."Activation Trigger"::"Manual only") and GuiAllowed() then begin + OnConfirmUpdateManualTriggerStatusOnBeforeOnCheckTriggerIsNoTrigger(Rec, IsNoTrigger); + + if not ((Rec."Transfer Trigger" = Rec."Transfer Trigger"::NoTrigger) and + IsNoTrigger and + (Rec."Purchase Trigger" = Rec."Purchase Trigger"::NoTrigger) and (Rec."Sales Return Trigger" = Rec."Sales Return Trigger"::NoTrigger) and (Rec."Warehouse Receive Trigger" = Rec."Warehouse Receive Trigger"::NoTrigger) and (Rec."Warehouse Movement Trigger" = Rec."Warehouse Movement Trigger"::NoTrigger)) then if Confirm(StrSubstNo(TriggerNotActiveConfirmQst, Rec."Activation Trigger", Rec."Activation Trigger"::"Manual or Automatic")) then Rec."Activation Trigger" := Rec."Activation Trigger"::"Manual or Automatic"; + end; end; local procedure SetDefaultTriggerValuesToNoTrigger() @@ -474,9 +450,8 @@ table 20404 "Qlty. In. Test Generation Rule" Rec."Purchase Trigger" := Rec."Purchase Trigger"::NoTrigger; Rec."Sales Return Trigger" := Rec."Sales Return Trigger"::NoTrigger; Rec."Transfer Trigger" := Rec."Transfer Trigger"::NoTrigger; - Rec."Production Trigger" := Rec."Production Trigger"::NoTrigger; - Rec."Assembly Trigger" := Rec."Assembly Trigger"::NoTrigger; Rec."Warehouse Movement Trigger" := Rec."Warehouse Movement Trigger"::NoTrigger; + OnAfterSetDefaultTriggerValuesToNoTrigger(Rec); end; [TryFunction] @@ -518,11 +493,6 @@ table 20404 "Qlty. In. Test Generation Rule" QltyGenRuleIntent := QltyGenRuleIntent::Transfer; QltyCertainty := QltyCertainty::Yes; end; - Database::"Prod. Order Routing Line", Database::"Prod. Order Line", Database::"Production Order": - begin - QltyGenRuleIntent := QltyGenRuleIntent::Production; - QltyCertainty := QltyCertainty::Yes; - end; Database::"Posted Assembly Header", Database::"Assembly Line": begin QltyGenRuleIntent := QltyGenRuleIntent::Assembly; @@ -578,6 +548,8 @@ table 20404 "Qlty. In. Test Generation Rule" QltyCertainty := QltyCertainty::Maybe; end; end; + else + OnInferGenerationRuleIntentElseCase(Rec, QltyGenRuleIntent, QltyCertainty); end; end; @@ -591,6 +563,7 @@ table 20404 "Qlty. In. Test Generation Rule" TempItemLedgerEntry: Record "Item Ledger Entry" temporary; TempItemJournalLine: Record "Item Journal Line" temporary; QltyFilterHelpers: Codeunit "Qlty. Filter Helpers"; + Result: Boolean; begin if Rec."Source Table No." = 0 then exit(false); @@ -599,10 +572,6 @@ table 20404 "Qlty. In. Test Generation Rule" exit(false); case Rec."Source Table No." of - Database::"Prod. Order Routing Line", - Database::"Prod. Order Line", - Database::"Production Order": - exit(true); Database::"Item Ledger Entry": if QltyFilterHelpers.GetIsFilterSetToValue(Rec."Source Table No.", Rec."Condition Filter", TempItemLedgerEntry.FieldNo("Entry Type"), TempItemLedgerEntry."Entry Type"::Output) then exit(true) @@ -615,6 +584,10 @@ table 20404 "Qlty. In. Test Generation Rule" else if QltyFilterHelpers.GetIsFilterSetToValue(Rec."Source Table No.", Rec."Condition Filter", TempItemJournalLine.FieldNo("Order Type"), TempItemJournalLine."Order Type"::Production) then exit(true); + else begin + OnGetIsProductionIntentElseCase(Rec."Source Table No.", Rec."Condition Filter", Result); + exit(Result); + end; end; end; @@ -742,17 +715,39 @@ table 20404 "Qlty. In. Test Generation Rule" if IntentToCheck = IntentToCheck::Transfer then IntentSet := true; end; - if QltyManagementSetup."Production Trigger" <> QltyManagementSetup."Production Trigger"::NoTrigger then begin - TriggerCount += 1; - if IntentToCheck = IntentToCheck::Production then - IntentSet := true; - end; - if QltyManagementSetup."Assembly Trigger" <> QltyManagementSetup."Assembly Trigger"::NoTrigger then begin - TriggerCount += 1; - if IntentToCheck = IntentToCheck::Assembly then - IntentSet := true; - end; + OnAfterGetIsOnlyAutoTriggerInSetup(QltyManagementSetup, IntentToCheck, IntentSet, TriggerCount); exit((TriggerCount = 1) and IntentSet); end; + + [IntegrationEvent(false, false)] + local procedure OnGetIsProductionIntentElseCase(SourceTableNo: Integer; ConditionFilter: Text[400]; var Result: Boolean) + begin + // Your logic to determine if the intent is Production + end; + + [InternalEvent(false, false)] + local procedure OnConfirmUpdateManualTriggerStatusOnBeforeOnCheckTriggerIsNoTrigger(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var NoTrigger: Boolean) + begin + end; + + [InternalEvent(false, false)] + local procedure OnSetIntentAndDefaultTriggerValuesFromSetupElseCase(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var QltyManagementSetup: Record "Qlty. Management Setup"; InferredIntent: Enum "Qlty. Gen. Rule Intent") + begin + end; + + [InternalEvent(false, false)] + local procedure OnAfterSetDefaultTriggerValuesToNoTrigger(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule") + begin + end; + + [InternalEvent(false, false)] + local procedure OnInferGenerationRuleIntentElseCase(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var QltyGenRuleIntent: Enum "Qlty. Gen. Rule Intent"; var QltyCertainty: Enum "Qlty. Certainty") + begin + end; + + [InternalEvent(false, false)] + local procedure OnAfterGetIsOnlyAutoTriggerInSetup(var QltyManagementSetup: Record "Qlty. Management Setup"; var IntentToCheck: Enum "Qlty. Gen. Rule Intent"; var IntentSet: Boolean; var TriggerCount: Integer) + begin + end; } diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al index a89f7062b8..a10b653c3a 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/QltyAutoConfigure.Codeunit.al @@ -4,13 +4,9 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.QualityManagement.Configuration; -using Microsoft.Assembly.History; using Microsoft.Foundation.NoSeries; -using Microsoft.Inventory.Journal; -using Microsoft.Inventory.Ledger; using Microsoft.Inventory.Tracking; using Microsoft.Inventory.Transfer; -using Microsoft.Manufacturing.Document; using Microsoft.Purchases.Document; using Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.Grade; @@ -60,8 +56,6 @@ codeunit 20402 "Qlty. Auto Configure" SalesLineToTrackingDescriptionTok: Label 'Tracking Specification to Sales Line', Locked = true; WhseReceiptToPurchLineTok: Label 'WRTOPURCH', Locked = true; WhseReceiptToPurchLineDescriptionTok: Label 'Whse. Receipt to Purchase Line', Locked = true; - ProdLineToTrackingTok: Label 'TRACKINGTOPROD', Locked = true; - ProdLineToTrackingDescriptionTok: Label 'Tracking Specification to Prod. Order Line', Locked = true; PurchLineToTrackingTok: Label 'TRACKINGTOPURCH', Locked = true; PurchLineToTrackingDescriptionTok: Label 'Tracking Specification to Purchase Line', Locked = true; WhseReceiptToSalesLineTok: Label 'WRTOSALESRET', Locked = true; @@ -80,24 +74,8 @@ codeunit 20402 "Qlty. Auto Configure" SalesReturnLineToTestTok: Label 'SALESRETURNTOTEST', Locked = true; SalesReturnLineToTestDescriptionTok: Label 'Sales Return to Test', Locked = true; SalesReturnLineToTestFilterTok: Label 'WHERE(Document Type=FILTER(Return Order),Type=FILTER(Item))', Locked = true; - ProdJnlToTestTok: Label 'PRODJNLTOTEST', Locked = true; - ProdJnlToTestDescriptionTok: Label 'Production Output Journal to Test', Locked = true; - LedgerToTestTok: Label 'ITEMLDGEROUTTOTEST', Locked = true; - LedgerToTestDescriptionTok: Label 'Output Item Ledger to Test', Locked = true; - RtngToItemJnlTok: Label 'ROUTINGLINETOITEMJNL', Locked = true; - RtngToItemJnlDescriptionTok: Label 'Prod. Routing Line to Item Journal Line', Locked = true; - ProdLineToJnlTok: Label 'PRODLINETOITEMJNL', Locked = true; - ProdLineToJnlDescriptionTok: Label 'Prod. Order Line to Item Journal Line', Locked = true; - ProdLineToRoutingTok: Label 'PRODLINETOROUTING', Locked = true; - ProdLineToRoutingDescriptionTok: Label 'Prod. Order Line to Prod. Rtng.', Locked = true; InTransLineToTestTok: Label 'TRANSFERRECEIPTTOTEST', Locked = true; InTransLineToTestDescriptionTok: Label 'Inbound Transfer Line to Test', Locked = true; - ProdLineToLedgerTok: Label 'PRODLINETOITEMLEDGER', Locked = true; - ProdLineToLedgerDescriptionTok: Label 'Prod. Order Line to Item Ledger Entry.', Locked = true; - ProdRoutingToTestTok: Label 'ROUTINGTOTEST', Locked = true; - ProdRoutingToTestDescriptionTok: Label 'Prod. Order Routing Line to Test', Locked = true; - AssemblyOutputToTestTok: Label 'ASSEMBLYOUTPUTTOTEST', Locked = true; - AssemblyOutputToTestDescriptionTok: Label 'Posted Assembly Header to Test', Locked = true; ResourceBasedInstallFileTok: Label 'InstallFiles/PackageQM-EXPRESSDEMO.rapidstart', Locked = true; internal procedure GetDefaultPassGrade(): Text @@ -198,9 +176,9 @@ codeunit 20402 "Qlty. Auto Configure" exit; CreateDefaultTrackingSpecificationToTestConfiguration(); - CreateDefaultProductionConfiguration(); CreateDefaultReceivingConfiguration(); CreateDefaultWarehousingConfiguration(); + OnAfterEnsureAtLeastOneSourceConfiguration(this); end; /// @@ -245,21 +223,6 @@ codeunit 20402 "Qlty. Auto Configure" end; end; - internal procedure CreateDefaultProductionConfiguration() - begin - CreateDefaultProdOrderRoutingLineToTestConfiguration(); - CreateDefaultProdOrderLineToProdOrderRoutingConfiguration(); - - CreateDefaultItemLedgerOutputToTestConfiguration(); - CreateDefaultProdOrderLineToItemLedgerConfiguration(); - - CreateDefaultItemProdJournalToTestConfiguration(); - CreateDefaultProdOrderLineToItemJournalLineConfiguration(); - CreateDefaultProdOrderRoutingLineToItemJournalLineConfiguration(); - CreateDefaultTrackingSpecificationToProdConfiguration(); - CreateDefaultAssemblyOutputToTestConfiguration(); - end; - internal procedure CreateDefaultWarehousingConfiguration() begin CreateDefaultWarehouseEntryToTestConfiguration(); @@ -517,92 +480,6 @@ codeunit 20402 "Qlty. Auto Configure" true); end; - local procedure CreateDefaultTrackingSpecificationToProdConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderLine: Record "Prod. Order Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - TempTrackingSpecification: Record "Tracking Specification" temporary; - begin - EnsureSourceConfigWithFilterAndTrackFlag( - ProdLineToTrackingTok, - ProdLineToTrackingDescriptionTok, - Database::"Tracking Specification", - Database::"Prod. Order Line", - QltyInspectSourceConfig, - 'WHERE(Source Type=CONST(5406))', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Source Subtype"), - Database::"Prod. Order Line", - TempProdOrderLine.FieldNo(Status), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Source ID"), - Database::"Prod. Order Line", - TempProdOrderLine.FieldNo("Prod. Order No."), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Source Prod. Order Line"), - Database::"Prod. Order Line", - TempProdOrderLine.FieldNo("Line No."), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Item No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Item No."), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Quantity (Base)"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Variant Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Lot No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Lot No."), - '', - true); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Serial No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Serial No."), - '', - true); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Package No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Package No."), - ''); - EnsureSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempTrackingSpecification.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - '', - true); - end; - local procedure CreateDefaultTrackingSpecificationToPurchaseConfiguration() var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; @@ -1138,440 +1015,6 @@ codeunit 20402 "Qlty. Auto Configure" ''); end; - local procedure CreateDefaultItemProdJournalToTestConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempItemJournalLine: Record "Item Journal Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - ConfigFieldPriority: Enum "Qlty. Config. Field Priority"; - begin - EnsureSourceConfigWithFilter( - ProdJnlToTestTok, - ProdJnlToTestDescriptionTok, - Database::"Item Journal Line", - Database::"Qlty. Inspection Test Header", - QltyInspectSourceConfig, - 'WHERE(Entry Type=FILTER(Output),Order Type=FILTER(Production))'); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Order No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Order Line No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Operation No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Task No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Item No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Item No."), - ''); - EnsurePrioritizedSourceConfigLineWithTrackFlag( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Quantity (Base)"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), - '', - false, - ConfigFieldPriority::Priority); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Variant Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Lot No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Lot No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Serial No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Serial No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Package No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Package No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Description"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Description"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemJournalLine.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - ''); - end; - - local procedure CreateDefaultItemLedgerOutputToTestConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempItemLedgerEntry: Record "Item Ledger Entry" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfigWithFilter( - LedgerToTestTok, - LedgerToTestDescriptionTok, - Database::"Item Ledger Entry", - Database::"Qlty. Inspection Test Header", - QltyInspectSourceConfig, - 'WHERE(Entry Type=FILTER(Output),Order Type=FILTER(Production))'); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Order No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Order Line No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Item No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Item No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo(Quantity), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Variant Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Lot No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Lot No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Serial No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Serial No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Package No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Package No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo(Description), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo(Description), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempItemLedgerEntry.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - ''); - end; - - local procedure CreateDefaultProdOrderRoutingLineToItemJournalLineConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; - TempItemJournalLine: Record "Item Journal Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfigWithFilter( - RtngToItemJnlTok, - RtngToItemJnlDescriptionTok, - Database::"Prod. Order Routing Line", - Database::"Item Journal Line", - QltyInspectSourceConfig, - 'WHERE(Status=FILTER(Released))'); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Prod. Order No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Order No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Routing No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Routing No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Routing Reference No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Routing Reference No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Operation No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Operation No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Type"), - ' '); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), - ''); - end; - - local procedure CreateDefaultProdOrderLineToItemJournalLineConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderLine: Record "Prod. Order Line" temporary; - TempItemJournalLine: Record "Item Journal Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfigWithFilter( - ProdLineToJnlTok, - ProdLineToJnlDescriptionTok, - Database::"Prod. Order Line", - Database::"Item Journal Line", - QltyInspectSourceConfig, - 'WHERE(Status=FILTER(Released))'); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Prod. Order No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Order No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Line No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Order Line No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Item No."), - Database::"Item Journal Line", - TempItemJournalLine.FieldNo("Item No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Variant Code"), - Database::"Item Ledger Entry", - TempItemJournalLine.FieldNo("Variant Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Type"), - ' '); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), - ''); - end; - - local procedure CreateDefaultProdOrderLineToItemLedgerConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderLine: Record "Prod. Order Line" temporary; - TempItemLedgerEntry: Record "Item Ledger Entry" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfigWithFilter( - ProdLineToLedgerTok, - ProdLineToLedgerDescriptionTok, - Database::"Prod. Order Line", - Database::"Item Ledger Entry", - QltyInspectSourceConfig, - 'WHERE(Status=FILTER(Released))'); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Prod. Order No."), - Database::"Item Ledger Entry", - TempItemLedgerEntry.FieldNo("Order No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Line No."), - Database::"Item Ledger Entry", - TempItemLedgerEntry.FieldNo("Order Line No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Item No."), - Database::"Item Ledger Entry", - TempItemLedgerEntry.FieldNo("Item No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Variant Code"), - Database::"Item Ledger Entry", - TempItemLedgerEntry.FieldNo("Variant Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Type"), - ' '); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), - ''); - end; - - local procedure CreateDefaultProdOrderRoutingLineToTestConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfig( - ProdRoutingToTestTok, - ProdRoutingToTestDescriptionTok, - Database::"Prod. Order Routing Line", - Database::"Qlty. Inspection Test Header", - QltyInspectSourceConfig); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Prod. Order No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Type"), - ' '); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo(Status), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Operation No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Task No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Description"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Description"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderRoutingLine.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - ''); - end; - - local procedure CreateDefaultProdOrderLineToProdOrderRoutingConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempProdOrderLine: Record "Prod. Order Line" temporary; - TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfig( - ProdLineToRoutingTok, - ProdLineToRoutingDescriptionTok, - Database::"Prod. Order Line", - Database::"Prod. Order Routing Line", - QltyInspectSourceConfig); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Status"), - Database::"Prod. Order Routing Line", - TempProdOrderRoutingLine.FieldNo("Status"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Prod. Order No."), - Database::"Prod. Order Routing Line", - TempProdOrderRoutingLine.FieldNo("Prod. Order No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Routing No."), - Database::"Prod. Order Routing Line", - TempProdOrderRoutingLine.FieldNo("Routing No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Routing Reference No."), - Database::"Prod. Order Routing Line", - TempProdOrderRoutingLine.FieldNo("Routing Reference No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Item No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Item No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Quantity (Base)"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Variant Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Line No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempProdOrderLine.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - ''); - end; - local procedure CreateDefaultTransferLineReceiptToTestConfiguration() var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; @@ -1629,57 +1072,7 @@ codeunit 20402 "Qlty. Auto Configure" ''); end; - local procedure CreateDefaultAssemblyOutputToTestConfiguration() - var - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - TempPostedAssemblyHeader: Record "Posted Assembly Header" temporary; - TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; - begin - EnsureSourceConfig( - AssemblyOutputToTestTok, - AssemblyOutputToTestDescriptionTok, - Database::"Posted Assembly Header", - Database::"Qlty. Inspection Test Header", - QltyInspectSourceConfig); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo("No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Document No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo("Location Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Location Code"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo("Quantity (Base)"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo("Item No."), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Item No."), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo(Description), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo(Description), - ''); - EnsureSourceConfigLine( - QltyInspectSourceConfig, - TempPostedAssemblyHeader.FieldNo("Variant Code"), - Database::"Qlty. Inspection Test Header", - TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), - ''); - end; - - local procedure EnsureSourceConfig(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config.") + internal procedure EnsureSourceConfig(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config.") begin EnsureSourceConfigWithTrackFlag( Name, @@ -1690,7 +1083,7 @@ codeunit 20402 "Qlty. Auto Configure" false); end; - local procedure EnsureSourceConfigWithTrackFlag(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; TrackingOnly: Boolean) + internal procedure EnsureSourceConfigWithTrackFlag(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; TrackingOnly: Boolean) begin EnsureSourceConfigWithFilterAndTrackFlag( Name, @@ -1702,7 +1095,7 @@ codeunit 20402 "Qlty. Auto Configure" TrackingOnly); end; - local procedure EnsureSourceConfigWithFilter(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromFilter: Text) + internal procedure EnsureSourceConfigWithFilter(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromFilter: Text) begin EnsureSourceConfigWithFilterAndTrackFlag( Name, @@ -1714,7 +1107,7 @@ codeunit 20402 "Qlty. Auto Configure" false); end; - local procedure EnsureSourceConfigWithFilterAndTrackFlag(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromFilter: Text; TrackingOnly: Boolean) + internal procedure EnsureSourceConfigWithFilterAndTrackFlag(Name: Text; Description: Text; FromTable: Integer; ToTable: Integer; var QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromFilter: Text; TrackingOnly: Boolean) begin QltyInspectSourceConfig.Reset(); if not QltyInspectSourceConfig.Get(CopyStr(Name, 1, MaxStrLen(QltyInspectSourceConfig.Code))) then begin @@ -1736,7 +1129,7 @@ codeunit 20402 "Qlty. Auto Configure" end; end; - local procedure EnsureSourceConfigLine(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text) + internal procedure EnsureSourceConfigLine(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text) begin EnsureSourceConfigLineWithTrackFlag( QltyInspectSourceConfig, @@ -1747,14 +1140,14 @@ codeunit 20402 "Qlty. Auto Configure" false); end; - local procedure EnsureSourceConfigLineWithTrackFlag(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text; TrackingOnly: Boolean) + internal procedure EnsureSourceConfigLineWithTrackFlag(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text; TrackingOnly: Boolean) var ConfigFieldPriority: Enum "Qlty. Config. Field Priority"; begin EnsurePrioritizedSourceConfigLineWithTrackFlag(QltyInspectSourceConfig, FromField, ToTable, ToField, OptionalOverrideDisplay, TrackingOnly, ConfigFieldPriority::Normal); end; - local procedure EnsurePrioritizedSourceConfigLineWithTrackFlag(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text; TrackingOnly: Boolean; Priority: Enum "Qlty. Config. Field Priority") + internal procedure EnsurePrioritizedSourceConfigLineWithTrackFlag(QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; FromField: Integer; ToTable: Integer; ToField: Integer; OptionalOverrideDisplay: Text; TrackingOnly: Boolean; Priority: Enum "Qlty. Config. Field Priority") var QltyInspectSrcFldConf: Record "Qlty. Inspect. Src. Fld. Conf."; begin @@ -1881,4 +1274,9 @@ codeunit 20402 "Qlty. Auto Configure" CopyStream(OutStreamToConfigPackage, InStreamFromResource); ConfigPackageImport.ImportAndApplyRapidStartPackageStream(TempBlob); end; + + [InternalEvent(false, false)] + local procedure OnAfterEnsureAtLeastOneSourceConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + begin + end; } diff --git a/src/Apps/W1/Quality Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al index ba7fc3e8b8..7acfe6fbcf 100644 --- a/src/Apps/W1/Quality Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Configuration/SourceConfiguration/QltyTraversal.Codeunit.al @@ -5,9 +5,6 @@ namespace Microsoft.QualityManagement.Configuration.SourceConfiguration; using Microsoft.Inventory.Item; -using Microsoft.Manufacturing.Document; -using Microsoft.Manufacturing.ProductionBOM; -using Microsoft.Manufacturing.Routing; using Microsoft.Purchases.Vendor; using Microsoft.QualityManagement.Document; using Microsoft.QualityManagement.Utilities; @@ -970,321 +967,6 @@ codeunit 20408 "Qlty. Traversal" exit(false); end; - /// - /// Searches for a related Routing Header record by sequentially checking supplied record variants. - /// Uses early-exit pattern for improved readability and performance. - /// - /// Search sequence: - /// 1. Check Optional1Variant for Routing → exit immediately if found - /// 2. Check Optional2Variant for Routing → exit immediately if found - /// 3. Check Optional3Variant for Routing → exit immediately if found - /// 4. Check Optional4Variant for Routing → exit immediately if found - /// 5. Check Optional5Variant for Routing → exit immediately if found - /// 6. Find parent of Optional1Variant and check parent → return result - /// - /// Common usage: Finding Routing from Production Order Line, Item, or Routing Line - /// - /// Output parameter that will contain the found Routing Header record with all fields populated - /// First variant to search (typically primary record like Production Order Line) - /// Second variant to search (typically parent or related Item) - /// Third variant to search (optional) - /// Fourth variant to search (optional) - /// Fifth variant to search (optional) - /// True if a Routing was found in any variant or parent; False otherwise - procedure FindRelatedRouting(var RoutingHeader: Record "Routing Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean - var - ParentRecordRef: RecordRef; - begin - case true of - FindRelatedRoutingIn(RoutingHeader, Optional1Variant), - FindRelatedRoutingIn(RoutingHeader, Optional2Variant), - FindRelatedRoutingIn(RoutingHeader, Optional3Variant), - FindRelatedRoutingIn(RoutingHeader, Optional4Variant), - FindRelatedRoutingIn(RoutingHeader, Optional5Variant): - exit(true); - end; - - // Try to find parent record and search in it - if not FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then - exit(false); - - exit(FindRelatedRoutingIn(RoutingHeader, ParentRecordRef)); - end; - - /// - /// Searches for a related Routing Header within a specific record variant using field relationships. - /// Handles direct Routing Header records and indirect lookups through field mappings. - /// - /// Lookup strategy: - /// 1. If CurrentVariant is a Routing Header record → return it directly - /// 2. Call FindRelatedRecordByFieldRelation to search for Routing No. field mappings - /// 3. If a routing number is found, attempt Routing Header.Get() with that number - /// - /// Common scenarios: - /// - Production Order with "Routing No." → Routing lookup - /// - Item with "Routing No." → Routing lookup - /// - Routing Line with "Routing No." → Routing Header lookup - /// - /// Output: The found Routing Header record with all fields populated - /// The record variant to search (Record, RecordRef, or RecordId) - /// True if a Routing Header was found and loaded into RoutingHeader; False otherwise - procedure FindRelatedRoutingIn(var RoutingHeader: Record "Routing Header"; CurrentVariant: Variant): Boolean - var - RecordRef: RecordRef; - RoutingNo: Text; - begin - if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then - exit(false); - - // Try direct record match first - if RecordRef.Number() = Database::"Routing Header" then begin - RecordRef.SetTable(RoutingHeader); - exit(RoutingHeader.Get(RoutingHeader."No.")); - end; - - // Search through field relationships - if FindRelatedRecordByFieldRelation(RecordRef, Database::"Routing Header", MaxStrLen(RoutingHeader."No."), RoutingNo) then - exit(RoutingHeader.Get(RoutingNo)); - - exit(false); - end; - - /// - /// Searches for a related Production BOM Header record by sequentially checking supplied record variants. - /// Uses early-exit pattern for improved readability and performance. - /// - /// Search sequence: - /// 1. Check Optional1Variant for BOM → exit immediately if found - /// 2. Check Optional2Variant for BOM → exit immediately if found - /// 3. Check Optional3Variant for BOM → exit immediately if found - /// 4. Check Optional4Variant for BOM → exit immediately if found - /// 5. Check Optional5Variant for BOM → exit immediately if found - /// 6. Find parent of Optional1Variant and check parent → return result - /// - /// Common usage: Finding Production BOM from Production Order Line, Item, or BOM Line - /// - /// Output parameter that will contain the found Production BOM Header record with all fields populated - /// First variant to search (typically primary record like Production Order Line) - /// Second variant to search (typically parent or related Item) - /// Third variant to search (optional) - /// Fourth variant to search (optional) - /// Fifth variant to search (optional) - /// True if a Production BOM was found in any variant or parent; False otherwise - procedure FindRelatedBillOfMaterial(var ProductionBOMHeader: Record "Production BOM Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean - var - ParentRecordRef: RecordRef; - begin - case true of - FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional1Variant), - FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional2Variant), - FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional3Variant), - FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional4Variant), - FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional5Variant): - exit(true); - end; - - // Try to find parent record and search in it - if not FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then - exit(false); - - exit(FindRelatedBillOfMaterialIn(ProductionBOMHeader, ParentRecordRef)); - end; - - /// - /// Searches for a related Production BOM Header within a specific record variant using field relationships. - /// Handles direct BOM Header records and indirect lookups through both field mappings and table relations. - /// - /// Lookup strategy (more complex than other FindRelated* procedures): - /// 1. If CurrentVariant is a Production BOM Header → return it directly - /// 2. Find all fields in the source table that relate to Production BOM Header - /// 3. For each related field: - /// a. Check if there's an enabled Quality Inspection Source Field Configuration - /// b. If configured, read the field value and attempt Production BOM Header.Get() - /// c. If not configured but field has table relation, try direct field value lookup - /// 4. Return first successfully found Production BOM Header - /// - /// Common scenarios: - /// - Production Order with "Production BOM No." → BOM lookup - /// - Item with "Production BOM No." → BOM lookup - /// - Production BOM Line with parent BOM No. → BOM Header lookup - /// - /// Output: The found Production BOM Header record with all fields populated - /// The record variant to search (Record, RecordRef, or RecordId) - /// True if a Production BOM Header was found and loaded into ProductionBOMHeader; False otherwise - procedure FindRelatedBillOfMaterialIn(var ProductionBOMHeader: Record "Production BOM Header"; CurrentVariant: Variant): Boolean - var - CurrentField: Record Field; - QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; - QltyInspectSrcFldConf: Record "Qlty. Inspect. Src. Fld. Conf."; - RecordRef: RecordRef; - FromFieldReference: FieldRef; - PossibleBillOfMaterialNo: Text; - begin - if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then - exit(false); - - // Try direct record match first - if RecordRef.Number() = Database::"Production BOM Header" then begin - RecordRef.SetTable(ProductionBOMHeader); - exit(ProductionBOMHeader.Get(ProductionBOMHeader."No.")); - end; - - // Search through field relationships - CurrentField.SetRange(TableNo, RecordRef.Number()); - CurrentField.SetRange(RelationTableNo, Database::"Production BOM Header"); - if CurrentField.FindSet() then - repeat - QltyInspectSrcFldConf.SetRange("From Table No.", RecordRef.Number()); - QltyInspectSrcFldConf.SetRange("To Type", QltyInspectSrcFldConf."To Type"::Test); - QltyInspectSrcFldConf.SetRange("To Table No.", Database::"Qlty. Inspection Test Header"); - QltyInspectSrcFldConf.SetRange("From Field No.", CurrentField."No."); - if QltyInspectSrcFldConf.FindSet() then - repeat - if QltyInspectSourceConfig.Code <> QltyInspectSrcFldConf.Code then - if QltyInspectSourceConfig.Get(QltyInspectSrcFldConf.Code) then; - - if QltyInspectSourceConfig.Enabled then - if QltyInspectSrcFldConf."From Field No." <> 0 then begin - FromFieldReference := RecordRef.Field(QltyInspectSrcFldConf."From Field No."); - if FromFieldReference.Class() = FieldClass::FlowField then - FromFieldReference.CalcField(); - - PossibleBillOfMaterialNo := Format(FromFieldReference.Value()); - if PossibleBillOfMaterialNo <> '' then - if ProductionBOMHeader.Get(CopyStr(PossibleBillOfMaterialNo, 1, MaxStrLen(ProductionBOMHeader."No."))) then - exit(true); - end; - - until QltyInspectSrcFldConf.Next() = 0 - else begin - FromFieldReference := RecordRef.Field(CurrentField."No."); - if FromFieldReference.Class() = FieldClass::FlowField then - FromFieldReference.CalcField(); - - PossibleBillOfMaterialNo := Format(FromFieldReference.Value()); - if PossibleBillOfMaterialNo <> '' then - if ProductionBOMHeader.Get(CopyStr(PossibleBillOfMaterialNo, 1, MaxStrLen(ProductionBOMHeader."No."))) then - exit(true); - end; - until CurrentField.Next() = 0; - - exit(false); - end; - - /// - /// Searches for a related Production Order Routing Line by sequentially checking supplied record variants. - /// Uses an exact table number match strategy through the GetIfAnExactMatch helper procedure. - /// - /// Unlike other FindRelated* procedures that search through field mappings, this procedure - /// looks for an exact Production Order Routing Line record in the provided variants. - /// - /// Search sequence (through GetIfAnExactMatch): - /// 1. Check Optional1Variant for exact table match → exit if found - /// 2. Check Optional2Variant for exact table match → exit if found - /// 3. Check Optional3Variant for exact table match → exit if found - /// 4. Check Optional4Variant for exact table match → exit if found - /// 5. Check Optional5Variant for exact table match → exit if found - /// 6. Find parent of Optional1Variant and check parent → return result - /// - /// Common usage: Finding routing line from Production Order, Manufacturing process records - /// - /// Output: The found Production Order Routing Line record - /// First variant to check (typically Production Order or related record) - /// Second variant to check (optional) - /// Third variant to check (optional) - /// Fourth variant to check (optional) - /// Fifth variant to check (optional) - /// True if a Production Order Routing Line was found in any variant or parent; False otherwise - procedure FindRelatedProdOrderRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean - var - RecordRefToProdOrderRoutingLine: RecordRef; - begin - RecordRefToProdOrderRoutingLine.GetTable(ProdOrderRoutingLine); - if GetIfAnExactMatch(RecordRefToProdOrderRoutingLine, Optional1Variant, Optional2Variant, Optional3Variant, Optional4Variant, Optional5Variant) then begin - RecordRefToProdOrderRoutingLine.SetTable(ProdOrderRoutingLine); - exit(true); - end; - end; - - /// - /// Searches for an exact record match by sequentially checking supplied record variants. - /// Uses early-exit pattern for improved readability and performance. - /// - /// This is a helper procedure that looks for a record matching the exact table number specified - /// in FoundRecordRef. The FoundRecordRef parameter must be initialized with the target - /// table number before calling this procedure. - /// - /// Unlike the FindRelated* procedures which search for specific entity types, this procedure - /// performs a generic table-number-based match, useful for finding specific record types like - /// Prod. Order Routing Line that don't fit the standard relationship patterns. - /// - /// Search sequence: - /// 1. Check Optional1Variant for exact table match → exit immediately if found - /// 2. Check Optional2Variant for exact table match → exit immediately if found - /// 3. Check Optional3Variant for exact table match → exit immediately if found - /// 4. Check Optional4Variant for exact table match → exit immediately if found - /// 5. Check Optional5Variant for exact table match → exit immediately if found - /// 6. Find parent of Optional1Variant and check parent → return result - /// - /// Usage: Primarily used by FindRelatedProdOrderRoutingLine to locate routing line records - /// - /// Input/Output: Must contain the target table number on input; contains the found record on output - /// First variant to check for exact table match - /// Second variant to check for exact table match - /// Third variant to check for exact table match - /// Fourth variant to check for exact table match - /// Fifth variant to check for exact table match - /// True if an exact table match was found in any variant or parent; False otherwise - local procedure GetIfAnExactMatch(var FoundRecordRef: RecordRef; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean - var - ParentRecordRef: RecordRef; - begin - case true of - GetIfAnExactMatch(FoundRecordRef, Optional1Variant), - GetIfAnExactMatch(FoundRecordRef, Optional2Variant), - GetIfAnExactMatch(FoundRecordRef, Optional3Variant), - GetIfAnExactMatch(FoundRecordRef, Optional4Variant), - GetIfAnExactMatch(FoundRecordRef, Optional5Variant): - exit(true); - end; - - // Try to find parent record and search in it - if not FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then - exit(false); - - exit(GetIfAnExactMatch(FoundRecordRef, ParentRecordRef)); - end; - - /// - /// Checks if a specific record variant exactly matches the target table number specified in FoundRecordRef. - /// This is the single-variant implementation called by the multi-variant overload. - /// - /// Comparison logic: - /// 1. Convert CurrentVariant to RecordRef - /// 2. Check if RecordRef table number matches FoundRecordRef table number - /// 3. If match found, copy RecordRef to FoundRecordRef and set record filter - /// 4. Attempt to find the record with the filter applied - /// - /// Note: FoundRecordRef must be initialized with the target table number before calling. - /// This procedure is used internally by GetIfAnExactMatch(5-variant overload) and FindRelatedProdOrderRoutingLine. - /// - /// Input: Target table number; Output: Found record if match successful - /// The record variant to check (Record, RecordRef, or RecordId) - /// True if CurrentVariant's table number matches FoundRecordRef's table number and record exists; False otherwise - local procedure GetIfAnExactMatch(var FoundRecordRef: RecordRef; CurrentVariant: Variant): Boolean - var - RecordRef: RecordRef; - begin - if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then - exit(false); - - if RecordRef.Number() = FoundRecordRef.Number() then begin - FoundRecordRef := RecordRef; - FoundRecordRef.SetRecFilter(); - exit(FoundRecordRef.FindFirst()); - end; - end; - /// /// Generic helper to find a related record by searching through field relationships. /// This implements the common pattern used by all FindRelated*In procedures. @@ -1294,7 +976,7 @@ codeunit 20408 "Qlty. Traversal" /// Maximum field length for the target record's No. field /// Output parameter containing the found record number /// True if a related record was found - local procedure FindRelatedRecordByFieldRelation(RecordRef: RecordRef; TargetTableNo: Integer; MaxFieldLength: Integer; var RecordNoAsText: Text): Boolean + internal procedure FindRelatedRecordByFieldRelation(RecordRef: RecordRef; TargetTableNo: Integer; MaxFieldLength: Integer; var RecordNoAsText: Text): Boolean var CurrentField: Record Field; QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/ExtensionLogo.png b/src/Apps/W1/Quality Management/app/src/Manufacturing/ExtensionLogo.png new file mode 100644 index 0000000000..4d2c9a626c Binary files /dev/null and b/src/Apps/W1/Quality Management/app/src/Manufacturing/ExtensionLogo.png differ diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/app.json b/src/Apps/W1/Quality Management/app/src/Manufacturing/app.json new file mode 100644 index 0000000000..07b069bb52 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/app.json @@ -0,0 +1,47 @@ +{ + "id": "547e43c1-3f32-4791-a9d6-874e6aef462b", + "name": "Quality Management - Manufacturing", + "publisher": "Microsoft", + "brief": "Quality Management - Manufacturing extends Quality Management with capabilities that help ensure products meet defined standards by enabling systematic quality control in the production scenarios.", + "description": "Quality Management - Manufacturing helps ensure products meet defined standards by integrating inspection routines, test plans, and quality specifications directly into production, inventory, and purchasing workflows.", + "version": "28.0.0.0", + "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2338953", + "privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009", + "EULA": "https://go.microsoft.com/fwlink/?linkid=2182906", + "help": "https://go.microsoft.com/fwlink/?linkid=2338953", + "url": "https://go.microsoft.com/fwlink/?LinkId=724011", + "logo": "ExtensionLogo.png", + "dependencies": [ + { + "id": "bc7b3891-f61b-4883-bbb3-384cdef88bec", + "name": "Quality Management", + "publisher": "Microsoft", + "version": "28.0.0.0" + } + ], + "screenshots": [], + "platform": "28.0.0.0", + "application": "28.0.0.0", + "idRanges": [ + { + "from": 20400, + "to": 20600 + } + ], + "resourceExposurePolicy": { + "allowDebugging": true, + "includeSourceInSymbolFile": true, + "allowDownloadingSource": true + }, + "features": [ + "NoImplicitWith", + "TranslationFile" + ], + "internalsVisibleTo": [ + { + "id": "aa5fc5d3-ef4e-4b03-8512-9c584cdc1ceb", + "name": "Quality Management-Tests", + "publisher": "Microsoft" + } + ] +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAssemblyIntegration.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Assembly/QltyAssemblyIntegration.Codeunit.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAssemblyIntegration.Codeunit.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Assembly/QltyAssemblyIntegration.Codeunit.al diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAssemblyTrigger.Enum.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Assembly/QltyAssemblyTrigger.Enum.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Assembly/QltyAssemblyTrigger.Enum.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Assembly/QltyAssemblyTrigger.Enum.al diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.Codeunit.al new file mode 100644 index 0000000000..347a32fb2d --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.Codeunit.al @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Configuration.GenerationRule; + +using Microsoft.Manufacturing.Document; +using Microsoft.QualityManagement.Setup.Setup; +codeunit 20419 "Qlty. In Test Gen. Rule - Mfg." +{ + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnConfirmUpdateManualTriggerStatusOnBeforeOnCheckTriggerIsNoTrigger', '', false, false)] + local procedure OnConfirmUpdateManualTriggerStatusOnBeforeOnCheckTriggerIsNoTrigger(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var NoTrigger: Boolean) + begin + if NoTrigger then + NoTrigger := NoTrigger and (QltyInTestGenerationRule."Production Trigger" = QltyInTestGenerationRule."Production Trigger"::NoTrigger) and (QltyInTestGenerationRule."Assembly Trigger" = QltyInTestGenerationRule."Assembly Trigger"::NoTrigger); + end; + + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnSetIntentAndDefaultTriggerValuesFromSetupElseCase', '', false, false)] + local procedure OnSetIntentAndDefaultTriggerValuesFromSetupElseCase(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var QltyManagementSetup: Record "Qlty. Management Setup"; InferredIntent: Enum "Qlty. Gen. Rule Intent") + begin + case InferredIntent of + InferredIntent::Assembly: + QltyInTestGenerationRule."Assembly Trigger" := QltyManagementSetup."Assembly Trigger"; + InferredIntent::Production: + QltyInTestGenerationRule."Production Trigger" := QltyManagementSetup."Production Trigger"; + end; + end; + + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnAfterSetDefaultTriggerValuesToNoTrigger', '', false, false)] + local procedure OnAfterSetDefaultTriggerValuesToNoTrigger(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule") + begin + QltyInTestGenerationRule."Assembly Trigger" := QltyInTestGenerationRule."Assembly Trigger"::NoTrigger; + QltyInTestGenerationRule."Production Trigger" := QltyInTestGenerationRule."Production Trigger"::NoTrigger; + end; + + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnInferGenerationRuleIntentElseCase', '', false, false)] + local procedure OnInferGenerationRuleIntentElseCase(var QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; var QltyGenRuleIntent: Enum "Qlty. Gen. Rule Intent"; var QltyCertainty: Enum "Qlty. Certainty") + begin + if QltyInTestGenerationRule."Source Table No." in [Database::"Prod. Order Routing Line", Database::"Prod. Order Line", Database::"Production Order"] then begin + QltyGenRuleIntent := QltyGenRuleIntent::Production; + QltyCertainty := QltyCertainty::Yes; + end; + end; + + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnGetIsProductionIntentElseCase', '', false, false)] + local procedure OnGetIsProductionIntentElseCase(SourceTableNo: Integer; ConditionFilter: Text[400]; var Result: Boolean) + begin + if SourceTableNo in [Database::"Prod. Order Routing Line", Database::"Prod. Order Line", Database::"Production Order"] then + Result := true; + end; + + [EventSubscriber(ObjectType::Table, Database::"Qlty. In. Test Generation Rule", 'OnAfterGetIsOnlyAutoTriggerInSetup', '', false, false)] + local procedure OnAfterGetIsOnlyAutoTriggerInSetup(var QltyManagementSetup: Record "Qlty. Management Setup"; var IntentToCheck: Enum "Qlty. Gen. Rule Intent"; var IntentSet: Boolean; var TriggerCount: Integer) + begin + if QltyManagementSetup."Production Trigger" <> QltyManagementSetup."Production Trigger"::NoTrigger then begin + TriggerCount += 1; + if IntentToCheck = IntentToCheck::Production then + IntentSet := true; + end; + + if QltyManagementSetup."Assembly Trigger" <> QltyManagementSetup."Assembly Trigger"::NoTrigger then begin + TriggerCount += 1; + if IntentToCheck = IntentToCheck::Assembly then + IntentSet := true; + end; + end; +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.TableExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.TableExt.al new file mode 100644 index 0000000000..0b4f35f058 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QltyInTestGenRuleMfg.TableExt.al @@ -0,0 +1,48 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Configuration.GenerationRule; + +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Utilities; +using Microsoft.QualityManagement.Integration.Assembly; +tableextension 20401 "Qlty. In Test Gen. Rule - Mfg." extends "Qlty. In. Test Generation Rule" +{ + fields + { + field(26; "Production Trigger"; Enum "Qlty. Production Trigger") + { + Caption = 'Production Trigger'; + ToolTip = 'Specifies whether the generation rule should be used to automatically create tests based on a production trigger.'; + DataClassification = CustomerContent; + + trigger OnValidate() + var + QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; + begin + Rec.ConfirmUpdateManualTriggerStatus(); + if (Rec."Activation Trigger" = Rec."Activation Trigger"::Disabled) and (Rec."Template Code" <> '') and (Rec."Production Trigger" <> Rec."Production Trigger"::NoTrigger) and GuiAllowed() then + QltyNotificationMgmt.Notify(StrSubstNo(RuleCurrentlyDisabledMfgLbl, Rec."Sort Order", Rec."Template Code", Rec."Production Trigger")); + end; + } + field(27; "Assembly Trigger"; Enum "Qlty. Assembly Trigger") + { + Caption = 'Assembly Trigger'; + ToolTip = 'Specifies whether the generation rule should be used to automatically create tests based on an assembly trigger.'; + DataClassification = CustomerContent; + + trigger OnValidate() + var + QltyNotificationMgmt: Codeunit "Qlty. Notification Mgmt."; + begin + ConfirmUpdateManualTriggerStatus(); + if (Rec."Activation Trigger" = Rec."Activation Trigger"::Disabled) and (Rec."Template Code" <> '') and (Rec."Assembly Trigger" <> Rec."Assembly Trigger"::NoTrigger) and GuiAllowed() then + QltyNotificationMgmt.Notify(StrSubstNo(RuleCurrentlyDisabledMfgLbl, Rec."Sort Order", Rec."Template Code", Rec."Assembly Trigger")); + end; + } + } + + var + RuleCurrentlyDisabledMfgLbl: Label 'The generation rule Sort Order %1, Template Code %2 is currently disabled. It will need to have an activation trigger of "Automatic Only" or "Manual or Automatic" before it will be triggered by "%3"', Comment = '%1=generation rule sort order,%2=generation rule template code,%3=auto trigger'; +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QtyInTestGenRulesMfg.PageExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QtyInTestGenRulesMfg.PageExt.al new file mode 100644 index 0000000000..36307bbc71 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/GenerationRule/QtyInTestGenRulesMfg.PageExt.al @@ -0,0 +1,188 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Configuration.GenerationRule; + +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Setup.Setup; +pageextension 20421 "Qty. In Test Gen. Rules - Mfg." extends "Qlty. In. Test Generat. Rules" +{ + layout + { + addafter("Activation Trigger") + { + field("Assembly Trigger"; Rec."Assembly Trigger") + { + Visible = ShowAssemblyTrigger; + Editable = EditAssemblyTrigger; + StyleExpr = AssemblyStyle; + ApplicationArea = Assembly; + } + field("Production Trigger"; Rec."Production Trigger") + { + Visible = ShowProductionTrigger; + Editable = EditProductionTrigger; + StyleExpr = ProductionStyle; + ApplicationArea = Manufacturing; + } + } + } + + actions + { + addafter(CreateNewGenerationRuleForWhseWizard_Promoted) + { + actionref(CreateNewGenerationRuleForProdWizard_Promoted; CreateNewGenerationRuleForProdWizard) + { + } + } + + addbefore(CreateNewGenerationRuleForRecWizard) + { + action(CreateNewGenerationRuleForProdWizard) + { + Caption = 'Create Production Rule'; + ToolTip = 'Specifies to create a rule for production.'; + Image = Receipt; + ApplicationArea = Manufacturing; + + trigger OnAction() + var + RecQltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; + begin + RecQltyProdGenRuleWizard.RunModalWithGenerationRule(Rec); + CurrPage.Update(false); + end; + } + action(EditGenerationRuleForProdWizard) + { + ApplicationArea = Manufacturing; + Caption = 'Edit Production Rule'; + ToolTip = 'Edit a Rule for production.'; + Image = Receipt; + Scope = Repeater; + Visible = ShowEditWizardProductionRule; + + trigger OnAction() + var + QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; + PreviousEntryNo: Integer; + begin + PreviousEntryNo := Rec."Entry No."; + QltyProdGenRuleWizard.RunModalWithGenerationRule(Rec); + + CurrPage.Update(false); + Rec.Reset(); + Rec.SetRange("Entry No.", PreviousEntryNo); + if Rec.FindSet() then; + Rec.SetRange("Entry No."); + end; + } + } + + } + + trigger OnAfterGetCurrRecord() + begin + UpdateControls(); + end; + + trigger OnAfterGetRecord() + begin + UpdateControls(); + end; + + trigger OnOpenPage() + begin + SetTriggerColumnVisibleState(); + CurrPage.Update(false); + end; + + local procedure UpdateControls() + var + KnownOrInferredIntent: Enum "Qlty. Gen. Rule Intent"; + Certainty: Enum "Qlty. Certainty"; + begin + KnownOrInferredIntent := Rec.Intent; + + ClearRowSpecificVisibleAndEditFlags(); + if KnownOrInferredIntent = KnownOrInferredIntent::Unknown then begin + Rec.InferGenerationRuleIntent(KnownOrInferredIntent, Certainty); + + if Certainty = Certainty::Maybe then begin + ShowEditWizardProductionRule := true; + EditAssemblyTrigger := true; + EditProductionTrigger := true; + AssemblyStyle := Format(RowStyle::Ambiguous); + ProductionStyle := Format(RowStyle::Ambiguous); + end; + end; + + case KnownOrInferredIntent of + Rec.Intent::Assembly: + begin + ShowEditWizardProductionRule := true; + EditAssemblyTrigger := true; + AssemblyStyle := Format(RowStyle::Standard); + end; + Rec.Intent::Production: + begin + ShowEditWizardProductionRule := true; + EditProductionTrigger := true; + ProductionStyle := Format(RowStyle::Standard); + end; + end; + end; + + local procedure ClearRowSpecificVisibleAndEditFlags() + begin + ShowEditWizardProductionRule := false; + EditAssemblyTrigger := false; + EditProductionTrigger := false; + AssemblyStyle := Format(RowStyle::Subordinate); + ProductionStyle := Format(RowStyle::Subordinate); + end; + + local procedure SetTriggerColumnVisibleState() + var + QltyManagementSetup: Record "Qlty. Management Setup"; + QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; + begin + ShowAssemblyTrigger := false; + ShowProductionTrigger := false; + + QltyInTestGenerationRule.CopyFilters(Rec); + QltyInTestGenerationRule.SetLoadFields(Intent); + QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Assembly); + if not QltyInTestGenerationRule.IsEmpty() then + ShowAssemblyTrigger := true; + + QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Production); + if not QltyInTestGenerationRule.IsEmpty() then + ShowProductionTrigger := true; + + QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Unknown); + if not QltyInTestGenerationRule.IsEmpty() then begin + ShowProductionTrigger := true; + ShowAssemblyTrigger := true; + end; + + if not QltyManagementSetup.Get() then + exit; + + if QltyManagementSetup."Assembly Trigger" <> QltyManagementSetup."Assembly Trigger"::NoTrigger then + ShowAssemblyTrigger := true; + + if QltyManagementSetup."Production Trigger" <> QltyManagementSetup."Production Trigger"::NoTrigger then + ShowProductionTrigger := true; + end; + + protected var + ShowProductionTrigger, EditProductionTrigger : Boolean; + ProductionStyle: Text; + AssemblyStyle: Text; + ShowEditWizardProductionRule: Boolean; + EditAssemblyTrigger: Boolean; + ShowAssemblyTrigger: Boolean; +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/QltyAutoConfigureMfg.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/QltyAutoConfigureMfg.Codeunit.al new file mode 100644 index 0000000000..6a65b33cdd --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/QltyAutoConfigureMfg.Codeunit.al @@ -0,0 +1,631 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Configuration; + +using Microsoft.Assembly.History; +using Microsoft.Inventory.Tracking; +using Microsoft.Inventory.Journal; +using Microsoft.Inventory.Ledger; +using Microsoft.Manufacturing.Document; +using Microsoft.QualityManagement.Configuration.SourceConfiguration; +using Microsoft.QualityManagement.Document; + +/// +/// Contains helper functions to use for automatic configuration. +/// +codeunit 20422 "Qlty. Auto Configure - Mfg." +{ + var + ProdLineToTrackingTok: Label 'TRACKINGTOPROD', Locked = true; + ProdLineToTrackingDescriptionTok: Label 'Tracking Specification to Prod. Order Line', Locked = true; + ProdJnlToTestTok: Label 'PRODJNLTOTEST', Locked = true; + ProdJnlToTestDescriptionTok: Label 'Production Output Journal to Test', Locked = true; + RtngToItemJnlTok: Label 'ROUTINGLINETOITEMJNL', Locked = true; + RtngToItemJnlDescriptionTok: Label 'Prod. Routing Line to Item Journal Line', Locked = true; + ProdLineToJnlTok: Label 'PRODLINETOITEMJNL', Locked = true; + ProdLineToJnlDescriptionTok: Label 'Prod. Order Line to Item Journal Line', Locked = true; + ProdLineToRoutingTok: Label 'PRODLINETOROUTING', Locked = true; + ProdLineToRoutingDescriptionTok: Label 'Prod. Order Line to Prod. Rtng.', Locked = true; + ProdLineToLedgerTok: Label 'PRODLINETOITEMLEDGER', Locked = true; + ProdLineToLedgerDescriptionTok: Label 'Prod. Order Line to Item Ledger Entry.', Locked = true; + ProdRoutingToTestTok: Label 'ROUTINGTOTEST', Locked = true; + ProdRoutingToTestDescriptionTok: Label 'Prod. Order Routing Line to Test', Locked = true; + LedgerToTestTok: Label 'ITEMLDGEROUTTOTEST', Locked = true; + LedgerToTestDescriptionTok: Label 'Output Item Ledger to Test', Locked = true; + AssemblyOutputToTestTok: Label 'ASSEMBLYOUTPUTTOTEST', Locked = true; + AssemblyOutputToTestDescriptionTok: Label 'Posted Assembly Header to Test', Locked = true; + + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"Qlty. Auto Configure", OnAfterEnsureAtLeastOneSourceConfiguration, '', false, false)] + local procedure OnAfterEnsureAtLeastOneSourceConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + begin + CreateDefaultProductionConfiguration(QltyAutoConfigure); + end; + + internal procedure CreateDefaultProductionConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + begin + CreateDefaultProdOrderRoutingLineToTestConfiguration(QltyAutoConfigure); + CreateDefaultProdOrderLineToProdOrderRoutingConfiguration(QltyAutoConfigure); + + CreateDefaultItemLedgerOutputToTestConfiguration(QltyAutoConfigure); + CreateDefaultProdOrderLineToItemLedgerConfiguration(QltyAutoConfigure); + + CreateDefaultItemProdJournalToTestConfiguration(QltyAutoConfigure); + CreateDefaultProdOrderLineToItemJournalLineConfiguration(QltyAutoConfigure); + CreateDefaultProdOrderRoutingLineToItemJournalLineConfiguration(QltyAutoConfigure); + CreateDefaultTrackingSpecificationToProdConfiguration(QltyAutoConfigure); + CreateDefaultAssemblyOutputToTestConfiguration(QltyAutoConfigure); + end; + + local procedure CreateDefaultTrackingSpecificationToProdConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderLine: Record "Prod. Order Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + TempTrackingSpecification: Record "Tracking Specification" temporary; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilterAndTrackFlag( + ProdLineToTrackingTok, + ProdLineToTrackingDescriptionTok, + Database::"Tracking Specification", + Database::"Prod. Order Line", + QltyInspectSourceConfig, + 'WHERE(Source Type=CONST(5406))', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Source Subtype"), + Database::"Prod. Order Line", + TempProdOrderLine.FieldNo(Status), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Source ID"), + Database::"Prod. Order Line", + TempProdOrderLine.FieldNo("Prod. Order No."), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Source Prod. Order Line"), + Database::"Prod. Order Line", + TempProdOrderLine.FieldNo("Line No."), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Item No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Item No."), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Quantity (Base)"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Variant Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Lot No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Lot No."), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Serial No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Serial No."), + '', + true); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Package No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Package No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempTrackingSpecification.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + '', + true); + end; + + local procedure CreateDefaultItemProdJournalToTestConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempItemJournalLine: Record "Item Journal Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + ConfigFieldPriority: Enum "Qlty. Config. Field Priority"; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilter( + ProdJnlToTestTok, + ProdJnlToTestDescriptionTok, + Database::"Item Journal Line", + Database::"Qlty. Inspection Test Header", + QltyInspectSourceConfig, + 'WHERE(Entry Type=FILTER(Output),Order Type=FILTER(Production))'); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Order No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Order Line No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Operation No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Task No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Item No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Item No."), + ''); + QltyAutoConfigure.EnsurePrioritizedSourceConfigLineWithTrackFlag( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Quantity (Base)"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), + '', + false, + ConfigFieldPriority::Priority); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Variant Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Lot No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Lot No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Serial No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Serial No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Package No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Package No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Description"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Description"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemJournalLine.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + ''); + end; + + local procedure CreateDefaultItemLedgerOutputToTestConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempItemLedgerEntry: Record "Item Ledger Entry" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilter( + LedgerToTestTok, + LedgerToTestDescriptionTok, + Database::"Item Ledger Entry", + Database::"Qlty. Inspection Test Header", + QltyInspectSourceConfig, + 'WHERE(Entry Type=FILTER(Output),Order Type=FILTER(Production))'); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Order No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Order Line No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Item No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Item No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo(Quantity), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Variant Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Lot No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Lot No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Serial No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Serial No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Package No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Package No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo(Description), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo(Description), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempItemLedgerEntry.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + ''); + end; + + local procedure CreateDefaultProdOrderRoutingLineToItemJournalLineConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; + TempItemJournalLine: Record "Item Journal Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilter( + RtngToItemJnlTok, + RtngToItemJnlDescriptionTok, + Database::"Prod. Order Routing Line", + Database::"Item Journal Line", + QltyInspectSourceConfig, + 'WHERE(Status=FILTER(Released))'); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Prod. Order No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Order No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Routing No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Routing No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Routing Reference No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Routing Reference No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Operation No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Operation No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Type"), + ' '); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), + ''); + end; + + local procedure CreateDefaultProdOrderLineToItemJournalLineConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderLine: Record "Prod. Order Line" temporary; + TempItemJournalLine: Record "Item Journal Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilter( + ProdLineToJnlTok, + ProdLineToJnlDescriptionTok, + Database::"Prod. Order Line", + Database::"Item Journal Line", + QltyInspectSourceConfig, + 'WHERE(Status=FILTER(Released))'); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Prod. Order No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Order No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Line No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Order Line No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Item No."), + Database::"Item Journal Line", + TempItemJournalLine.FieldNo("Item No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Variant Code"), + Database::"Item Ledger Entry", + TempItemJournalLine.FieldNo("Variant Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Type"), + ' '); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), + ''); + end; + + local procedure CreateDefaultProdOrderLineToItemLedgerConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderLine: Record "Prod. Order Line" temporary; + TempItemLedgerEntry: Record "Item Ledger Entry" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfigWithFilter( + ProdLineToLedgerTok, + ProdLineToLedgerDescriptionTok, + Database::"Prod. Order Line", + Database::"Item Ledger Entry", + QltyInspectSourceConfig, + 'WHERE(Status=FILTER(Released))'); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Prod. Order No."), + Database::"Item Ledger Entry", + TempItemLedgerEntry.FieldNo("Order No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Line No."), + Database::"Item Ledger Entry", + TempItemLedgerEntry.FieldNo("Order Line No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Item No."), + Database::"Item Ledger Entry", + TempItemLedgerEntry.FieldNo("Item No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Variant Code"), + Database::"Item Ledger Entry", + TempItemLedgerEntry.FieldNo("Variant Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Type"), + ' '); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), + ''); + end; + + local procedure CreateDefaultProdOrderRoutingLineToTestConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfig( + ProdRoutingToTestTok, + ProdRoutingToTestDescriptionTok, + Database::"Prod. Order Routing Line", + Database::"Qlty. Inspection Test Header", + QltyInspectSourceConfig); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Prod. Order No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Type"), + ' '); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo(Status), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Custom 1"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Operation No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Task No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Description"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Description"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderRoutingLine.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + ''); + end; + + local procedure CreateDefaultProdOrderLineToProdOrderRoutingConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempProdOrderLine: Record "Prod. Order Line" temporary; + TempProdOrderRoutingLine: Record "Prod. Order Routing Line" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfig( + ProdLineToRoutingTok, + ProdLineToRoutingDescriptionTok, + Database::"Prod. Order Line", + Database::"Prod. Order Routing Line", + QltyInspectSourceConfig); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Status"), + Database::"Prod. Order Routing Line", + TempProdOrderRoutingLine.FieldNo("Status"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Prod. Order No."), + Database::"Prod. Order Routing Line", + TempProdOrderRoutingLine.FieldNo("Prod. Order No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Routing No."), + Database::"Prod. Order Routing Line", + TempProdOrderRoutingLine.FieldNo("Routing No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Routing Reference No."), + Database::"Prod. Order Routing Line", + TempProdOrderRoutingLine.FieldNo("Routing Reference No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Item No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Item No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Quantity (Base)"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Variant Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Line No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document Line No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempProdOrderLine.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + ''); + end; + + local procedure CreateDefaultAssemblyOutputToTestConfiguration(QltyAutoConfigure: Codeunit "Qlty. Auto Configure") + var + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + TempPostedAssemblyHeader: Record "Posted Assembly Header" temporary; + TempQltyInspectionTestHeader: Record "Qlty. Inspection Test Header" temporary; + begin + QltyAutoConfigure.EnsureSourceConfig( + AssemblyOutputToTestTok, + AssemblyOutputToTestDescriptionTok, + Database::"Posted Assembly Header", + Database::"Qlty. Inspection Test Header", + QltyInspectSourceConfig); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo("No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Document No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo("Location Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Location Code"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo("Quantity (Base)"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Quantity (Base)"), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo("Item No."), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Item No."), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo(Description), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo(Description), + ''); + QltyAutoConfigure.EnsureSourceConfigLine( + QltyInspectSourceConfig, + TempPostedAssemblyHeader.FieldNo("Variant Code"), + Database::"Qlty. Inspection Test Header", + TempQltyInspectionTestHeader.FieldNo("Source Variant Code"), + ''); + end; +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/SourceConfiguration/QltyTraversalMfg.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/SourceConfiguration/QltyTraversalMfg.Codeunit.al new file mode 100644 index 0000000000..240c86312d --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Configuration/SourceConfiguration/QltyTraversalMfg.Codeunit.al @@ -0,0 +1,334 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Configuration.SourceConfiguration; + +using Microsoft.Manufacturing.Document; +using Microsoft.Manufacturing.ProductionBOM; +using System.Reflection; +using Microsoft.QualityManagement.Utilities; +using Microsoft.Manufacturing.Routing; +using Microsoft.QualityManagement.Document; +codeunit 20427 "Qlty. Traversal - Mfg." +{ + var + QltyMiscHelpers: Codeunit "Qlty. Misc Helpers"; + QltyTraversal: Codeunit "Qlty. Traversal"; + + /// + /// Searches for a related Routing Header record by sequentially checking supplied record variants. + /// Uses early-exit pattern for improved readability and performance. + /// + /// Search sequence: + /// 1. Check Optional1Variant for Routing → exit immediately if found + /// 2. Check Optional2Variant for Routing → exit immediately if found + /// 3. Check Optional3Variant for Routing → exit immediately if found + /// 4. Check Optional4Variant for Routing → exit immediately if found + /// 5. Check Optional5Variant for Routing → exit immediately if found + /// 6. Find parent of Optional1Variant and check parent → return result + /// + /// Common usage: Finding Routing from Production Order Line, Item, or Routing Line + /// + /// Output parameter that will contain the found Routing Header record with all fields populated + /// First variant to search (typically primary record like Production Order Line) + /// Second variant to search (typically parent or related Item) + /// Third variant to search (optional) + /// Fourth variant to search (optional) + /// Fifth variant to search (optional) + /// True if a Routing was found in any variant or parent; False otherwise + procedure FindRelatedRouting(var RoutingHeader: Record "Routing Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean + var + ParentRecordRef: RecordRef; + begin + case true of + FindRelatedRoutingIn(RoutingHeader, Optional1Variant), + FindRelatedRoutingIn(RoutingHeader, Optional2Variant), + FindRelatedRoutingIn(RoutingHeader, Optional3Variant), + FindRelatedRoutingIn(RoutingHeader, Optional4Variant), + FindRelatedRoutingIn(RoutingHeader, Optional5Variant): + exit(true); + end; + + // Try to find parent record and search in it + if not QltyTraversal.FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then + exit(false); + + exit(FindRelatedRoutingIn(RoutingHeader, ParentRecordRef)); + end; + + /// + /// Searches for a related Routing Header within a specific record variant using field relationships. + /// Handles direct Routing Header records and indirect lookups through field mappings. + /// + /// Lookup strategy: + /// 1. If CurrentVariant is a Routing Header record → return it directly + /// 2. Call FindRelatedRecordByFieldRelation to search for Routing No. field mappings + /// 3. If a routing number is found, attempt Routing Header.Get() with that number + /// + /// Common scenarios: + /// - Production Order with "Routing No." → Routing lookup + /// - Item with "Routing No." → Routing lookup + /// - Routing Line with "Routing No." → Routing Header lookup + /// + /// Output: The found Routing Header record with all fields populated + /// The record variant to search (Record, RecordRef, or RecordId) + /// True if a Routing Header was found and loaded into RoutingHeader; False otherwise + procedure FindRelatedRoutingIn(var RoutingHeader: Record "Routing Header"; CurrentVariant: Variant): Boolean + var + RecordRef: RecordRef; + RoutingNo: Text; + begin + if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then + exit(false); + + // Try direct record match first + if RecordRef.Number() = Database::"Routing Header" then begin + RecordRef.SetTable(RoutingHeader); + exit(RoutingHeader.Get(RoutingHeader."No.")); + end; + + // Search through field relationships + if QltyTraversal.FindRelatedRecordByFieldRelation(RecordRef, Database::"Routing Header", MaxStrLen(RoutingHeader."No."), RoutingNo) then + exit(RoutingHeader.Get(RoutingNo)); + + exit(false); + end; + + /// + /// Searches for a related Production BOM Header record by sequentially checking supplied record variants. + /// Uses early-exit pattern for improved readability and performance. + /// + /// Search sequence: + /// 1. Check Optional1Variant for BOM → exit immediately if found + /// 2. Check Optional2Variant for BOM → exit immediately if found + /// 3. Check Optional3Variant for BOM → exit immediately if found + /// 4. Check Optional4Variant for BOM → exit immediately if found + /// 5. Check Optional5Variant for BOM → exit immediately if found + /// 6. Find parent of Optional1Variant and check parent → return result + /// + /// Common usage: Finding Production BOM from Production Order Line, Item, or BOM Line + /// + /// Output parameter that will contain the found Production BOM Header record with all fields populated + /// First variant to search (typically primary record like Production Order Line) + /// Second variant to search (typically parent or related Item) + /// Third variant to search (optional) + /// Fourth variant to search (optional) + /// Fifth variant to search (optional) + /// True if a Production BOM was found in any variant or parent; False otherwise + procedure FindRelatedBillOfMaterial(var ProductionBOMHeader: Record "Production BOM Header"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean + var + ParentRecordRef: RecordRef; + begin + case true of + FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional1Variant), + FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional2Variant), + FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional3Variant), + FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional4Variant), + FindRelatedBillOfMaterialIn(ProductionBOMHeader, Optional5Variant): + exit(true); + end; + + // Try to find parent record and search in it + if not QltyTraversal.FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then + exit(false); + + exit(FindRelatedBillOfMaterialIn(ProductionBOMHeader, ParentRecordRef)); + end; + + /// + /// Searches for a related Production BOM Header within a specific record variant using field relationships. + /// Handles direct BOM Header records and indirect lookups through both field mappings and table relations. + /// + /// Lookup strategy (more complex than other FindRelated* procedures): + /// 1. If CurrentVariant is a Production BOM Header → return it directly + /// 2. Find all fields in the source table that relate to Production BOM Header + /// 3. For each related field: + /// a. Check if there's an enabled Quality Inspection Source Field Configuration + /// b. If configured, read the field value and attempt Production BOM Header.Get() + /// c. If not configured but field has table relation, try direct field value lookup + /// 4. Return first successfully found Production BOM Header + /// + /// Common scenarios: + /// - Production Order with "Production BOM No." → BOM lookup + /// - Item with "Production BOM No." → BOM lookup + /// - Production BOM Line with parent BOM No. → BOM Header lookup + /// + /// Output: The found Production BOM Header record with all fields populated + /// The record variant to search (Record, RecordRef, or RecordId) + /// True if a Production BOM Header was found and loaded into ProductionBOMHeader; False otherwise + procedure FindRelatedBillOfMaterialIn(var ProductionBOMHeader: Record "Production BOM Header"; CurrentVariant: Variant): Boolean + var + CurrentField: Record Field; + QltyInspectSourceConfig: Record "Qlty. Inspect. Source Config."; + QltyInspectSrcFldConf: Record "Qlty. Inspect. Src. Fld. Conf."; + RecordRef: RecordRef; + FromFieldReference: FieldRef; + PossibleBillOfMaterialNo: Text; + begin + if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then + exit(false); + + // Try direct record match first + if RecordRef.Number() = Database::"Production BOM Header" then begin + RecordRef.SetTable(ProductionBOMHeader); + exit(ProductionBOMHeader.Get(ProductionBOMHeader."No.")); + end; + + // Search through field relationships + CurrentField.SetRange(TableNo, RecordRef.Number()); + CurrentField.SetRange(RelationTableNo, Database::"Production BOM Header"); + if CurrentField.FindSet() then + repeat + QltyInspectSrcFldConf.SetRange("From Table No.", RecordRef.Number()); + QltyInspectSrcFldConf.SetRange("To Type", QltyInspectSrcFldConf."To Type"::Test); + QltyInspectSrcFldConf.SetRange("To Table No.", Database::"Qlty. Inspection Test Header"); + QltyInspectSrcFldConf.SetRange("From Field No.", CurrentField."No."); + if QltyInspectSrcFldConf.FindSet() then + repeat + if QltyInspectSourceConfig.Code <> QltyInspectSrcFldConf.Code then + if QltyInspectSourceConfig.Get(QltyInspectSrcFldConf.Code) then; + + if QltyInspectSourceConfig.Enabled then + if QltyInspectSrcFldConf."From Field No." <> 0 then begin + FromFieldReference := RecordRef.Field(QltyInspectSrcFldConf."From Field No."); + if FromFieldReference.Class() = FieldClass::FlowField then + FromFieldReference.CalcField(); + + PossibleBillOfMaterialNo := Format(FromFieldReference.Value()); + if PossibleBillOfMaterialNo <> '' then + if ProductionBOMHeader.Get(CopyStr(PossibleBillOfMaterialNo, 1, MaxStrLen(ProductionBOMHeader."No."))) then + exit(true); + end; + + until QltyInspectSrcFldConf.Next() = 0 + else begin + FromFieldReference := RecordRef.Field(CurrentField."No."); + if FromFieldReference.Class() = FieldClass::FlowField then + FromFieldReference.CalcField(); + + PossibleBillOfMaterialNo := Format(FromFieldReference.Value()); + if PossibleBillOfMaterialNo <> '' then + if ProductionBOMHeader.Get(CopyStr(PossibleBillOfMaterialNo, 1, MaxStrLen(ProductionBOMHeader."No."))) then + exit(true); + end; + until CurrentField.Next() = 0; + + exit(false); + end; + + /// + /// Searches for a related Production Order Routing Line by sequentially checking supplied record variants. + /// Uses an exact table number match strategy through the GetIfAnExactMatch helper procedure. + /// + /// Unlike other FindRelated* procedures that search through field mappings, this procedure + /// looks for an exact Production Order Routing Line record in the provided variants. + /// + /// Search sequence (through GetIfAnExactMatch): + /// 1. Check Optional1Variant for exact table match → exit if found + /// 2. Check Optional2Variant for exact table match → exit if found + /// 3. Check Optional3Variant for exact table match → exit if found + /// 4. Check Optional4Variant for exact table match → exit if found + /// 5. Check Optional5Variant for exact table match → exit if found + /// 6. Find parent of Optional1Variant and check parent → return result + /// + /// Common usage: Finding routing line from Production Order, Manufacturing process records + /// + /// Output: The found Production Order Routing Line record + /// First variant to check (typically Production Order or related record) + /// Second variant to check (optional) + /// Third variant to check (optional) + /// Fourth variant to check (optional) + /// Fifth variant to check (optional) + /// True if a Production Order Routing Line was found in any variant or parent; False otherwise + procedure FindRelatedProdOrderRoutingLine(var ProdOrderRoutingLine: Record "Prod. Order Routing Line"; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean + var + RecordRefToProdOrderRoutingLine: RecordRef; + begin + RecordRefToProdOrderRoutingLine.GetTable(ProdOrderRoutingLine); + if GetIfAnExactMatch(RecordRefToProdOrderRoutingLine, Optional1Variant, Optional2Variant, Optional3Variant, Optional4Variant, Optional5Variant) then begin + RecordRefToProdOrderRoutingLine.SetTable(ProdOrderRoutingLine); + exit(true); + end; + end; + + /// + /// Searches for an exact record match by sequentially checking supplied record variants. + /// Uses early-exit pattern for improved readability and performance. + /// + /// This is a helper procedure that looks for a record matching the exact table number specified + /// in FoundRecordRef. The FoundRecordRef parameter must be initialized with the target + /// table number before calling this procedure. + /// + /// Unlike the FindRelated* procedures which search for specific entity types, this procedure + /// performs a generic table-number-based match, useful for finding specific record types like + /// Prod. Order Routing Line that don't fit the standard relationship patterns. + /// + /// Search sequence: + /// 1. Check Optional1Variant for exact table match → exit immediately if found + /// 2. Check Optional2Variant for exact table match → exit immediately if found + /// 3. Check Optional3Variant for exact table match → exit immediately if found + /// 4. Check Optional4Variant for exact table match → exit immediately if found + /// 5. Check Optional5Variant for exact table match → exit immediately if found + /// 6. Find parent of Optional1Variant and check parent → return result + /// + /// Usage: Primarily used by FindRelatedProdOrderRoutingLine to locate routing line records + /// + /// Input/Output: Must contain the target table number on input; contains the found record on output + /// First variant to check for exact table match + /// Second variant to check for exact table match + /// Third variant to check for exact table match + /// Fourth variant to check for exact table match + /// Fifth variant to check for exact table match + /// True if an exact table match was found in any variant or parent; False otherwise + local procedure GetIfAnExactMatch(var FoundRecordRef: RecordRef; Optional1Variant: Variant; Optional2Variant: Variant; Optional3Variant: Variant; Optional4Variant: Variant; Optional5Variant: Variant): Boolean + var + ParentRecordRef: RecordRef; + begin + case true of + GetIfAnExactMatch(FoundRecordRef, Optional1Variant), + GetIfAnExactMatch(FoundRecordRef, Optional2Variant), + GetIfAnExactMatch(FoundRecordRef, Optional3Variant), + GetIfAnExactMatch(FoundRecordRef, Optional4Variant), + GetIfAnExactMatch(FoundRecordRef, Optional5Variant): + exit(true); + end; + + // Try to find parent record and search in it + if not QltyTraversal.FindSingleParentRecordWithVariant(Optional1Variant, ParentRecordRef) then + exit(false); + + exit(GetIfAnExactMatch(FoundRecordRef, ParentRecordRef)); + end; + + /// + /// Checks if a specific record variant exactly matches the target table number specified in FoundRecordRef. + /// This is the single-variant implementation called by the multi-variant overload. + /// + /// Comparison logic: + /// 1. Convert CurrentVariant to RecordRef + /// 2. Check if RecordRef table number matches FoundRecordRef table number + /// 3. If match found, copy RecordRef to FoundRecordRef and set record filter + /// 4. Attempt to find the record with the filter applied + /// + /// Note: FoundRecordRef must be initialized with the target table number before calling. + /// This procedure is used internally by GetIfAnExactMatch(5-variant overload) and FindRelatedProdOrderRoutingLine. + /// + /// Input: Target table number; Output: Found record if match successful + /// The record variant to check (Record, RecordRef, or RecordId) + /// True if CurrentVariant's table number matches FoundRecordRef's table number and record exists; False otherwise + local procedure GetIfAnExactMatch(var FoundRecordRef: RecordRef; CurrentVariant: Variant): Boolean + var + RecordRef: RecordRef; + begin + if not QltyMiscHelpers.GetRecordRefFromVariant(CurrentVariant, RecordRef) then + exit(false); + + if RecordRef.Number() = FoundRecordRef.Number() then begin + FoundRecordRef := RecordRef; + FoundRecordRef.SetRecFilter(); + exit(FoundRecordRef.FindFirst()); + end; + end; + +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Document/QltyProdOrderRouting.PageExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Document/QltyProdOrderRouting.PageExt.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Document/QltyProdOrderRouting.PageExt.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Document/QltyProdOrderRouting.PageExt.al diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Journal/QltyConsumptionJournal.PageExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Journal/QltyConsumptionJournal.PageExt.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Journal/QltyConsumptionJournal.PageExt.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Journal/QltyConsumptionJournal.PageExt.al diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Journal/QltyOutputJournal.PageExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Journal/QltyOutputJournal.PageExt.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Journal/QltyOutputJournal.PageExt.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Journal/QltyOutputJournal.PageExt.al diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgEntryInspector.PermissionSetExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgEntryInspector.PermissionSetExt.al new file mode 100644 index 0000000000..7c0123ff2d --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgEntryInspector.PermissionSetExt.al @@ -0,0 +1,25 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Integration.Manufacturing.Permissions; + +using Microsoft.QualityManagement.Integration.Assembly; +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Integration.Manufacturing.Routing; +using Microsoft.QualityManagement.Permissions; +using Microsoft.QualityManagement.Utilities; + +/// +/// Adds permissions for manufacturing objects +/// +permissionsetextension 20472 "Qlty. Mfg. Entry Inspector" extends QltyEntryInspector +{ + Permissions = + codeunit "Qlty. Manufactur. Integration" = X, + codeunit "Qlty. Assembly Integration" = X, + codeunit "Qlty. Filter Helpers - Mfg." = X, + codeunit "Qlty. Session Helper - Mfg." = X, + page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Routing Line Lookup" = X; +} diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgGeneral.PermissionSetExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgGeneral.PermissionSetExt.al new file mode 100644 index 0000000000..ce963f5297 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgGeneral.PermissionSetExt.al @@ -0,0 +1,25 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Integration.Manufacturing.Permissions; + +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Integration.Assembly; +using Microsoft.QualityManagement.Integration.Manufacturing.Routing; +using Microsoft.QualityManagement.Permissions; +using Microsoft.QualityManagement.Utilities; + +/// +/// Adds permissions for manufacturing objects +/// +permissionsetextension 20471 "Qlty. Mfg. General" extends QltyGeneral +{ + Permissions = + codeunit "Qlty. Manufactur. Integration" = X, + codeunit "Qlty. Assembly Integration" = X, + codeunit "Qlty. Filter Helpers - Mfg." = X, + codeunit "Qlty. Session Helper - Mfg." = X, + page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Routing Line Lookup" = X; +} diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgMngmntObjects.PermissionSetExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgMngmntObjects.PermissionSetExt.al new file mode 100644 index 0000000000..70440adfd2 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgMngmntObjects.PermissionSetExt.al @@ -0,0 +1,25 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Integration.Manufacturing.Permissions; + +using Microsoft.QualityManagement.Integration.Assembly; +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Integration.Manufacturing.Routing; +using Microsoft.QualityManagement.Permissions; +using Microsoft.QualityManagement.Utilities; + +/// +/// Adds permissions for manufacturing objects +/// +permissionsetextension 20470 "Qlty. Mfg. Mngmnt. - Objects" extends "QltyMngmnt - Objects" +{ + Permissions = + codeunit "Qlty. Manufactur. Integration" = X, + codeunit "Qlty. Assembly Integration" = X, + codeunit "Qlty. Filter Helpers - Mfg." = X, + codeunit "Qlty. Session Helper - Mfg." = X, + page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Routing Line Lookup" = X; +} diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgObjects.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgObjects.PermissionSet.al new file mode 100644 index 0000000000..e94f207ba7 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Permissions/QltyMfgObjects.PermissionSet.al @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Integration.Manufacturing; + +using Microsoft.QualityManagement.Configuration.SourceConfiguration; +using Microsoft.QualityManagement.Integration.Manufacturing.Routing; +using Microsoft.QualityManagement.Utilities; + +permissionset 20470 "Qlty. Mfg. - Objects" +{ + Access = Internal; + Assignable = false; + Caption = 'Quality Management Manufacturing - Objects'; + + Permissions = + codeunit "Qlty. Manufactur. Integration" = X, + codeunit "Qlty. Filter Helpers - Mfg." = X, + codeunit "Qlty. Session Helper - Mfg." = X, + codeunit "Qlty. Traversal - Mfg." = X, + page "Qlty. Prod. Gen. Rule Wizard" = X, + page "Qlty. Routing Line Lookup" = X; +} diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyAutoProductionTrigger.Enum.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyAutoProductionTrigger.Enum.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyAutoProductionTrigger.Enum.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyAutoProductionTrigger.Enum.al diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyManufacturIntegration.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyManufacturIntegration.Codeunit.al similarity index 99% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyManufacturIntegration.Codeunit.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyManufacturIntegration.Codeunit.al index ab82328853..e3b12cc5ce 100644 --- a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyManufacturIntegration.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyManufacturIntegration.Codeunit.al @@ -22,7 +22,7 @@ codeunit 20407 "Qlty. Manufactur. Integration" { var QltyTraversal: Codeunit "Qlty. Traversal"; - QltySessionHelper: Codeunit "Qlty. Session Helper"; + QltySessionHelperMfg: Codeunit "Qlty. Session Helper - Mfg."; PermissionErr: Label 'User %1 not have permission to modify Quality Inspection Results tables, this will prevent test being updated.', Comment = '%1:User ID'; ProductionRegisteredLogEventIDTok: Label 'QMERR0002', Locked = true; TargetDetailRecordTok: Label 'Target', Locked = true; @@ -98,7 +98,7 @@ codeunit 20407 "Qlty. Manufactur. Integration" if not QltyManagementSetup.GetSetupRecord() then exit; - QltySessionHelper.SetProductionOrderBeforeChangingStatus(ProductionOrder); + QltySessionHelperMfg.SetProductionOrderBeforeChangingStatus(ProductionOrder); end; [EventSubscriber(ObjectType::Codeunit, Codeunit::"Prod. Order Status Management", 'OnAfterChangeStatusOnProdOrder', '', true, true)] @@ -112,7 +112,7 @@ codeunit 20407 "Qlty. Manufactur. Integration" if not QltyManagementSetup.GetSetupRecord() then exit; - QltySessionHelper.GetProductionOrderBeforeChangingStatus(OldProductionOrder); + QltySessionHelperMfg.GetProductionOrderBeforeChangingStatus(OldProductionOrder); OnBeforeProductionHandleOnAfterChangeStatusOnProdOrder(OldProductionOrder, ToProdOrder, Handled); if Handled then diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyProdGenRuleWizard.Page.al similarity index 98% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyProdGenRuleWizard.Page.al index 91367bfaac..46e1a7c823 100644 --- a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProdGenRuleWizard.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyProdGenRuleWizard.Page.al @@ -163,7 +163,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" trigger OnAssistEdit() begin - QltyFilterHelpers.AssistEditRouting(RoutingNoFilter); + QltyFilterHelpersMfg.AssistEditRouting(RoutingNoFilter); end; trigger OnValidate() @@ -180,7 +180,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" trigger OnAssistEdit() begin - QltyFilterHelpers.AssistEditRoutingOperation(RoutingNoFilter, OperationNo); + QltyFilterHelpersMfg.AssistEditRoutingOperation(RoutingNoFilter, OperationNo); end; trigger OnValidate() @@ -197,7 +197,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" trigger OnAssistEdit() begin - QltyFilterHelpers.AssistEditWorkCenter(WorkCenterNo); + QltyFilterHelpersMfg.AssistEditWorkCenter(WorkCenterNo); end; trigger OnValidate() @@ -214,7 +214,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" trigger OnAssistEdit() begin - QltyFilterHelpers.AssistEditMachine(SpecificNoFilter); + QltyFilterHelpersMfg.AssistEditMachine(SpecificNoFilter); end; trigger OnValidate() @@ -536,6 +536,7 @@ page 20462 "Qlty. Prod. Gen. Rule Wizard" TempItem: Record "Item" temporary; TempQltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule" temporary; TempPostedAssemblyHeader: Record "Posted Assembly Header" temporary; + QltyFilterHelpersMfg: Codeunit "Qlty. Filter Helpers - Mfg."; QltyFilterHelpers: Codeunit "Qlty. Filter Helpers"; CurrentStepCounter: Integer; LocationCodeFilter: Code[20]; diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProductionTrigger.Enum.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyProductionTrigger.Enum.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/QltyProductionTrigger.Enum.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/QltyProductionTrigger.Enum.al diff --git a/src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Routing/QltyRoutingLineLookup.Page.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Routing/QltyRoutingLineLookup.Page.al similarity index 100% rename from src/Apps/W1/Quality Management/app/src/Integration/Manufacturing/Routing/QltyRoutingLineLookup.Page.al rename to src/Apps/W1/Quality Management/app/src/Manufacturing/src/Routing/QltyRoutingLineLookup.Page.al diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.PageExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.PageExt.al new file mode 100644 index 0000000000..5d47c4d8c3 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.PageExt.al @@ -0,0 +1,79 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Setup.Setup; + +using Microsoft.QualityManagement.Integration.Manufacturing; + +pageextension 20422 "Qlty. Mgmt. Setup - Mfg" extends "Qlty. Management Setup" +{ + layout + { + addbefore(SettingsForReceiving) + { + group(SettingsForProduction) + { + Caption = 'Production'; + InstructionalText = 'Production related settings are configured in this group. For example, you can choose to automatically create tests when output is created.'; + + group(SettingsForProductionAutomation) + { + Caption = 'Automation'; + InstructionalText = 'Define the default automation settings for test generation rules related to production output. Different triggers can be changed on the test generation rules.'; + AboutTitle = 'Production Related Automation Settings'; + AboutText = 'Production related settings are configured in this group. You can choose to automatically create tests when output is created, whether or not to update the source, and other automatic features.'; + + field("Assembly Trigger"; Rec."Assembly Trigger") + { + Caption = 'Assembly - Create Test'; + ApplicationArea = Assembly; + ShowCaption = true; + AboutTitle = 'Assembly related trigger'; + AboutText = 'Optionally choose an assembly-related trigger to try and create a test.'; + } + field("Production Trigger"; Rec."Production Trigger") + { + Caption = 'Production - Create Test'; + ApplicationArea = Manufacturing; + ShowCaption = true; + AboutTitle = 'Production related trigger'; + AboutText = 'Optionally choose a production-related trigger to try and create a test.'; + } + field("Auto Output Configuration"; Rec."Auto Output Configuration") + { + Caption = 'Auto Output Configuration'; + ApplicationArea = Manufacturing; + ShowCaption = true; + AboutTitle = 'Auto Output Configuration'; + AboutText = 'Provides granular options for when a test should be created automatically during the production process.'; + } + field(ChooseCreateNewRule_Production; 'Click here to create a new generation rule...') + { + ShowCaption = false; + ApplicationArea = Assembly, Manufacturing; + + trigger OnDrillDown() + var + QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; + begin + CurrPage.Update(true); + QltyProdGenRuleWizard.RunModal(); + CurrPage.Update(false); + end; + } + field("Production Update Control"; Rec."Production Update Control") + { + ApplicationArea = Manufacturing; + ShowCaption = true; + Caption = 'Control Source'; + Importance = Additional; + Visible = false; + AboutTitle = 'When to update on production related changes.'; + AboutText = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; + } + } + } + } + } +} diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.TableExt.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.TableExt.al new file mode 100644 index 0000000000..5465de0ea3 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Setup/QltyMgmtSetupMfg.TableExt.al @@ -0,0 +1,74 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Setup.Setup; + +using Microsoft.QualityManagement.Integration.Manufacturing; +using Microsoft.QualityManagement.Configuration.GenerationRule; +using Microsoft.QualityManagement.Integration.Assembly; + +tableextension 20400 "Qlty. Mgmt. Setup - Mfg" extends "Qlty. Management Setup" +{ + fields + { + field(10; "Production Trigger"; Enum "Qlty. Production Trigger") + { + Description = 'Optionally choose a production related trigger to try and create a test.'; + Caption = 'Production Trigger'; + ToolTip = 'Specifies a default production-related trigger value for Test Generation Rules to try and create a test.'; + DataClassification = CustomerContent; + + trigger OnValidate() + var + QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; + begin + if (Rec."Production Trigger" <> xRec."Production Trigger") and (xRec."Production Trigger" <> xRec."Production Trigger"::NoTrigger) then begin + QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Production); + QltyInTestGenerationRule.SetRange("Production Trigger", xRec."Production Trigger"); + if (not QltyInTestGenerationRule.IsEmpty()) and GuiAllowed() then + if Confirm(StrSubstNo(ConfirmExistingRulesMfgQst, QltyInTestGenerationRule.Count(), xRec."Production Trigger", Rec."Production Trigger")) then + QltyInTestGenerationRule.ModifyAll("Production Trigger", Rec."Production Trigger", false); + end; + end; + } + field(11; "Production Update Control"; Enum "Qlty. Update Source Behavior") + { + Description = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; + InitValue = "Do not update"; + Caption = 'Production Update Control'; + ToolTip = 'Specifies whether to update when the source changes. Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; + DataClassification = CustomerContent; + } + field(92; "Auto Output Configuration"; Enum "Qlty. Auto. Production Trigger") + { + Caption = 'Auto Output Configuration'; + ToolTip = 'Specifies granular options for when a test should be created automatically during the production process.'; + DataClassification = CustomerContent; + } + field(101; "Assembly Trigger"; Enum "Qlty. Assembly Trigger") + { + Caption = 'Create Test On Assembly Trigger'; + Description = 'Provides automation to create a test when an assembly order creates output.'; + ToolTip = 'Specifies a default assembly-related trigger value for Test Generation Rules to try and create a test.'; + DataClassification = CustomerContent; + + trigger OnValidate() + var + QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; + begin + if (Rec."Assembly Trigger" <> xRec."Assembly Trigger") and (xRec."Assembly Trigger" <> xRec."Assembly Trigger"::NoTrigger) then begin + QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Assembly); + QltyInTestGenerationRule.SetRange("Assembly Trigger", xRec."Assembly Trigger"); + if (not QltyInTestGenerationRule.IsEmpty()) and GuiAllowed() then + if Confirm(StrSubstNo(ConfirmExistingRulesMfgQst, QltyInTestGenerationRule.Count(), xRec."Assembly Trigger", Rec."Assembly Trigger")) then + QltyInTestGenerationRule.ModifyAll("Assembly Trigger", Rec."Assembly Trigger", false); + end; + end; + } + + } + + var + ConfirmExistingRulesMfgQst: Label 'You have %1 existing generation rules that used the "%2" setting. Do you want to change those to be "%3"?', Comment = '%1=the count, %2=the old setting, %3=the new setting.'; +} diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltyFilterHelpersMfg.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltyFilterHelpersMfg.Codeunit.al new file mode 100644 index 0000000000..a42552ef6b --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltyFilterHelpersMfg.Codeunit.al @@ -0,0 +1,112 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Utilities; + +using Microsoft.Manufacturing.MachineCenter; +using Microsoft.Manufacturing.Routing; +using Microsoft.Manufacturing.WorkCenter; +using Microsoft.QualityManagement.Integration.Manufacturing.Routing; + +codeunit 20400 "Qlty. Filter Helpers - Mfg." +{ + EventSubscriberInstance = Manual; + + /// + /// Starts the assist edit dialog for choosing a machine. + /// + /// + /// + procedure AssistEditMachine(var MachineNoFilter: Code[20]): Boolean + var + MachineCenter: Record "Machine Center"; + MachineCenterList: Page "Machine Center List"; + begin + MachineCenterList.LookupMode(true); + if MachineNoFilter <> '' then begin + MachineCenter.SetFilter("No.", MachineNoFilter); + if MachineCenter.FindSet() then + MachineCenterList.SetRecord(MachineCenter); + end; + MachineCenter.SetRange("No."); + + if MachineCenterList.RunModal() in [Action::LookupOK, Action::OK] then begin + MachineCenterList.GetRecord(MachineCenter); + MachineNoFilter := MachineCenter."No."; + exit(true); + end; + end; + + /// + /// Starts the assist edit dialog for choosing a routing. + /// + /// + /// + procedure AssistEditRouting(var RoutingNoFilter: Code[20]): Boolean + var + RoutingHeader: Record "Routing Header"; + RoutingList: Page "Routing List"; + begin + RoutingList.LookupMode(true); + if RoutingNoFilter <> '' then begin + RoutingHeader.SetFilter("No.", RoutingNoFilter); + if RoutingHeader.FindSet() then + RoutingList.SetRecord(RoutingHeader); + end; + RoutingHeader.SetRange("No."); + + if RoutingList.RunModal() in [Action::LookupOK, Action::OK] then begin + RoutingList.GetRecord(RoutingHeader); + RoutingNoFilter := RoutingHeader."No."; + exit(true); + end; + end; + + procedure AssistEditRoutingOperation(InRoutingNoFilter: Code[20]; var OperationNoFilter: Code[20]): Boolean + var + RoutingLine: Record "Routing Line"; + QltyRoutingLineLookup: Page "Qlty. Routing Line Lookup"; + + begin + QltyRoutingLineLookup.LookupMode(true); + + if InRoutingNoFilter <> '' then + RoutingLine.SetFilter("Routing No.", InRoutingNoFilter); + + if OperationNoFilter <> '' then begin + RoutingLine.SetFilter("Operation No.", OperationNoFilter); + if RoutingLine.FindSet() then + QltyRoutingLineLookup.SetRecord(RoutingLine); + RoutingLine.SetRange("Operation No."); + end; + + QltyRoutingLineLookup.SetTableView(RoutingLine); + + if QltyRoutingLineLookup.RunModal() in [Action::LookupOK, Action::OK] then begin + QltyRoutingLineLookup.GetRecord(RoutingLine); + OperationNoFilter := RoutingLine."Operation No."; + exit(true); + end; + end; + + procedure AssistEditWorkCenter(var RoutingNoFilter: Code[20]): Boolean + var + WorkCenter: Record "Work Center"; + WorkCenterList: Page "Work Center List"; + begin + WorkCenterList.LookupMode(true); + if RoutingNoFilter <> '' then begin + WorkCenter.SetFilter("No.", RoutingNoFilter); + if WorkCenter.FindSet() then + WorkCenterList.SetRecord(WorkCenter); + end; + WorkCenter.SetRange("No."); + + if WorkCenterList.RunModal() in [Action::LookupOK, Action::OK] then begin + WorkCenterList.GetRecord(WorkCenter); + RoutingNoFilter := WorkCenter."No."; + exit(true); + end; + end; +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltySessionHelperMfg.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltySessionHelperMfg.Codeunit.al new file mode 100644 index 0000000000..4004d02260 --- /dev/null +++ b/src/Apps/W1/Quality Management/app/src/Manufacturing/src/Utilities/QltySessionHelperMfg.Codeunit.al @@ -0,0 +1,32 @@ +// ------------------------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// ------------------------------------------------------------------------------------------------ +namespace Microsoft.QualityManagement.Utilities; + +using Microsoft.Manufacturing.Document; + +/// +/// This exists to help keep track of variables to work around a variety of BC issues. +/// +codeunit 20431 "Qlty. Session Helper - Mfg." +{ + SingleInstance = true; + InherentPermissions = X; + + var + ProductionOrderBeforeChangingStatus: Record "Production Order"; + + #region Manufacturing - Production Order Status Change Handling + internal procedure SetProductionOrderBeforeChangingStatus(var ProductionOrderToSet: Record "Production Order") + begin + ProductionOrderBeforeChangingStatus := ProductionOrderToSet; + end; + + internal procedure GetProductionOrderBeforeChangingStatus(var ProductionOrderToGet: Record "Production Order") + begin + ProductionOrderToGet := ProductionOrderBeforeChangingStatus; + end; + #endregion Manufacturing - Production Order Status Change Handling + +} \ No newline at end of file diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al index c21211e9ff..8d13c274fe 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyEntryInspector.PermissionSet.al @@ -20,13 +20,10 @@ using Microsoft.QualityManagement.Dispositions.Purchase; using Microsoft.QualityManagement.Dispositions.PutAway; using Microsoft.QualityManagement.Dispositions.Transfer; using Microsoft.QualityManagement.Document; -using Microsoft.QualityManagement.Integration.Assembly; using Microsoft.QualityManagement.Integration.Foundation.Attachment; using Microsoft.QualityManagement.Integration.Foundation.Navigate; using Microsoft.QualityManagement.Integration.Inventory; using Microsoft.QualityManagement.Integration.Inventory.Transfer; -using Microsoft.QualityManagement.Integration.Manufacturing; -using Microsoft.QualityManagement.Integration.Manufacturing.Routing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Utilities; using Microsoft.QualityManagement.Integration.Warehouse; @@ -35,7 +32,7 @@ using Microsoft.QualityManagement.RoleCenters; using Microsoft.QualityManagement.Setup; using Microsoft.QualityManagement.Setup.ApplicationAreas; using Microsoft.QualityManagement.Setup.Setup; -using Microsoft.QualityManagement.Setup.SetupWizard; +//using Microsoft.QualityManagement.Setup.SetupWizard; using Microsoft.QualityManagement.Utilities; using Microsoft.QualityManagement.Workflow; @@ -77,8 +74,6 @@ permissionset 20404 QltyEntryInspector codeunit "Qlty. Misc Helpers" = X, codeunit "Qlty. Notification Mgmt." = X, codeunit "Qlty. Permission Mgmt." = X, - codeunit "Qlty. Manufactur. Integration" = X, - codeunit "Qlty. Assembly Integration" = X, codeunit "Qlty. Receiving Integration" = X, codeunit "Qlty. Report Mgmt." = X, codeunit "Qlty. Session Helper" = X, @@ -106,14 +101,12 @@ permissionset 20404 QltyEntryInspector page "Qlty. Lookup Code List" = X, page "Qlty. Lookup Code Part" = X, page "Qlty. Manager Role Center" = X, - page "Qlty. Management Setup Wizard" = X, + //page "Qlty. Management Setup Wizard" = X, page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, - page "Qlty. Prod. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection" = X, - page "Qlty. Routing Line Lookup" = X, page "Qlty. Inspect. Source Config." = X, page "Qlty. Source Config Line Part" = X, page "Qlty. Ins. Source Config. List" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al index 225838ab0d..67f202f481 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyGeneral.PermissionSet.al @@ -20,13 +20,10 @@ using Microsoft.QualityManagement.Dispositions.Purchase; using Microsoft.QualityManagement.Dispositions.PutAway; using Microsoft.QualityManagement.Dispositions.Transfer; using Microsoft.QualityManagement.Document; -using Microsoft.QualityManagement.Integration.Assembly; using Microsoft.QualityManagement.Integration.Foundation.Attachment; using Microsoft.QualityManagement.Integration.Foundation.Navigate; using Microsoft.QualityManagement.Integration.Inventory; using Microsoft.QualityManagement.Integration.Inventory.Transfer; -using Microsoft.QualityManagement.Integration.Manufacturing; -using Microsoft.QualityManagement.Integration.Manufacturing.Routing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Utilities; using Microsoft.QualityManagement.Integration.Warehouse; @@ -75,8 +72,6 @@ permissionset 20403 QltyGeneral codeunit "Qlty. Misc Helpers" = X, codeunit "Qlty. Notification Mgmt." = X, codeunit "Qlty. Permission Mgmt." = X, - codeunit "Qlty. Manufactur. Integration" = X, - codeunit "Qlty. Assembly Integration" = X, codeunit "Qlty. Receiving Integration" = X, codeunit "Qlty. Report Mgmt." = X, codeunit "Qlty. Session Helper" = X, @@ -107,11 +102,9 @@ permissionset 20403 QltyGeneral page "Qlty. Manager Role Center" = X, page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, - page "Qlty. Prod. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection" = X, - page "Qlty. Routing Line Lookup" = X, page "Qlty. Inspection Test Subform" = X, page "Qlty. Inspection Test Lines" = X, page "Qlty. Inspection Activities" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al b/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al index 0d76530577..312d0f0d2f 100644 --- a/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al +++ b/src/Apps/W1/Quality Management/app/src/Permissions/QltyMngmntObjects.PermissionSet.al @@ -20,13 +20,10 @@ using Microsoft.QualityManagement.Dispositions.Purchase; using Microsoft.QualityManagement.Dispositions.PutAway; using Microsoft.QualityManagement.Dispositions.Transfer; using Microsoft.QualityManagement.Document; -using Microsoft.QualityManagement.Integration.Assembly; using Microsoft.QualityManagement.Integration.Foundation.Attachment; using Microsoft.QualityManagement.Integration.Foundation.Navigate; using Microsoft.QualityManagement.Integration.Inventory; using Microsoft.QualityManagement.Integration.Inventory.Transfer; -using Microsoft.QualityManagement.Integration.Manufacturing; -using Microsoft.QualityManagement.Integration.Manufacturing.Routing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Utilities; using Microsoft.QualityManagement.Integration.Warehouse; @@ -75,8 +72,6 @@ permissionset 20406 "QltyMngmnt - Objects" codeunit "Qlty. Misc Helpers" = X, codeunit "Qlty. Notification Mgmt." = X, codeunit "Qlty. Permission Mgmt." = X, - codeunit "Qlty. Manufactur. Integration" = X, - codeunit "Qlty. Assembly Integration" = X, codeunit "Qlty. Receiving Integration" = X, codeunit "Qlty. Report Mgmt." = X, codeunit "Qlty. Session Helper" = X, @@ -105,11 +100,9 @@ permissionset 20406 "QltyMngmnt - Objects" page "Qlty. Management Setup Wizard" = X, page "Qlty. Management Setup" = X, page "Qlty. Most Recent Picture" = X, - page "Qlty. Prod. Gen. Rule Wizard" = X, page "Qlty. Rec. Gen. Rule Wizard" = X, page "Qlty. Related Transfer Orders" = X, page "Qlty. Report Selection" = X, - page "Qlty. Routing Line Lookup" = X, page "Qlty. Inspection Template List" = X, page "Qlty. Inspection Template Subf" = X, page "Qlty. Inspection Template" = X, diff --git a/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Page.al b/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Page.al index e6d24a8a5c..3989fccc57 100644 --- a/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Page.al +++ b/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Page.al @@ -8,7 +8,6 @@ using Microsoft.QualityManagement.Configuration; using Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.Grade; using Microsoft.QualityManagement.Configuration.Template; -using Microsoft.QualityManagement.Integration.Manufacturing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Warehouse; using Microsoft.QualityManagement.Setup.ApplicationAreas; @@ -184,68 +183,6 @@ page 20400 "Qlty. Management Setup" } } } - group(SettingsForProduction) - { - Caption = 'Production'; - InstructionalText = 'Production related settings are configured in this group. For example, you can choose to automatically create tests when output is created.'; - - group(SettingsForProductionAutomation) - { - Caption = 'Automation'; - InstructionalText = 'Define the default automation settings for test generation rules related to production output. Different triggers can be changed on the test generation rules.'; - AboutTitle = 'Production Related Automation Settings'; - AboutText = 'Production related settings are configured in this group. You can choose to automatically create tests when output is created, whether or not to update the source, and other automatic features.'; - - field("Production Trigger"; Rec."Production Trigger") - { - Caption = 'Production - Create Test'; - ApplicationArea = Manufacturing; - ShowCaption = true; - AboutTitle = 'Production related trigger'; - AboutText = 'Optionally choose a production-related trigger to try and create a test.'; - } - field("Auto Output Configuration"; Rec."Auto Output Configuration") - { - Caption = 'Auto Output Configuration'; - ApplicationArea = Manufacturing; - ShowCaption = true; - AboutTitle = 'Auto Output Configuration'; - AboutText = 'Provides granular options for when a test should be created automatically during the production process.'; - } - field("Assembly Trigger"; Rec."Assembly Trigger") - { - Caption = 'Assembly - Create Test'; - ApplicationArea = Assembly; - ShowCaption = true; - AboutTitle = 'Assembly related trigger'; - AboutText = 'Optionally choose an assembly-related trigger to try and create a test.'; - } - field(ChooseCreateNewRule_Production; 'Click here to create a new generation rule...') - { - ShowCaption = false; - ApplicationArea = Assembly, Manufacturing; - - trigger OnDrillDown() - var - QltyProdGenRuleWizard: Page "Qlty. Prod. Gen. Rule Wizard"; - begin - CurrPage.Update(true); - QltyProdGenRuleWizard.RunModal(); - CurrPage.Update(false); - end; - } - field("Production Update Control"; Rec."Production Update Control") - { - ApplicationArea = Manufacturing; - ShowCaption = true; - Caption = 'Control Source'; - Importance = Additional; - Visible = false; - AboutTitle = 'When to update on production related changes.'; - AboutText = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; - } - } - } group(SettingsForInventory) { Caption = 'Inventory and Warehousing'; diff --git a/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Table.al b/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Table.al index b10cddef76..c6c67cf627 100644 --- a/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Table.al +++ b/src/Apps/W1/Quality Management/app/src/Setup/Setup/QltyManagementSetup.Table.al @@ -13,9 +13,7 @@ using Microsoft.QualityManagement.Configuration.GenerationRule; using Microsoft.QualityManagement.Configuration.Grade; using Microsoft.QualityManagement.Configuration.Template; using Microsoft.QualityManagement.Document; -using Microsoft.QualityManagement.Integration.Assembly; using Microsoft.QualityManagement.Integration.Inventory; -using Microsoft.QualityManagement.Integration.Manufacturing; using Microsoft.QualityManagement.Integration.Receiving; using Microsoft.QualityManagement.Integration.Warehouse; using Microsoft.QualityManagement.Setup.ApplicationAreas; @@ -65,32 +63,6 @@ table 20400 "Qlty. Management Setup" TableRelation = Contact."No."; ToolTip = 'Specifies the contact details that will appear on the Certificate of Analysis report when supplied.'; } - field(10; "Production Trigger"; Enum "Qlty. Production Trigger") - { - Description = 'Optionally choose a production related trigger to try and create a test.'; - Caption = 'Production Trigger'; - ToolTip = 'Specifies a default production-related trigger value for Test Generation Rules to try and create a test.'; - - trigger OnValidate() - var - QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; - begin - if (Rec."Production Trigger" <> xRec."Production Trigger") and (xRec."Production Trigger" <> xRec."Production Trigger"::NoTrigger) then begin - QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Production); - QltyInTestGenerationRule.SetRange("Production Trigger", xRec."Production Trigger"); - if (not QltyInTestGenerationRule.IsEmpty()) and GuiAllowed() then - if Confirm(StrSubstNo(ConfirmExistingRulesQst, QltyInTestGenerationRule.Count(), xRec."Production Trigger", Rec."Production Trigger")) then - QltyInTestGenerationRule.ModifyAll("Production Trigger", Rec."Production Trigger", false); - end; - end; - } - field(11; "Production Update Control"; Enum "Qlty. Update Source Behavior") - { - Description = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; - InitValue = "Do not update"; - Caption = 'Production Update Control'; - ToolTip = 'Specifies whether to update when the source changes. Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; - } field(21; "Receive Update Control"; Enum "Qlty. Update Source Behavior") { Description = 'Set to "Update when Source Changes" to alter source information as the source record changes (for example, such as when a Production Order changes status to Finished). Set to "Do Not Update" to prevent updating the original source that created the test.'; @@ -315,11 +287,6 @@ table 20400 "Qlty. Management Setup" DataClassification = SystemMetadata; ToolTip = 'Specifies the maximum number of rows to fetch on data lookups. Keeping the number as low as possible will increase usability and performance. A larger number will reduce performance and reduce usability.'; } - field(92; "Auto Output Configuration"; Enum "Qlty. Auto. Production Trigger") - { - Caption = 'Auto Output Configuration'; - ToolTip = 'Specifies granular options for when a test should be created automatically during the production process.'; - } field(93; "Whse. Wksh. Name"; Code[10]) { Caption = 'Warehouse Worksheet Name'; @@ -488,25 +455,6 @@ table 20400 "Qlty. Management Setup" end; end; } - field(101; "Assembly Trigger"; Enum "Qlty. Assembly Trigger") - { - Caption = 'Create Test On Assembly Trigger'; - Description = 'Provides automation to create a test when an assembly order creates output.'; - ToolTip = 'Specifies a default assembly-related trigger value for Test Generation Rules to try and create a test.'; - - trigger OnValidate() - var - QltyInTestGenerationRule: Record "Qlty. In. Test Generation Rule"; - begin - if (Rec."Assembly Trigger" <> xRec."Assembly Trigger") and (xRec."Assembly Trigger" <> xRec."Assembly Trigger"::NoTrigger) then begin - QltyInTestGenerationRule.SetRange(Intent, QltyInTestGenerationRule.Intent::Assembly); - QltyInTestGenerationRule.SetRange("Assembly Trigger", xRec."Assembly Trigger"); - if (not QltyInTestGenerationRule.IsEmpty()) and GuiAllowed() then - if Confirm(StrSubstNo(ConfirmExistingRulesQst, QltyInTestGenerationRule.Count(), xRec."Assembly Trigger", Rec."Assembly Trigger")) then - QltyInTestGenerationRule.ModifyAll("Assembly Trigger", Rec."Assembly Trigger", false); - end; - end; - } } keys diff --git a/src/Apps/W1/Quality Management/app/src/Utilities/QltyFilterHelpers.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Utilities/QltyFilterHelpers.Codeunit.al index f89157290d..dda11e4450 100644 --- a/src/Apps/W1/Quality Management/app/src/Utilities/QltyFilterHelpers.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Utilities/QltyFilterHelpers.Codeunit.al @@ -10,12 +10,9 @@ using Microsoft.Inventory.Item; using Microsoft.Inventory.Item.Attribute; using Microsoft.Inventory.Item.Catalog; using Microsoft.Inventory.Location; -using Microsoft.Manufacturing.MachineCenter; using Microsoft.Manufacturing.Routing; -using Microsoft.Manufacturing.WorkCenter; using Microsoft.Purchases.Vendor; using Microsoft.QualityManagement.Configuration.Template; -using Microsoft.QualityManagement.Integration.Manufacturing.Routing; using Microsoft.Sales.Customer; using Microsoft.Warehouse.Structure; using System.IO; @@ -546,103 +543,6 @@ codeunit 20403 "Qlty. Filter Helpers" end; end; - /// - /// Starts the assist edit dialog for choosing a machine. - /// - /// - /// - procedure AssistEditMachine(var MachineNoFilter: Code[20]): Boolean - var - MachineCenter: Record "Machine Center"; - MachineCenterList: Page "Machine Center List"; - begin - MachineCenterList.LookupMode(true); - if MachineNoFilter <> '' then begin - MachineCenter.SetFilter("No.", MachineNoFilter); - if MachineCenter.FindSet() then - MachineCenterList.SetRecord(MachineCenter); - end; - MachineCenter.SetRange("No."); - - if MachineCenterList.RunModal() in [Action::LookupOK, Action::OK] then begin - MachineCenterList.GetRecord(MachineCenter); - MachineNoFilter := MachineCenter."No."; - exit(true); - end; - end; - - /// - /// Starts the assist edit dialog for choosing a routing. - /// - /// - /// - procedure AssistEditRouting(var RoutingNoFilter: Code[20]): Boolean - var - RoutingHeader: Record "Routing Header"; - RoutingList: Page "Routing List"; - begin - RoutingList.LookupMode(true); - if RoutingNoFilter <> '' then begin - RoutingHeader.SetFilter("No.", RoutingNoFilter); - if RoutingHeader.FindSet() then - RoutingList.SetRecord(RoutingHeader); - end; - RoutingHeader.SetRange("No."); - - if RoutingList.RunModal() in [Action::LookupOK, Action::OK] then begin - RoutingList.GetRecord(RoutingHeader); - RoutingNoFilter := RoutingHeader."No."; - exit(true); - end; - end; - - procedure AssistEditRoutingOperation(InRoutingNoFilter: Code[20]; var OperationNoFilter: Code[20]): Boolean - var - RoutingLine: Record "Routing Line"; - QltyRoutingLineLookup: Page "Qlty. Routing Line Lookup"; - - begin - QltyRoutingLineLookup.LookupMode(true); - - if InRoutingNoFilter <> '' then - RoutingLine.SetFilter("Routing No.", InRoutingNoFilter); - - if OperationNoFilter <> '' then begin - RoutingLine.SetFilter("Operation No.", OperationNoFilter); - if RoutingLine.FindSet() then - QltyRoutingLineLookup.SetRecord(RoutingLine); - RoutingLine.SetRange("Operation No."); - end; - - QltyRoutingLineLookup.SetTableView(RoutingLine); - - if QltyRoutingLineLookup.RunModal() in [Action::LookupOK, Action::OK] then begin - QltyRoutingLineLookup.GetRecord(RoutingLine); - OperationNoFilter := RoutingLine."Operation No."; - exit(true); - end; - end; - - procedure AssistEditWorkCenter(var RoutingNoFilter: Code[20]): Boolean - var - WorkCenter: Record "Work Center"; - WorkCenterList: Page "Work Center List"; - begin - WorkCenterList.LookupMode(true); - if RoutingNoFilter <> '' then begin - WorkCenter.SetFilter("No.", RoutingNoFilter); - if WorkCenter.FindSet() then - WorkCenterList.SetRecord(WorkCenter); - end; - WorkCenter.SetRange("No."); - - if WorkCenterList.RunModal() in [Action::LookupOK, Action::OK] then begin - WorkCenterList.GetRecord(WorkCenter); - RoutingNoFilter := WorkCenter."No."; - exit(true); - end; - end; - procedure AssistEditPurchasingCode(var PurchasingCode: Code[20]): Boolean var Purchasing: Record Purchasing; diff --git a/src/Apps/W1/Quality Management/app/src/Utilities/QltySessionHelper.Codeunit.al b/src/Apps/W1/Quality Management/app/src/Utilities/QltySessionHelper.Codeunit.al index 4d43c1e92c..6c87eac432 100644 --- a/src/Apps/W1/Quality Management/app/src/Utilities/QltySessionHelper.Codeunit.al +++ b/src/Apps/W1/Quality Management/app/src/Utilities/QltySessionHelper.Codeunit.al @@ -4,8 +4,6 @@ // ------------------------------------------------------------------------------------------------ namespace Microsoft.QualityManagement.Utilities; -using Microsoft.Manufacturing.Document; - /// /// This exists to help keep track of variables to work around a variety of BC issues. /// @@ -15,25 +13,12 @@ codeunit 20430 "Qlty. Session Helper" InherentPermissions = X; var - ProductionOrderBeforeChangingStatus: Record "Production Order"; MiscKeyValuePairs: Dictionary of [Text, Text]; ItemTrackingFlagAllOrSingleTok: Label 'Qlty::ItemTracking::AllOrSingle', Locked = true; ItemTrackingFlagAllDocsTok: Label 'Qlty::ItemTracking::AllOrSingle::ALLDOCS', Locked = true; ItemTrackingFlagSourceDocOnlyTok: Label 'Qlty::ItemTracking::AllOrSingle::SOURCEDOCONLY', Locked = true; ItemTrackingIsFromQITestModeTok: Label 'Qlty::ItemTracking::StartingFromQITest', Locked = true; - #region Manufacturing - Production Order Status Change Handling - internal procedure SetProductionOrderBeforeChangingStatus(var ProductionOrderToSet: Record "Production Order") - begin - ProductionOrderBeforeChangingStatus := ProductionOrderToSet; - end; - - internal procedure GetProductionOrderBeforeChangingStatus(var ProductionOrderToGet: Record "Production Order") - begin - ProductionOrderToGet := ProductionOrderBeforeChangingStatus; - end; - #endregion Manufacturing - Production Order Status Change Handling - internal procedure SetSessionValue(CurrentKey: Text; Value: Text) begin MiscKeyValuePairs.Set(CurrentKey, Value); diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsFilterHelpers.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsFilterHelpers.Codeunit.al index 3f5af004c8..dac176a004 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsFilterHelpers.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsFilterHelpers.Codeunit.al @@ -34,6 +34,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" var LibraryAssert: Codeunit "Library Assert"; QltyFilterHelpers: Codeunit "Qlty. Filter Helpers"; + QltyFilterHelpersMfg: Codeunit "Qlty. Filter Helpers - Mfg."; Code20: Code[20]; ZoneTok: Label 'PICK'; FilterTok: Label 'WHERE(No.=FILTER(%1))', Comment = '%1=item no.'; @@ -1553,7 +1554,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" end; // [WHEN] AssistEditMachine is called with no filter - FoundMachine := QltyFilterHelpers.AssistEditMachine(Machine); + FoundMachine := QltyFilterHelpersMfg.AssistEditMachine(Machine); // [THEN] A machine is found and the machine number matches LibraryAssert.IsTrue(FoundMachine, 'Should claim found machine.'); @@ -1581,7 +1582,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" Machine := MachineCenter."No."; // [WHEN] AssistEditMachine is called with machine filter - FoundMachine := QltyFilterHelpers.AssistEditMachine(Machine); + FoundMachine := QltyFilterHelpersMfg.AssistEditMachine(Machine); // [THEN] A machine is found and the machine number matches LibraryAssert.IsTrue(FoundMachine, 'Should claim found machine.'); @@ -1604,7 +1605,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" LibraryManufacturing.CreateRoutingHeader(RoutingHeader, RoutingHeader.Type::Serial); // [WHEN] AssistEditRouting is called with no filter - FoundRouting := QltyFilterHelpers.AssistEditRouting(Routing); + FoundRouting := QltyFilterHelpersMfg.AssistEditRouting(Routing); // [THEN] A routing is found and the routing number matches LibraryAssert.IsTrue(FoundRouting, 'Should claim found routing.'); @@ -1628,7 +1629,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" Routing := RoutingHeader."No."; // [WHEN] AssistEditRouting is called with routing filter - FoundRouting := QltyFilterHelpers.AssistEditRouting(Routing); + FoundRouting := QltyFilterHelpersMfg.AssistEditRouting(Routing); // [THEN] A routing is found and the routing number matches LibraryAssert.IsTrue(FoundRouting, 'Should claim found routing.'); @@ -1665,7 +1666,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" end; OperationNo2 := RoutingLine."Operation No."; // [WHEN] AssistEditRoutingOperation is called with routing and operation number filters - FoundRoutingOperation := QltyFilterHelpers.AssistEditRoutingOperation(RoutingHeader."No.", OperationNo2); + FoundRoutingOperation := QltyFilterHelpersMfg.AssistEditRoutingOperation(RoutingHeader."No.", OperationNo2); // [THEN] A routing operation is found and the operation number matches LibraryAssert.IsTrue(FoundRoutingOperation, 'Should claim found routing operation.'); @@ -1701,7 +1702,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" LibraryManufacturing.CreateRoutingLine(RoutingHeader, RoutingLine, Version, OperationNo, Enum::"Capacity Type Routing"::" ", No); end; // [WHEN] AssistEditRoutingOperation is called with routing filter - FoundRoutingOperation := QltyFilterHelpers.AssistEditRoutingOperation(RoutingHeader."No.", OperationNo2); + FoundRoutingOperation := QltyFilterHelpersMfg.AssistEditRoutingOperation(RoutingHeader."No.", OperationNo2); // [THEN] A routing operation is found and the operation number matches LibraryAssert.IsTrue(FoundRoutingOperation, 'Should claim found routing operation.'); @@ -1738,7 +1739,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" end; OperationNo2 := OperationNo; // [WHEN] AssistEditRoutingOperation is called with operation filter - FoundRoutingOperation := QltyFilterHelpers.AssistEditRoutingOperation('', OperationNo2); + FoundRoutingOperation := QltyFilterHelpersMfg.AssistEditRoutingOperation('', OperationNo2); // [THEN] A routing operation is found and the operation number matches LibraryAssert.IsTrue(FoundRoutingOperation, 'Should claim found routing operation.'); @@ -1774,7 +1775,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" LibraryManufacturing.CreateRoutingLine(RoutingHeader, RoutingLine, Version, OperationNo, Enum::"Capacity Type Routing"::" ", No); end; // [WHEN] AssistEditRoutingOperation is called with no filter - FoundRoutingOperation := QltyFilterHelpers.AssistEditRoutingOperation('', OperationNo2); + FoundRoutingOperation := QltyFilterHelpersMfg.AssistEditRoutingOperation('', OperationNo2); // [THEN] A routing operation is found and the operation number matches the first routing line RoutingLine.Reset(); @@ -1799,7 +1800,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" LibraryManufacturing.CreateWorkCenter(WorkCenter); // [WHEN] AssistEditWorkCenter is called with no filter - FoundWorkCenter := QltyFilterHelpers.AssistEditWorkCenter(WorkCenterToUse); + FoundWorkCenter := QltyFilterHelpersMfg.AssistEditWorkCenter(WorkCenterToUse); // [THEN] A work center is found and the work center number matches LibraryAssert.IsTrue(FoundWorkCenter, 'Should claim found work center.'); @@ -1823,7 +1824,7 @@ codeunit 139962 "Qlty. Tests - FilterHelpers" WorkCenterToUse := WorkCenter."No."; // [WHEN] AssistEditWorkCenter is called with work center filter - FoundWorkCenter := QltyFilterHelpers.AssistEditWorkCenter(WorkCenterToUse); + FoundWorkCenter := QltyFilterHelpersMfg.AssistEditWorkCenter(WorkCenterToUse); // [THEN] A work center is found and the work center number matches LibraryAssert.IsTrue(FoundWorkCenter, 'Should claim found work center.'); diff --git a/src/Apps/W1/Quality Management/test/src/QltyTestsTraversal.Codeunit.al b/src/Apps/W1/Quality Management/test/src/QltyTestsTraversal.Codeunit.al index 99a26c5752..5c49b3c93e 100644 --- a/src/Apps/W1/Quality Management/test/src/QltyTestsTraversal.Codeunit.al +++ b/src/Apps/W1/Quality Management/test/src/QltyTestsTraversal.Codeunit.al @@ -32,6 +32,7 @@ codeunit 139968 "Qlty. Tests - Traversal" var QltyTraversal: Codeunit "Qlty. Traversal"; + QltyTraversalMfg: Codeunit "Qlty. Traversal - Mfg."; LibraryAssert: Codeunit "Library Assert"; [Test] @@ -349,7 +350,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing with routing record in variant 2 position // [THEN] The traversal function successfully finds the routing and returns the matching routing number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find routing.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find routing.'); LibraryAssert.AreEqual(RoutingHeader."No.", FoundRoutingHeader."No.", 'Should be same routing.'); end; @@ -380,7 +381,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing with routing record in variant 3 position // [THEN] The traversal function successfully finds the routing and returns the matching routing number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4), 'Should find routing.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4), 'Should find routing.'); LibraryAssert.AreEqual(RoutingHeader."No.", FoundRoutingHeader."No.", 'Should be same routing.'); end; @@ -411,7 +412,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing with routing record in variant 4 position // [THEN] The traversal function successfully finds the routing and returns the matching routing number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4), 'Should find routing.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4), 'Should find routing.'); LibraryAssert.AreEqual(RoutingHeader."No.", FoundRoutingHeader."No.", 'Should be same routing.'); end; @@ -442,7 +443,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing with routing record in variant 5 position // [THEN] The traversal function successfully finds the routing and returns the matching routing number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef), 'Should find routing.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedRouting(FoundRoutingHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef), 'Should find routing.'); LibraryAssert.AreEqual(RoutingHeader."No.", FoundRoutingHeader."No.", 'Should be same routing.'); end; @@ -469,7 +470,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related BOM with BOM record in variant 2 position // [THEN] The traversal function successfully finds the BOM and returns the matching BOM number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); LibraryAssert.AreEqual(ProductionBOMHeader."No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; @@ -496,7 +497,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related BOM with BOM record in variant 3 position // [THEN] The traversal function successfully finds the BOM and returns the matching BOM number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); LibraryAssert.AreEqual(ProductionBOMHeader."No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; @@ -523,7 +524,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related BOM with BOM record in variant 4 position // [THEN] The traversal function successfully finds the BOM and returns the matching BOM number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4), 'Should find BOM.'); LibraryAssert.AreEqual(ProductionBOMHeader."No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; @@ -550,7 +551,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related BOM with BOM record in variant 5 position // [THEN] The traversal function successfully finds the BOM and returns the matching BOM number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef), 'Should find BOM.'); LibraryAssert.AreEqual(ProductionBOMHeader."No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; @@ -604,7 +605,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [THEN] Finding related BOM from the item record using source configuration // [THEN] The traversal function successfully finds the BOM and returns the matching BOM number - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, RecordRef, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, RecordRef, EmptyVariant1, EmptyVariant2, EmptyVariant3, EmptyVariant4), 'Should find BOM.'); LibraryAssert.AreEqual(ProductionBOMHeader."No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; @@ -630,7 +631,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing line with routing line record in variant 2 position // [THEN] The traversal function successfully finds the routing line with matching key fields - LibraryAssert.IsTrue(QltyTraversal.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, RecordRef, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); LibraryAssert.AreEqual(ProdOrderRoutingLine.Status, FoundProdOrderRoutingLine.Status, 'Should be same status'); LibraryAssert.AreEqual(ProdOrderRoutingLine."No.", FoundProdOrderRoutingLine."No.", 'Should be same No.'); LibraryAssert.AreEqual(ProdOrderRoutingLine."Prod. Order No.", FoundProdOrderRoutingLine."Prod. Order No.", 'Should be same Prod. Order No.'); @@ -660,7 +661,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing line with routing line record in variant 3 position // [THEN] The traversal function successfully finds the routing line with matching key fields - LibraryAssert.IsTrue(QltyTraversal.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, RecordRef, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); LibraryAssert.AreEqual(ProdOrderRoutingLine.Status, FoundProdOrderRoutingLine.Status, 'Should be same status'); LibraryAssert.AreEqual(ProdOrderRoutingLine."No.", FoundProdOrderRoutingLine."No.", 'Should be same No.'); LibraryAssert.AreEqual(ProdOrderRoutingLine."Prod. Order No.", FoundProdOrderRoutingLine."Prod. Order No.", 'Should be same Prod. Order No.'); @@ -690,7 +691,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing line with routing line record in variant 4 position // [THEN] The traversal function successfully finds the routing line with matching key fields - LibraryAssert.IsTrue(QltyTraversal.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef, EmptyVariant5), 'Should find routing line.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, EmptyVariant4, RecordRef, EmptyVariant5), 'Should find routing line.'); LibraryAssert.AreEqual(ProdOrderRoutingLine.Status, FoundProdOrderRoutingLine.Status, 'Should be same status'); LibraryAssert.AreEqual(ProdOrderRoutingLine."No.", FoundProdOrderRoutingLine."No.", 'Should be same No.'); LibraryAssert.AreEqual(ProdOrderRoutingLine."Prod. Order No.", FoundProdOrderRoutingLine."Prod. Order No.", 'Should be same Prod. Order No.'); @@ -720,7 +721,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing line with routing line record in variant 5 position // [THEN] The traversal function successfully finds the routing line with matching key fields - LibraryAssert.IsTrue(QltyTraversal.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5, RecordRef), 'Should find routing line.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5, RecordRef), 'Should find routing line.'); LibraryAssert.AreEqual(ProdOrderRoutingLine.Status, FoundProdOrderRoutingLine.Status, 'Should be same status'); LibraryAssert.AreEqual(ProdOrderRoutingLine."No.", FoundProdOrderRoutingLine."No.", 'Should be same No.'); LibraryAssert.AreEqual(ProdOrderRoutingLine."Prod. Order No.", FoundProdOrderRoutingLine."Prod. Order No.", 'Should be same Prod. Order No.'); @@ -1176,7 +1177,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing from production order routing line by traversing to parent production order // [THEN] The traversal function finds the routing from the production order - LibraryAssert.IsTrue(QltyTraversal.FindRelatedRouting(FoundRoutingHeader, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedRouting(FoundRoutingHeader, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing.'); LibraryAssert.AreEqual(ProdProductionOrder."Routing No.", FoundRoutingHeader."No.", 'Should be same routing.'); end; @@ -1279,7 +1280,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related routing line from production order line by chained traversal // [THEN] The traversal function finds the routing line with matching key fields - LibraryAssert.IsTrue(QltyTraversal.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedProdOrderRoutingLine(FoundProdOrderRoutingLine, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find routing line.'); LibraryAssert.AreEqual(ProdOrderRoutingLine.Status, FoundProdOrderRoutingLine.Status, 'Should be same status'); LibraryAssert.AreEqual(ProdOrderRoutingLine."No.", FoundProdOrderRoutingLine."No.", 'Should be same No.'); LibraryAssert.AreEqual(ProdOrderRoutingLine."Prod. Order No.", FoundProdOrderRoutingLine."Prod. Order No.", 'Should be same Prod. Order No.'); @@ -1392,7 +1393,7 @@ codeunit 139968 "Qlty. Tests - Traversal" // [WHEN] Finding related BOM from production order routing line by chained traversal // [THEN] The traversal function finds the BOM from the production order line - LibraryAssert.IsTrue(QltyTraversal.FindRelatedBillOfMaterial(FundProductionBOMHeader, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find BOM.'); + LibraryAssert.IsTrue(QltyTraversalMfg.FindRelatedBillOfMaterial(FundProductionBOMHeader, RecordRef, EmptyVariant2, EmptyVariant3, EmptyVariant4, EmptyVariant5), 'Should find BOM.'); LibraryAssert.AreEqual(ProdOrderLine."Production BOM No.", FundProductionBOMHeader."No.", 'Should be same BOM.'); end; }