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']);
34 display_notification_centered(_("Company setup has been updated."));
37 } /* end of if submit */
39 //---------------------------------------------------------------------------------------------
44 $myrow = get_company_prefs();
46 $_POST['coy_name'] = $myrow["coy_name"];
47 $_POST['gst_no'] = $myrow["gst_no"];
48 $_POST['tax_prd'] = $myrow["tax_prd"];
49 $_POST['tax_last'] = $myrow["tax_last"];
50 $_POST['coy_no'] = $myrow["coy_no"];
51 $_POST['postal_address'] = $myrow["postal_address"];
52 $_POST['phone'] = $myrow["phone"];
53 $_POST['fax'] = $myrow["fax"];
54 $_POST['email'] = $myrow["email"];
55 $_POST['coy_logo'] = $myrow["coy_logo"];
56 $_POST['domicile'] = $myrow["domicile"];
57 $_POST['use_dimension'] = $myrow["use_dimension"];
58 $_POST['custom1_name'] = $myrow["custom1_name"];
59 $_POST['custom2_name'] = $myrow["custom2_name"];
60 $_POST['custom3_name'] = $myrow["custom3_name"];
61 $_POST['custom1_value'] = $myrow["custom1_value"];
62 $_POST['custom2_value'] = $myrow["custom2_value"];
63 $_POST['custom3_value'] = $myrow["custom3_value"];
64 $_POST['curr_default'] = $myrow["curr_default"];
65 $_POST['f_year'] = $myrow["f_year"];
67 start_table($table_style2);
69 text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
70 text_row_ex(_("Official Company Number:"), 'coy_no', 25);
71 text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25);
73 text_row_ex(_("Tax Periods:"), 'tax_prd', 10, 10, null, null, _('Months.'));
74 text_row_ex(_("Tax Last Period:"), 'tax_last', 10, 10, null, null, _('Months back.'));
76 currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
77 fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
79 textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5);
81 text_row_ex(_("Telephone Number:"), 'phone', 25, 55);
82 text_row_ex(_("Facsimile Number:"), 'fax', 25);
83 text_row_ex(_("Email Address:"), 'email', 25, 55);
84 text_row_ex(_("Company Logo:"), 'coy_logo', 25, 55);
85 text_row_ex(_("Domicile:"), 'domicile', 25, 55);
87 number_list_row(_("Use Dimensions:"), 'use_dimension', null, 0, 2);
91 label_row(_("Custom Field Name"), _("Custom Field Value"));
94 text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25);
95 text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30);
99 text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25);
100 text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30);
104 text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25);
105 text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
110 submit_center('submit', _("Update"));
113 //-------------------------------------------------------------------------------------------------