From 4d6769aa5b74ea3416853faa9dadfa1eac7af7b1 Mon Sep 17 00:00:00 2001 From: dpradeep Date: Thu, 22 May 2014 09:48:41 +0530 Subject: [PATCH] VAT-88 Associate the tax to be charged to the financial type + Add new column tax_amount in contribution and lineitem table --- CRM/Financial/Page/AJAX.php | 1 + CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl | 10 ++++++++++ xml/templates/civicrm_data.tpl | 1 + 3 files changed, 12 insertions(+) diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 4b12cf42d1d8..c1777b80de24 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -61,6 +61,7 @@ static function jqFinancial($config) { '7' => 4, //cost of sales '8' => 1, //premium inventory '9' => 3, //discount account is + '10' => 2, //sales tax liability ); $financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType); $result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType); diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl index c824797427f2..5e2f6e321981 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl @@ -519,3 +519,13 @@ WHERE co.id IS NULL; WHERE v.name = 'Awaiting Information'; {/if} +-- Financial account relationship +SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship'; +INSERT INTO + `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}`description`{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) +VALUES +(@option_group_id_arel, {localize}'{ts escape="sql"}Sales Tax Account is{/ts}'{/localize}, 10, 'Sales Tax Account is', NULL, 0, 0, 10, {localize}'Sales Tax Account is'{/localize}, 0, 1, 1, 2, NULL); + +-- Add new column tax_amount in contribution and lineitem table +ALTER TABLE `civicrm_contribution` ADD `tax_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Total tax amount of this contribution.'; +ALTER TABLE `civicrm_line_item` ADD `tax_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'tax of each item'; diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 1e35fd9bde78..0d2c57dec0d9 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -857,6 +857,7 @@ VALUES (@option_group_id_arel, '{ts escape="sql"}Cost of Sales Account is{/ts}', 7, 'Cost of Sales Account is', NULL, 0, 0, 7, 'Cost of Sales Account is', 0, 1, 1, 2, NULL), (@option_group_id_arel, '{ts escape="sql"}Premiums Inventory Account is{/ts}', 8, 'Premiums Inventory Account is', NULL, 0, 0, 8, 'Premiums Inventory Account is', 0, 1, 1, 2, NULL), (@option_group_id_arel, '{ts escape="sql"}Discounts Account is{/ts}', 9, 'Discounts Account is', NULL, 0, 0, 9, 'Discounts Account is', 0, 1, 1, 2, NULL), + (@option_group_id_arel, '{ts escape="sql"}Sales Tax Account is{/ts}', 10, 'Sales Tax Account is', NULL, 0, 0, 10, 'Sales Tax Account is', 0, 1, 1, 2, NULL), -- event_contacts (@option_group_id_ere, '{ts escape="sql"}Participant Role{/ts}', 1, 'participant_role', NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL, NULL),