X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FBAO%2FContribution.php;h=e42b0909e1899063cea450d29b8280fade7fb9b8;hb=f49cdeab3a9749f011c4b5387c44ff02d7d634e3;hp=37518424d982652e227f93117cb69c96b22670a6;hpb=ac648bfc4c26c16eb7eac0e624f56c81f9e6f8b4;p=civicrm-core.git diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 37518424d9..e42b0909e1 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -179,9 +179,9 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { $setPrevContribution = TRUE; // CRM-13964 partial payment - if (!empty($params['partial_payment_total']) && !empty($params['partial_amount_pay'])) { + if (!empty($params['partial_payment_total']) && !empty($params['partial_amount_to_pay'])) { $partialAmtTotal = $params['partial_payment_total']; - $partialAmtPay = $params['partial_amount_pay']; + $partialAmtPay = $params['partial_amount_to_pay']; $params['total_amount'] = $partialAmtTotal; if ($partialAmtPay < $partialAmtTotal) { $params['contribution_status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Partially paid'); @@ -3168,9 +3168,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $statusId = $params['contribution']->contribution_status_id; // CRM-13964 partial payment if ($contributionStatus == 'Partially paid' - && !empty($params['partial_payment_total']) && !empty($params['partial_amount_pay']) + && !empty($params['partial_payment_total']) && !empty($params['partial_amount_to_pay']) ) { - $partialAmtPay = CRM_Utils_Rule::cleanMoney($params['partial_amount_pay']); + $partialAmtPay = CRM_Utils_Rule::cleanMoney($params['partial_amount_to_pay']); $partialAmtTotal = CRM_Utils_Rule::cleanMoney($params['partial_payment_total']); $fromFinancialAccountId = CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['financial_type_id'], 'Accounts Receivable Account is'); @@ -3450,7 +3450,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $trxnParams['card_type_id'] = CRM_Utils_Array::value('card_type_id', $params); $return = $financialTxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams); $params['entity_id'] = $financialTxn->id; - if (empty($params['partial_payment_total']) && empty($params['partial_amount_pay'])) { + if (empty($params['partial_payment_total']) && empty($params['partial_amount_to_pay'])) { self::$_trxnIDs[] = $financialTxn->id; } } @@ -3468,7 +3468,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac 'entity_table' => 'civicrm_financial_trxn', 'entity_id' => $financialTxn->id, ); - CRM_Batch_BAO_Batch::addBatchEntity($entityParams); + CRM_Batch_BAO_EntityBatch::create($entityParams); } // when a fee is charged @@ -3852,7 +3852,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $arAccountId = CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($contributionDAO->financial_type_id, 'Accounts Receivable Account is'); if ($paymentType == 'owed') { $params['partial_payment_total'] = $contributionDAO->total_amount; - $params['partial_amount_pay'] = $trxnsData['total_amount']; + $params['partial_amount_to_pay'] = $trxnsData['total_amount']; $trxnsData['net_amount'] = !empty($trxnsData['net_amount']) ? $trxnsData['net_amount'] : $trxnsData['total_amount']; $params['pan_truncation'] = CRM_Utils_Array::value('pan_truncation', $trxnsData); $params['card_type_id'] = CRM_Utils_Array::value('card_type_id', $trxnsData); @@ -4727,10 +4727,6 @@ LIMIT 1;"; $contribution->contact_id = $ids['related_contact']; } CRM_Activity_BAO_Activity::addActivity($contribution, NULL, $targetContactID); - // event - } - else { - CRM_Activity_BAO_Activity::addActivity($participant); } // CRM-9132 legacy behaviour was that receipts were sent out in all instances. Still sending