Modifying Supplier Credit: reverted GL postings - fixed.
[fa-stable.git] / purchasing / includes / db / suppalloc_db.inc
index e8506bb04c6ff5101ae788730aa0bb03a861ad7c..cf996d602d0e72db63625d953053293cf3c60c11 100644 (file)
@@ -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,