From 6803e54bf2de7be5ced29a7158a7c3a2d5f610a9 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sun, 23 Jun 2013 20:54:18 +0100 Subject: [PATCH] Fixed qoh to return 0 instead of null when moves history is empty. --- includes/db/inventory_db.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index aca5447..288434d 100644 --- a/includes/db/inventory_db.inc +++ b/includes/db/inventory_db.inc @@ -45,7 +45,8 @@ function get_qoh_on_date($stock_id, $location=null, $date_=null, $exclude=0) $myrow[0] -= $myrow2[0]; } - return $myrow[0]; + $qoh = $myrow[0]; + return $qoh ? $qoh : 0; } //-------------------------------------------------------------------------------------- @@ -428,4 +429,4 @@ function get_location_name($loc_code) //-------------------------------------------------------------------------------------------------- -?> \ No newline at end of file +?> -- 2.30.2