$balanceTrxnParams['from_financial_account_id'] = $fromFinancialAccountId;
$balanceTrxnParams['total_amount'] = $params['total_amount'];
$balanceTrxnParams['contribution_id'] = $params['contribution_id'];
- $balanceTrxnParams['trxn_date'] = !empty($params['contribution_receive_date']) ? $params['contribution_receive_date'] : date('YmdHis');
+ $balanceTrxnParams['trxn_date'] = CRM_Utils_Array::value('trxn_date', $params, CRM_Utils_Array::value('contribution_receive_date', $params, date('YmdHis')));
$balanceTrxnParams['fee_amount'] = CRM_Utils_Array::value('fee_amount', $params);
$balanceTrxnParams['net_amount'] = CRM_Utils_Array::value('total_amount', $params);
$balanceTrxnParams['currency'] = $contribution['currency'];
'paymentAmount' => $entities['payment']['total_amount'],
'event' => NULL,
'component' => 'contribution',
+ 'checkNumber' => CRM_Utils_Array::value('check_number', $entities['payment']),
+ 'receive_date' => $entities['payment']['trxn_date'],
+ 'paidBy' => CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_FinancialTrxn', 'payment_instrument_id', $entities['payment']['payment_instrument_id']),
];
if (!empty($entities['event'])) {
$templateVariables['component'] = 'event';
'paymentAmount',
'event',
'component',
+ 'checkNumber',
+ 'receive_date',
+ 'paidBy',
];
// Need to do these before switching the form over...
$todoParams = [
'totalPaid',
'refundAmount',
'paymentsComplete',
- 'receive_date',
- 'paidBy',
- 'checkNumber',
'contributeMode',
'isAmountzero',
'billingName',
$params = array(
'contribution_id' => $contribution['id'],
'total_amount' => 50,
+ 'check_number' => '345',
+ 'trxn_date' => '2018-08-13 17:57:56',
);
$payment = $this->callAPISuccess('payment', 'create', $params);
$this->checkPaymentResult($payment, [
'This Payment Amount: $ 50.00',
'Balance Owed: $ 100.00', //150 was paid in the 1st payment.
'Event Information and Location',
+ 'Paid By: Check',
+ 'Check Number: 345',
+ 'Transaction Date: August 13th, 2018 5:57 PM',
));
$mut->stop();
}