X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Fsuppalloc_db.inc;h=cf996d602d0e72db63625d953053293cf3c60c11;hb=0dfa3ce0411c9d123d25d6a0079668e551a88b14;hp=e8506bb04c6ff5101ae788730aa0bb03a861ad7c;hpb=e9ad9e87f5eb2682d2e91c93134250fd8a8d2ad9;p=fa-stable.git diff --git a/purchasing/includes/db/suppalloc_db.inc b/purchasing/includes/db/suppalloc_db.inc index e8506bb0..cf996d60 100644 --- a/purchasing/includes/db/suppalloc_db.inc +++ b/purchasing/includes/db/suppalloc_db.inc @@ -44,7 +44,7 @@ function get_supp_trans_allocation_balance($trans_type, $trans_no) $result = db_query($sql,"calculate the allocation"); $myrow = db_fetch_row($result); - return $myrow[0]; + return $myrow ? $myrow[0] : 0; } //---------------------------------------------------------------------------------------- @@ -100,7 +100,7 @@ function clear_supp_alloctions($type, $type_no, $person_id=null, $date="") } //------------------------------------------------------------------------------------------------------------- -function get_allocatable_from_supp_sql($supplier_id=null, $settled) +function get_allocatable_from_supp_sql($supplier_id, $settled) { $sql = "SELECT trans.type,