...
//ReservEngineMgt.InitFilterAndSortingFor(ReservEntry,TRUE);
//ProdOrderCompReserve.FilterReservFor(ReservEntry,ProdOrderComponent);
ProdOrderCompReserve.FindReservEntry(ProdOrderComponent,ReservEntry);
IF ReservEntry.FIND('-') THEN
REPEAT
IF Item.GET(ReservEntry."Item No.") THEN BEGIN
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Transfer Line",0,
TransferLine."Document No.",ReservEntry."Source Batch Name",
TransferLine."Derived From Line No.",TransferLine."Line No.",
TransferLine."Qty. per Unit of Measure",-ReservEntry."Quantity (Base)",
ReservEntry."Serial No.",ReservEntry."Lot No.");
CreateReservEntry.CreateEntry(
ReservEntry."Item No.",ReservEntry."Variant Code",
ReservEntry."Location Code",ReservEntry.Description,
ReservEntry."Expected Receipt Date",ReservEntry."Shipment Date",
ReservEntry."Entry No.",ReservEntry."Reservation Status");
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Transfer Line",1,
TransferLine."Document No.",ReservEntry."Source Batch Name",
TransferLine."Derived From Line No.",TransferLine."Line No.",
TransferLine."Qty. per Unit of Measure",-ReservEntry."Quantity (Base)",
ReservEntry."Serial No.",ReservEntry."Lot No.");
CreateReservEntry.CreateEntry(
ReservEntry."Item No.",ReservEntry."Variant Code",
TransferLine."Transfer-to Code",ReservEntry.Description,
ReservEntry."Expected Receipt Date",ReservEntry."Shipment Date",
ReservEntry."Entry No.",ReservEntry."Reservation Status");
ReservEntry."Location Code" := TransferLine."Transfer-to Code";
ReservEntry.MODIFY;
IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGIN
TotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);
ReservMgt.AutoTrack(TotalQty);
END;
//Refresh Related Line for Item Ledger Entry
IF ReservEntry.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive) THEN BEGIN
ReservEntry.VALIDATE("Quantity (Base)",-TransferLine."Quantity (Base)");
ReservEntry.VALIDATE(Positive,TransferLine."Quantity (Base)" < 0);
ReservEntry.MODIFY;
IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGIN
TotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);
ReservMgt.AutoTrack(TotalQty);
END;
END;1
END;
UNTIL ReservEntry.NEXT = 0;
END;
...
...
PROCEDURE TransfSUBOrdCompToSUBTransfOrd@1130008(TransferLine@1130000 : Record 5741;ProdOrderComponent@1130001 : Record 5407;Direction@1130002 : Integer);
VAR
ReservEntry@1130003 : Record 337;
Item@1130004 : Record 27;
ReservEngineMgt@1130005 : Codeunit 99000831;
ProdOrderCompReserve@1130006 : Codeunit 99000838;
ReservMgt@1130007 : Codeunit 99000845;
CreateReservEntry@1130008 : Codeunit 99000830;
TotalQty@1130009 : Decimal;
ReservEntry2@1130010 : Record 337;
BEGIN
// The following lines are updated.
ProdOrderCompReserve.FindReservEntry(ProdOrderComponent,ReservEntry);
IF ReservEntry.FIND('-') THEN
REPEAT
IF Item.GET(ReservEntry."Item No.") THEN BEGIN
CreateReservEntry.CreateReservEntryFor(
DATABASE::"Transfer Line",1,
TransferLine."Document No.",ReservEntry."Source Batch Name",
TransferLine."Derived From Line No.",TransferLine."Line No.",
TransferLine."Qty. per Unit of Measure",-ReservEntry."Quantity (Base)",
ReservEntry."Serial No.",ReservEntry."Lot No.");
CreateReservEntry.CreateReservEntryFrom(
DATABASE::"Prod. Order Component", 3,
ProdOrderComponent."Prod. Order No.",ReservEntry."Source Batch Name",
ProdOrderComponent."Prod. Order Line No.", ProdOrderComponent."Line No.",
ProdOrderComponent."Qty. per Unit of Measure",
ReservEntry."Serial No.",ReservEntry."Lot No.");
CreateReservEntry.CreateEntry(
ReservEntry."Item No.",ReservEntry."Variant Code",
TransferLine."Transfer-to Code",ReservEntry.Description,
ReservEntry."Expected Receipt Date",ReservEntry."Shipment Date",
ReservEntry."Entry No.",ReservEntry."Reservation Status");
//Refresh Related Line for Item Ledger Entry
IF ReservEntry.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive) THEN BEGIN
IF Item."Order Tracking Policy" > Item."Order Tracking Policy"::None THEN BEGIN
TotalQty := ReservMgt.SourceQuantity(ReservEntry,TRUE);
ReservMgt.AutoTrack(TotalQty);
END;
END;
END;
UNTIL ReservEntry.NEXT = 0;
// End of the lines.
END;
...