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=fd7d96554309b35aa41279f58ea33134484cd1f3;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;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 fd7d9655..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); - // ------------------------------------------------------------------------- if ($memo_) add_comments(29, $id, $date_, $memo_);