Minor bug in advanced overhead and labour update.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 10 Jun 2009 08:56:19 +0000 (08:56 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 10 Jun 2009 08:56:19 +0000 (08:56 +0000)
manufacturing/includes/db/work_orders_quick_db.inc
manufacturing/work_order_entry.php

index bf8cca898a5ef09dd62f125a2e9de27e70eb3442..b1f9a6c7a19c65b42ce75e1a48ef85e6f2e637cd 100644 (file)
@@ -128,13 +128,13 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced
                add_issue_cost($stock_id, $units_reqd, $date_, $issue_total);
                $result = get_gl_wo_cost_trans($woid, WO_LABOUR);
                $lcost = 0;
-               while ($row = db_fetch_row($result))
+               while ($row = db_fetch($result))
                        $lcost += -$row['amount'];
                if ($lcost != 0)        
                        add_labour_cost($stock_id, $units_reqd, $date_, $lcost * $units_reqd / $wo['units_reqd']);
                $result = get_gl_wo_cost_trans($woid, WO_OVERHEAD);
                $ocost = 0;
-               while ($row = db_fetch_row($result))
+               while ($row = db_fetch($result))
                        $ocost += -$row['amount'];
                if ($ocost != 0)        
                        add_overhead_cost($stock_id, $units_reqd, $date_, $ocost * $units_reqd / $wo['units_reqd']);
index b30209fc984fca9f5bcc04172c8ce828fd366583..18abddb5762fc20a75d89411960d3aaa4e10c2bf 100644 (file)
@@ -254,7 +254,10 @@ function can_process()
 
 if (isset($_POST['ADD_ITEM']) && can_process())
 {
-
+       if (!isset($_POST['cr_acc']))
+               $_POST['cr_acc'] = "";
+       if (!isset($_POST['cr_lab_acc']))
+               $_POST['cr_lab_acc'] = "";
        $id = add_work_order($_POST['wo_ref'], $_POST['StockLocation'], input_num('quantity'),
                $_POST['stock_id'],  $_POST['type'], $_POST['date_'],
                $_POST['RequDate'], $_POST['memo_'], input_num('Costs'), $_POST['cr_acc'], input_num('Labour'), $_POST['cr_lab_acc']);