From 643852690b4fb69873d6240bc8a68081f339dd61 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 8 Jul 2016 01:27:29 +0530 Subject: [PATCH] CRM-16189, added script for new activity type 'Closing Accounting period' (#8584) ---------------------------------------- * CRM-16189: Improve support for Accrual Method bookkeeping https://issues.civicrm.org/jira/browse/CRM-16189 Conflicts: CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl --- CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl | 9 +++++++++ xml/templates/civicrm_data.tpl | 3 +++ 2 files changed, 12 insertions(+) diff --git a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl index 6ab2ac3c30..3be47b33cb 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl @@ -53,3 +53,12 @@ INSERT INTO `civicrm_entity_financial_account` VALUES ('civicrm_financial_type', @financial_type_id_ef, @option_value_rel_id_dr, @financial_account_id_dref), ('civicrm_financial_type', @financial_type_id_md, @option_value_rel_id_dr, @financial_account_id_drmd); + +-- CRM-16189 Financial account relationship +SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; +SELECT @option_group_id_act_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; +SELECT @option_group_id_act_val := MAX(CAST( `value` AS UNSIGNED )) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; +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_act, {localize}'{ts escape="sql"}Close Accounting Period{/ts}'{/localize}, @option_group_id_act_val+1, 'Close Accounting Period', NULL, 0, 0, @option_group_id_act_wt+1, {localize}'Close Accounting Period'{/localize}, 0, 1, 1, 2, NULL); diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 0b63df5bb4..88aa38502f 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -386,6 +386,9 @@ VALUES -- Activity Type for failed payment (@option_group_id_act, 'Failed Payment', 53, 'Failed Payment', NULL, 1, 0, 53, 'Failed Payment', 0, 1, 1, @contributeCompId, NULL), + -- Activity Type for Close Accounting Period + (@option_group_id_act, '{ts escape="sql"}Close Accounting Period{/ts}', 54, 'Close Accounting Period', NULL, 1, 0, 54, '{ts escape="sql"}Close Accounting Period{/ts}', 0, 1, 1, @contributeCompId, NULL), + (@option_group_id_gender, '{ts escape="sql"}Female{/ts}', 1, 'Female', NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL, NULL), (@option_group_id_gender, '{ts escape="sql"}Male{/ts}', 2, 'Male', NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL), (@option_group_id_gender, '{ts escape="sql"}Transgender{/ts}', 3, 'Transgender', NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL), -- 2.25.1