Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
monishdeb committed Jul 16, 2018
1 parent a9ba00c commit 38648e7
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions CRM/Grant/Form/Grant/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -581,22 +581,16 @@ static function processApplication(&$form,
$params['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Grant_BAO_Grant', 'status_id', 'Draft');
}
else {
$grantParams['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Grant_BAO_Grant', 'status_id', 'Submitted');
}
if (CRM_Utils_Array::value('grant_id', $params)) {
$grantParams['id'] = $params['grant_id'];
}
if (CRM_Utils_Array::value('grant_note', $params)) {
$grantParams['note'] = $params['grant_note'];
}
if (!$online && isset($params['thankyou_date'])) {
$grantParams['thankyou_date'] = $params['thankyou_date'];
$params['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Grant_BAO_Grant', 'status_id', 'Submitted');
}
$ids = array();
if (!empty($params['grant_id'])) {
$params['id'] = $params['grant_id'];
$ids['grant_id'] = $params['grant_id'];
}
else {
unset($params['grant_id']);
}

$params['amount_requested'] = trim(CRM_Utils_Money::format($nonDeductibleAmount, ' '));
if (empty($params['amount_total'])) {
Expand All @@ -605,7 +599,7 @@ static function processApplication(&$form,

if ($nonDeductibleAmount || $isDraft) {
//add grant record
$grant = CRM_Grant_BAO_Grant::create($grantParams, $ids);
$grant = CRM_Grant_BAO_Grant::add($params, $ids);
}
if ($grant) {
CRM_Core_BAO_CustomValueTable::postProcess($form->_params,
Expand Down

0 comments on commit 38648e7

Please sign in to comment.