projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ade8fdd
)
New customer/supplier currency can be changed as long as no transaction is entered.
author
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Sun, 18 Jul 2010 16:39:20 +0000
(16:39 +0000)
committer
Janusz Dobrowolski
<janusz@frontaccounting.eu>
Sun, 18 Jul 2010 16:39:20 +0000
(16:39 +0000)
purchasing/includes/db/suppliers_db.inc
patch
|
blob
|
history
purchasing/manage/suppliers.php
patch
|
blob
|
history
sales/includes/db/customers_db.inc
patch
|
blob
|
history
sales/manage/customers.php
patch
|
blob
|
history
diff --git
a/purchasing/includes/db/suppliers_db.inc
b/purchasing/includes/db/suppliers_db.inc
index b0fae283637a4ccf5cae54c73cd8595b1dd01c4a..be6eb5b3cd88d37339d8502330d3b421a0b52398 100644
(file)
--- a/
purchasing/includes/db/suppliers_db.inc
+++ b/
purchasing/includes/db/suppliers_db.inc
@@
-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
?>
\ No newline at end of file
diff --git
a/purchasing/manage/suppliers.php
b/purchasing/manage/suppliers.php
index b2ad33c7f47d370fbef07571f553fe9a32f3bf0b..a7336240a737247b4236a63790d67638ebb75e8e 100644
(file)
--- a/
purchasing/manage/suppliers.php
+++ b/
purchasing/manage/suppliers.php
@@
-85,7
+85,7
@@
function supplier_settings(&$supplier_id)
text_row(_("GSTNo:"), 'gst_no', null, 42, 40);
link_row(_("Website:"), 'website', null, 35, 55);
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']);
{
label_row(_("Supplier's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
diff --git
a/sales/includes/db/customers_db.inc
b/sales/includes/db/customers_db.inc
index a9a6301b8f39ad65f0ca7d6680d69da9483de6ff..bd5b8d34583d578cbd52ef80ba43df2b31ee16c0 100644
(file)
--- a/
sales/includes/db/customers_db.inc
+++ b/
sales/includes/db/customers_db.inc
@@
-164,4
+164,10
@@
function get_current_cust_credit($customer_id)
}
}
+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
?>
\ No newline at end of file
diff --git
a/sales/manage/customers.php
b/sales/manage/customers.php
index ee19756583bc2510c0da74ab3b960933c4eb5d52..a20dffb4f5b6b026e6490f74f699b5c75d6db41a 100644
(file)
--- a/
sales/manage/customers.php
+++ b/
sales/manage/customers.php
@@
-205,7
+205,7
@@
function customer_settings($selected_id)
text_row(_("GSTNo:"), 'tax_id', null, 40, 40);
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']);
}
{
currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
}