X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=haxe%2FItemScheduler.hx;h=ab4e9ac83f78fd623696335ff6021d176cdb0b04;hb=dcfbc4cb92372d78e5647ecf4b303453737190db;hp=d01c9602be47f960acb9378d5bd4330bcad1bae5;hpb=7a4c7c9512eb74d2f91ef7939cd435cb98b8114c;p=order_line_extra.git diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index d01c960..ab4e9ac 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -118,7 +118,7 @@ class ItemScheduler { for(order in orders()) { var quantity : Int = Std.parseInt(order.quantity); - while(0 > left && locationIter.hasNext()) { + while(0 >= left && locationIter.hasNext()) { location = locationIter.next(); var quantityForLocation : Int = location.quantityOnHand(stock_id, null); if(quantityForLocation == null || quantityForLocation == 0) continue; @@ -131,7 +131,7 @@ class ItemScheduler { } // display the left locations - while(0 > left && locationIter.hasNext()) { + while(0 >= left && locationIter.hasNext()) { location = locationIter.next(); var quantityForLocation : Int = location.quantityOnHand(stock_id, null); if(quantityForLocation == null || quantityForLocation == 0) continue; @@ -232,7 +232,7 @@ return cast(locations(), Array); private function loadOrders() { var tb : String = untyped __php__('TB_PREF'); - var sql : String = "SELECT * , d.priority AS pp + var sql : String = "SELECT * , d.quantity as qty, d.priority AS pp FROM "+tb+"denorm_order_details_queue d JOIN "+tb+"sales_order_details od ON (od.id = d.id) JOIN "+tb+"sales_orders so ON (so.order_no = d.order_id) @@ -252,6 +252,7 @@ function orders():Array { var a:Dynamic = php.Lib.objectOfAssociativeArray(row); var order:Order = a; order.priority = Date.fromString(a.pp); + order.quantity = a.qty; orderList.push(order); };