Skip to content

Commit fd5b939

Browse files
authored
Merge pull request #20358 from eileenmcnaughton/partial
Remove legacy references to partial_amount_to_pay
2 parents a0203d5 + 2602eee commit fd5b939

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

CRM/Contribute/BAO/Contribution.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -3626,9 +3626,7 @@ public static function recordFinancialAccounts(&$params, $financialTrxnValues =
36263626
$trxnParams['card_type_id'] = $params['card_type_id'] ?? NULL;
36273627
$return = $financialTxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams);
36283628
$params['entity_id'] = $financialTxn->id;
3629-
if (empty($params['partial_payment_total']) && empty($params['partial_amount_to_pay'])) {
3630-
self::$_trxnIDs[] = $financialTxn->id;
3631-
}
3629+
self::$_trxnIDs[] = $financialTxn->id;
36323630
}
36333631
}
36343632
// record line items and financial items

CRM/Event/Form/Participant.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ public function submit($params) {
13121312
);
13131313
}
13141314

1315-
// CRM-13964 partial_payment_total
1315+
// CRM-13964 partial payment
13161316
if ($amountOwed > $params['total_amount']) {
13171317
// the owed amount
13181318
$contributionParams['total_amount'] = $amountOwed;

CRM/Price/BAO/LineItem.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ public static function syncLineItems($entityId, $entityTable = 'civicrm_contribu
490490
public static function getLineItemArray(&$params, $entityId = NULL, $entityTable = 'contribution', $isRelatedID = FALSE) {
491491
if (!$entityId) {
492492
$priceSetDetails = CRM_Price_BAO_PriceSet::getDefaultPriceSet($entityTable);
493-
$totalAmount = CRM_Utils_Array::value('partial_payment_total', $params, CRM_Utils_Array::value('total_amount', $params));
493+
$totalAmount = $params['total_amount'] ?? 0;
494494
$financialType = $params['financial_type_id'] ?? NULL;
495495
foreach ($priceSetDetails as $values) {
496496
if ($entityTable == 'membership') {

CRM/Price/BAO/PriceField.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ public static function priceSetValidation($priceSetId, $fields, &$error, $allowN
804804
// now we have all selected amount in hand.
805805
$totalAmount = array_sum($selectedAmounts);
806806
// The form offers a field to enter the amount paid. This may differ from the amount that is due to complete the purchase
807-
$totalPaymentAmountEnteredOnForm = CRM_Utils_Array::value('partial_payment_total', $fields, CRM_Utils_Array::value('total_amount', $fields));
807+
$totalPaymentAmountEnteredOnForm = CRM_Utils_Array::value('total_amount', $fields);
808808
if ($totalAmount < 0) {
809809
$error['_qf_default'] = ts('%1 amount can not be less than zero. Please select the options accordingly.', [1 => $componentName]);
810810
}

CRM/Price/BAO/PriceSet.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ public static function getLine(&$params, &$lineItem, $priceSetID, $field, $id):
16571657
case 'Text':
16581658
$firstOption = reset($field['options']);
16591659
$params["price_{$id}"] = [$firstOption['id'] => $params["price_{$id}"]];
1660-
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem, CRM_Utils_Array::value('partial_payment_total', $params));
1660+
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem);
16611661
$optionValueId = key($field['options']);
16621662

16631663
if (CRM_Utils_Array::value('name', $field['options'][$optionValueId]) === 'contribution_amount') {
@@ -1691,7 +1691,7 @@ public static function getLine(&$params, &$lineItem, $priceSetID, $field, $id):
16911691
$amount_override = NULL;
16921692

16931693
if ($priceSetID && count(self::filterPriceFieldsFromParams($priceSetID, $params)) === 1) {
1694-
$amount_override = CRM_Utils_Array::value('partial_payment_total', $params, CRM_Utils_Array::value('total_amount', $params));
1694+
$amount_override = CRM_Utils_Array::value('total_amount', $params);
16951695
}
16961696
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem, $amount_override);
16971697
if (!empty($field['options'][$optionValueId]['tax_rate'])) {
@@ -1706,15 +1706,15 @@ public static function getLine(&$params, &$lineItem, $priceSetID, $field, $id):
17061706
$params["price_{$id}"] = [$params["price_{$id}"] => 1];
17071707
$optionValueId = CRM_Utils_Array::key(1, $params["price_{$id}"]);
17081708

1709-
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem, CRM_Utils_Array::value('partial_payment_total', $params));
1709+
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem);
17101710
if (!empty($field['options'][$optionValueId]['tax_rate'])) {
17111711
$lineItem = self::setLineItem($field, $lineItem, $optionValueId, $totalTax);
17121712
}
17131713
break;
17141714

17151715
case 'CheckBox':
17161716

1717-
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem, CRM_Utils_Array::value('partial_payment_total', $params));
1717+
CRM_Price_BAO_LineItem::format($id, $params, $field, $lineItem);
17181718
foreach ($params["price_{$id}"] as $optionId => $option) {
17191719
if (!empty($field['options'][$optionId]['tax_rate'])) {
17201720
$lineItem = self::setLineItem($field, $lineItem, $optionId, $totalTax);

0 commit comments

Comments
 (0)