-
- if (db_num_rows($result) == 0)
- {
-
- /*Because there is no balance - so just retrieve the header information about the customer - the choice is do one query to get the balance and transactions for those customers who have a balance and two queries for those who don't have a balance OR always do two queries - I opted for the former */
-
- $nil_balance = true;
-
- $sql = "SELECT ".TB_PREF."suppliers.supp_name, ".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.supplier_id, ".TB_PREF."payment_terms.terms
- FROM ".TB_PREF."suppliers,
- ".TB_PREF."payment_terms
- WHERE
- ".TB_PREF."suppliers.payment_terms = ".TB_PREF."payment_terms.terms_indicator
- AND ".TB_PREF."suppliers.supplier_id = ".db_escape($supplier_id);
-
- $result = db_query($sql,"The customer details could not be retrieved");
-
- }
- else
- {
- $nil_balance = false;
- }
-