New customer/supplier currency can be changed as long as no transaction is entered.
[fa-stable.git] / purchasing / includes / db / suppliers_db.inc
index b0fae283637a4ccf5cae54c73cd8595b1dd01c4a..be6eb5b3cd88d37339d8502330d3b421a0b52398 100644 (file)
@@ -164,4 +164,10 @@ function get_current_supp_credit($supplier_id)
 
 }
 
+function is_new_supplier($id)
+{
+       $tables = array('supp_trans', 'grn_batch', 'purch_orders', 'purch_data');
+
+       return !key_in_foreign_table($id, $tables, 'supplier_id');
+}
 ?>
\ No newline at end of file