diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 5dc43d28..6817d990 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -61,19 +61,12 @@ $routes->post('materialExist','Rawmaterialdetails::checkmaterial');
$routes->get('viewRawmaterial','Rawmaterialdetails::viewRawmaterial');
$routes->post('rawmaterialdetails/editRawmaterial', 'Rawmaterialdetails::editRawmaterial');
$routes->get('exportmaterial' , 'Rawmaterialdetails::exportmaterial');
+$routes->get('rawmaterialdetailsautocomplete' , 'Rawmaterialdetails::autocomplete');
// Cost Center Routes
$routes->get('costListing', 'CostCenter::index');
-$routes->get('addCostCenter', 'CostCenter::addCostCenter');
-$routes->get('editCostCenter', 'CostCenter::editCostCenter');
+$routes->get('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit....
$routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter');
-$routes->post('saveCostCenter', 'CostCenter::saveCostCenter');
-$routes->post('updateCostCenter', 'CostCenter::updateCostCenter');
-$routes->post('CostCenter/AddCostDepartment','CostCenter::AddCostDepartment');
-$routes->post('CostCenter/DeleteCostDepartment','CostCenter::DeleteCostDepartment');
-
-$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'CostCenter/GetBudgetForYear','CostCenter::GetBudgetForYear');
-$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'deletecost', 'CostCenter::deletecost');
$routes->get('exportcost', 'CostCenter::exportcost');
// Asset Detail Routes
diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php
index 42e5eb68..11d25da1 100644
--- a/app/Controllers/CostCenter.php
+++ b/app/Controllers/CostCenter.php
@@ -52,122 +52,47 @@ class CostCenter extends BaseController
}
/**
- * This function is used to load the add new cost Center */
- function addCostCenter()
- {
-
- $data['Department'] = $this->costcenter_model->getDepartment();
-
- $data['BudgetType'] = $this->costcenter_model->getConfigValue('C004');
-
- $data['Approver'] = $this->costcenter_model->getApproverName();
-
- $data['FiscalYear'] = $this->costcenter_model->getFiscalYear();
-
- $this->global['pageTitle'] = 'Add Cost Center';
-
- $this->loadViews("addCostCenter", $this->global, $data, NULL);
- }
-
- function Dep_SelectedDepartment($selectValue)
- {
- //echo 'select_validate method called';
- // 'none' is the first option and the text says something like "-Choose one-"
- if (strlen($selectValue) <= 0) {
- // $this->validator->setMessage('Dep_SelectedDepartment', 'Please Select Department.');
- return false;
- } else // user picked something
- {
- return true;
- }
- }
-
- /**
- * This function is used to add new Cost to the system
+ * This function is used to add/edit Cost
*/
- function saveCostCenter()
- {
- // $this->validator->setRules([
- // 'CostName' => 'trim|required',
- // 'CostCode' => 'trim|required',
- // ]);
-
- // if ($this->validator->run() == FALSE) {
- // $this->addCostCenter();
- // } else {
+ public function fetchCostCenterDetails() {
+ $id = $this->request->getPost('id');
+ $CostCenterName = $this->request->getPost('CostCenterName');
+ $CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
+ $userId = $this->session->get('userId');
+ $approverId = $this->session->get('EmpID');
+ $currentdt = get_current_date_time();
+
+ $data = ['status' => false, 'message' => 'An error occurred while creating cost details'];
+
+ if ($id == 0) {
+ $lastccid = $this->costcenter_model->lastCCID();
+ $lastccid = (int)$lastccid++;
+ $newccc = generateCostCenterCode($lastccid);
+ log_message('debug', 'newccc returned: ' . $newccc);
- $CostCode = $this->request->getPost('CostCode');
- $CostCode = ($CostCode !== null && is_string($CostCode)) ? strtoupper(trim($CostCode)) :null;
- $CostName = $this->request->getPost('CostName');
- $CostName = ($CostName !== null && is_string($CostName)) ? strtoupper(trim($CostName)) :null;
- $CreateBy = $this->session->get('userId');
- $SelectedDepartment = $this->request->getPost('txtSelectedDepartment');
-
- // $ApproverName = $this->request->getPost('ApprovedBy');
- $ApproverName = $this->session->get('EmpID');
- $comma_separated = explode(':', (string)$SelectedDepartment);
- // $comma_separated = $this->costcenter_model->getDepartment();
- // print_r($comma_separated);die;
-
- $createddt = get_current_date_time();
- $CodeExists = $this->costcenter_model->checkCostDetailsExists($CostCode);
- if (count($CodeExists) == 0) {
- $Cost = array('CostCenterCode' => $CostCode, 'CostCenterName' => $CostName, 'ApprovedBy' => $ApproverName, 'CreatedBy' => $CreateBy, 'createdDate' => $createddt);
- $this->costcenter_model->saveCostCenter($Cost);
+ $Cost = ['CostCenterCode' => $newccc,
+ 'CostCenterName' => $CostCenterName,
+ 'ApprovedBy' => $approverId,
+ 'CreatedBy' => $userId,
+ 'CreatedDate' => $currentdt
+ ];
+ if ($this->costcenter_model->saveCostCenter($Cost) > 0) {
+ $data = ['status' => true, 'message' => 'Successfully created cost details'];
}
- for ($j = 0; $j < count($comma_separated); $j++) {
- $DeptCode = $comma_separated[$j];
-
- $this->costcenter_model->DeleteDepartment($DeptCode, $CostCode);
-
- $Dept = array('CostCenterCode' => $CostCode, 'DEPCode' => $DeptCode, 'CreatedBy' => $CreateBy, 'createdDate' => $createddt);
- $this->costcenter_model->addCostCenterDepartment($Dept);
- }
- $RowCount = $this->request->getPost('txtRowCount');
-
- for ($i = 1; $i <= $RowCount; $i++) {
- $BudgetType = $this->request->getPost('BudgetType' . $i);
- $BudgetYear = $this->request->getPost('BudgetYear' . $i);
- $BudgetAmount = $this->request->getPost('BudgetAmount' . $i);
- $Remarks = $this->request->getPost('Remarks' . $i);
- $this->costcenter_model->DeleteBudget($BudgetType, $BudgetYear, $CostCode);
-
- $Budget = array('CostCenterCode' => $CostCode, 'BudgetType' => $BudgetType, 'BudgetYear' => $BudgetYear, 'BudgetAmount' => $BudgetAmount, 'Remarks' => $Remarks, 'CreatedBy' => $CreateBy, 'createdDate' => $createddt);
- $this->costcenter_model->addBudget($Budget);
- }
- echo 'Successfully Created Cost details';
- // }
- }
- /**
- * This function is used load user edit information
- * @param number $userId : Optional : This is user id
- */
- function editCostCenter($CostCode = NULL)
- {
-
- if ($CostCode == '') {
- $CostCenterID = $_GET['CostCode'];
} else {
-
- $CostCenterID = $CostCode;
+ $Cost = ['CostCenterName' => $CostCenterName,'UpdatedBy' => $userId,'UpdatedDate' => $currentdt];
+ if ($this->costcenter_model->updateCostCenter($Cost, $id) > 0) {
+ $data = ['status' => true, 'message' => 'Successfully updated cost details'];
+ }
}
-
- $data['CostMaster'] = $this->costcenter_model->GetCostCenterMaster($CostCenterID);
- $data['CostDepts'] = $this->costcenter_model->GetCostCenterDepartment($CostCenterID);
- $data['CostBudget'] = $this->costcenter_model->GetCostCenterBudget($CostCenterID);
- $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'] = 'Edit Cost';
-
-
-
- $this->loadViews("editCostCenter", $this->global, $data, NULL);
+
+ return $this->response->setJSON($data);
}
-
+
+
+ /**
+ * delete the Cost
+ */
function deleteCostCenter($CostCode = NULL)
{
@@ -183,246 +108,9 @@ class CostCenter extends BaseController
}
- function GetBudgetForYear()
- {
-
- //$id = $this->request->getPost('id');
- $BudYear = $_GET['BudYear'];
- $CostCenterID = $_GET['CostCode'];
- $result = $this->costcenter_model->GetCostCenterBudgetByYear($CostCenterID, $BudYear);
- $BudList = $this->costcenter_model->GetCostBudgetTypeByYear($CostCenterID, 'C004', $BudYear);
-
- $HTML = "";
- $HTML2 = "";
- $index = 0;
- // $HTML2 = $BudList[0]['ConfigValue'];
- //if($BudList->num_rows() > 0){
- for ($j = 0; $j < count($BudList); $j++) {
- $ConfigValue = $BudList[$j]['ConfigValue'];
- $HTML2 .= "";
- }
-
- for ($i = 0; $i < count($result); $i++) {
- $index = $index + 1;
- $BudgetType = $result[$i]['BudgetType'];
- $BudgetYear = $result[$i]['BudgetYear'];
- $BudgetAmount = $result[$i]['BudgetAmount'];
- $Remarks = $result[$i]['Remarks'];
- $HTML .= "
- | " . $BudgetType . " |
-
-
-
-
-
- " . $BudgetYear . " |
-
- " . $BudgetAmount . " |
-
- " . $Remarks . " |
-
- |
- ";
- }
- $HTML .= "";
- die(json_encode(array('Html' => $HTML, 'BudYear' => $HTML2)));
- // echo $HTML2;
- }
-
/**
- * This function is used to edit the user information
+ * export the Cost
*/
- function updateCostCenter()
- {
-
- $CostCode = $this->request->getPost('CostCode');
- $CostCode = ($CostCode !== null && is_string($CostCode)) ? strtoupper(trim($CostCode)) :null;
- $CostName = $this->request->getPost('CostName');
- $CostName = ($CostName !== null && is_string($CostName)) ? strtoupper(trim($CostName)) :null;
- $updatedBy = $this->session->get('userId');
-
- $SelectedDepartment = (string)$this->request->getPost('txtSelectedDepartment');
-
- // $ApproverName = $this->request->getPost('ApprovedBy');
- // $ApproverName = $this->session->get('EmpID');
- $ApproverName = NULL;
-
-
- $comma_separated = [];
- print_r(strlen($SelectedDepartment));
- if(strlen($SelectedDepartment)>0)
- {
-
- $comma_separated = explode(':', $SelectedDepartment);
- }
-
- $updateddt = get_current_date_time();
-
- $Cost = array( 'CostCenterName'=>$CostName,'ApprovedBy'=>$ApproverName,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
- $this->costcenter_model->EditCost($Cost,$CostCode);
-
-
- if(count($comma_separated)>= 1)
- {
- for ($j = 0; $j < count($comma_separated); $j++)
- {
- // $DeptCode = $comma_separated[$j];
- // $this->costcenter_model->DeleteDepartment( $DeptCode,$CostCode);
- // $Dept = array('CostCenterCode'=>$CostCode, 'DEPCode'=>$DeptCode,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
- // $this->costcenter_model->addCostCenterDepartment($Dept);
- }
- }
-
- $RowCount = $this->request->getPost('txtRowCount');
-
- if($RowCount){
- for ($i = 1; $i <= $RowCount; $i++)
- {
- $BudgetType = $this->request->getPost('BudgetType'.$i);
- $BudgetYear = $this->request->getPost('BudgetYear'.$i);
- $BudgetAmount = $this->request->getPost('BudgetAmount'.$i);
- $Remarks = $this->request->getPost('Remarks'.$i);
- // $this->costcenter_model->DeleteBudget($BudgetType,$BudgetYear,$CostCode);
-
- $Budget = array('CostCenterCode'=>$CostCode, 'BudgetType'=>$BudgetType,'BudgetYear'=>$BudgetYear,'BudgetAmount'=>$BudgetAmount,'Remarks'=>$Remarks,'CreatedBy'=>$updatedBy,'createdDate'=>$updateddt,'UpdatedBy'=>$updatedBy,'UpdatedDate'=>$updateddt);
- $ExistYearBudget = $this->costcenter_model->CheckExistBudget($BudgetType,$BudgetYear,$CostCode);
-
- // print_r($Budget);
- if($ExistYearBudget){
- $this->costcenter_model->updateBudget($Budget,$BudgetType,$BudgetYear,$CostCode);
- }
- else{
- $this->costcenter_model->addBudget($Budget);
- }
- }
- }
- echo('Successfully Updated Cost details');
- }
-
- function DeleteCostDepartment()
- {
- // echo "dasf";
- // die();
- $CostCode = $this->request->getPost('CostCode');
- $CostCode = ($CostCode !== null && is_string($CostCode)) ? strtoupper(trim($CostCode)) :null;
- $CostName = $this->request->getPost('CostName');
- $CostName = ($CostName !== null && is_string($CostName)) ? strtoupper(trim($CostName)) :null;
- $updatedBy = $this->session->get('userId');
- $SelectedDepartment = $this->request->getPost('txtSelectedDepartment');
- $this->costcenter_model->DeleteDepartment($SelectedDepartment, $CostCode);
- echo ("Department Removed Successfully");
- }
-
-
- function AddCostDepartment()
- {
- $CostCode = $this->request->getPost('CostCode');
- $CostCode = ($CostCode !== null && is_string($CostCode)) ? strtoupper(trim($CostCode)) :null;
- $CostName = $this->request->getPost('CostName');
- $CostName = ($CostName !== null && is_string($CostName)) ? strtoupper(trim($CostName)) :null;
- $updatedBy = $this->session->get('userId');
- $SelectedDepartment = $this->request->getPost('txtSelectedDepartment');
- // $updatedBy = $this->session->get ( 'userId' );
-
- $updateddt = get_current_date_time();
-
- $Dept = array('CostCenterCode' => $CostCode, 'DEPCode' => $SelectedDepartment, 'CreatedBy' => $updatedBy, 'createdDate' => $updateddt, 'UpdatedBy' => $updatedBy, 'UpdatedDate' => $updateddt);
- $this->costcenter_model->addCostCenterDepartment($Dept);
- echo ("Department Added Successfully");
- }
-
-
- // function AddCostDepartment()
- // {
- // // echo "343";
- // // die();
- // $CostCode = strtoupper(trim($this->request->getPost('CostCode')));
- // $CostName = strtoupper(trim($this->request->getPost('CostName')));
- // $updatedBy = $this->session->get ( 'userId' );
- // $SelectedDepartment = $this->request->getPost('txtSelectedDepartment');
- // //echo $SelectedDepartment;
- // //die();
-
- // $ApproverName = $this->request->getPost('ApprovedBy');
- // $comma_separated = "";
- // //print_r(strlen($SelectedDepartment));
- // if(strlen($SelectedDepartment)>0)
- // {
-
- // $comma_separated = explode(':', $SelectedDepartment);
- // }
-
- // //die();
- // //echo count($comma_separated);
-
-
- // $updateddt = get_current_date_time();
-
-
- // if(count($comma_separated)>= 1)
- // {
-
-
- // for ($j = 0; $j < count($comma_separated); $j++)
- // {
- // $DeptCode = $comma_separated[$j];
-
- // $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);
-
- // }
- // echo "Updated";
- // }
-
-
-
- // }
-
-
- function viewcost($CostCenterID = NULL)
- {
-
- if ($CostCenterID == null) {
- redirect('costListing');
- }
-
- $data['Cost'] = $this->costcenter_model->getuserinfo($CostCenterID);
- //$data['users'] = $this->purchaseorder_model->getusers();
-
- $this->global['pageTitle'] = 'View Cost';
-
- $this->loadViews("viewcost", $this->global, $data, NULL);
- }
-
- /**
- * This function is used to delete the user using userId
- * @return boolean $result : TRUE / FALSE
- */
- function deletecost()
- {
- // if($this->isAdmin() == TRUE)
- // {
- // echo(json_encode(array('status'=>'access')));
- // }
- // else
- // {
- $CostCenterID = $this->request->getPost('CostCentreID');
- $cost = array('CreateDate' => date('Y-m-d H:i:sa'));
-
- $result = $this->costcenter_model->deletecost($cost, $CostCenterID);
-
- if ($result > 0) {
- echo (json_encode(array('status' => TRUE)));
- } else {
- echo (json_encode(array('status' => FALSE)));
- }
- //}
- }
-
function exportcost()
{
diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php
index bc976f12..1a1829f5 100644
--- a/app/Controllers/Rawmaterialdetails.php
+++ b/app/Controllers/Rawmaterialdetails.php
@@ -237,6 +237,7 @@ class Rawmaterialdetails extends BaseController
}
$data['materialDetails'] = $this->rawmaterialdetails_model->getMaterialDetails($RawMaterialID);
+ $data['material'] = $this->rawmaterialdetails_model->getmaterialType();
$data['currentstock'] = $this->rawmaterialdetails_model->getMaterialstock($RawMaterialID, $currentdate);
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType);
$data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory);
diff --git a/app/Helpers/cias_helper.php b/app/Helpers/cias_helper.php
index 0df54a71..c48c5d5c 100755
--- a/app/Helpers/cias_helper.php
+++ b/app/Helpers/cias_helper.php
@@ -130,4 +130,20 @@ if (!function_exists('trans')) {
return $lang_string;
}
-}
\ No newline at end of file
+}
+
+
+if (!function_exists('generateCostCenterCode')) {
+ function generateCostCenterCode($id)
+ {
+ if ($id < 10) {
+ $CostCenterCode = 'C00' . $id;
+ } elseif ($id < 100) {
+ $CostCenterCode = 'C0' . $id;
+ } else {
+ $CostCenterCode = 'C' . $id;
+ }
+
+ return $CostCenterCode;
+ }
+}
diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php
index c60f316e..3541c4aa 100644
--- a/app/Models/Costcenter_model.php
+++ b/app/Models/Costcenter_model.php
@@ -16,7 +16,7 @@ class Costcenter_model extends Model
function CostListing()
{
$builder = $this->db->table('t_costcenter_master as Cost')
- ->select('Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy')
+ ->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy')
->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy');
@@ -30,21 +30,29 @@ class Costcenter_model extends Model
* This function used to get user information by id
* @param number $userId : This is user id
* @return array $result : This is user information
- */
-
-function saveCostCenter($Cost)
- {
+ */
+ public function saveCostCenter($Cost) {
$this->db->transStart();
$builder = $this->db->table('t_costcenter_master');
- $builder->insert($Cost);
-
- $insert_id = $this->db->affectedRows();
-
- $this->db->transComplete();
-
- return $insert_id;
+ $builder->insert($Cost);
+ $aff_row = $this->db->affectedRows();
+ $this->db->transComplete();
+ return $aff_row;
}
+ public function updateCostCenter($Cost, $id) {
+ $this->db->table('t_costcenter_master')
+ ->where('id', $id)
+ ->update($Cost);
+ $aff_row = $this->db->affectedRows();
+ return $aff_row;
+ }
+ public function lastCCID(){
+ $query = $this->db->table('t_costcenter_master')->select('id')->orderBy('id', 'DESC')->limit(1)->get();
+ $lastCCID = $query->getRow()->id;
+ return $lastCCID;
+ }
+
function getFiscalYear()
{
$builder = $this->db->table('t_company_details')
@@ -54,44 +62,6 @@ function saveCostCenter($Cost)
return $query->getResult();
}
- function addCostCenterDepartment($Dept)
- {
- $this->db->transStart();
- $builder = $this->db->table('t_costcenter_departments');
- $builder->insert($Dept);
-
- $insert_id = $this->db->affectedRows();
-
- $this->db->transComplete();
-
- return $insert_id;
- }
-
-
- function addBudget($Budget)
- {
- $this->db->transStart();
- $builder = $this->db->table('t_costcenter_budget');
- $builder->insert($Budget);
-
- $insert_id = $this->db->affectedRows();
-
- $this->db->transComplete();
-
- return $insert_id;
- }
-
- function getApproverName()
- {
- $builder = $this->db->table('t_employee_details')
- ->select('EmpID,FirstName,LastName,Designation')
- ->where('Departmentcode ', 'DEP10');
-
- $query =$builder->get();
-
- return $query->getResult();
- }
-
/**
* This function used to get user information by id
* @param number $userId : This is user id
@@ -337,19 +307,7 @@ where Dept.DEPCode not in
}
}
- /* *//**
- * This function is used to get the Department details from t_departmentdetails
- * @return array $result : This is result of the query
- */
- function getDepartment()
- {
- $builder = $this->db->table('t_departmentdetails')
- ->select('DEPCode, DepartmentName')
- ->where('IsActive =', 1);
- $query =$builder->get();
-
- return $query->getResult();
- }
+
/**
* This function is used to get the Config value from configuration table
* @return array $result : This is result of the query
diff --git a/app/Views/addCostCenter.php b/app/Views/addCostCenter.php
deleted file mode 100644
index e4ce4ccf..00000000
--- a/app/Views/addCostCenter.php
+++ /dev/null
@@ -1,871 +0,0 @@
-
-'Select Budget Year');
-if(!empty($FiscalYear))
-{
- foreach ($FiscalYear as $Fy)
- {
- $FYStart =$Fy->StartYear;
- $FYEnd =$Fy->EndYear;
- }
- //$FYear = $FYStart." - ".$FYEnd ;
-
-}
-
-for($i=1;$i<5;$i++)
-{
-
- $FYear = $FYStart." - ".$FYEnd ;
- $opt[$FYear] = $FYear;
- $FYStart++;
- $FYEnd++;
-}
-//print_r($opt);
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'form-label-left addCost ','name' => 'addCost','id' => 'addCost');
-
- echo form_open(base_url().'saveCostCenter/',$attributes); ?>
-
-
-
-
-
-
-
-
-
-
- 'Select Department');
- //print_r( $options);
-
- if(!empty($Department))
- {
- foreach ($Department as $SID):
-
-
- $options[$SID->DEPCode] = $SID->DEPCode.' '.' - '.' '.$SID->DepartmentName;
-
- endforeach;
- }
- echo form_multiselect('distriList', $options,set_value('distriList',$options),'id="distriList"' ,'class="form-control required"','required="true"');
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'Select Approver');
- //print_r( $options);
-
- if(!empty($Approver))
- {
- foreach ($Approver as $SID):
-
-
- $options[$SID->EmpID] = $SID->EmpID . " - " . $SID->FirstName . " - " . $SID->Designation;
-
- endforeach;
- }
-
- // echo form_dropdown('ApprovedBy',$options,set_value('ApprovedBy'),'id="ApprovedBy"', 'class = "form-control "'); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | Budget Type |
- Budget Year |
-
- Remarks |
- Action |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getFlashdata('error');
- if($error)
- {
- ?>
-
-
- getFlashdata('error'); ?>
-
-
- getFlashdata('success');
- if($success)
- {
- ?>
-
-
- getFlashdata('success'); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Views/addRawMaterial.php b/app/Views/addRawMaterial.php
index e94c8e3f..0a57f7f3 100644
--- a/app/Views/addRawMaterial.php
+++ b/app/Views/addRawMaterial.php
@@ -196,7 +196,7 @@
$('#MatCate').autocomplete("option", "minLength", 0);
},
- serviceUrl: "rawmaterialdetails/autocomplete",
+ serviceUrl: "rawmaterialdetailsautocomplete",
onSelect: function(suggestion) {
var data = suggestion.ConfigValue;
diff --git a/app/Views/costListing.php b/app/Views/costListing.php
index 48b82049..a9aabba5 100644
--- a/app/Views/costListing.php
+++ b/app/Views/costListing.php
@@ -1,98 +1,190 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
- | Cost Center Code |
- Cost Center Name |
- Created By |
- Create Date |
- Active |
- Action |
-
-
-
-
-
- | code ?> |
- CostCenterName ?> |
-
- FirstName ?> |
- CreatedDate);
- echo $date->format('d-m-Y'); ?> |
-
- IsActive == 1?$R='ACTIVE':$R='INACTIVE';
- echo $R;
- ?> |
-
- DeletedBy == ''){
- ?>
-
-
+
+
+
+
+
+
+
+
+ | Create Date |
+ Create Time |
+ Cost Center Code |
+ Cost Center Name |
+ Created By |
+ Active |
+ Action |
+
+
+
+ code; ?>"> -->
-
-
-
- CreatedDate);
+ $date = $createdat->format('d-m-Y');
+ $time = $createdat->format('h:i A');
+ ?>
+
+ |
+ |
+ code ?> |
+ CostCenterName ?> |
+
+ FirstName ?> |
+ IsActive == 1 ? $R = 'ACTIVE' : $R = 'INACTIVE';
+ echo $R;
+ ?> |
+
+ DeletedBy == '') {
+ ?>
+
+
+
+ |
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ ?>
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/Views/editCostCenter.php b/app/Views/editCostCenter.php
deleted file mode 100644
index a314ed39..00000000
--- a/app/Views/editCostCenter.php
+++ /dev/null
@@ -1,1016 +0,0 @@
-BudgetType;
- //print_r($BudgetTypeAdd);
-}
-
-//print_r($BudgetTypeAdd);
-
-if (!empty($CostMaster)) {
- foreach ($CostMaster as $Cost) {
-
- $CostCenterCode = $Cost->CostCenterCode;
-
- $CostCenterName = $Cost->CostCenterName;
- $ApprovedBy = $Cost->ApprovedBy;
- //echo $ApprovedBy;
- $FirstName = $Cost->FirstName;
- $Designation = $Cost->Designation;
- $BudYr = $Cost->BudYear;;
- }
-}
-$optYear = array($BudYr => $BudYr);
-if (!empty($FiscalYear)) {
- foreach ($FiscalYear as $Fy) {
- $FYStart = $Fy->StartYear;
- $FYEnd = $Fy->EndYear;
- }
- //$FYear = $FYStart." - ".$FYEnd ;
-
-}
-
-for ($i = 1; $i < 5; $i++) {
-
- $FYear = $FYStart . " - " . $FYEnd;
- $optYear[$FYear] = $FYear;
- $FYStart++;
- $FYEnd++;
-}
-
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'form-label-left EditCost ', 'name' => 'EditCost', 'id' => 'EditCost');
-
- echo form_open(base_url() . 'saveCostCenter/', $attributes); ?>
-
-
-
-
-
-
-
-
-
-
-
*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 'Select Department');
- //print_r( $options);
-
- if (!empty($DeptList)) {
- foreach ($DeptList as $SID) :
-
- $opt[$SID->DEPCode] = $SID->DEPCode . ' ' . ' - ' . ' ' . $SID->DepartmentName;
-
- endforeach;
- }
- echo form_multiselect('distriList', $opt, set_value('distriList',$opt), 'id="distriList"', 'class="form-control required"', 'required="true"');
-
- ?>
-
-
-
-
-
-
- DEPCode] = $SID->DEPCode . ' ' . ' - ' . ' ' . $SID->DepartmentName;
-
- endforeach;
- }
- echo form_multiselect('selectDistriList[]', $options, set_value('selectDistriList[]',$options), 'id="selectDistriList"', 'size="10"');
-
- ?>
-
-
-
-
-
- IsApproved
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | Budget Type |
- Budget Year |
-
- Remarks |
- Action |
-
-
- BudgetType;
- // print_r($BudgetTypeAdd);
- ?>
-
-
- | BudgetType ?> |
-
-
-
-
-
- BudgetYear ?> |
-
- BudgetAmount ?> |
-
- Remarks ?> |
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php
index b3099f87..1286a25c 100644
--- a/app/Views/editRawmaterial.php
+++ b/app/Views/editRawmaterial.php
@@ -142,12 +142,30 @@ if ($total <= $reorder) {
-
-
+
+
+
+
+ *
+
+
@@ -310,6 +328,7 @@ if ($total <= $reorder) {
$("#UOM").select2();
+ $("#MaterialType").select2();
/** ---- auto search code -------- */
$('#MaterialCategory').autocomplete({
@@ -318,7 +337,7 @@ if ($total <= $reorder) {
$('#MaterialCategory').autocomplete("option", "minLength", 0);
},
- serviceUrl: "rawmaterialdetails/autocomplete",
+ serviceUrl: "rawmaterialdetailsautocomplete",
onSelect: function(suggestion) {
var data = suggestion.ConfigValue;