On the Planning worksheet using the 'Calculate Regenerative Plan' I want it to calculate only The Items with Stock keeping Units. I want it to essentially say if there is enough on the Inventory and the Qty on Purch Order than don't plan this. I Have added this code.. If there is enough stock it changes the quantity to 0 and is later deleted. How can I:
1) Only make it bring in orders for today date i.e Due date = WORKDATE
2) Filter for lower than workdate
SETFILTER("Due Date" ,'>%1', WORKDATE);
DELETEALL; ( I've set stand and end date as today on the first screen)
3) Correctly check the SKU quantities to not Plan if there is demand met..
IF 1=1 THEN;
CurrentWorkdate := WORKDATE;
Item.CALCFIELDS("Stockkeeping Unit Exists");
IF Item."Stockkeeping Unit Exists" THEN BEGIN
recStockKeepingUnits.RESET;
recStockKeepingUnits.SETRANGE("Item No.", Item."No.");
recStockKeepingUnits.SETRANGE("Variant Code", ReqLine."Variant Code");
IF recStockKeepingUnits.FINDFIRST THEN BEGIN
recStockKeepingUnits.CALCFIELDS(Inventory);
recStockKeepingUnits.CALCFIELDS("Qty. on Purch. Order");
IF (recStockKeepingUnits."Qty. on Purch. Order" + recStockKeepingUnits.Inventory >= recStockKeepingUnits."Reorder Point") OR
(ReqLine."Due Date" <> CurrentworkDate) THEN BEGIN
ReqLine.Quantity := 0;
ReqLine."Quantity (Base)" := 0;
ReqLine.MODIFY;
END;
END;
END ELSE
IF Item."Qty. on Purch. Order" + Item.Inventory >= ReqLine.Quantity THEN BEGIN
ReqLine.Quantity := 0;
ReqLine."Quantity (Base)" := 0;
ReqLine.MODIFY;
END;
// TIO000002 : END
*This post is locked for comments