From 8bd22b7671d18cfdf01b8a0f3f66455d5de28014 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 4 Apr 2010 12:16:45 +0000 Subject: [PATCH] Added report langauge selector --- sales/manage/customer_branches.php | 10 +++++++--- sales/manage/customers.php | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/sales/manage/customer_branches.php b/sales/manage/customer_branches.php index 91c291a0..135e54f0 100644 --- a/sales/manage/customer_branches.php +++ b/sales/manage/customer_branches.php @@ -82,7 +82,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') $_POST['salesman'], $_POST['area'], $_POST['email'], $_POST['tax_group_id'], $_POST['sales_account'], $_POST['sales_discount_account'], $_POST['receivables_account'], $_POST['payment_discount_account'], $_POST['default_location'], $_POST['br_post_address'], $_POST['disable_trans'], $_POST['group_no'], - $_POST['default_ship_via'], $_POST['notes']); + $_POST['default_ship_via'], $_POST['notes'], $_POST['rep_lang']); $note =_('Selected customer branch has been updated'); } @@ -94,7 +94,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') $_POST['salesman'], $_POST['area'], $_POST['email'], $_POST['tax_group_id'], $_POST['sales_account'], $_POST['sales_discount_account'], $_POST['receivables_account'], $_POST['payment_discount_account'], $_POST['default_location'], $_POST['br_post_address'], $_POST['disable_trans'], $_POST['group_no'], - $_POST['default_ship_via'], $_POST['notes']); + $_POST['default_ship_via'], $_POST['notes'], $_POST['rep_lang']); $note = _('New customer branch has been added'); } @@ -224,6 +224,7 @@ if ($selected_id != -1) $_POST['contact_name'] = $myrow["contact_name"]; $_POST['salesman'] =$myrow["salesman"]; $_POST['area'] =$myrow["area"]; + $_POST['rep_lang'] =$myrow["rep_lang"]; $_POST['phone'] =$myrow["phone"]; $_POST['phone2'] =$myrow["phone2"]; $_POST['fax'] =$myrow["fax"]; @@ -243,8 +244,9 @@ if ($selected_id != -1) } elseif ($Mode != 'ADD_ITEM') { //end of if $SelectedBranch only do the else when a new record is being entered + $myrow = get_default_info_for_branch($_POST['customer_id']); + $_POST['rep_lang'] = $myrow['rep_lang']; if(!$num_branches) { - $myrow = get_default_info_for_branch($_POST['customer_id']); $_POST['br_name'] = $myrow["name"]; $_POST['br_ref'] = $myrow["debtor_ref"]; $_POST['contact_name'] = _('Main Branch'); @@ -286,6 +288,8 @@ table_section_title(_("Sales")); sales_persons_list_row( _("Sales Person:"), 'salesman', null); +languages_list_row( _("Document Language:"), 'rep_lang', null, _("Customer default")); + sales_areas_list_row( _("Sales Area:"), 'area', null); sales_groups_list_row(_("Sales Group:"), 'group_no', null, true); diff --git a/sales/manage/customers.php b/sales/manage/customers.php index e95af958..32c6a880 100644 --- a/sales/manage/customers.php +++ b/sales/manage/customers.php @@ -80,7 +80,7 @@ function handle_submit() update_customer($_POST['customer_id'], $_POST['CustName'], $_POST['cust_ref'], $_POST['address'], $_POST['tax_id'], $_POST['curr_code'], $_POST['email'], $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['credit_status'], $_POST['payment_terms'], input_num('discount') / 100, input_num('pymt_discount') / 100, - input_num('credit_limit'), $_POST['sales_type'], $_POST['notes']); + input_num('credit_limit'), $_POST['sales_type'], $_POST['notes'], $_POST['rep_lang']); update_record_status($_POST['customer_id'], $_POST['inactive'], 'debtors_master', 'debtor_no'); @@ -95,7 +95,7 @@ function handle_submit() add_customer($_POST['CustName'], $_POST['cust_ref'], $_POST['address'], $_POST['tax_id'], $_POST['curr_code'], $_POST['email'], $_POST['dimension_id'], $_POST['dimension2_id'], $_POST['credit_status'], $_POST['payment_terms'], input_num('discount') / 100, input_num('pymt_discount') / 100, - input_num('credit_limit'), $_POST['sales_type'], $_POST['notes']); + input_num('credit_limit'), $_POST['sales_type'], $_POST['notes'], $_POST['rep_lang']); $_POST['customer_id'] = db_insert_id(); $new_customer = false; @@ -188,6 +188,7 @@ if ($new_customer) $_POST['dimension_id'] = 0; $_POST['dimension2_id'] = 0; $_POST['sales_type'] = -1; + $_POST['rep_lang'] = ''; $_POST['email'] = ''; $_POST['curr_code'] = get_company_currency(); $_POST['credit_status'] = -1; @@ -209,6 +210,7 @@ else $_POST['dimension_id'] = $myrow["dimension_id"]; $_POST['dimension2_id'] = $myrow["dimension2_id"]; $_POST['sales_type'] = $myrow["sales_type"]; + $_POST['rep_lang'] = $myrow["rep_lang"]; $_POST['curr_code'] = $myrow["curr_code"]; $_POST['credit_status'] = $myrow["credit_status"]; $_POST['payment_terms'] = $myrow["payment_terms"]; @@ -241,6 +243,7 @@ else hidden('curr_code', $_POST['curr_code']); } sales_types_list_row(_("Sales Type/Price List:"), 'sales_type', $_POST['sales_type']); +languages_list_row( _("Document Language:"), 'rep_lang', $_POST['rep_lang'], _('System default')); table_section(2); -- 2.30.2