Added report langauge selector
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 4 Apr 2010 12:16:45 +0000 (12:16 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 4 Apr 2010 12:16:45 +0000 (12:16 +0000)
sales/manage/customer_branches.php
sales/manage/customers.php

index 91c291a0c0b164b0cfedf6b26d4dd2d3c2da1317..135e54f0c5eb69c542788e1fd43e5d462f385252 100644 (file)
@@ -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);
index e95af9586cd66c9f04939f8661a6439907c812cf..32c6a880dc8bda649ea71b7c5c81759510fbba9f 100644 (file)
@@ -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);