Avl Bud Amt issue fixed
This commit is contained in:
parent
c20389e065
commit
0f5b870d64
@ -211,16 +211,32 @@ class requisitionform extends BaseController
|
|||||||
}
|
}
|
||||||
if(count($CostList) == 1)
|
if(count($CostList) == 1)
|
||||||
{
|
{
|
||||||
$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');
|
}
|
||||||
$CostCode = $CostList[0]['CostCenterCode'];
|
|
||||||
|
|
||||||
$Cost = $this->requistion_model->GetAvailableBudgetAmount( $CostCode,$Year,$ReqType);
|
$FYdt = $FYStart." - ".$FYEnd ;
|
||||||
if(count($Cost) >0)
|
$this->load->model('purchaseorder_model');
|
||||||
{
|
|
||||||
$BudAmount = $Cost[0]['BudgetAmount'];
|
$result = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
|
||||||
}
|
//print_r($result);
|
||||||
|
$AvilBudAmt = '0';
|
||||||
|
if(count($result)>0)
|
||||||
|
{
|
||||||
|
$BudAmount = $result[0]['BudgetAmount'] - $result[0]['Totalvalue'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
die(json_encode(array('emp' => $empDetails,'Cost' => $HTML,'AvlAmount' => $BudAmount)));
|
die(json_encode(array('emp' => $empDetails,'Cost' => $HTML,'AvlAmount' => $BudAmount)));
|
||||||
}
|
}
|
||||||
@ -229,11 +245,26 @@ class requisitionform extends BaseController
|
|||||||
{
|
{
|
||||||
$ReqType = $_GET['ReqType'];
|
$ReqType = $_GET['ReqType'];
|
||||||
$CostCode= $this->input->post('id');
|
$CostCode= $this->input->post('id');
|
||||||
$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');
|
||||||
|
|
||||||
$Cost = $this->requistion_model->GetAvailableBudgetAmount( $CostCode,$Year,$ReqType);
|
$Cost = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
|
||||||
|
|
||||||
|
|
||||||
|
//$Cost = $this->requistion_model->GetAvailableBudgetAmount( $CostCode,$Year,$ReqType);
|
||||||
|
|
||||||
die(json_encode(array('Cost' =>$Cost)));
|
die(json_encode(array('Cost' =>$Cost)));
|
||||||
}
|
}
|
||||||
@ -494,9 +525,20 @@ class requisitionform extends BaseController
|
|||||||
}
|
}
|
||||||
$CostCode = '';
|
$CostCode = '';
|
||||||
$ReqType = '';
|
$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 ;
|
||||||
if(count($ReqList)>0)
|
if(count($ReqList)>0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -505,7 +547,7 @@ class requisitionform extends BaseController
|
|||||||
$CostCode = $ReqList[0]['CostCenterCode'];
|
$CostCode = $ReqList[0]['CostCenterCode'];
|
||||||
}
|
}
|
||||||
$this->load->model('purchaseorder_model');
|
$this->load->model('purchaseorder_model');
|
||||||
$AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType);
|
$AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType);
|
||||||
//print_r($result);
|
//print_r($result);
|
||||||
$AvilBudAmt = '0';
|
$AvilBudAmt = '0';
|
||||||
if(count($AvlBudget)>0)
|
if(count($AvlBudget)>0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user