Changes to code

This commit is contained in:
2018-08-11 23:21:25 +05:30
parent 0c4fe4ccd6
commit b5c998846e
5 changed files with 37 additions and 6 deletions

View File

@ -37,17 +37,18 @@ class CRM_Grant_BAO_GrantBudget extends CRM_Grant_DAO_GrantBudget {
LEFT JOIN civicrm_grant cg
ON cg.financial_type_id = cft.id AND cg.status_id IN (%4)
AND cg.decision_date >= %2 AND cg.decision_date <= %3
$where
{$where}
GROUP BY cft.id
ORDER BY cft.name";
$result = CRM_Core_DAO::executeQuery($sql, $qParams);
while ($result->fetch()) {
$grantBudget[$result->id] = [
'id' => $result->id,
'name' => $result->name,
'budget' => $result->budget,
'total_amount_granted' => $result->total_amount_granted,
'balance_amount' => ($result->budget - $result->total_amount_granted),
'budget' => CRM_Utils_Money::format($result->budget),
'total_amount_granted' => CRM_Utils_Money::format($result->total_amount_granted),
'balance_amount' => CRM_Utils_Money::format(($result->budget - $result->total_amount_granted)),
];
}
return $grantBudget;