Changed API for input/lists functions, added empty hints when needed
[fa-stable.git] / admin / company_preferences.php
index b4c98781661fe385f42df6cacdc454f637fc31c3..dccfb0d7b1a04b9af87faaadce1763b0cbbe5f63 100644 (file)
@@ -13,15 +13,16 @@ include_once($path_to_root . "/admin/db/company_db.inc");
 
 //-------------------------------------------------------------------------------------------------
 
-if (isset($_POST['submit']) && $_POST['submit'] != "") 
+if (isset($_POST['submit']) && $_POST['submit'] != "")
 {
 
        $input_error = 0;
 
-       if (strlen($_POST['coy_name'])==0) 
+       if (strlen($_POST['coy_name'])==0)
        {
                $input_error = 1;
                display_error(_("The company name must be entered."));
+               set_focus('coy_name');
        }
        if ($input_error != 1)
        {
@@ -29,7 +30,8 @@ if (isset($_POST['submit']) && $_POST['submit'] != "")
                        $_POST['postal_address'], $_POST['phone'], $_POST['fax'], $_POST['email'], $_POST['coy_logo'], $_POST['domicile'],
                        $_POST['use_dimension'], $_POST['custom1_name'], $_POST['custom2_name'], $_POST['custom3_name'],
                        $_POST['custom1_value'], $_POST['custom2_value'], $_POST['custom3_value'],
-                       $_POST['curr_default'], $_POST['f_year']);
+                       $_POST['curr_default'], $_POST['f_year'], check_value('no_item_list'), check_value('no_customer_list'),
+                       check_value('no_supplier_list'), $_POST['base_sales']);
 
                display_notification_centered(_("Company setup has been updated."));
        }
@@ -55,6 +57,10 @@ $_POST['email']  = $myrow["email"];
 $_POST['coy_logo']  = $myrow["coy_logo"];
 $_POST['domicile']  = $myrow["domicile"];
 $_POST['use_dimension']  = $myrow["use_dimension"];
+$_POST['base_sales']  = $myrow["base_sales"];
+$_POST['no_item_list']  = $myrow["no_item_list"];
+$_POST['no_customer_list']  = $myrow["no_customer_list"];
+$_POST['no_supplier_list']  = $myrow["no_supplier_list"];
 $_POST['custom1_name']  = $myrow["custom1_name"];
 $_POST['custom2_name']  = $myrow["custom2_name"];
 $_POST['custom3_name']  = $myrow["custom3_name"];
@@ -70,8 +76,8 @@ text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
 text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25);
 
-text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, null, null, _('Months.'));
-text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, null, null, _('Months back.'));
+text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, '', null, null, _('Months.'));
+text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, '', null, null, _('Months back.'));
 
 currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
 fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
@@ -85,6 +91,12 @@ text_row_ex(_("Company Logo:"), 'coy_logo', 25, 55);
 text_row_ex(_("Domicile:"), 'domicile', 25, 55);
 
 number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);
+sales_types_list_row(_("Base for auto price calculations:"), 'base_sales', $_POST['base_sales'], false,
+    _('No base price list') );
+
+check_row(_("No Item List"), 'no_item_list', $_POST['no_item_list']);
+check_row(_("No Customer List"), 'no_customer_list', $_POST['no_customer_list']);
+check_row(_("No Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']);
 
 start_row();
 end_row();