X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=haxe%2FItemScheduler.hx;h=274f562b256a1999e3a04296c2a6d3686f73473c;hb=514ad9dfb6f8ea147b9cb9ee9b89d2b0b485b607;hp=6da40434ccbfb15828bc655acfc6b0832642737e;hpb=a73cdbbda185c9a43ef3870f5ab95d3e861b9f87;p=order_line_extra.git diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index 6da4043..274f562 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -127,7 +127,7 @@ class ItemScheduler { while(0 >= left && locationIter.hasNext()) { location = locationIter.next(); - var quantityForLocation : Int = location.quantityOnHand(stock_id, null); + var quantityForLocation : Int = location.quantityOnHand(stock_id, null) + location.quantityOnOrder(stock_id); if(quantityForLocation == null || quantityForLocation == 0 || location.delivery == null) continue; left += quantityForLocation; formatLocation(location, "Delivery", left); @@ -297,6 +297,17 @@ function locations() { function purcharseOrders() { + var TB = FA.tb(); + var sql = 'SELECT SUM(quantity_ordered - quantity_received) as quantity + into_stock_location AS location + FROM '+TB+'purch_order_details + NATURAL JOIN '+TB+'purch_orders + WHERE item_code = "'+this.stock_id+'" + AND quantity_ordered > quantity_received + GROUP by item_code,delivery_date, into_stock_location + ORDER by delivery_date' ; + + return FA.query(sql); } public function needsUpdate():Bool {