Company setup option for printing server Time Zone on Reports Print-Out.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 2 May 2009 08:41:51 +0000 (08:41 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 2 May 2009 08:41:51 +0000 (08:41 +0000)
Company setup version_id for stamping the version id. Can be used for check for update.

CHANGELOG.txt
admin/company_preferences.php
admin/db/company_db.inc
reporting/includes/pdf_report.inc
sql/alter2.2.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 398a1b4af38f69f50eb577f8d42e18051e246a49..1346c0989053db8131afcc3df1a4d5661e073404 100644 (file)
@@ -19,6 +19,16 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+02-May-2009 Joe Hunt
+! Company setup option for printing server Time Zone on Reports Print-Out.
+! Company setup version_id for stamping the version id. Can be used for check for update.
+$ /admin/company_preferences.php
+  /admin/db/company_db.inc
+  /reporting/includes/pdf_report.inc
+  /sql/alter2.2.sql
+  /sql/en_US-demo.sql
+  /sql/en_US-new.sql
+  
 01-May-2009 Joe Hunt
 ! Changed Customer Balance and Supplier Balance to period select with Open Balance
 $ /reporting/reports_main.php
index feddf62fbdca78c247a8b1442d0ebc1243b829aa..648d260f7541697b220a0418a77cc83fdff0e616 100644 (file)
@@ -101,7 +101,7 @@ if (isset($_POST['update']) && $_POST['update'] != "")
                        $_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']);
+                       check_value('no_supplier_list'), $_POST['base_sales'], check_value('time_zone'));
 
                display_notification_centered(_("Company setup has been updated."));
        }
@@ -134,6 +134,8 @@ $_POST['no_customer_list']  = $myrow["no_customer_list"];
 $_POST['no_supplier_list']  = $myrow["no_supplier_list"];
 $_POST['curr_default']  = $myrow["curr_default"];
 $_POST['f_year']  = $myrow["f_year"];
+$_POST['time_zone']  = $myrow["time_zone"];
+$_POST['version_id']  = $myrow["version_id"];
 $_POST['del_coy_logo']  = 0;
 
 start_outer_table($table_style2);
@@ -151,13 +153,13 @@ text_row_ex(_("Official Company Number:"), 'coy_no', 25);
 text_row_ex(_("GSTNo:"), 'gst_no', 25);
 
 currencies_list_row(_("Home Currency:"), 'curr_default', $_POST['curr_default']);
+fiscalyears_list_row(_("Fiscal Year:"), 'f_year', $_POST['f_year']);
 
 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'>");
 check_row(_("Delete Company Logo:"), 'del_coy_logo', $_POST['del_coy_logo']);
@@ -170,9 +172,10 @@ sales_types_list_row(_("Base for auto price calculations:"), 'base_sales', $_POS
 check_row(_("Search Item List"), 'no_item_list', $_POST['no_item_list']);
 check_row(_("Search Customer List"), 'no_customer_list', $_POST['no_customer_list']);
 check_row(_("Search Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']);
+label_row("", "&nbsp;");
+check_row(_("Time Zone on Reports"), 'time_zone', $_POST['time_zone']);
+label_row(_("Version Id"), $_POST['version_id']);
 
-start_row();
-end_row();
 end_outer_table(1);
 
 hidden('coy_logo', $_POST['coy_logo']);
index c9f416f0315a93888fc325e17f959afac699a321..0e8ddaaf506a78fe7cd55a77bae6bc5e77f60e64 100644 (file)
@@ -64,7 +64,7 @@ function update_company_gl_setup($retained_act, $profit_loss_act, $debtors_act,
 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)
+       $base_sales, $time_zone)
 {
        if ($f_year == null)
                $f_year = 0;
@@ -84,7 +84,8 @@ function update_company_setup($coy_name, $coy_no, $gst_no, $tax_prd, $tax_last,
                no_supplier_list=$no_supplier_list,
                curr_default=".db_escape($curr_default).",
                f_year=$f_year,
-               base_sales=$base_sales
+               base_sales=$base_sales,
+               time_zone=$time_zone
                WHERE coy_code=1";
 
        db_query($sql, "The company setup could not be updated ");
index 5beea7e978f4feecd1c39f0fb88e30032a2a28f3..5b8e98dc276cb4266f5a9faedbbee59a17e1d821 100644 (file)
@@ -203,6 +203,8 @@ class FrontReport extends Cpdf
                $str = _("Print Out Date") . ':';
                $this->Text($this->leftMargin, $str, $this->titleCol);
                $str = Today() . '   ' . Now();
+               if ($this->company['time_zone'])
+                       $str .= ' ' . date('O') . ' GMT';
                $this->Text($this->titleCol, $str, $this->companyCol);
                $this->Text($this->companyCol, $this->host);
 
index 0973d87e81b6a67a53a9fec40dbc2a98130fe1df..5904d82b6b75eb70ce2e954855b1d9c372878636 100644 (file)
@@ -8,8 +8,9 @@ ALTER TABLE `0_company` DROP COLUMN `custom3_value`;
 ALTER TABLE `0_company` ADD COLUMN `default_delivery_required` SMALLINT(6) NULL DEFAULT '1';
 ALTER TABLE `0_company` ADD COLUMN `version_id` VARCHAR(11) NOT NULL DEFAULT '';
 ALTER TABLE `0_company` CHANGE `purch_exchange_diff_act` `profit_loss_year_act` VARCHAR(11) NOT NULL DEFAULT '';
+ALTER TABLE `0_company` ADD COLUMN `time_zone` TINYINT(1) NOT NULL DEFAULT '0';
 INSERT INTO `0_chart_master` VALUES ('8900', '', 'Profit and Loss this year', '52', '0');
-UPDATE `0_company` SET `profit_loss_year_act`='8900' WHERE `coy_code`=1; 
+UPDATE `0_company` SET `profit_loss_year_act`='8900', `version_id`='2.2' WHERE `coy_code`=1; 
 
 ALTER TABLE `0_stock_category` DROP COLUMN `stock_act`;
 ALTER TABLE `0_stock_category` DROP COLUMN `cogs_act`;
index 9757d2ae6f64fc8f0eaf8385d46d8ca7b8bf5abd..538f1dfd66c4f3dcf5dcb9a9430dfd7a23df3126 100644 (file)
@@ -369,13 +369,14 @@ CREATE TABLE `0_company` (
   `legal_text` tinytext NOT NULL,
   `default_delivery_required` smallint(6) NOT NULL default '1',
   `version_id` varchar(11) NOT NULL default '',
+  `time_zone` tinyint(1) NOT NULL default '0',
   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', '', '1');
+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', '2.2', '0');
 
 
 ### Structure of table `0_credit_status` ###
index a95fd791ff5c5a2655ae934d685e2de7c8ed239c..a9681851bcf145ff9ba1306ce7ffbefe1eb5699d 100644 (file)
@@ -340,13 +340,14 @@ CREATE TABLE `0_company` (
   `legal_text` tinytext NOT NULL,
   `default_delivery_required` smallint(6) NOT NULL default '1',
   `version_id` varchar(11) NOT NULL default '',
+  `time_zone` tinyint(1) NOT NULL default '0',
   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', '', '1');
+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'. '2.2', '0');
 
 
 ### Structure of table `0_credit_status` ###