From: Maxime Bourget Date: Sun, 23 Jun 2013 19:54:18 +0000 (+0100) Subject: Fixed qoh to return 0 instead of null when moves history is empty. X-Git-Tag: 2.3-final~226 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=dde3fa9d0b4b176ef4fdb70a5794f46c5bc3485c;p=fa-stable.git Fixed qoh to return 0 instead of null when moves history is empty. --- diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index aca54475..288434d5 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 +?>