setting.
}
if ($input_error != 1)
{
- update_company_setup($_POST['coy_name'], $_POST['coy_no'], $_POST['gst_no'], $_POST['tax_prd'], $_POST['tax_last'],
- $_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'], check_value('no_item_list'), check_value('no_customer_list'),
+ update_company_setup($_POST['coy_name'], $_POST['coy_no'],
+ $_POST['gst_no'], $_POST['tax_prd'], $_POST['tax_last'],
+ $_POST['postal_address'], $_POST['phone'], $_POST['fax'],
+ $_POST['email'], $_POST['coy_logo'], $_POST['domicile'],
+ $_POST['use_dimension'], $_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."));
$_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"];
-$_POST['custom1_value'] = $myrow["custom1_value"];
-$_POST['custom2_value'] = $myrow["custom2_value"];
-$_POST['custom3_value'] = $myrow["custom3_value"];
$_POST['curr_default'] = $myrow["curr_default"];
$_POST['f_year'] = $myrow["f_year"];
$_POST['del_coy_logo'] = 0;
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);
+textarea_row(_("Address:"), 'postal_address', $_POST['postal_address'], 35, 6);
text_row_ex(_("Phone Number:"), 'phone', 25, 55);
text_row_ex(_("Fax Number:"), 'fax', 25);
text_row_ex(_("Official Company Number:"), 'coy_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']);
table_section(2);
+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.'));
+
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'>");
start_row();
end_row();
-label_row(_("Custom Field Name"), _("Custom Field Value"));
-
-start_row();
-text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25);
-text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30);
-end_row();
-
-start_row();
-text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25);
-text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30);
-end_row();
-
-start_row();
-text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25);
-text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30);
-end_row();
-
end_outer_table(1);
hidden('coy_logo', $_POST['coy_logo']);
$past_due_days,
$default_credit_limit,
$default_workorder_required,
- $default_dim_required)
+ $default_dim_required,
+ $default_delivery_required)
{
$sql = "UPDATE ".TB_PREF."company SET
debtors_act=".db_escape($debtors_act).", pyt_discount_act=".db_escape($pyt_discount_act).",
past_due_days=$past_due_days,
default_credit_limit=$default_credit_limit,
default_workorder_required=$default_workorder_required,
- default_dim_required=$default_dim_required
+ default_dim_required=$default_dim_required,
+ default_delivery_required=$default_delivery_required
WHERE coy_code=1";
db_query($sql, "The company gl setup could not be updated ");
}
-function update_company_setup($coy_name, $coy_no, $gst_no, $tax_prd, $tax_last, $postal_address, $phone, $fax, $email,
- $coy_logo, $domicile, $Dimension, $custom1_name, $custom2_name, $custom3_name,
- $custom1_value, $custom2_value, $custom3_value, $curr_default, $f_year, $no_item_list, $no_customer_list,
- $no_supplier_list, $base_sales)
+function update_company_setup($coy_name, $coy_no, $gst_no, $tax_prd, $tax_last,
+ $postal_address, $phone, $fax, $email, $coy_logo, $domicile, $Dimension,
+ $curr_default, $f_year, $no_item_list, $no_customer_list, $no_supplier_list,
+ $base_sales)
{
if ($f_year == null)
$f_year = 0;
no_item_list=$no_item_list,
no_customer_list=$no_customer_list,
no_supplier_list=$no_supplier_list,
- custom1_name=".db_escape($custom1_name).",
- custom2_name=".db_escape($custom2_name).",
- custom3_name=".db_escape($custom3_name).",
- custom1_value=".db_escape($custom1_value).",
- custom2_value=".db_escape($custom2_value).",
- custom3_value=".db_escape($custom3_value).",
curr_default=".db_escape($curr_default).",
f_year=$f_year,
base_sales=$base_sales
$_POST['past_due_days'],
$_POST['default_credit_limit'],
$_POST['default_workorder_required'],
- $_POST['default_dim_required']);
+ $_POST['default_dim_required'],
+ $_POST['default_delivery_required']);
display_notification(_("The general GL setup has been updated."));
$_POST['default_workorder_required'] = $myrow['default_workorder_required'];
$_POST['default_dim_required'] = $myrow['default_dim_required'];
+$_POST['default_delivery_required'] = $myrow['default_delivery_required'];
//---------------
gl_all_accounts_list_row(_("Prompt Payment Discount Account:"), 'default_prompt_payment_act');
+text_row(_("Delivery Required By:"), 'default_delivery_required', $_POST['default_delivery_required'], 6, 6, '', "", _("days"));
+
//----------------
table_section_title(_("Dimension Defaults"));
}
function default_delivery_required_by()
- { // FIX this in next major release
-// return get_company_pref('default_delivery_required');
+ {
+ return get_company_pref('default_delivery_required');
return 1;
}
--- /dev/null
+<?php
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+class fa2_2 {
+ var $version = '2.2'; // version installed
+ var $description = 'Version 2.2';
+ var $sql = 'alter2.2.sql';
+ //
+ // Install procedure. All additional changes
+ // not included in sql file should go here.
+ //
+ function install($pref, $force)
+ {
+ global $db;
+
+ return true;
+ }
+ //
+ // Checking before install
+ //
+ function pre_check($pref)
+ {
+ return true; // true when ok, fail otherwise
+ }
+ //
+ // Test if patch was applied before.
+ //
+ function installed($pref) {
+ if (check_table($pref, 'company', 'default_delivery_required')) return false;
+ return true;
+ }
+};
+
+$install = new fa2_2;
+?>
\ No newline at end of file
--- /dev/null
+ALTER TABLE `0_company` DROP COLUMN `custom1_name`;
+ALTER TABLE `0_company` DROP COLUMN `custom2_name`;
+ALTER TABLE `0_company` DROP COLUMN `custom3_name`;
+ALTER TABLE `0_company` DROP COLUMN `custom1_value`;
+ALTER TABLE `0_company` DROP COLUMN `custom2_value`;
+ALTER TABLE `0_company` DROP COLUMN `custom3_value`;
+
+ALTER TABLE `0_company` ADD COLUMN `default_delivery_required` SMALLINT(6) DEFAULT '1';
`default_inv_sales_act` varchar(11) NOT NULL default '',
`default_assembly_act` varchar(11) NOT NULL default '',
`payroll_act` varchar(11) NOT NULL default '',
- `custom1_name` varchar(60) NOT NULL default '',
- `custom2_name` varchar(60) NOT NULL default '',
- `custom3_name` varchar(60) NOT NULL default '',
- `custom1_value` varchar(100) NOT NULL default '',
- `custom2_value` varchar(100) NOT NULL default '',
- `custom3_value` varchar(100) NOT NULL default '',
`allow_negative_stock` tinyint(1) NOT NULL default '0',
`po_over_receive` int(11) NOT NULL default '10',
`po_over_charge` int(11) NOT NULL default '10',
`foreign_codes` tinyint(1) NOT NULL default '0',
`accumulate_shipping` tinyint(1) NOT NULL default '0',
`legal_text` tinytext NOT NULL,
+ `default_delivery_required` smallint(6) NOT NULL default '1',
PRIMARY KEY (`coy_code`)
) TYPE=MyISAM ;
### Data of table `0_company` ###
-INSERT INTO `0_company` VALUES ('1', 'Training Co.', '987654321', '123123123', '1', '1', 'N/A', '202-122320', '202-18889123', 'delta@delta.com', 'logo_frontaccounting.jpg', 'DownTown', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '', '', '', '', '', '', '0', '10', '10', '1000', '20', '20', '30', '1', '7', '0', '0', '0', '0', '0', '0', '');
+INSERT INTO `0_company` VALUES ('1', 'Training Co.', '987654321', '123123123', '1', '1', 'N/A', '202-122320', '202-18889123', 'delta@delta.com', 'logo_frontaccounting.jpg', 'DownTown', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '7', '0', '0', '0', '0', '0', '0', '', '1');
### Structure of table `0_credit_status` ###
`default_inv_sales_act` varchar(11) NOT NULL default '',
`default_assembly_act` varchar(11) NOT NULL default '',
`payroll_act` varchar(11) NOT NULL default '',
- `custom1_name` varchar(60) NOT NULL default '',
- `custom2_name` varchar(60) NOT NULL default '',
- `custom3_name` varchar(60) NOT NULL default '',
- `custom1_value` varchar(100) NOT NULL default '',
- `custom2_value` varchar(100) NOT NULL default '',
- `custom3_value` varchar(100) NOT NULL default '',
`allow_negative_stock` tinyint(1) NOT NULL default '0',
`po_over_receive` int(11) NOT NULL default '10',
`po_over_charge` int(11) NOT NULL default '10',
`foreign_codes` tinyint(1) NOT NULL default '0',
`accumulate_shipping` tinyint(1) NOT NULL default '0',
`legal_text` tinytext NOT NULL,
+ `default_delivery_required` smallint(6) NOT NULL default '1',
PRIMARY KEY (`coy_code`)
) TYPE=MyISAM ;
### Data of table `0_company` ###
-INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '', '', '', '', '', '', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '-1', '0', '0', '');
+INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '-1', '0', '0', '', '1');
### Structure of table `0_credit_status` ###