$balanceTrxnParams['status_id'] = $statusId;
$balanceTrxnParams['payment_instrument_id'] = $params['contribution']->payment_instrument_id;
$balanceTrxnParams['check_number'] = CRM_Utils_Array::value('check_number', $params);
+ if (!empty($balanceTrxnParams['from_financial_account_id']) &&
+ ($statusId == array_search('Completed', $contributionStatuses) || $statusId == array_search('Partially paid', $contributionStatuses))
+ ) {
+ $balanceTrxnParams['is_payment'] = 1;
+ }
if (!empty($params['payment_processor'])) {
$balanceTrxnParams['payment_processor_id'] = $params['payment_processor'];
}
if ($contributionStatus == 'Refunded') {
$trxnParams['trxn_date'] = !empty($params['contribution']->cancel_date) ? $params['contribution']->cancel_date : date('YmdHis');
}
-
+ //CRM-16259, set is_payment flag for non pending status
+ if (!in_array(CRM_Utils_Array::value('contribution_status_id', $params), $pendingStatus)) {
+ $trxnParams['is_payment'] = 1;
+ }
if (!empty($params['payment_processor'])) {
$trxnParams['payment_processor_id'] = $params['payment_processor'];
}