CRM-16189, added script for new activity type 'Closing Accounting period' (#8584)
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 7 Jul 2016 19:57:29 +0000 (01:27 +0530)
committercolemanw <coleman@civicrm.org>
Thu, 7 Jul 2016 19:57:29 +0000 (15:57 -0400)
----------------------------------------
* 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
xml/templates/civicrm_data.tpl

index 6ab2ac3c306a946a38a9869340bb4db244968a7d..3be47b33cb8cb7c58a1467b34defa973c08fc571 100644 (file)
@@ -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);
index 0b63df5bb41c19790f98508255bbcd8b92d44d6c..88aa38502fab25b6eca4ddd97383647d3684abf2 100644 (file)
@@ -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),