From e3d8b9578c9a7102b66094b7c0999dc2333d4d65 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 1 Feb 2013 17:12:48 +0100 Subject: [PATCH] When updating costs and no quantity on hand we got a db error (in newer mysql releases). --- inventory/includes/db/items_trans_db.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inventory/includes/db/items_trans_db.inc b/inventory/includes/db/items_trans_db.inc index 0a17b66..a7591dd 100644 --- a/inventory/includes/db/items_trans_db.inc +++ b/inventory/includes/db/items_trans_db.inc @@ -67,7 +67,8 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co } } - add_audit_trail(ST_COSTUPDATE, $update_no, $date_); + if ($update_no != -1) + add_audit_trail(ST_COSTUPDATE, $update_no, $date_); commit_transaction(); return $update_no; -- 2.30.2