Fixed a non esisting voiding of Work Order Advanced and a couple of bugs in the same...
[fa-stable.git] / manufacturing / includes / db / work_order_produce_items_db.inc
index 428508112d75d9428b950d7366b5a6886b4e1b78..b9fd16f0e9198ad61d94b74a281e21b4aebc84b8 100644 (file)
@@ -42,7 +42,7 @@ function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo)
 
        // -------------------------------------------------------------------------
 
-       work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, true);
+       work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, $id);
 
        // -------------------------------------------------------------------------
        // insert a +ve stock move for the item being manufactured
@@ -107,7 +107,7 @@ function void_work_order_produce($type_no)
        // deduct the quantity of this production from the parent work order
        work_order_update_finished_quantity($row["workorder_id"], -$row["quantity"]);
 
-       work_order_quick_costs($row['workorder_id'], $row['stock_id'], -$row['quantity'], sql2date($row['date_']), true);
+       work_order_quick_costs($row['workorder_id'], $row['stock_id'], -$row['quantity'], sql2date($row['date_']), $type_no);
 
        // clear the production record
        $sql = "UPDATE ".TB_PREF."wo_manufacture SET quantity=0 WHERE id=".db_escape($type_no);