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

View File

@ -111,15 +111,26 @@ class servicepurchaseorder extends BaseController
function AvilBudgetAmount() function AvilBudgetAmount()
{ {
// echo 'Controller called'; // echo 'Controller called';
$this->load->model('costcenter_model');
$CostCode = $this->input->post('id'); $CostCode = $this->input->post('id');
$ReqType = $_GET['ReqType']; $ReqType = $_GET['ReqType'];
$FYStart = '';
$FYEnd = '';
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $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'); $this->load->model('purchaseorder_model');
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType);
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
//print_r($result); //print_r($result);
$AvilBudAmt = '0'; $AvilBudAmt = '0';
if(count($result)>0) if(count($result)>0)