+function get_supplier_contacts($supplier_id, $action=null)
+{
+ $results = array();
+ $res = get_crm_persons('supplier', $action, $supplier_id);
+ while($contact = db_fetch($res))
+ $results[] = $contact;
+
+ return $results;
+}
+
+function get_current_supp_credit($supplier_id)
+{
+ $suppdet = get_supplier_details($supplier_id);
+ return $suppdet['cur_credit'];
+
+}
+
+function is_new_supplier($id)
+{
+ $tables = array('supp_trans', 'grn_batch', 'purch_orders', 'purch_data');
+
+ return !key_in_foreign_table($id, $tables, 'supplier_id');
+}
+
+function update_supp_tax_algorithm($supplier_id, $tax_algorithm)
+{
+ $sql = "UPDATE ".TB_PREF."suppliers SET tax_algorithm=".db_escape($tax_algorithm)
+ . " WHERE supplier_id=".db_escape($supplier_id);
+ return db_query($sql, "cannot update supplier's tax calculation algorithm");
+}