From: Pradeep Nayak Date: Wed, 15 Mar 2017 07:07:24 +0000 (+0530) Subject: CRM-19715, Removed Close Accounting Period Activity Type X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a6a9f77238e048e279bef8928b5d594c7f1a11e7;p=civicrm-core.git CRM-19715, Removed Close Accounting Period Activity Type ---------------------------------------- * CRM-19715: Remove Close Accounting Period code https://issues.civicrm.org/jira/browse/CRM-19715 CRM-19715, updated sql to delete activity type if not present ---------------------------------------- * CRM-19715: Remove Close Accounting Period code https://issues.civicrm.org/jira/browse/CRM-19715 CRM-19715, removed cruft ---------------------------------------- * CRM-19715: Remove Close Accounting Period code https://issues.civicrm.org/jira/browse/CRM-19715 --- diff --git a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl index 16f16ed038..d6cecd7134 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.19.mysql.tpl @@ -1 +1,9 @@ {* file to handle db changes in 4.7.19 during upgrade *} +-- CRM-19715 +SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; +SELECT @close_acc_period_act_val := `value` FROM civicrm_option_value WHERE option_group_id = @option_group_id_act AND name = 'Close Accounting Period'; +SELECT @close_accounting_period_activity_count := count(id) FROM `civicrm_activity` WHERE `activity_type_id` = @close_acc_period_act_val; + +-- Delete Close Accounting Period activity type +DELETE FROM civicrm_option_value + WHERE option_group_id = @option_group_id_act AND name = 'Close Accounting Period' AND @close_accounting_period_activity_count = 0; diff --git a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl index f934b5b6be..cfce4adccc 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl @@ -42,11 +42,3 @@ VALUES ('Deferred Revenue - Event Fee', @domainContactId, @opLiability, 'Event revenue to be recognized in future months when the events occur', '2730', 'OCLIAB', 0, 1, 0, 0), ('Deferred Revenue - Member Dues', @domainContactId, @opLiability, 'Membership revenue to be recognized in future months', '2740', 'OCLIAB', 0, 1, 0, 0); --- 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 f82cc13df8..3ddce5e41f 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -388,9 +388,6 @@ 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, 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, NULL), - (@option_group_id_gender, '{ts escape="sql"}Female{/ts}', 1, 'Female', NULL, 0, NULL, 1, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_gender, '{ts escape="sql"}Male{/ts}', 2, 'Male', NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_gender, '{ts escape="sql"}Other{/ts}', 3, 'Other', NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL, NULL),