X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=manufacturing%2Fincludes%2Fdb%2Fwork_order_produce_items_db.inc;h=ef5640c3448f8c83b0341b73bef10588f3b31558;hb=569f3733188bdff8d7df940aa88eb425335f7276;hp=6c2010c9c292f5dcb91fd2eaf8a31f3bf932709d;hpb=f7c8004b367843301c98f49db953907e20f5fe39;p=fa-stable.git diff --git a/manufacturing/includes/db/work_order_produce_items_db.inc b/manufacturing/includes/db/work_order_produce_items_db.inc index 6c2010c9..ef5640c3 100644 --- a/manufacturing/includes/db/work_order_produce_items_db.inc +++ b/manufacturing/includes/db/work_order_produce_items_db.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo) { begin_transaction(); @@ -28,19 +37,19 @@ function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo) $id = db_insert_id(); + // ------------------------------------------------------------------------- + + work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, true); + + // ------------------------------------------------------------------------- // insert a +ve stock move for the item being manufactured // negative means "unproduce" or unassemble add_stock_move(29, $details["stock_id"], $id, $details["loc_code"], $date_, $memo_, $quantity, 0); - // update wo quantity and close wo if requested work_order_update_finished_quantity($woid, $quantity, $close_wo); - // ------------------------------------------------------------------------- - - work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, 0, true); - // ------------------------------------------------------------------------- if ($memo_) add_comments(29, $id, $date_, $memo_);