5. Dezember 2017 19:59
lcuReservationManagement.SetSalesLine(lSalesLine);
DoFullReserve := FALSE;
lcuReservationManagement.AutoReserve(DoFullReserve,'TEST',WORKDATE,lSalesLine."Quantity (Base)",lSalesLine."Quantity (Base)");
5. Dezember 2017 20:17
6. Dezember 2017 22:18
11. Dezember 2017 16:22
LOCAL PROCEDURE SalesOrderLineReserve@1000000012(VAR pioSalesLine@1000000000 : Record 37;piItem@1000000001 : Record 27);
VAR
lReservationEntry@1000000010 : Record 337;
lReservEntryILE@1000000009 : Record 337;
lReservEntryEdit@1000000008 : Record 337;
lSalesLine@1000000006 : Record 37;
lcuReservationManagement@1000000004 : Codeunit 99000845;
DoFullReserve@1000000003 : Boolean;
lcuSalesLineReserve@1000000002 : Codeunit 99000832;
BEGIN
lcuReservationManagement.SetSalesLine(pioSalesLine);
lcuReservationManagement.AutoReserve(DoFullReserve, pioSalesLine.Description, WORKDATE, pioSalesLine."Outstanding Quantity", pioSalesLine."Outstanding Qty. (Base)");
lcuSalesLineReserve.FilterReservFor(lReservationEntry,pioSalesLine);
IF lReservationEntry.FINDSET THEN
REPEAT
lReservEntryILE.GET(lReservationEntry."Entry No.", NOT lReservationEntry.Positive);
lReservEntryEdit.GET(lReservationEntry."Entry No.", lReservationEntry.Positive);
lReservEntryEdit."Lot No." := lReservEntryILE."Lot No.";
lReservEntryEdit.MODIFY;
UNTIL lReservationEntry.NEXT = 0;
END;
LOCAL PROCEDURE SalesReturnOrderLineReserve@1000000015(VAR pioSalesLine@1000000001 : Record 37);
VAR
lcuSalesLineReserve@1000000000 : Codeunit 99000832;
lTempTrackSpec@1000000002 : TEMPORARY Record 336;
lTempTrackingSpecification@1000000008 : TEMPORARY Record 336;
lItemTrackingInformation@1000000004 : Record 6505;
lRemainingLifeDate@1000000005 : Date;
lExpirationDate@1000000009 : Date;
loldestLotNo@1000000006 : Code[20];
lNextLineNo@1000000007 : Integer;
lcuReservationManagement@1000000010 : Codeunit 99000845;
lcuCreateReservEntry@1000000011 : Codeunit 99000830;
lpgItemTrkgLines@1000000003 : Page 6510;
BEGIN
lcuSalesLineReserve.InitTrackingSpecification(pioSalesLine, lTempTrackSpec);
IF lTempTrackSpec.FINDLAST THEN
lNextLineNo := lTempTrackSpec."Entry No." + 1
ELSE
lNextLineNo := 1;
lItemTrackingInformation.SETRANGE("Item No.", pioSalesLine."No.");
lItemTrackingInformation.SETFILTER("Location Filter", pioSalesLine."Location Code");
lItemTrackingInformation.SETFILTER(Inventory, '>0');
IF lItemTrackingInformation.FINDSET THEN BEGIN
lRemainingLifeDate := lItemTrackingInformation."Remaining Life Date";
loldestLotNo := lItemTrackingInformation."Lot No.";
lExpirationDate := lItemTrackingInformation."Expiration Date";
REPEAT
IF lItemTrackingInformation."Remaining Life Date" < lRemainingLifeDate THEN BEGIN
lRemainingLifeDate := lItemTrackingInformation."Remaining Life Date";
loldestLotNo := lItemTrackingInformation."Lot No.";
lExpirationDate := lItemTrackingInformation."Expiration Date";
END;
UNTIL lItemTrackingInformation.NEXT = 0;
END;
lTempTrackingSpecification := lTempTrackSpec;
lTempTrackingSpecification."Entry No." := lNextLineNo;
lTempTrackingSpecification.VALIDATE("Lot No.", loldestLotNo);
lTempTrackingSpecification.VALIDATE("Remaining Life Date", lRemainingLifeDate);
lTempTrackingSpecification.VALIDATE("Expiration Date", lExpirationDate);
lTempTrackingSpecification.INSERT;
lpgItemTrkgLines.SetSource(lTempTrackSpec, pioSalesLine."Shipment Date");
lpgItemTrkgLines.AdjustItemTrkgLines(lTempTrackSpec, pioSalesLine."Shipment Date", lTempTrackingSpecification);
END;