X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=manufacturing%2Fincludes%2Fdb%2Fwork_orders_quick_db.inc;h=1ce76932a61ee06994b454edd6ae8dcdc9117460;hb=7561718ee5113232ce917f63085d272884b0929c;hp=33350aeb11c2197ff3ae5c2269e23854db729e56;hpb=53d942f2a0d20cce5e9c409c6485867ce0869e4d;p=fa-stable.git diff --git a/manufacturing/includes/db/work_orders_quick_db.inc b/manufacturing/includes/db/work_orders_quick_db.inc index 33350aeb..1ce76932 100644 --- a/manufacturing/includes/db/work_orders_quick_db.inc +++ b/manufacturing/includes/db/work_orders_quick_db.inc @@ -66,6 +66,7 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, db_query($sql, "The work order requirements could not be added"); // insert a -ve stock move for each item + $UnitCost = get_standard_cost($bom_item["component"]); add_stock_move(ST_WORKORDER, $bom_item["component"], $woid, $bom_item["loc_code"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, 1, $UnitCost); } @@ -81,6 +82,10 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, } + //Negative Stock Handling First; Prior to add_stock_move + if ($cost_adjust) + adjust_deliveries($stock_id, get_standard_cost($stock_id), $date_); + // ------------------------------------------------------------------------- // insert a +ve stock move for the item being manufactured @@ -185,4 +190,3 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced //-------------------------------------------------------------------------------------- -?> \ No newline at end of file