[0000947] Fixed unneeded input fields reset after input error in Customers.
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Wed, 20 Jul 2011 14:28:36 +0000 (16:28 +0200)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Wed, 20 Jul 2011 14:28:36 +0000 (16:28 +0200)
sales/manage/customers.php

index 133505304e1b962ae7ee23b283e6044d020e5d98..f3ac068af0338206c76e2e19cc3de5a7ca8c941e 100644 (file)
@@ -162,16 +162,18 @@ function customer_settings($selected_id)
        
        if (!$selected_id) 
        {
-               $_POST['CustName'] = $_POST['cust_ref'] = $_POST['address'] = $_POST['tax_id']  = '';
-               $_POST['dimension_id'] = 0;
-               $_POST['dimension2_id'] = 0;
-               $_POST['sales_type'] = -1;
-               $_POST['curr_code']  = get_company_currency();
-               $_POST['credit_status']  = -1;
-               $_POST['payment_terms']  = $_POST['notes']  = '';
-
-               $_POST['discount']  = $_POST['pymt_discount'] = percent_format(0);
-               $_POST['credit_limit']  = price_format($SysPrefs->default_credit_limit());
+               if (list_updated('customer_id') || !isset($_POST['CustName'])) {
+                       $_POST['CustName'] = $_POST['cust_ref'] = $_POST['address'] = $_POST['tax_id']  = '';
+                       $_POST['dimension_id'] = 0;
+                       $_POST['dimension2_id'] = 0;
+                       $_POST['sales_type'] = -1;
+                       $_POST['curr_code']  = get_company_currency();
+                       $_POST['credit_status']  = -1;
+                       $_POST['payment_terms']  = $_POST['notes']  = '';
+
+                       $_POST['discount']  = $_POST['pymt_discount'] = percent_format(0);
+                       $_POST['credit_limit']  = price_format($SysPrefs->default_credit_limit());
+               }
        }
        else 
        {