Skip to content

Commit

Permalink
Merge pull request civicrm#23805 from mattwire/devfinancial197alt
Browse files Browse the repository at this point in the history
dev/financial#197 Revert freezing on total_amount field on recurring form (alt to civicrm#23796)
  • Loading branch information
monishdeb authored Jun 15, 2022
2 parents 460cd5a + d9e93c8 commit 084274a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions CRM/Contribute/Form/UpdateSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,17 @@ public function buildQuickForm() {
TRUE, 'currency', $this->_subscriptionDetails->currency, TRUE
);

// https://lab.civicrm.org/dev/financial/-/issues/197 https://github.com/civicrm/civicrm-core/pull/23796
// Revert freezing on total_amount field on recurring form - particularly affects IATs
// This will need revisiting in the future as updating amount on recur does not work for multiple lineitems.
// Also there are "point of truth" issues ie. is the amount on template contribution or recur the current one?
// The amount on the recurring contribution should not be updated directly. If we update the amount using a template contribution the recurring contribution
// will be updated automatically.
$paymentProcessorObj = Civi\Payment\System::singleton()->getById(CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorID($this->contributionRecurID));
$templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($this->contributionRecurID);
if (!empty($templateContribution['id']) && $paymentProcessorObj->supportsEditRecurringContribution()) {
$amountField->freeze();
}
// $paymentProcessorObj = Civi\Payment\System::singleton()->getById(CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorID($this->contributionRecurID));
// $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($this->contributionRecurID);
// if (!empty($templateContribution['id']) && $paymentProcessorObj->supportsEditRecurringContribution()) {
// $amountField->freeze();
// }

$this->add('text', 'installments', ts('Number of Installments'), ['size' => 20], FALSE);

Expand Down

0 comments on commit 084274a

Please sign in to comment.