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."));
26 if ($input_error != 1)
28 update_company_setup($_POST['coy_name'], $_POST['coy_no'], $_POST['gst_no'], $_POST['tax_prd'], $_POST['tax_last'],
29 $_POST['postal_address'], $_POST['phone'], $_POST['fax'], $_POST['email'], $_POST['coy_logo'], $_POST['domicile'],
30 $_POST['use_dimension'], $_POST['custom1_name'], $_POST['custom2_name'], $_POST['custom3_name'],
31 $_POST['custom1_value'], $_POST['custom2_value'], $_POST['custom3_value'],
32 $_POST['curr_default'], $_POST['f_year'], check_value('no_item_list'), check_value('no_customer_list'),
33 check_value('no_supplier_list'));
35 display_notification_centered(_("Company setup has been updated."));
38 } /* end of if submit */
40 //---------------------------------------------------------------------------------------------
45 $myrow = get_company_prefs();
47 $_POST['coy_name'] = $myrow["coy_name"];
48 $_POST['gst_no'] = $myrow["gst_no"];
49 $_POST['tax_prd'] = $myrow["tax_prd"];
50 $_POST['tax_last'] = $myrow["tax_last"];
51 $_POST['coy_no'] = $myrow["coy_no"];
52 $_POST['postal_address'] = $myrow["postal_address"];
53 $_POST['phone'] = $myrow["phone"];
54 $_POST['fax'] = $myrow["fax"];
55 $_POST['email'] = $myrow["email"];
56 $_POST['coy_logo'] = $myrow["coy_logo"];
57 $_POST['domicile'] = $myrow["domicile"];
58 $_POST['use_dimension'] = $myrow["use_dimension"];
59 $_POST['no_item_list'] = $myrow["no_item_list"];
60 $_POST['no_customer_list'] = $myrow["no_customer_list"];
61 $_POST['no_supplier_list'] = $myrow["no_supplier_list"];
62 $_POST['custom1_name'] = $myrow["custom1_name"];
63 $_POST['custom2_name'] = $myrow["custom2_name"];
64 $_POST['custom3_name'] = $myrow["custom3_name"];
65 $_POST['custom1_value'] = $myrow["custom1_value"];
66 $_POST['custom2_value'] = $myrow["custom2_value"];
67 $_POST['custom3_value'] = $myrow["custom3_value"];
68 $_POST['curr_default'] = $myrow["curr_default"];
69 $_POST['f_year'] = $myrow["f_year"];
71 start_table($table_style2);
73 text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
74 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
75 text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25);
77 text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, null, null, _('Months.'));
78 text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, null, null, _('Months back.'));
80 currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
81 fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
83 textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5);
85 text_row_ex(_("Telephone Number:"), 'phone', 25, 55);
86 text_row_ex(_("Facsimile Number:"), 'fax', 25);
87 text_row_ex(_("Email Address:"), 'email', 25, 55);
88 text_row_ex(_("Company Logo:"), 'coy_logo', 25, 55);
89 text_row_ex(_("Domicile:"), 'domicile', 25, 55);
91 number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);
93 check_row(_("No Item List"), 'no_item_list', $_POST['no_item_list']);
94 check_row(_("No Customer List"), 'no_customer_list', $_POST['no_customer_list']);
95 check_row(_("No Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']);
99 label_row(_("Custom Field Name"), _("Custom Field Value"));
102 text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25);
103 text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30);
107 text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25);
108 text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30);
112 text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25);
113 text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
118 submit_center('submit', _("Update"));
121 //-------------------------------------------------------------------------------------------------