5 include($path_to_root . "/includes/session.inc");
7 page(_("Company Setup"));
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/ui.inc");
12 include_once($path_to_root . "/admin/db/company_db.inc");
14 //-------------------------------------------------------------------------------------------------
16 if (isset($_POST['submit']) && $_POST['submit'] != "")
21 if (strlen($_POST['coy_name'])==0)
24 display_error(_("The company name must be entered."));
25 set_focus('coy_name');
27 if ($input_error != 1)
29 update_company_setup($_POST['coy_name'], $_POST['coy_no'], $_POST['gst_no'], $_POST['tax_prd'], $_POST['tax_last'],
30 $_POST['postal_address'], $_POST['phone'], $_POST['fax'], $_POST['email'], $_POST['coy_logo'], $_POST['domicile'],
31 $_POST['use_dimension'], $_POST['custom1_name'], $_POST['custom2_name'], $_POST['custom3_name'],
32 $_POST['custom1_value'], $_POST['custom2_value'], $_POST['custom3_value'],
33 $_POST['curr_default'], $_POST['f_year'], check_value('no_item_list'), check_value('no_customer_list'),
34 check_value('no_supplier_list'), $_POST['base_sales']);
36 display_notification_centered(_("Company setup has been updated."));
39 } /* end of if submit */
41 //---------------------------------------------------------------------------------------------
46 $myrow = get_company_prefs();
48 $_POST['coy_name'] = $myrow["coy_name"];
49 $_POST['gst_no'] = $myrow["gst_no"];
50 $_POST['tax_prd'] = $myrow["tax_prd"];
51 $_POST['tax_last'] = $myrow["tax_last"];
52 $_POST['coy_no'] = $myrow["coy_no"];
53 $_POST['postal_address'] = $myrow["postal_address"];
54 $_POST['phone'] = $myrow["phone"];
55 $_POST['fax'] = $myrow["fax"];
56 $_POST['email'] = $myrow["email"];
57 $_POST['coy_logo'] = $myrow["coy_logo"];
58 $_POST['domicile'] = $myrow["domicile"];
59 $_POST['use_dimension'] = $myrow["use_dimension"];
60 $_POST['base_sales'] = $myrow["base_sales"];
61 $_POST['no_item_list'] = $myrow["no_item_list"];
62 $_POST['no_customer_list'] = $myrow["no_customer_list"];
63 $_POST['no_supplier_list'] = $myrow["no_supplier_list"];
64 $_POST['custom1_name'] = $myrow["custom1_name"];
65 $_POST['custom2_name'] = $myrow["custom2_name"];
66 $_POST['custom3_name'] = $myrow["custom3_name"];
67 $_POST['custom1_value'] = $myrow["custom1_value"];
68 $_POST['custom2_value'] = $myrow["custom2_value"];
69 $_POST['custom3_value'] = $myrow["custom3_value"];
70 $_POST['curr_default'] = $myrow["curr_default"];
71 $_POST['f_year'] = $myrow["f_year"];
73 start_table($table_style2);
75 text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
76 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
77 text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25);
79 text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, '', null, null, _('Months.'));
80 text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, '', null, null, _('Months back.'));
82 currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
83 fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
85 textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5);
87 text_row_ex(_("Telephone Number:"), 'phone', 25, 55);
88 text_row_ex(_("Facsimile Number:"), 'fax', 25);
89 text_row_ex(_("Email Address:"), 'email', 25, 55);
90 text_row_ex(_("Company Logo:"), 'coy_logo', 25, 55);
91 text_row_ex(_("Domicile:"), 'domicile', 25, 55);
93 number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);
94 sales_types_list_row(_("Base for auto price calculations:"), 'base_sales', $_POST['base_sales'], false,
95 _('No base price list') );
97 check_row(_("No Item List"), 'no_item_list', $_POST['no_item_list']);
98 check_row(_("No Customer List"), 'no_customer_list', $_POST['no_customer_list']);
99 check_row(_("No Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']);
103 label_row(_("Custom Field Name"), _("Custom Field Value"));
106 text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25);
107 text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30);
111 text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25);
112 text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30);
116 text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25);
117 text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
122 submit_center('submit', _("Update"));
125 //-------------------------------------------------------------------------------------------------