From c5ae15e661a41edf92c483c476dd87d292008f8f Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 20 Jul 2011 16:28:36 +0200 Subject: [PATCH] [0000947] Fixed unneeded input fields reset after input error in Customers. --- sales/manage/customers.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sales/manage/customers.php b/sales/manage/customers.php index 13350530..f3ac068a 100644 --- a/sales/manage/customers.php +++ b/sales/manage/customers.php @@ -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 { -- 2.30.2