}
+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
text_row(_("GSTNo:"), 'gst_no', null, 42, 40);
link_row(_("Website:"), 'website', null, 35, 55);
- if ($supplier_id)
+ if ($supplier_id && !is_new_supplier($supplier_id))
{
label_row(_("Supplier's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
}
+function is_new_customer($id)
+{
+ $tables = array('cust_branch', 'debtor_trans', 'recurrent_invoices', 'sales_orders');
+
+ return !key_in_foreign_table($id, $tables, 'debtor_no');
+}
?>
\ No newline at end of file
text_row(_("GSTNo:"), 'tax_id', null, 40, 40);
- if (!$selected_id)
+ if (!$selected_id || is_new_customer($selected_id))
{
currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
}