Merged latest changes from stable branch.
[fa-stable.git] / manufacturing / includes / db / work_orders_db.inc
index 9bfebb758d920995ea1df620df42d58cbfb81e0e..c9a352e1f9b93408dd460a25527c4d66f1cc25e3 100644 (file)
@@ -252,14 +252,8 @@ function void_work_order($woid)
                        // clear the production record
                        $sql = "UPDATE ".TB_PREF."wo_manufacture SET quantity=0 WHERE id=".$$row['id'];
                        db_query($sql, "Cannot void a wo production");
-                       
-                       //Post voided entry if not prevoided explicitly
-                       $void_entry = get_voided_entry(ST_MANURECEIVE, $row['id']);
-                       if ($void_entry)
-                               continue;
-                       $memo_ = _("Voiding Work Order Trans # ").$woid;
-                       add_audit_trail(ST_MANURECEIVE, $row['id'], today(), _("Voided.")."\n".$memo_);
-                       add_voided_entry(ST_MANURECEIVE, $row['id'], today(), $memo_);
+
+                       void_stock_move(ST_MANURECEIVE, $row['id']); // and void the stock moves; 
                }
 
                $result = get_work_order_issues($woid);