CRM-19715, removed settings related to close accounting period and moved to an extension
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 15 Mar 2017 06:33:34 +0000 (12:03 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 15 Mar 2017 06:33:34 +0000 (12:03 +0530)
----------------------------------------
* CRM-19715: Remove Close Accounting Period code
  https://issues.civicrm.org/jira/browse/CRM-19715

CRM/Admin/Form/Preferences/Contribute.php
api/v3/examples/Setting/GetFields.php
settings/Contribute.setting.php
templates/CRM/Admin/Form/Preferences/Contribute.tpl
templates/CRM/Form/basicForm.tpl

index 2027fdf1f13610be7f0ffd3af80b4daaa94f626a..e07b876a3f39429220b7fc0f705a9ecc4233df5e 100644 (file)
@@ -41,9 +41,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
     'always_post_to_accounts_receivable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
     'deferred_revenue_enabled' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
     'default_invoice_page' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'financial_account_bal_enable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
-    'fiscalYearStart' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
-    'prior_financial_period' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
     'invoicing' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
   );
 
@@ -217,9 +214,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
         )
       );
     }
-    $defaults['fiscalYearStart'] = Civi::settings()->get('fiscalYearStart');
-    $period = CRM_Contribute_BAO_Contribution::checkContributeSettings('prior_financial_period');
-    $this->assign('priorFinancialPeriod', $period);
     return $defaults;
   }
 
@@ -232,7 +226,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
     unset($params['qfKey']);
     unset($params['entryURL']);
     Civi::settings()->set('contribution_invoice_settings', $params);
-    Civi::settings()->set('fiscalYearStart', $params['fiscalYearStart']);
 
     // to set default value for 'Invoices / Credit Notes' checkbox on display preferences
     $values = CRM_Core_BAO_Setting::getItem("CiviCRM Preferences");
index 9e6170e70d97560be91a4567b6e038b3394b852b..90ca0004bcb3e27f268c81fbebf2797f7ad01879 100644 (file)
@@ -225,36 +225,6 @@ function setting_getfields_expectedresult() {
         'description' => '',
         'help_text' => '',
       ),
-      'financial_account_bal_enable' => array(
-        'group_name' => 'Contribute Preferences',
-        'group' => 'contribute',
-        'name' => 'financial_account_bal_enable',
-        'type' => 'Integer',
-        'html_type' => 'checkbox',
-        'quick_form_type' => 'Element',
-        'default' => 0,
-        'add' => '4.7',
-        'title' => 'Enable Financial Account Balances',
-        'is_domain' => 1,
-        'is_contact' => 0,
-        'description' => '',
-        'help_text' => '',
-      ),
-      'prior_financial_period' => array(
-        'group_name' => 'Contribute Preferences',
-        'group' => 'contribute',
-        'name' => 'prior_financial_period',
-        'type' => 'activityDate',
-        'quick_form_type' => 'Date',
-        'html_type' => 'Date',
-        'default' => '',
-        'add' => '4.7',
-        'title' => 'Prior Financial Period',
-        'is_domain' => 1,
-        'is_contact' => 0,
-        'description' => '',
-        'help_text' => '',
-      ),
       'always_post_to_accounts_receivable' => array(
         'group_name' => 'Contribute Preferences',
         'group' => 'contribute',
index 54115ddf451dd79b25fe8370cf935bf73bdc71fd..67313e3031a626acc8e8b3a76e1d1add4c1946e6 100644 (file)
@@ -135,36 +135,6 @@ return array(
     'description' => NULL,
     'help_text' => NULL,
   ),
-  'financial_account_bal_enable' => array(
-    'group_name' => 'Contribute Preferences',
-    'group' => 'contribute',
-    'name' => 'financial_account_bal_enable',
-    'type' => 'Integer',
-    'html_type' => 'checkbox',
-    'quick_form_type' => 'Element',
-    'default' => 0,
-    'add' => '4.7',
-    'title' => 'Enable Financial Account Balances',
-    'is_domain' => 1,
-    'is_contact' => 0,
-    'description' => NULL,
-    'help_text' => NULL,
-  ),
-  'prior_financial_period' => array(
-    'group_name' => 'Contribute Preferences',
-    'group' => 'contribute',
-    'name' => 'prior_financial_period',
-    'type' => 'activityDate',
-    'quick_form_type' => 'Date',
-    'html_type' => 'Date',
-    'default' => NULL,
-    'add' => '4.7',
-    'title' => 'Prior Financial Period',
-    'is_domain' => 1,
-    'is_contact' => 0,
-    'description' => NULL,
-    'help_text' => NULL,
-  ),
   'always_post_to_accounts_receivable' => array(
     'group_name' => 'Contribute Preferences',
     'group' => 'contribute',
index bb98b832954782a92a8b208a1eeb8dea5bca70ae..7daf9869162de3e5fd1b41e879adf896db8e7ca7 100644 (file)
       $("#deferred_revenue_enabled").click(function() {
         showHideElement('deferred_revenue_enabled', 'default_invoice_page');
       });
-      showHideElement('financial_account_bal_enable', 'fiscalYearStart');
-      $("#financial_account_bal_enable").click(function() {
-        showHideElement('financial_account_bal_enable', 'fiscalYearStart');
-      });
       function showHideElement(checkEle, toHide) {
         if ($('#' + checkEle).prop('checked')) {
           $("tr.crm-preferences-form-block-" + toHide).show();
           $("tr.crm-preferences-form-block-" + toHide).hide();
         }
       }
-      $('input[name=_qf_Contribute_next]').on('click', checkPeriod);
-      function checkPeriod() {
-        var speriod = $('#prior_financial_period').val();
-       var hperiod = '{/literal}{$priorFinancialPeriod}{literal}';
-       if (((hperiod && speriod == '') || (hperiod && speriod != '')) && (speriod != hperiod)) {
-         var msg = '{/literal}{ts}Changing the Prior Financial Period may result in problems calculating closing account balances accurately and / or exporting of financial transactions. Do you want to proceed?{/ts}{literal}';
-          return confirm(msg);
-        }
-      }
     });
   </script>
 {/literal}
index cb30a35ba47d766d04bfdaa63e56ab5ee0cf06e0..2b15663b414b75246e6277dbe4d082a4fd4d41c0 100644 (file)
               {else}
                 <td class="label">{$form.$htmlField.label}&nbsp;{if $htmlField eq 'acl_financial_type'}{help id="$htmlField"}{/if}</td>
                 <td>
-                  {if $htmlField eq 'prior_financial_period'}
-                    {include file="CRM/common/jcalendar.tpl" elementName=$htmlField}
-                 {else}
-                     {$form.$htmlField.html}
-                  {/if}
+                  {$form.$htmlField.html}
                   {if $desc}
                     <br /><span class="description">{$desc}</span>
                   {/if}
@@ -55,8 +51,6 @@
             </tr>
           {/if}
         {/foreach}
-       {$form.prior_financial_period_M_hidden.html}
-       {$form.prior_financial_period_d_hidden.html}
       </table>
     {/if}
     <table class="form-layout" id="invoicing_blocks">