cost center

This commit is contained in:
venbatechnologies@gmail.com 2017-08-01 12:23:25 +05:30
parent 40a5564b11
commit c3e0195cf4
3 changed files with 15 additions and 4 deletions

View File

@ -104,6 +104,7 @@ class CostCenter extends BaseController
$CostName = strtoupper(trim($this->input->post('CostName')));
$CreateBy = $this->session->userdata ( 'userId' );
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
//echo $SelectedDepartment;
$ApproverName = $this->input->post('ApprovedBy');
$comma_separated = explode(':', $SelectedDepartment);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
@ -247,6 +248,8 @@ class CostCenter extends BaseController
$CostName = strtoupper(trim($this->input->post('CostName')));
$updatedBy = $this->session->userdata ( 'userId' );
$SelectedDepartment = $this->input->post('txtSelectedDepartment');
//echo $SelectedDepartment;
$ApproverName = $this->input->post('ApprovedBy');
$comma_separated = "";
//print_r(strlen($SelectedDepartment));
@ -254,6 +257,9 @@ class CostCenter extends BaseController
{
$comma_separated = explode(':', $SelectedDepartment);
}
//print_r($comma_separated);
//echo count($comma_separated);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$updateddt = $dt->format('Y-m-d H:i:s');
@ -267,8 +273,11 @@ class CostCenter extends BaseController
}
//echo count($comma_separated);
if(count($comma_separated)> 1)
if(count($comma_separated)> 0)
{
//echo "scs";
//die();
for ($j = 0; $j < count($comma_separated); $j++)
{
$DeptCode = $comma_separated[$j];
@ -276,6 +285,8 @@ class CostCenter extends BaseController
$this->costcenter_model->DeleteDepartment( $DeptCode,$CostCode);
$Dept = array('CostCenterCode'=>$CostCode, 'DEPCode'=>$DeptCode,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
//print_r($Dept);
$this->costcenter_model->addCostCenterDepartment($Dept);
}
@ -294,7 +305,7 @@ class CostCenter extends BaseController
$Budget = array('CostCenterCode'=>$CostCode, 'BudgetType'=>$BudgetType,'BudgetYear'=>$BudgetYear,'BudgetAmount'=>$BudgetAmount,'Remarks'=>$Remarks,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
$this->costcenter_model->addBudget($Budget);
print_r( $BudgetType );
//print_r( $BudgetType );
}
echo('Successfully Updated Cost details');

View File

@ -59,7 +59,7 @@ function addNewcost($Cost)
$insert_id = $this->db->affected_rows();
$this->db->trans_complete();
// print_r( $this->db->last_query());
// print_r( $this->db->last_query());
return $insert_id;
}

View File

@ -757,7 +757,7 @@ $('.tempClickEdit').click(function(){
if ($('#distriList option:selected').val() != null) {
var tempSelect = $('#distriList option:selected').val();
var tempText = $('#distriList option:selected').text();
//alert(tempSelect);
var o = new Option(tempText,tempSelect);
var hidval = tempSelect;
var orgVal = $('#txtSelectedDepartment').val();