implement the is_reserved lock

This commit is contained in:
2019-08-19 18:59:03 -04:00
parent 4cf1c728e1
commit 87888691dc
2 changed files with 14 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class CRM_AnnualGrantBudgets_BAO_GrantBudget extends CRM_AnnualGrantBudgets_DAO_
$grantBudgetTableName = CRM_AnnualGrantBudgets_DAO_GrantBudget::getTableName();
$sql = "SELECT cgb.id, cft.name, IFNULL(cgb.budget, 0) AS budget,
SUM(CASE WHEN cg.id IS NULL THEN 0 ELSE IFNULL(trxn.total_amount, 0) END) as total_amount_granted,
cft.id AS financial_type_id
cft.id AS financial_type_id, cgb.note, cgb.is_reserved
FROM civicrm_financial_type cft
INNER JOIN " . GRANT_SCHOLARSHIP_CUSTOM_TABLE_NAME . " gs
ON gs.entity_id = cft.id
@ -85,6 +85,8 @@ class CRM_AnnualGrantBudgets_BAO_GrantBudget extends CRM_AnnualGrantBudgets_DAO_
'total_amount_granted' => CRM_Utils_Money::format($result->total_amount_granted),
'balance_amount' => CRM_Utils_Money::format(($result->budget - $result->total_amount_granted)),
'financial_type_id' => $result->financial_type_id,
'note' => $result->note,
'is_reserved' => $result->is_reserved,
];
if ($returnTotals) {
$totals['budget'] += $result->budget;