2. Juni 2010 09:37
IF ProdBOMNo = '' THEN
EXIT;
ProdOrderComp.LOCKTABLE;
IF Level > 50 THEN
ERROR(
Text000,
ProdBOMNo);
BOMHeader.GET(ProdBOMNo);
BomComponent[Level].SETRANGE("Production BOM No.",ProdBOMNo);
IF Level > 1 THEN
BomComponent[Level].SETRANGE("Version Code",VersionMgt.GetBOMVersion(ProdBOMNo,ProdOrderLine."Starting Date",TRUE))
ELSE
BomComponent[Level].SETRANGE("Version Code",ProdOrderLine."Production BOM Version Code");
BomComponent[Level].SETFILTER("Starting Date",'%1|..%2',0D,ProdOrderLine."Starting Date");
BomComponent[Level].SETFILTER("Ending Date", '%1|%2..',0D,ProdOrderLine."Starting Date");
IF BomComponent[Level].FIND('-') THEN
REPEAT
IF (BomComponent[Level]."Routing Link Code" <> '') THEN BEGIN
ProdOrderRtngLine2.SETRANGE(Status,ProdOrderLine.Status);
ProdOrderRtngLine2.SETRANGE("Prod. Order No.",ProdOrderLine."Prod. Order No.");
ProdOrderRtngLine2.SETRANGE("Routing Link Code",BomComponent[Level]."Routing Link Code");
ProdOrderRtngLine2.FIND('-');
ReqQty :=
Quantity *
BomComponent[Level].Quantity *
(1 + BomComponent[Level]."Scrap %" / 100) *
(1 + ProdOrderRtngLine2."Scrap Factor % (Accumulated)") *
(1 + ProdOrderLine."Scrap %" / 100) +
ProdOrderRtngLine2."Fixed Scrap Qty. (Accum.)";
END ELSE
ReqQty :=
Quantity * BomComponent[Level].Quantity *
(1 + BomComponent[Level]."Scrap %" / 100) *
(1 + ProdOrderLine."Scrap %" / 100);
CASE BomComponent[Level].Type OF
BomComponent[Level].Type::Item:
BEGIN
IF ReqQty <> 0 THEN BEGIN
ProdOrderComp.SETCURRENTKEY(Status,"Prod. Order No.","Prod. Order Line No.","Item No.");
ProdOrderComp.SETRANGE(Status,ProdOrderLine.Status);
ProdOrderComp.SETRANGE("Prod. Order No.", ProdOrderLine."Prod. Order No.");
ProdOrderComp.SETRANGE("Prod. Order Line No.",ProdOrderLine."Line No.");
ProdOrderComp.SETRANGE("Item No.",BomComponent[Level]."No.");
ProdOrderComp.SETRANGE("Variant Code",BomComponent[Level]."Variant Code");
ProdOrderComp.SETRANGE("Routing Link Code",BomComponent[Level]."Routing Link Code");
ProdOrderComp.SETRANGE(Position,BomComponent[Level].Position);
ProdOrderComp.SETRANGE("Position 2",BomComponent[Level]."Position 2");
ProdOrderComp.SETRANGE("Position 3",BomComponent[Level]."Position 3");
ProdOrderComp.SETRANGE(Length,BomComponent[Level].Length);
ProdOrderComp.SETRANGE(Width,BomComponent[Level].Width);
ProdOrderComp.SETRANGE(Weight,BomComponent[Level].Weight);
ProdOrderComp.SETRANGE(Depth,BomComponent[Level].Depth);
ProdOrderComp.SETRANGE("Unit of Measure Code",BomComponent[Level]."Unit of Measure Code");
IF NOT ProdOrderComp.FIND('-') THEN BEGIN
ProdOrderComp.RESET;
ProdOrderComp.SETRANGE(Status,ProdOrderLine.Status);
ProdOrderComp.SETRANGE("Prod. Order No.", ProdOrderLine."Prod. Order No.");
ProdOrderComp.SETRANGE("Prod. Order Line No.",ProdOrderLine."Line No.");
IF ProdOrderComp.FIND('+') THEN
NextProdOrderCompLineNo := ProdOrderComp."Line No." + 10000
ELSE
NextProdOrderCompLineNo := 10000;
ProdOrderComp.INIT;
ProdOrderComp.BlockDynamicTracking(Blocked);
ProdOrderComp.Status := ProdOrderLine.Status;
ProdOrderComp."Prod. Order No." := ProdOrderLine."Prod. Order No.";
ProdOrderComp."Prod. Order Line No." := ProdOrderLine."Line No.";
ProdOrderComp."Line No." := NextProdOrderCompLineNo;
CLEAR(itemComplementFoundLoc);
itemComplementLoc.INIT;
IF itemLoc.GET(BomComponent[Level]."No.") THEN BEGIN
IF itemLoc."Item Disc. Group" IN ['200','201'] THEN BEGIN
IF prodOrderLineReserveLoc.FindReservEntry(ProdOrderLine,reservationEntryLoc) THEN BEGIN
IF reservationEntryLoc."Reservation Status" = reservationEntryLoc."Reservation Status"::Reservation THEN BEGIN
reservationEntryLoc.GET(reservationEntryLoc."Entry No.",NOT reservationEntryLoc.Positive);
IF salesLineLoc.GET(reservationEntryLoc."Source Subtype",reservationEntryLoc."Source ID",
reservationEntryLoc."Source Ref. No.") THEN BEGIN
IF salesLineLoc.VV THEN BEGIN
IF itemComplementLoc.GET(salesLineLoc."No.",salesLineLoc."Sell-to Customer No.") THEN BEGIN
IF itemComplementLoc.Status = itemComplementLoc.Status::active THEN BEGIN
IF itemComplementLoc."Packaging Item No." <> '' THEN BEGIN
ProdOrderComp.VALIDATE("Item No.",itemComplementLoc."Packaging Item No.");
itemComplementFoundLoc := TRUE;
END;
END;
END;
IF NOT itemComplementFoundLoc THEN BEGIN
itemComplementLoc.SETRANGE("Customer No.",salesLineLoc."Sell-to Customer No.");
itemComplementLoc.SETRANGE("Item Substitution",salesLineLoc."No.");
itemComplementLoc.SETRANGE(Status,itemComplementLoc.Status::active);
itemComplementLoc.SETFILTER("Packaging Item No.",'<>%1','');
IF itemComplementLoc.FINDFIRST THEN BEGIN
ProdOrderComp.VALIDATE("Item No.",itemComplementLoc."Packaging Item No.");
itemComplementFoundLoc := TRUE;
END;
itemComplementLoc.RESET;
END;
END;
END;
END;
END;
END;
END;
IF NOT itemComplementFoundLoc THEN BEGIN
ProdOrderComp.VALIDATE("Item No.",BomComponent[Level]."No.");
END;
ProdOrderComp."Variant Code" := BomComponent[Level]."Variant Code";
ProdOrderComp."Location Code" := SKU."Components at Location";
ProdOrderComp."Bin Code" := GetDefaultBin;
IF NOT itemComplementFoundLoc THEN BEGIN
ProdOrderComp.Description := BomComponent[Level].Description;
END;
ProdOrderComp.VALIDATE("Unit of Measure Code",BomComponent[Level]."Unit of Measure Code");
ProdOrderComp."Quantity per" :=
Quantity * BomComponent[Level]."Quantity per";
ProdOrderComp.Length := BomComponent[Level].Length;
ProdOrderComp.Width := BomComponent[Level].Width;
ProdOrderComp.Weight := BomComponent[Level].Weight;
ProdOrderComp.Depth := BomComponent[Level].Depth;
ProdOrderComp.Position := BomComponent[Level].Position;
ProdOrderComp."Position 2" := BomComponent[Level]."Position 2";
ProdOrderComp."Position 3" := BomComponent[Level]."Position 3";
ProdOrderComp."Production Lead Time" := BomComponent[Level]."Production Lead Time";
ProdOrderComp.VALIDATE("Routing Link Code",BomComponent[Level]."Routing Link Code");
ProdOrderComp.VALIDATE("Scrap %",BomComponent[Level]."Scrap %");
ProdOrderComp.VALIDATE("Calculation Formula",BomComponent[Level]."Calculation Formula");
GetPlanningParameters.AtSKU(
ComponentSKU,ProdOrderComp."Item No.",
ProdOrderComp."Variant Code",
ProdOrderComp."Location Code");
//ProdOrderComp."Flushing Method" := ComponentSKU."Flushing Method";
IF BomComponent[Level]."Customer Provided Part" <> 0 THEN
ProdOrderComp."Flushing Method" := ProdOrderComp."Flushing Method"::Backward
ELSE
ProdOrderComp."Flushing Method" := ComponentSKU."Flushing Method";
ProdOrderComp.VALIDATE("Calculation Formula",BomComponent[Level]."Calculation Formula");
IF (SKU."Manufacturing Policy" = SKU."Manufacturing Policy"::"Make-to-Order") AND
(ComponentSKU."Manufacturing Policy" = ComponentSKU."Manufacturing Policy"::"Make-to-Order") AND
(ComponentSKU."Replenishment System" = ComponentSKU."Replenishment System"::"Prod. Order")
THEN BEGIN
ProdOrderComp."Planning Level Code" := ProdOrderLine."Planning Level Code" + 1;
Item2.GET(ProdOrderComp."Item No.");
ProdOrderComp."Item Low-Level Code" := Item2."Low-Level Code";
END;
ProdOrderComp.GetDefaultBin;
ProdOrderComp."Customer Provided Part" := BomComponent[Level]."Customer Provided Part";
IF ProdOrderComp."Customer Provided Part" =
ProdOrderComp."Customer Provided Part"::"Cust. Provided Part at Supplier (int.)" THEN BEGIN
IF recWorkCenter.GET(ProdOrderRtngLine2."Work Center No.") THEN BEGIN
IF recVendor.GET(recWorkCenter."Subcontractor No.") AND (recVendor."Location Code External"<>'') THEN BEGIN
ProdOrderComp."Location Code" := recVendor."Location Code External";
ProdOrderComp."Bin Code" := '';
END ELSE
IF recWorkCenter."Location external" <> '' THEN BEGIN
ProdOrderComp."Location Code" := recWorkCenter."Location external";
ProdOrderComp."Bin Code" := '';
END;
END;
END ELSE
IF recItem2.GET(ProdOrderComp."Item No.") THEN BEGIN
ProdOrderComp."Location Code" := recItem2."Default Location Code";
ProdOrderComp."Bin Code" := recItem2."Default Bin Code";
END;
RecArtikelLagerplatzZuordnung.RESET;
RecArtikelLagerplatzZuordnung.SETRANGE("Artikelnr.",ProdOrderComp."Item No.");
IF RecArtikelLagerplatzZuordnung.FIND('-') THEN
ProdOrderComp."Location Code" := RecArtikelLagerplatzZuordnung.Lagerort;
IF ProdOrderComp."Customer Provided Part" <> ProdOrderComp."Customer Provided Part"::
"Cust. Provided Part from Supplier (ext) " THEN
ProdOrderComp.INSERT(TRUE);
END ELSE BEGIN
ProdOrderComp.SETCURRENTKEY(Status,"Prod. Order No."); // Reset key
ProdOrderComp.BlockDynamicTracking(Blocked);
ProdOrderComp.VALIDATE(
"Quantity per",
ProdOrderComp."Quantity per" +
Quantity * BomComponent[Level]."Quantity per");
ProdOrderComp.VALIDATE("Routing Link Code",BomComponent[Level]."Routing Link Code");
ProdOrderComp.MODIFY;
END;
ProdOrderComp.AutoReserve;
ProdBOMCompComment.SETRANGE("Production BOM No.",BomComponent[Level]."Production BOM No.");
ProdBOMCompComment.SETRANGE("BOM Line No.",BomComponent[Level]."Line No.");
ProdBOMCompComment.SETRANGE("Version Code",BomComponent[Level]."Version Code");
IF ProdBOMCompComment.FIND('-') THEN
REPEAT
ProdOrderBOMCompComment.TRANSFERFIELDS(ProdBOMCompComment);
ProdOrderBOMCompComment.Status := ProdOrderComp.Status;
ProdOrderBOMCompComment."Prod. Order No." := ProdOrderComp."Prod. Order No.";
ProdOrderBOMCompComment."Prod. Order Line No." := ProdOrderComp."Prod. Order Line No.";
ProdOrderBOMCompComment."Prod. Order BOM Line No." := ProdOrderComp."Line No.";
IF NOT ProdOrderBOMCompComment.INSERT THEN
ProdOrderBOMCompComment.MODIFY;
UNTIL ProdBOMCompComment.NEXT = 0;
END;
END;
BomComponent[Level].Type::"Production BOM":
BEGIN
TransferBOM(
BomComponent[Level]."No.",
Level + 1,
ReqQty);
BomComponent[Level].SETRANGE("Production BOM No.",ProdBOMNo);
IF Level > 1 THEN
BomComponent[Level].SETRANGE("Version Code",VersionMgt.GetBOMVersion(ProdBOMNo,ProdOrderLine."Starting Date",TRUE))
ELSE
BomComponent[Level].SETRANGE("Version Code",ProdOrderLine."Production BOM Version Code");
BomComponent[Level].SETFILTER("Starting Date",'%1|..%2',0D,ProdOrderLine."Starting Date");
BomComponent[Level].SETFILTER("Ending Date", '%1|%2..',0D,ProdOrderLine."Starting Date");
END;
END;
UNTIL BomComponent[Level].NEXT = 0;
2. Juni 2010 09:42
escabrosa hat geschrieben:Häkchen gesetzt:
- Eine Komponentenzeile mit dem Fertigartikel
- Das Setzen des Haken löst eine Berechnung analog einer Mengenänderung aus
Häkchen nicht gesetz/ nicht mehr gesetzt:
- Komponenten sollen wieder angezeigt werden (normaler Ablauf, so wie die funktion schon war)
2. Juni 2010 09:45
2. Juni 2010 10:09
2. Juni 2010 10:52
2. Juni 2010 11:32
2. Juni 2010 11:45
2. Juni 2010 12:28
2. Juni 2010 13:05
2. Juni 2010 13:21
Bender hat geschrieben:mir wurde gerade heute im Geschäft gesagt, dass ich eh nicht lesen kann und auch mündliche Inputs nicht verstehe ... )
2. Juni 2010 13:43
2. Juni 2010 14:59