From: Janusz Dobrowolski Date: Wed, 20 Jul 2011 14:28:36 +0000 (+0200) Subject: [0000947] Fixed unneeded input fields reset after input error in Customers. X-Git-Tag: 2.3-final~599 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=c5ae15e661a41edf92c483c476dd87d292008f8f;p=fa-stable.git [0000947] Fixed unneeded input fields reset after input error in Customers. --- 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 {