From 9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 15 Jun 2012 13:36:36 +0200 Subject: [PATCH] Fixes in sales reports to use debtor_trans.tax_included field instead of trans_tax_details.included_in_price --- reporting/rep107.php | 2 +- reporting/rep110.php | 4 ++-- reporting/rep113.php | 2 +- sql/alter2.4.sql | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/reporting/rep107.php b/reporting/rep107.php index 36acff5a..84e56113 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -164,7 +164,7 @@ function print_invoices() else $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) "; - if ($tax_item['included_in_price']) + if ($myrow['tax_included']) { if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1) { diff --git a/reporting/rep110.php b/reporting/rep110.php index 856da324..488d5831 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -176,8 +176,8 @@ function print_deliveries() $tax_type_name = $tax_item['tax_type_name']; else $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) "; - - if ($tax_item['included_in_price']) + + if ($myrow['tax_included']) { if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1) { diff --git a/reporting/rep113.php b/reporting/rep113.php index aec634e2..26f51fbd 100644 --- a/reporting/rep113.php +++ b/reporting/rep113.php @@ -163,7 +163,7 @@ function print_credits() else $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) "; - if ($tax_item['included_in_price']) + if ($myrow['tax_included']) { if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1) { diff --git a/sql/alter2.4.sql b/sql/alter2.4.sql index c0fdca27..2d816bc3 100644 --- a/sql/alter2.4.sql +++ b/sql/alter2.4.sql @@ -41,8 +41,9 @@ ALTER TABLE `0_cust_branch` ADD COLUMN `bank_account` varchar(60) DEFAULT NULL A ALTER TABLE `0_debtor_trans` ADD COLUMN `tax_included` tinyint(1) unsigned NOT NULL default '0' AFTER `payment_terms`; UPDATE `0_debtor_trans` tr, `0_trans_tax_details` td SET tr.tax_included=td.included_in_price - WHERE tr.`type`=td.trans_type AND tr.trans_no=td.trans_no AND td.included_in_price + WHERE tr.`type`=td.trans_type AND tr.trans_no=td.trans_no AND td.included_in_price; + ALTER TABLE `0_bank_accounts` ADD COLUMN `bank_charge_act` varchar(15) NOT NULL DEFAULT '' AFTER `id`; -UPDATE `0_bank_accounts` SET `bank_charge_act`=(SELECT `value` FROM 0_sys_prefs WHERE name='bank_charge_act'); -ALTER TABLE `0_users` ADD `transaction_days` INT( 6 ) NOT NULL COMMENT 'Transaction days' AFTER `startup_tab`; -UPDATE `0_users` SET `transaction_days`=30; +UPDATE `0_bank_accounts` SET `bank_charge_act`=(SELECT `value` FROM 0_sys_prefs WHERE name='bank_charge_act'); + +ALTER TABLE `0_users` ADD `transaction_days` INT( 6 ) NOT NULL default '30' COMMENT 'Transaction days' AFTER `startup_tab`; -- 2.30.2