! -> Note
$ -> Affected files
+07-Dec-2008 Joe Hunt
+! Better layout. Copyright notes. Mailto links.
+$ /admin/company_preferences.php
+ /admin/display_prefs.php
+ /gl_setup.php
+ /admin/users.php
+ /includes/ui_controls.inc
+ /includes/ui_input.inc
+ /inventory/manage/locations.php
+ /purchasing/manage/suppliers.php
+ /sales/manage/customer_branches.php
+ /sales/manage/customers.php
+ /sales/manage/sales_people.php
+
05-Dec-2008 Joe Hunt
+ New fields in suppliers, phone, fax, vat no, contact and credit limit
$ /purchasing/suppliers.php
$_POST['curr_default'] = $myrow["curr_default"];
$_POST['f_year'] = $myrow["f_year"];
-start_table($table_style2);
+start_outer_table($table_style2);
+
+table_section(1);
text_row_ex(_("Name (to appear on reports):"), 'coy_name', 42, 50);
+textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5);
+
+text_row_ex(_("Phone Number:"), 'phone', 25, 55);
+text_row_ex(_("Fax Number:"), 'fax', 25);
+email_row_ex(_("Email Address:"), 'email', 25, 55);
+
text_row_ex(_("Official Company Number:"), 'coy_no', 25);
-text_row_ex(_("Tax Authority Reference:"), 'gst_no', 25);
+text_row_ex(_("GSTNo:"), '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.'));
currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
-fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
-textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 5);
+table_section(2);
-text_row_ex(_("Telephone Number:"), 'phone', 25, 55);
-text_row_ex(_("Facsimile Number:"), 'fax', 25);
-text_row_ex("<a href='Mailto:".$_POST['email']."'>" . _("E-mail Address:") . "</a>", 'email', 25, 55);
+fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
label_row(_("Company Logo:"), $_POST['coy_logo']);
label_row(_("New Company Logo (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
end_row();
-end_table(1);
+end_outer_table(1);
+
hidden('coy_logo', $_POST['coy_logo']);
submit_center('update', _("Update"), true, '', true);
}
start_form();
-start_table($table_style2);
+start_outer_table($table_style2);
+
+table_section(1);
table_section_title(_("Decimal Places"));
text_row_ex(_("Prices/Amounts:"), 'prices', 5, 5, '', user_price_dec());
/* The array $decseps is set up in config.php for modifications
possible separators can be added by modifying the array definition by editing that file */
+if (!isset($_POST['language']))
+ $_POST['language'] = $_SESSION['language']->code;
+
+table_section_title(_("Language"));
+
+languages_list_row(_("Language:"), 'language', $_POST['language']);
+table_section(2);
table_section_title(_("Miscellaneous"));
check_row(_("Show hints for new users:"), 'show_hints', user_hints());
text_row_ex(_("Query page size:"), 'query_size', 5, 5, '', user_query_size());
-table_section_title(_("Language"));
-
-if (!isset($_POST['language']))
- $_POST['language'] = $_SESSION['language']->code;
-
-languages_list_row(_("Language:"), 'language', $_POST['language']);
-
-end_table(1);
+end_outer_table(1);
submit_center('setprefs', _("Update"), true, '', true);
//-------------------------------------------------------------------------------------------------
start_form();
-start_table("class='tablestyle'");
+
+start_outer_table("class='tablestyle'");
+
+table_section(1);
$myrow = get_company_prefs();
// Not used in FA2.0.
//gl_all_accounts_list_row(_("Goods Received Clearing Account:"), 'grn_act', $_POST['grn_act']);
+//---------------
+table_section(2);
table_section_title(_("Suppliers and Purchasing Defaults"));
gl_all_accounts_list_row(_("Payable Account:"), 'creditors_act', $_POST['creditors_act']);
gl_all_accounts_list_row(_("Purchase Discount Account:"), 'pyt_discount_act', $_POST['pyt_discount_act']);
-//---------------
-
table_section_title(_("Inventory"));
check_row(_("Allow Negative Inventory:"), 'allow_negative_stock', null);
//----------------
-end_table(1);
+end_outer_table(1);
submit_center('submit', _("Update"), true, '', true);
label_cell($myrow["user_id"]);
label_cell($myrow["real_name"]);
label_cell($myrow["phone"]);
- label_cell("<a href=mailto:" . $myrow["email"]. ">" . $myrow["email"]. "</a>");
+ email_cell($myrow["email"]);
label_cell($last_visit_date, "nowrap");
label_cell($security_headings[$myrow["full_access"]]);
edit_button_cell("Edit".$myrow["user_id"], _("Edit"));
text_row_ex(_("Telephone No.:"), 'phone', 30);
-text_row_ex("<a href='Mailto:".$_POST['email']."'>" . _("Email Address:") . "</a>", 'email', 50);
+email_row_ex(_("Email Address:"), 'email', 50);
security_headings_list_row(_("Access Level:"), 'Access', null);
br($breaks);
}
+function start_outer_table($extra="", $padding='2', $spacing='0')
+{
+ br();
+ start_table($extra, $padding, $spacing);
+ echo "<tr valign=top><td>\n"; // outer table
+}
+
+function table_section($number=1)
+{
+ if ($number == 2)
+ {
+ echo "</table>\n";
+ echo "</td><td class='tableseparator'>\n"; // outer table
+ }
+ echo "<table>\n";
+}
+
+function end_outer_table($breaks=0)
+{
+ echo "</table>\n";
+ echo "</td></tr>\n";
+ end_table($breaks);
+}
+
function meta_forward($forward_to, $params="")
{
global $Ajax;
}
}
-function table_section_title($msg)
+function table_section_title($msg, $colspan=2)
{
- echo "<tr><td colspan=2 class='tableheader'>$msg</td><tr>\n";
+ echo "<tr><td colspan=$colspan class='tableheader'>$msg</td></tr>\n";
}
function table_header($labels)
return $label;
}
+function email_cell($label, $params="", $id=null)
+{
+ label_cell("<a href='mailto:$label'>$label</a>", $params, $id);
+}
+
function amount_cell($label, $bold=false, $params="", $id=null)
{
if ($bold)
echo "</tr>\n";
}
+//-----------------------------------------------------------------------------------
+function email_row($label, $name, $value, $size, $max, $title=null, $params="", $post_label="")
+{
+ text_row("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $value, $size, $max, $title, $params, $post_label);
+}
+
+function email_row_ex($label, $name, $size, $max=null, $title=null, $value=null, $params=null, $post_label=null)
+{
+ text_row_ex("<a href='Mailto:".$_POST[$name]."'>$label</a>", $name, $size, $max, $title, $value, $params, $post_label);
+}
+
//-----------------------------------------------------------------------------------
function date_cells($label, $name, $title = null, $init=null, $inc_days=0,
text_row_ex(_("Telephone No:"), 'phone', 30, 30);
text_row_ex(_("Facsimile No:"), 'fax', 30, 30);
-text_row_ex("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", 'email', 30);
+email_row_ex(_("E-mail:"), 'email', 30);
end_table(1);
submit_add_or_update_center($selected_id == -1, '', true);
hidden('supplier_id', get_post('supplier_id'));
}
-br();
-start_table("$table_style2 width=65%", 5);
-echo "<tr valign=top><td>"; // outer table
+start_outer_table($table_style2, 5);
-echo "<table>";
+table_section(1);
if (!$new_supplier)
{
table_section_title(_("Name and Contact"));
text_row(_("Supplier Name:"), 'supp_name', null, 42, 40);
-text_row(_("Contact:"), 'contact', null, 42, 40);
+text_row(_("Contact Person:"), 'contact', null, 42, 40);
text_row(_("Phone Number:"), 'phone', null, 42, 40);
text_row(_("Fax Number:"), 'fax', null, 42, 40);
-text_row("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", 'email', null, 35, 55);
+email_row(_("E-mail:"), 'email', null, 35, 55);
table_section_title(_("Addresses"));
textarea_row(_("Mailing Address:"), 'address', null, 35, 5);
textarea_row(_("Physical Address:"), 'supp_address', null, 35, 5);
-echo "</table>";
-
-echo "</td><td class='tableseparator'>"; // outer table
-
-echo"<table>";
+table_section(2);
table_section_title(_("Purchasing"));
text_row(_("GSTNo:"), 'gst_no', null, 42, 40);
if ($dim < 2)
hidden('dimension2_id', 0);
-end_table();
-
-end_table(1);
+end_outer_table(1);
div_start('controls');
if (!$new_supplier)
label_cell($myrow["description"]);
label_cell($myrow["phone"]);
label_cell($myrow["fax"]);
- label_cell("<a href=mailto:" . $myrow["email"]. ">" . $myrow["email"]. "</a>");
+ email_cell($myrow["email"]);
label_cell($myrow["tax_group_name"]);
if (count($_SESSION['Context']))
edit_button_cell("Select".$myrow["branch_code"], _("Select"));
else
display_note(_("The selected customer does not have any branches. Please create at least one branch."));
-echo "<br>";
-start_table("$table_style2 width=70%", 5);
-echo "<tr valign=top><td>"; // outer table
-
-echo "<table>";
+start_outer_table($table_style2, 5);
+table_section(1);
$_POST['email'] = "";
if ($selected_id != -1)
text_row(_("Phone Number:"), 'phone', null, 20, 20);
text_row(_("Fax Number:"), 'fax', null, 20, 20);
-text_row("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", 'email', null, 35, 55);
+email_row(_("E-mail:"), 'email', null, 35, 55);
table_section_title(_("Sales"));
sales_areas_list_row( _("Sales Area:"), 'area', null);
+sales_groups_list_row(_("Sales Group:"), 'group_no', null, true);
+
locations_list_row(_("Default Inventory Location:"), 'default_location', null);
shippers_list_row(_("Default Shipping Company:"), 'default_ship_via', null);
yesno_list_row(_("Disable this Branch:"), 'disable_trans', null);
-sales_groups_list_row(_("Sales Group:"), 'group_no', null, true);
-
-echo "</table>";
-
-echo "</td><td class='tableseparator'>"; // outer table
-
-echo"<table>";
+table_section(2);
table_section_title(_("GL Accounts"));
textarea_row(_("Billing Address:"), 'br_address', null, 35, 5);
-end_table();
-
-end_table(1); // outer table
+end_outer_table(1);
submit_add_or_update_center($selected_id == -1, '', true);
hidden('customer_id');
}
-br();
-start_table($table_style2, 5);
-echo "<tr valign=top><td>"; // outer table
+start_outer_table($table_style2, 5);
-echo "<table>";
+table_section(1);
if ($new_customer)
{
text_row(_("Customer Name:"), 'CustName', $_POST['CustName'], 40, 40);
textarea_row(_("Address:"), 'address', $_POST['address'], 35, 5);
-text_row("<a href='Mailto:".$_POST['email']."'>" . _("E-mail:") . "</a>", 'email', null, 40, 40);
+email_row(_("E-mail:"), 'email', null, 40, 40);
text_row(_("GSTNo:"), 'tax_id', null, 40, 40);
-// Sherifoz 23.09.03 currency can't be changed if editing
if ($new_customer)
{
currencies_list_row(_("Customer's Currency:"), 'curr_code', $_POST['curr_code']);
label_row(_("Customer's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
}
-end_table();
-echo "</td><td class='tableseparator'>"; // outer table
-
-echo"<table>";
+table_section(2);
table_section_title(_("Sales"));
"debtor_no=".$_POST['customer_id']);
end_row();
}
-end_table();
-end_table(1); // outer table
+end_outer_table(1);
+
div_start('controls');
if ($new_customer)
{
label_cell($myrow["salesman_name"]);
label_cell($myrow["salesman_phone"]);
label_cell($myrow["salesman_fax"]);
- label_cell("<a href=mailto:" . $myrow["salesman_email"]. ">" . $myrow["salesman_email"]. "</a>");
+ email_cell($myrow["salesman_email"]);
label_cell(percent_format($myrow["provision"])." %", "nowrap align=right");
amount_cell($myrow["break_pt"]);
label_cell(percent_format($myrow["provision2"])." %", "nowrap align=right");
text_row_ex(_("Sales person name:"), 'salesman_name', 30);
text_row_ex(_("Telephone number:"), 'salesman_phone', 20);
text_row_ex(_("Fax number:"), 'salesman_fax', 20);
-text_row_ex("<a href='Mailto:".$_POST['salesman_email']."'>" . _("E-mail:") . "</a>", 'salesman_email', 40);
+email_row_ex(_("E-mail:"), 'salesman_email', 40);
percent_row(_("Provision").':', 'provision');
amount_row(_("Break Pt.:"), 'break_pt');
percent_row(_("Provision")." 2:", 'provision2');