From 7407b4258624adbc84d3c3b46f67c0eae010de81 Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Fri, 13 Sep 2024 15:08:00 +0200 Subject: [PATCH] Add a setting for grouping by financial types --- CRM/Admin/Form/Setting/SepaSettings.php | 3 +++ settings/sepa.setting.php | 13 ++++++++++++- templates/CRM/Admin/Form/Setting/SepaSettings.hlp | 7 ++++++- templates/CRM/Admin/Form/Setting/SepaSettings.tpl | 6 ++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Form/Setting/SepaSettings.php b/CRM/Admin/Form/Setting/SepaSettings.php index cd77ac56..0933efa9 100644 --- a/CRM/Admin/Form/Setting/SepaSettings.php +++ b/CRM/Admin/Form/Setting/SepaSettings.php @@ -132,6 +132,7 @@ public function buildQuickForm( ) { // look up some values $async_batch = CRM_Sepa_Logic_Settings::getGenericSetting('sdd_async_batching'); + $financial_type_grouping = CRM_Sepa_Logic_Settings::getGenericSetting('sdd_financial_type_grouping'); $skip_closed = CRM_Sepa_Logic_Settings::getGenericSetting('sdd_skip_closed'); $no_draftxml = CRM_Sepa_Logic_Settings::getGenericSetting('sdd_no_draft_xml'); $excld_we = CRM_Sepa_Logic_Settings::getGenericSetting('exclude_weekends'); @@ -157,6 +158,7 @@ public function buildQuickForm( ) { $this->addElement('checkbox', 'is_test_creditor', E::ts("Is a Test Creditor"), "", array('value' =>'0')); $this->addElement('checkbox', 'exclude_weekends', E::ts("Exclude Weekends"), "", ($excld_we?array('checked'=>'checked'):array())); $this->addElement('checkbox', 'sdd_async_batching', E::ts("Large Groups"), "", ($async_batch?array('checked'=>'checked'):array())); + $this->addElement('checkbox', 'sdd_financial_type_grouping', E::ts('Groups by Financial Types'), "", ($financial_type_grouping?array('checked'=>'checked'):array())); $this->addElement('checkbox', 'sdd_skip_closed', E::ts("Only Completed Contributions"), "", ($skip_closed?array('checked'=>'checked'):array())); $this->addElement('checkbox', 'sdd_no_draft_xml', E::ts("No XML drafts"), "", ($no_draftxml?array('checked'=>'checked'):array())); $this->addElement('text', 'pp_buffer_days', E::ts("Buffer Days"), array('size' => 2, 'value' => $bffrdays)); @@ -252,6 +254,7 @@ function postProcess() { CRM_Sepa_Logic_Settings::setSetting((isset($values['exclude_weekends']) ? "1" : "0"), 'exclude_weekends'); CRM_Sepa_Logic_Settings::setSetting((isset($values['sdd_async_batching']) ? "1" : "0"), 'sdd_async_batching'); + CRM_Sepa_Logic_Settings::setSetting((isset($values['sdd_financial_type_grouping']) ? "1" : "0"), 'sdd_financial_type_grouping'); CRM_Sepa_Logic_Settings::setSetting((isset($values['sdd_skip_closed']) ? "1" : "0"), 'sdd_skip_closed'); CRM_Sepa_Logic_Settings::setSetting((isset($values['sdd_no_draft_xml']) ? "1" : "0"), 'sdd_no_draft_xml'); CRM_Sepa_Logic_Settings::setSetting((isset($values['pp_buffer_days']) ? (int) $values['pp_buffer_days'] : "0"), 'pp_buffer_days'); diff --git a/settings/sepa.setting.php b/settings/sepa.setting.php index ee162d11..40e3eef7 100644 --- a/settings/sepa.setting.php +++ b/settings/sepa.setting.php @@ -273,6 +273,17 @@ 'is_contact' => 0, 'description' => 'Enables asychronous batching', ), + 'sdd_financial_type_grouping' => array( + 'group_name' => 'SEPA Direct Debit Preferences', + 'group' => 'org.project60', + 'name' => 'sdd_financial_type_grouping', + 'type' => 'Boolean', + 'html_type' => 'checkbox', + 'default' => 0, + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'Groups by Financial Types.', + ), 'sdd_skip_closed' => array( 'group_name' => 'SEPA Direct Debit Preferences', 'group' => 'org.project60', @@ -308,4 +319,4 @@ 'description' => "Contribution page buffer (in days) before debit needs to be collected", 'help_text' => "Contribution page buffer (in days) before debit needs to be collected", ) - ); \ No newline at end of file + ); diff --git a/templates/CRM/Admin/Form/Setting/SepaSettings.hlp b/templates/CRM/Admin/Form/Setting/SepaSettings.hlp index de0e645f..62463bdc 100644 --- a/templates/CRM/Admin/Form/Setting/SepaSettings.hlp +++ b/templates/CRM/Admin/Form/Setting/SepaSettings.hlp @@ -150,6 +150,11 @@

{ts}This option will activate a runner page with a progress bar for these critical processes. There shouldn't be any timeouts, but you have to keep that open until it's done.{/ts}

{/htxt} +{htxt id='id-financial-type-grouping'} +

{ts}Whether to group transactions by financial types additionally.{/ts}

+

{ts}Enable this settings if you use the Financial ACLs extension, as transaction groups with mixed financial type contributions can cause issues with overlapping Financial ACLs' permissions.{/ts}

+{/htxt} + {htxt id='id-creditor-type'}

{ts}Always use SEPA if you want to do SEPA style direct debit.{/ts}

{ts}PSP can help you to use this extension for other direct debit systems or payment service providers (PSP), but all SEPA style validations and tools are then disabled.{/ts}

@@ -178,4 +183,4 @@

{ts}CUC-code ("Codice Univoco CBI") of the financial institution of the creditor. It is only required for CBIBdySDDReq SEPA file format.{/ts}

{ts}Be careful when changing this!{/ts}

{/htxt} -{/crmScope} \ No newline at end of file +{/crmScope} diff --git a/templates/CRM/Admin/Form/Setting/SepaSettings.tpl b/templates/CRM/Admin/Form/Setting/SepaSettings.tpl index 0f355732..437f9c7b 100644 --- a/templates/CRM/Admin/Form/Setting/SepaSettings.tpl +++ b/templates/CRM/Admin/Form/Setting/SepaSettings.tpl @@ -338,6 +338,12 @@ div.sdd-add-creditor { {$form.sdd_async_batching.html} + + {$form.sdd_financial_type_grouping.label}   + + {$form.sdd_financial_type_grouping.html} + +
{include file="CRM/common/formButtons.tpl" location="bottom"}