Fiscal year change in Cost center

This commit is contained in:
gandhimathi Bharathirajan 2017-07-30 02:12:47 +05:30
parent ac969d3ca7
commit 15ce7862e7
2 changed files with 20 additions and 6 deletions

View File

@ -59,7 +59,9 @@ class CostCenter extends BaseController
$data['BudgetType'] = $this->costcenter_model->getConfigValue('C004');
$data['Approver'] = $this->costcenter_model->getApproverName();
$data['Approver'] = $this->costcenter_model->getApproverName();
$data['FiscalYear'] = $this->costcenter_model->getFiscalYear();
$this->global['pageTitle'] = 'siddharth : Add Cost Center';
@ -169,6 +171,7 @@ class CostCenter extends BaseController
$data['DeptList'] = $this->costcenter_model->GetDepartmentNotinCostCenter($CostCenterID);
$data['BudType'] = $this->costcenter_model->GetBudgetTypeNotinCostCenter($CostCenterID,'C004');
$data['BudYear'] = $this->costcenter_model->GetBudgetYear($CostCenterID);
$data['FiscalYear'] = $this->costcenter_model->getFiscalYear();
//print_r(count($data['BudType']));
$this->global['pageTitle'] = 'Siddharth : Edit Cost';

View File

@ -111,15 +111,26 @@ class servicepurchaseorder extends BaseController
function AvilBudgetAmount()
{
// echo 'Controller called';
$this->load->model('costcenter_model');
$CostCode = $this->input->post('id');
$ReqType = $_GET['ReqType'];
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$FYStart = '';
$FYEnd = '';
$FiscalYear = $this->costcenter_model->getFiscalYear();
if(!empty($FiscalYear))
{
foreach ($FiscalYear as $Fy)
{
$FYStart =$Fy->StartYear;
$FYEnd =$Fy->EndYear;
}
$Year = $dt->format('Y');
}
$FYdt = $FYStart." - ".$FYEnd ;
$this->load->model('purchaseorder_model');
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType);
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
//print_r($result);
$AvilBudAmt = '0';
if(count($result)>0)