Skip to content

Commit

Permalink
Merge pull request civicrm#1 from dpradeep/VAT-88
Browse files Browse the repository at this point in the history
VAT-88 Added sales account option value on install + upgrade. Also handl...
  • Loading branch information
kurund committed Mar 4, 2014
2 parents 516ee52 + 48050c7 commit 929f784
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CRM/Financial/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function jqFinancial($config) {
'7' => 4, //cost of sales
'8' => 1, //premium inventory
'9' => 3, //discount account is
'10' => 2, //sales tax
);
$financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType);
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
Expand Down
7 changes: 7 additions & 0 deletions CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,10 @@ ALTER TABLE `civicrm_contact` CHANGE `preferred_mail_format` `preferred_mail_
-- CRM-14183
INSERT INTO civicrm_state_province (country_id, abbreviation, name) VALUES (1157, "PL", "Plateau");
UPDATE civicrm_state_province SET name = "Abuja Federal Capital Territory" WHERE name = "Abuja Capital Territory";

-- add 'Sales Tax Account is' as 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);
1 change: 1 addition & 0 deletions xml/templates/civicrm_data.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,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),
Expand Down

0 comments on commit 929f784

Please sign in to comment.