From 18987c6c16e648d17a6457971a2dd3d9348f747a Mon Sep 17 00:00:00 2001 From: Jaap Jansma Date: Mon, 31 May 2021 11:24:03 +0200 Subject: [PATCH] dev/financial#6 Added is template to search screen --- CRM/Contribute/BAO/Query.php | 2 ++ CRM/Contribute/Selector/Search.php | 1 + templates/CRM/Contact/Form/Search/Advanced.hlp | 9 +++++++++ templates/CRM/Contribute/Form/Search/Common.tpl | 6 ++++++ templates/CRM/Contribute/Form/Selector.tpl | 6 +++++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 5255b6d36e..e5aabe2a97 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -961,6 +961,7 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { $form->addYesNo('contribution_recurring', ts('Contribution is Recurring?'), TRUE); $form->addYesNo('contribution_test', ts('Contribution is a Test?'), TRUE); + $form->addYesNo('is_template', ts('Contribution is Template?'), TRUE); // Add field for transaction ID search $form->addElement('text', 'contribution_trxn_id', ts("Transaction ID")); $form->addElement('text', 'contribution_check_number', ts('Check Number')); @@ -1029,6 +1030,7 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query { $form->assign('validCiviContribute', TRUE); $form->setDefaults(['contribution_test' => 0]); + $form->setDefaults(['is_template' => 0]); CRM_Contribute_BAO_ContributionRecur::recurringContribution($form); } diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index c8b5a8ca18..fed38afc1e 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -53,6 +53,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C 'contribution_cancel_date', 'product_name', 'is_test', + 'is_template', 'contribution_recur_id', 'receipt_date', 'membership_id', diff --git a/templates/CRM/Contact/Form/Search/Advanced.hlp b/templates/CRM/Contact/Form/Search/Advanced.hlp index 3747d071c3..7878b00767 100644 --- a/templates/CRM/Contact/Form/Search/Advanced.hlp +++ b/templates/CRM/Contact/Form/Search/Advanced.hlp @@ -96,6 +96,15 @@

{ts}Once you have finished your testing, it is a good idea to clean up by finding your test records and deleting them.{/ts}

{/htxt} + +{htxt id="is-template-title"} +{ts}Template Records{/ts} +{/htxt} +{htxt id="is-template"} +

{ts}Template contributions are used with recurring contribution to generate follow up contributions.{/ts}

+

{ts}You can change the template contribution and the changes will occur as soon as new contribution is generated within the recurring serie.{/ts}

+{/htxt} + {htxt id="processor-id-title"} {ts}Processor ID{/ts} {/htxt} diff --git a/templates/CRM/Contribute/Form/Search/Common.tpl b/templates/CRM/Contribute/Form/Search/Common.tpl index 5564d23fa0..8f79a3bf40 100644 --- a/templates/CRM/Contribute/Form/Search/Common.tpl +++ b/templates/CRM/Contribute/Form/Search/Common.tpl @@ -110,6 +110,12 @@ {$form.contribution_recurring.html} + + {$form.is_template.label} {help id="is-template" file="CRM/Contact/Form/Search/Advanced"} + + {$form.is_template.html} + + diff --git a/templates/CRM/Contribute/Form/Selector.tpl b/templates/CRM/Contribute/Form/Selector.tpl index 82bf0ca05f..dde319b318 100644 --- a/templates/CRM/Contribute/Form/Selector.tpl +++ b/templates/CRM/Contribute/Form/Selector.tpl @@ -49,7 +49,11 @@   {$row.total_amount|crmMoney:$row.currency} {if $row.amount_level }
({$row.amount_level}){/if} - {if $row.contribution_recur_id}
{ts}(Recurring){/ts}{/if} + {if $row.contribution_recur_id && $row.is_template} +
{ts}(Recurring Template){/ts} + {elseif $row.contribution_recur_id } +
{ts}(Recurring){/ts} + {/if} {foreach from=$columnHeaders item=column} {assign var='columnName' value=$column.field_name} -- 2.25.1