Skip to content
Open
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 @@ -31,7 +31,7 @@ codeunit 99001517 "Subc. Calc. Prod. Order Ext."
begin
ProdOrderComponent."Orig. Location Code" := ProdOrderComponent."Location Code";
ProdOrderComponent."Orig. Bin Code" := ProdOrderComponent."Bin Code";
ProdOrderComponent."Subcontracting Type" := ProductionBOMLine."Subcontracting Type";
ProdOrderComponent."Component Supply Method" := ProductionBOMLine."Component Supply Method";

OnAfterTransferSubcontractingFieldsBOMComponent(ProductionBOMLine, ProdOrderComponent);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ codeunit 99001523 "Subc. Carry Out Action Ext."
#endif
local procedure OnAfterTransferPlanningComp(var PlanningComponent: Record "Planning Component"; var ProdOrderComponent: Record "Prod. Order Component")
begin
ProdOrderComponent."Subcontracting Type" := PlanningComponent."Subcontracting Type";
ProdOrderComponent."Component Supply Method" := PlanningComponent."Component Supply Method";
ProdOrderComponent."Orig. Location Code" := PlanningComponent."Orig. Location Code";
ProdOrderComponent."Orig. Bin Code" := PlanningComponent."Orig. Bin Code";
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ codeunit 99001522 "Subc. Planning Comp. Ext."
[EventSubscriber(ObjectType::Table, Database::"Planning Component", OnAfterTransferFromComponent, '', false, false)]
local procedure OnAfterTransferFromComponent(var PlanningComponent: Record "Planning Component"; var ProdOrderComp: Record "Prod. Order Component")
begin
PlanningComponent."Subcontracting Type" := ProdOrderComp."Subcontracting Type";
PlanningComponent."Component Supply Method" := ProdOrderComp."Component Supply Method";
PlanningComponent."Orig. Location Code" := ProdOrderComp."Orig. Location Code";
PlanningComponent."Orig. Bin Code" := ProdOrderComp."Orig. Bin Code";
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext."
TransferShipmentLine: Record "Transfer Shipment Line";
ConfirmManagement: Codeunit "Confirm Management";
begin
if ProdOrderComponent."Subcontracting Type" <> "Subcontracting Type"::Transfer then
if ProdOrderComponent."Component Supply Method" <> "Component Supply Method"::"Transfer to Vendor" then
exit;

TransferShipmentLine.SetRange("Prod. Order No.", ProdOrderComponent."Prod. Order No.");
Expand Down Expand Up @@ -107,7 +107,7 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext."
PurchaseLine: Record "Purchase Line";
TempPurchaseLine: Record "Purchase Line" temporary;
begin
if ProdOrderComponent."Subcontracting Type" <> ProdOrderComponent."Subcontracting Type"::Purchase then
if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then
exit;

PurchaseLine.SetRange("Prod. Order No.", ProdOrderComponent."Prod. Order No.");
Expand Down Expand Up @@ -143,7 +143,7 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext."
if ProdOrderComponent."Location Code" = xProdOrderComponent."Location Code" then
exit;

if ProdOrderComponent."Subcontracting Type" <> "Subcontracting Type"::Transfer then
if ProdOrderComponent."Component Supply Method" <> "Component Supply Method"::"Transfer to Vendor" then
exit;

TransferLine.SetCurrentKey("Prod. Order No.", "Routing No.", "Routing Reference No.", "Operation No.", "Subcontr. Purch. Order No.");
Expand Down Expand Up @@ -258,7 +258,7 @@ codeunit 99001524 "Subc. Prod. Order Comp. Ext."
PlanningGetParameters: Codeunit "Planning-Get Parameters";
SubcontractingManagement: Codeunit "Subcontracting Management";
begin
if ProdOrderComponent."Subcontracting Type" = ProdOrderComponent."Subcontracting Type"::Transfer then
if ProdOrderComponent."Component Supply Method" = ProdOrderComponent."Component Supply Method"::"Transfer to Vendor" then
exit;

ProdOrderLine.SetLoadFields("Routing No.", "Routing Reference No.", "Item No.", "Variant Code", "Location Code");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt."
begin
if ProdOrderComponent."Routing Link Code" = '' then
exit(0);
if ProdOrderComponent."Subcontracting Type" <> ProdOrderComponent."Subcontracting Type"::Purchase then
if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then
exit(0);

GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent);
Expand All @@ -94,7 +94,7 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt."
begin
if ProdOrderComponent."Routing Link Code" = '' then
exit;
if ProdOrderComponent."Subcontracting Type" <> ProdOrderComponent."Subcontracting Type"::Purchase then
if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then
exit;

GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent);
Expand All @@ -121,7 +121,7 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt."
begin
if ProdOrderComponent."Routing Link Code" = '' then
exit(0);
if ProdOrderComponent."Subcontracting Type" <> ProdOrderComponent."Subcontracting Type"::Purchase then
if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then
exit(0);

GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent);
Expand All @@ -148,7 +148,7 @@ codeunit 99001562 "Subc. Comp. Factbox Mgmt."
begin
if ProdOrderComponent."Routing Link Code" = '' then
exit;
if ProdOrderComponent."Subcontracting Type" <> ProdOrderComponent."Subcontracting Type"::Purchase then
if ProdOrderComponent."Component Supply Method" <> ProdOrderComponent."Component Supply Method"::"Vendor-Supplied" then
exit;
GetProdOrderRtngLineFromProdOrderComp(ProdOrderRoutingLine, ProdOrderComponent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ codeunit 99001557 "Subc. Purchase Order Creator"
PurchOrderAlreadyCreatedQst: Label 'Purchase order(s) have already been created.\\Do you want to view them?';
CreationOfSubcontractingOrderIsNotAllowedErr: Label 'You cannot create Subcontracting Order, because the Production Order %1 is not released.', Comment = '%1=Production Order No.';
NoProdOrderLineWithRemQtyErr: Label 'No Prod. Order Line with Remaining Quantity.';
BlankLocationConfirmQst: Label 'One or more Prod. Order Components with Subcontracting Type Transfer have a blank Location Code. Without a Location Code, you will not be able to create a transfer order to send the components to the subcontractor.\\Do you want to create the Subcontracting Order anyway?';
SameAsSubcLocConfirmQst: Label 'One or more Prod. Order Components with Subcontracting Type Transfer have Location Code %1, which is the same as the Subcontracting Location Code of vendor %2. A transfer order cannot be created from and to the same location.\\Do you want to create the Subcontracting Order anyway?', Comment = '%1=Component Location Code, %2=Vendor No.';
BlankLocationConfirmQst: Label 'One or more Prod. Order Components with Component Supply Method Transfer to Vendor have a blank Location Code. Without a Location Code, you will not be able to create a transfer order to send the components to the subcontractor.\\Do you want to create the Subcontracting Order anyway?';
SameAsSubcLocConfirmQst: Label 'One or more Prod. Order Components with Component Supply Method Transfer to Vendor have Location Code %1, which is the same as the Subcontracting Location Code of vendor %2. A transfer order cannot be created from and to the same location.\\Do you want to create the Subcontracting Order anyway?', Comment = '%1=Component Location Code, %2=Vendor No.';
NotEnoughSpaceErr: Label 'There is not enough space to insert the subcontracting info line.';

procedure CreateSubcontractingPurchaseOrderFromRoutingLine(ProdOrderRoutingLine: Record "Prod. Order Routing Line") NoOfCreatedPurchOrder: Integer
Expand Down Expand Up @@ -125,7 +125,7 @@ codeunit 99001557 "Subc. Purchase Order Creator"
ProdOrderComponent.SetRange(Status, ProdOrderRoutingLine.Status);
ProdOrderComponent.SetRange("Prod. Order No.", ProdOrderRoutingLine."Prod. Order No.");
ProdOrderComponent.SetRange("Prod. Order Line No.", RequisitionLine."Prod. Order Line No.");
ProdOrderComponent.SetRange("Subcontracting Type", "Subcontracting Type"::Purchase);
ProdOrderComponent.SetRange("Component Supply Method", "Component Supply Method"::"Vendor-Supplied");
ProdOrderComponent.SetRange("Routing Link Code", ProdOrderRoutingLine."Routing Link Code");
if ProdOrderComponent.FindSet() then
repeat
Expand Down Expand Up @@ -285,7 +285,7 @@ codeunit 99001557 "Subc. Purchase Order Creator"
ProdOrderComponent.SetRange(Status, ProdOrderRoutingLine.Status);
ProdOrderComponent.SetRange("Prod. Order No.", ProdOrderRoutingLine."Prod. Order No.");
ProdOrderComponent.SetRange("Routing Link Code", ProdOrderRoutingLine."Routing Link Code");
ProdOrderComponent.SetRange("Subcontracting Type", "Subcontracting Type"::Transfer);
ProdOrderComponent.SetRange("Component Supply Method", "Component Supply Method"::"Transfer to Vendor");

ProdOrderComponent.SetRange("Location Code", '');
if not ProdOrderComponent.IsEmpty() then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ codeunit 99001505 "Subcontracting Management"

procedure ChangeLocationOnProdOrderComponent(var ProdOrderComponent: Record "Prod. Order Component"; VendorSubcontrLocation: Code[10]; OriginalLocationCode: Code[10]; OriginalBinCode: Code[20])
begin
case ProdOrderComponent."Subcontracting Type" of
"Subcontracting Type"::InventoryByVendor,
"Subcontracting Type"::Purchase:
case ProdOrderComponent."Component Supply Method" of
"Component Supply Method"::"Consignment at Vendor",
"Component Supply Method"::"Vendor-Supplied":
if (VendorSubcontrLocation <> '') and (ProdOrderComponent."Location Code" <> VendorSubcontrLocation) then
ProdOrderComponent.Validate("Location Code", VendorSubcontrLocation);

"Subcontracting Type"::Transfer,
"Subcontracting Type"::Empty:
"Component Supply Method"::"Transfer to Vendor",
"Component Supply Method"::Empty:
begin
if (ProdOrderComponent."Location Code" <> OriginalLocationCode) and (OriginalLocationCode <> '') then begin
ProdOrderComponent.Validate("Location Code", OriginalLocationCode);
Expand All @@ -73,14 +73,14 @@ codeunit 99001505 "Subcontracting Management"

procedure ChangeLocationOnPlanningComponent(var PlanningComponent: Record "Planning Component"; VendorSubcontrLocation: Code[10]; OriginalLocationCode: Code[10]; OriginalBinCode: Code[20])
begin
case PlanningComponent."Subcontracting Type" of
"Subcontracting Type"::InventoryByVendor,
"Subcontracting Type"::Purchase:
case PlanningComponent."Component Supply Method" of
"Component Supply Method"::"Consignment at Vendor",
"Component Supply Method"::"Vendor-Supplied":
if (VendorSubcontrLocation <> '') and (PlanningComponent."Location Code" <> VendorSubcontrLocation) then
PlanningComponent.Validate("Location Code", VendorSubcontrLocation);

"Subcontracting Type"::Transfer,
"Subcontracting Type"::Empty:
"Component Supply Method"::"Transfer to Vendor",
"Component Supply Method"::Empty:
begin
if (PlanningComponent."Location Code" <> OriginalLocationCode) and (OriginalLocationCode <> '') then begin
PlanningComponent.Validate("Location Code", OriginalLocationCode);
Expand Down Expand Up @@ -388,7 +388,7 @@ codeunit 99001505 "Subcontracting Management"
end;
end;

procedure UpdateSubcontractingTypeForPlanningComponent(var PlanningComponent: Record "Planning Component")
procedure UpdateComponentSupplyMethodForPlanningComponent(var PlanningComponent: Record "Planning Component")
var
PlanningRoutingLine: Record "Planning Routing Line";
Vendor: Record Vendor;
Expand All @@ -409,7 +409,7 @@ codeunit 99001505 "Subcontracting Management"

if not GetSubcontractor(PlanningRoutingLine."No.", Vendor) then
Clear(Vendor);
if PlanningComponent."Subcontracting Type" in ["Subcontracting Type"::InventoryByVendor, "Subcontracting Type"::Purchase] then
if PlanningComponent."Component Supply Method" in ["Component Supply Method"::"Consignment at Vendor", "Component Supply Method"::"Vendor-Supplied"] then
VendorSubcontractingLocationCode := Vendor."Subcontr. Location Code";
OrigLocationCode := PlanningComponent."Orig. Location Code";
OrigBinCode := PlanningComponent."Orig. Bin Code";
Expand All @@ -420,7 +420,7 @@ codeunit 99001505 "Subcontracting Management"
end;
end;

procedure UpdateSubcontractingTypeForProdOrderComponent(var ProdOrderComponent: Record "Prod. Order Component")
procedure UpdateComponentSupplyMethodForProdOrderComponent(var ProdOrderComponent: Record "Prod. Order Component")
var
ProdOrderLine: Record "Prod. Order Line";
ProdOrderRoutingLine: Record "Prod. Order Routing Line";
Expand Down Expand Up @@ -460,14 +460,14 @@ codeunit 99001505 "Subcontracting Management"
end;
until (PurchaseLine.Next() = 0) or ProdOrderCompFound;
if ProdOrderCompFound then
Error(PurchOrderExistErr, ProdOrderComponent."Item No.", PurchOrderNo, ProdOrderComponent.FieldCaption(ProdOrderComponent."Subcontracting Type"));
Error(PurchOrderExistErr, ProdOrderComponent."Item No.", PurchOrderNo, ProdOrderComponent.FieldCaption(ProdOrderComponent."Component Supply Method"));

if ProdOrderRoutingLine.Type = "Capacity Type"::"Work Center" then begin
if not GetSubcontractor(ProdOrderRoutingLine."No.", Vendor) then
Clear(Vendor);

VendorSubcontractingLocationCode := Vendor."Subcontr. Location Code";
if not (ProdOrderComponent."Subcontracting Type" in ["Subcontracting Type"::InventoryByVendor, "Subcontracting Type"::Purchase]) then
if not (ProdOrderComponent."Component Supply Method" in ["Component Supply Method"::"Consignment at Vendor", "Component Supply Method"::"Vendor-Supplied"]) then
Clear(VendorSubcontractingLocationCode);
OrigLocationCode := ProdOrderComponent."Orig. Location Code";
OrigBinCode := ProdOrderComponent."Orig. Bin Code";
Expand Down Expand Up @@ -502,7 +502,7 @@ codeunit 99001505 "Subcontracting Management"
if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(RoutingLinkUpdConfQst, ProdOrderRoutingLine."Routing Link Code"), true) then
Error(UpdateIsCanceledErr);
repeat
if not (ProdOrderComponent."Subcontracting Type" in ["Subcontracting Type"::InventoryByVendor, "Subcontracting Type"::Purchase]) then
if not (ProdOrderComponent."Component Supply Method" in ["Component Supply Method"::"Consignment at Vendor", "Component Supply Method"::"Vendor-Supplied"]) then
Clear(VendorSubcontractingLocationCode);
OrigLocationCode := ProdOrderComponent."Orig. Location Code";
OrigBinCode := ProdOrderComponent."Orig. Bin Code";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Manufacturing.Subcontracting;

enum 99001500 "Component Supply Method"
Comment thread
ChethanT marked this conversation as resolved.
{
Extensible = true;
// No supply method is selected.
value(0; Empty)
{
Caption = ' ', Locked = true;
}
// The subcontractor provides the required component materials.
value(1; "Vendor-Supplied")
{
Caption = 'Vendor-Supplied';
}
// Your company owns the components and stores them at the subcontractor location (consignment stock).
value(2; "Consignment at Vendor")
{
Caption = 'Consignment at Vendor';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this jargon is used by people who work with subcontracting process. It's confusing, though, who owns the stock - we or subcontractor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a matter of documentation, tooltip and code comment?

}
// Components are sent to the subcontractor through a transfer order.
value(3; "Transfer to Vendor")
{
Caption = 'Transfer to Vendor';
}
}
Comment thread
ChethanT marked this conversation as resolved.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pageextension 99001511 "Subc. Planning Comp" extends "Planning Components"
{
addlast(Control1)
{
field("Subcontracting Type"; Rec."Subcontracting Type")
Comment thread
ChethanT marked this conversation as resolved.
field("Component Supply Method"; Rec."Component Supply Method")
{
ApplicationArea = Manufacturing;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pageextension 99001510 "Subc. Prod BOM Lines" extends "Production BOM Lines"
{
addlast(Control1)
{
field("Subcontracting Type"; Rec."Subcontracting Type")
field("Component Supply Method"; Rec."Component Supply Method")
{
ApplicationArea = Manufacturing;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ pageextension 99001514 "Subc. ProdBOMVersionLines" extends "Production BOM Versi
{
addlast(Control1)
{
field("Subcontracting Type"; Rec."Subcontracting Type")
field("Component Supply Method"; Rec."Component Supply Method")
{
ApplicationArea = Manufacturing;
ToolTip = 'Specifies the Type of Subcontracting that is assigned to the Production BOM Line.';
ToolTip = 'Specifies how components are supplied to the subcontractor for the production BOM line.';
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pageextension 99001512 "Subc. Prod Order Comp" extends "Prod. Order Components"
}
addlast(Control1)
{
field("Subcontracting Type"; Rec."Subcontracting Type")
field("Component Supply Method"; Rec."Component Supply Method")
{
ApplicationArea = Manufacturing;
}
Expand Down
Loading
Loading