Skip to content

Commit

Permalink
Merge pull request civicrm#11 from dpradeep/VAT-88-New
Browse files Browse the repository at this point in the history
VAT-88 Removed hardcode query during upgrade.
  • Loading branch information
pradpnayak committed Jun 20, 2014
2 parents 013cc8e + 2c58f61 commit bd9a7fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,13 @@ WHERE co.id IS NULL;

-- Financial account relationship
SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship';
SELECT @option_group_id_arel_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel;
SELECT @option_group_id_arel_val := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel;
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);
(@option_group_id_arel, {localize}'{ts escape="sql"}Sales Tax Account is{/ts}'{/localize}, @option_group_id_arel_val+1, 'Sales Tax Account is', NULL, 0, 0, @option_group_id_arel_wt+1, {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';
ALTER TABLE `civicrm_contribution` ADD `tax_amount` DECIMAL( 20, 2 ) DEFAULT NULL COMMENT 'Total tax amount of this contribution.';
ALTER TABLE `civicrm_line_item` ADD `tax_amount` DECIMAL( 20, 2 ) DEFAULT NULL COMMENT 'tax of each item';

0 comments on commit bd9a7fa

Please sign in to comment.