Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -359,34 +304,31 @@ 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;
EditWarehouseReceiveTrigger: Boolean;
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;
Expand Down Expand Up @@ -450,19 +392,15 @@ 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;
EditWarehouseMovementTrigger := true;
EditWarehouseReceiveTrigger := true;

AssemblyStyle := Format(RowStyle::Ambiguous);
ProductionStyle := Format(RowStyle::Ambiguous);
PurchaseStyle := Format(RowStyle::Ambiguous);
SalesReturnStyle := Format(RowStyle::Ambiguous);
WhseReceiveStyle := Format(RowStyle::Ambiguous);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down
Loading
Loading