$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
$financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id');
$itemStatus = NULL;
- if ($contribution->contribution_status_id == array_search('Completed', $contributionStatuses)) {
+ if ($contribution->contribution_status_id == array_search('Completed', $contributionStatuses)
+ || $contribution->contribution_status_id == array_search('Pending refund', $contributionStatuses)) {
$itemStatus = array_search('Paid', $financialItemStatus);
}
elseif ($contribution->contribution_status_id == array_search('Pending', $contributionStatuses)