fixed civilint

This commit is contained in:
2018-08-12 05:13:25 +05:30
parent 61ae4f80ea
commit 133a71f70b
4 changed files with 28 additions and 18 deletions

View File

@ -2,12 +2,23 @@
class CRM_Grant_BAO_GrantBudget extends CRM_Grant_DAO_GrantBudget {
/**
* Build Fiscal year option list.
*
*/
public static function getFiscalyear() {
$from = date("Y", strtotime(date('Y') . ' - ' . GRANT_SCHOLARSHIP_YEAR_DIFF . ' years'));
$to = date("Y", strtotime(date('Y') . ' + ' . GRANT_SCHOLARSHIP_YEAR_DIFF . ' years'));
return array_combine(range($to, $from), range($to, $from));
}
/**
* Build Fiscal year option list.
*
* @param $params array
*
* @return array
*/
public static function getGrantBudget($params) {
$fiscalYear = $params['fiscal_year'];
if (empty($fiscalYear)) {
@ -21,7 +32,7 @@ class CRM_Grant_BAO_GrantBudget extends CRM_Grant_DAO_GrantBudget {
);
$config = CRM_Core_Config::singleton();
$mkTime = mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], $fiscalYear);
$mkTime = mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], $fiscalYear);
$fiscalStartDate = date('Y-m-d', $mkTime);
$fiscalEndDate = date('Y-m-d', strtotime($fiscalStartDate . '+ 1 year'));