diff --git a/app/Config/Routes.php b/app/Config/Routes.php index be11d5aa..c794b782 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -124,6 +124,7 @@ $routes->get('employeedetails/ViewEmployee', 'Employeedetails::ViewEmployee'); $routes->get('employeedetails/downloadEmployeeDetails', 'Employeedetails::downloadEmployeeDetails'); $routes->post('employeedetails/UpdateEmployee', 'Employeedetails::UpdateEmployee'); $routes->get('exportemployee', 'Employeedetails::exportemployee'); +$routes->post('employeeHistory', 'Employeedetails::employeeHistory'); $routes->post('employeeEmailExist', 'Employeedetails::CheckEmail'); @@ -199,6 +200,7 @@ $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday $routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm'); $routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm'); $routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm'); +$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1'); $routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails'); $routes->get('emppaydate/addemppaydate', 'Emppaydate::addemppaydate'); diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index ef53544e..8847a3f7 100755 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -64,6 +64,12 @@ class Employeedetails extends BaseController $this->loadViews("employeeListing", $this->global, $data, NULL); } + function employeeHistory() + { + $Emp = $this->request->getPost('emp'); + $result = $this->employeedetails_model->employeeHistory($Emp); + return $this->response->setJSON($result); + } /* Validation for Gender status Dropdown */ @@ -757,7 +763,7 @@ class Employeedetails extends BaseController $ValidTill = $this->request->getPost('ValidTill'); $addinfo = $this->request->getPost('addinfo'); $driverlicense = $this->request->getPost('driverlicense'); - + $reason = $this->request->getPost('reason'); // dd($driverlicense); @@ -851,7 +857,8 @@ class Employeedetails extends BaseController 'is_driver' => $is_driver, 'esi_applicable' => $esi_applicable, 'pf_applicable' => $pf_applicable, - 'work_location' => $work_location + 'work_location' => $work_location, + 'reason' => $reason ); //print_r($Employee);die(); $result = $this->employeedetails_model->UpdateEmployee($Employee, $EmpId); diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index cbc05ff5..b25cd126 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -990,6 +990,22 @@ class Monthlypay extends BaseController } + public function leaveApplicationPDF($leave_application_id){ + + + $data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm($leave_application_id); + $data['company_info'] = $this->monthlypay_model->getCompanyInformation(); + + $html = view('leaveApplicationPDF', $data); + // echo $html;die; + $mpdf = new Mpdf(); + $mpdf->WriteHTML($html); + + $fName = $data['leave_info'][0]['emp_id'].'-LeaveApplicationForm.pdf'; + return $mpdf->Output($fName, "D"); + + } + public function overTimeDetails() { $current = $this->request->getPost('monthyear') ? $this->request->getPost('monthyear') :date("m-Y"); diff --git a/app/Controllers/User.php b/app/Controllers/User.php index 170fa718..2cc02934 100755 --- a/app/Controllers/User.php +++ b/app/Controllers/User.php @@ -938,7 +938,7 @@ class User extends BaseController // { $data['EmpList'] = $this->user_model->rolesNotAllotedEmployees(); $data['roles'] = $this->user_model->getUserRoles(); - $data['Department'] = json_decode(json_encode($this->department_model->departmentListing()), true); + $data['Department'] = json_decode(json_encode($this->department_model->departmentListing(1)), true); // echo "
";
         // print_r($data['Department']);
diff --git a/app/Models/Employeedetails_model.php b/app/Models/Employeedetails_model.php
index 46dac337..2ad3d0e7 100755
--- a/app/Models/Employeedetails_model.php
+++ b/app/Models/Employeedetails_model.php
@@ -27,6 +27,18 @@ class Employeedetails_model extends Model
         return $result;
     }
 
+    public function employeeHistory($emp)
+    {
+        $builder = $this->db->table('t_employee_history as h')
+        ->select('h.old_value,h.new_value,h.column_name,DATE_FORMAT(h.created_at, "%d-%m-%Y") AS indian_date, DATE_FORMAT(h.created_at, "%h:%i:%s %p") AS indian_time, CONCAT_WS(" ", ed.FirstName, ed.LastName) AS updater_name')
+        ->join('tbl_users as u', 'u.userId = h.updated_by', 'left')
+        ->join('t_employee_details as ed', 'ed on u.EmpID = ed.EmpID', 'left')
+        ->where('h.empcode ', $emp)
+        ->orderBy('h.created_at', 'asc');		
+        $query = $builder->get();
+        $result = $query->getResult();
+		return $result;
+    }
 
     function getUserRoles()
     {
diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php
index 50f42d6c..db7f7cb7 100755
--- a/app/Models/Monthlypay_model.php
+++ b/app/Models/Monthlypay_model.php
@@ -518,30 +518,46 @@ where Month_Year = ? and att.EmpID in (select EmpID  from t_attendance)";
 		$query = $this->db->query($sql);
 		return $query->getResult();
 	}
-	public function getheringleaveApplicationForm(){
-		$sql = "select leavetable.* ,Dep.DepartmentName as department,Emp.Designation as designation,
-		CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS employeeFullName ,
-		CONCAT_WS(' ', Emp2.FirstName, Emp2.LastName) AS creatorFullName
-		from t_employee_leave_application_form  as leavetable
-		left join tbl_users as user on user.userId =  leavetable.created_by
-		left join t_employee_details as Emp2 on Emp2.EmpID = user.EmpID
-		left join t_employee_details as Emp on Emp.EmpID = leavetable.emp_id
-		left join t_departmentdetails as Dep on Emp.Departmentcode = Dep.DEPCode
-		where leavetable.isactive = 1";
-		$query = $this->db->query($sql);
+	public function getheringleaveApplicationForm($leave_id = null ){
+
+		$builder = $this->db->table("t_employee_leave_application_form  as leavetable")
+            ->select("leavetable.* ,Dep.DepartmentName as department,Emp.Designation as designation")
+			->select("CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS employeeFullName")
+			->select("CONCAT_WS(' ', Emp2.FirstName, Emp2.LastName) AS creatorFullName")
+			->join("tbl_users as user", "user.userId =  leavetable.created_by", "left")
+			->join("t_employee_details as Emp", "Emp.EmpID = leavetable.emp_id", "left")
+			->join("t_employee_details as Emp2", "Emp2.EmpID = user.EmpID", "left")
+            ->join("t_departmentdetails as Dep", "Emp.Departmentcode = Dep.DEPCode", "left");
+			if (!empty($leave_id)) { 
+				$builder->where('leavetable.leave_application_id', $leave_id);
+			}
+			$builder->where('leavetable.isactive', 1);
+        $query = $builder->get();
 		return $query->getResultArray();
-	}
-	public function getheringemployeeinformation(){
+	}	
+	public function getheringemployeeinformation(){ //active employee only no driver also.
 		$builder = $this->db->table("t_employee_details as Emp")
             ->select("Emp.EmpID,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Dep.DepartmentName as DepartmentNamee,Dep.DepartmentName as DepartmentName")
 			->select("CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS FullName")
             ->join("t_departmentdetails as Dep", "Emp.Departmentcode = Dep.DEPCode", "left")
+			->where('Emp.is_driver != ', 1)
+			->where('Emp.IsActive', 1)
             ->orderBy("Emp.EmpID", "asc");
 
         $query = $builder->get();
 
         $result = $query->getResult();
         return $result;
+	}
+	function getCompanyInformation()
+	{
+
+		$subQuery = "select CompanyName,replace(Address,'
','') as Address,GSTNO,PAN,ContactNumber,EmailAddress,AlternateContactNumber,companyWebsite,StateCode + from t_company_details "; + + $query = $this->db->query($subQuery); + return $query->getResult(); + } public function saveleaveApplicationForm($data,$id){ if ($id == 0) { diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index dd1eb121..713769ef 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1622,8 +1622,8 @@ if (!empty($getlogpodtl)) {
diff --git a/app/Views/accountsDashboard.php b/app/Views/accountsDashboard.php index ca9777a7..534550c1 100644 --- a/app/Views/accountsDashboard.php +++ b/app/Views/accountsDashboard.php @@ -767,9 +767,9 @@ if (typeof item.MasterFile == 'string') { if (item.MasterFile !== null && item.MasterFile !== undefined && item.MasterFile.trim() !== "") { modal.find('#MasterFileLabel a').attr('href', '' + 'public/uploads/Igrfiles/' + item.MasterFile); - modal.find('#MasterFileLabel a').attr('title', 'previously uploaded IGR Master File'); + modal.find('#MasterFileLabel a').attr('title', 'Previous Upload IGR Master File'); modal.find('#MasterFileLabel a').attr('target', '_blank'); - modal.find('#MasterFileLabel a span').text('previously uploaded - '); + modal.find('#MasterFileLabel a span').text('Previous Upload - '); modal.find('#MasterFileLabel a small').text(item.MasterFile); modal.find('#MasterFileLabel').show(); } @@ -1294,10 +1294,10 @@ modal.find('#WeightFileLabel').hide(); console.log(typeof fileName); if (fileName !== 'null' && fileName !== undefined && fileName.trim() !== "") { - modal.find('#WeightFileLabel a').attr('title', 'previously uploaded IGR Weight File'); + modal.find('#WeightFileLabel a').attr('title', 'Previous Upload IGR Weight File'); modal.find('#WeightFileLabel a').attr('href', '' + 'public/uploads/Igrfiles/' + fileName); modal.find('#WeightFileLabel a').attr('target', '_blank'); - modal.find('#WeightFileLabel a span').text('previously uploaded - '); + modal.find('#WeightFileLabel a span').text('Previous Upload - '); modal.find('#WeightFileLabel a small').text(fileName); modal.find('#WeightFileLabel').show(); } diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index e2368f60..0aa07060 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -554,7 +554,7 @@
-
+
@@ -732,7 +732,7 @@
-
+
-
+
+
- - + +
- 'ViewCostCenter', 'value' => set_value('ViewCostCenter'), 'id' => 'ViewCostCenter', 'class' => 'form-control', 'readonly' => 'true'); echo form_input($data); ?>
-
+
- 'ViewCapitalbudAmt', 'value' => set_value('ViewCapitalbudAmt'), 'id' => 'ViewCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); ?>
-
-
+ + + +
- +
+
@@ -3150,7 +3156,7 @@ if (!empty($getlogpodtl)) { echo form_input($data); ?>
-
+
@@ -3159,7 +3165,7 @@ if (!empty($getlogpodtl)) { echo form_input($data); ?>
-
+
@@ -3168,41 +3174,49 @@ if (!empty($getlogpodtl)) { echo form_input($data); ?>
-
+
- 'ViewCPQuantity', 'value' => set_value('ViewCPQuantity'), 'id' => 'ViewCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); ?>
-
- + + +
+
- * + *
'ViewCPRate', 'value' => set_value('ViewCPRate'), 'id' => 'ViewCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); ?>
-
+
+
- + 'ViewPer', 'value' => set_value('ViewPer'), 'id' => 'ViewPer', 'class' => 'form-control', 'readonly' => 'true'); echo form_input($data); ?> -
+ +
- 'ViewCPTotalAmount', 'value' => set_value('ViewCPTotalAmount'), 'id' => 'ViewCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true'); - echo form_input($data); - ?> -
- +
+ 'ViewCPTotalAmount', 'value' => set_value('ViewCPTotalAmount'), 'id' => 'ViewCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true'); + echo form_input($data); + ?> +
+ + + +
@@ -3214,7 +3228,7 @@ if (!empty($getlogpodtl)) { echo form_input($data); ?>
- +
@@ -3223,17 +3237,18 @@ if (!empty($getlogpodtl)) { echo form_input($data); ?>
-
+
- 'txtViewAfterDiscount', 'value' => set_value('txtViewAfterDiscount'), 'id' => 'txtViewAfterDiscount', 'class' => 'form-control num', 'readonly' => 'true', 'style' => 'text-align:right;'); echo form_input($data); ?>
-
-
+ +
+
- -
+ +
'txtFreightlocview', 'value' => set_value('txtFreightlocview'), 'id' => 'txtFreightlocview', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightlocviewper();', 'disabled' => 'disabled'); echo form_input($data); ?> -
+
'txtAfterFreightlocview', 'value' => set_value('txtAfterFreightlocview'), 'id' => 'txtAfterFreightlocview', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); ?> -
+ +
+ +
-
+
- 'ViewAfterCgst', 'value' => set_value('ViewAfterCgst'), 'id' => 'ViewAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true'); - echo form_input($data); - ?> -
- +
+ 'ViewAfterCgst', 'value' => set_value('ViewAfterCgst'), 'id' => 'ViewAfterCgst', 'class' => 'form-control num', 'placeholder' => 'After CGST', 'readonly' => 'true'); + echo form_input($data); + ?> +
+ + + +
+
-
+
@@ -3299,8 +3320,13 @@ if (!empty($getlogpodtl)) { $data = array('name' => 'ViewSgst', 'value' => set_value('ViewSgst'), 'id' => 'ViewSgst', 'class' => 'form-control num', 'placeholder' => 'SGST TAX PERCENTAGE', 'onchange' => 'EditRatechange()', 'readonly' => 'true'); echo form_input($data); ?> +
+ + + +
@@ -3311,12 +3337,14 @@ if (!empty($getlogpodtl)) { ?>
- - + + +
-
+
+
@@ -3326,7 +3354,7 @@ if (!empty($getlogpodtl)) { ?>
-
+
@@ -3336,9 +3364,10 @@ if (!empty($getlogpodtl)) { ?>
-
+ + + -
@@ -3361,145 +3390,151 @@ if (!empty($getlogpodtl)) { $data = array('name' => 'ViewTotalAmountlocal', 'value' => set_value('ViewTotalAmountlocal'), 'id' => 'ViewTotalAmountlocal', 'class' => 'form-control num', 'placeholder' => 'Total Amount', 'readonly' => 'true'); echo form_input($data); ?> -
- -
-
+ +
+ +

-
-
- Basic Price -
-
- -
-
- Landing charge -
-
-
- +
+
+
+
+
+ Landing charge +
+
+
+ 'ViewLandingCharge', 'value' => set_value('ViewLandingCharge'), 'id' => 'ViewLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
- +
+
+
+
+ 'ViewAfterLandingCharge', 'value' => set_value('ViewAfterLandingCharge'), 'id' => 'ViewAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); ?> + ?> -
-
-
-
-
- Assessable Value (A) -
-
- +
+
+
+
+ Assessable Value (A) +
+
+ -
-
-
- +
+
+
+
+ 'ViewAfterAssessable', 'value' => set_value('ViewAfterAssessable'), 'id' => 'ViewAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
-
- Custom duty (B) -
-
-
- +
+
+
+
+
+ Custom duty (B) +
+
+
+ 'ViewCustomduty', 'value' => set_value('ViewCustomduty'), 'id' => 'ViewCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); ?> - -
-
-
-
- 'viewAfterCustomduty', 'value' => set_value('viewAfterCustomduty'), 'id' => 'viewAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true'); - echo form_input($data); ?> -
-
-
-
-
- Custom ED_cess (C) -
-
-
- + +
+
+
+
+ 'EditAfterCustomduty', 'value' => set_value('EditAfterCustomduty'), 'id' => 'EditAfterCustomduty', 'class' => 'form-control', 'readonly' => 'true'); + echo form_input($data); + ?> +
+
+
+
+
+ Custom ED_cess (C) +
+
+
+ 'ViewCustomEDcess', 'value' => set_value('ViewCustomEDcess'), 'id' => 'ViewCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
- +
+
+
+
+ 'ViewAfterCustomEDcess', 'value' => set_value('ViewAfterCustomEDcess'), 'id' => 'ViewAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
-
- Custom S & H cess (D) -
-
-
- +
+
+
+
+
+ Custom S & H cess (D) +
+
+
+ 'ViewCustomSHcess', 'value' => set_value('ViewCustomSHcess'), 'id' => 'ViewCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
- +
+
+
+
+ 'ViewAfterCustomSHcess', 'value' => set_value('ViewAfterCustomSHcess'), 'id' => 'ViewAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); - ?> -
-
-
-
+ ?> +
+
+
+
@@ -3519,7 +3554,6 @@ if (!empty($getlogpodtl)) { $data = array('name' => 'ViewSubtotal', 'value' => set_value('ViewSubtotal'), 'id' => 'ViewSubtotal', 'class' => 'form-control num', 'readonly' => 'true'); echo form_input($data); ?> -
@@ -3558,7 +3592,7 @@ if (!empty($getlogpodtl)) { - +
Freight Type @@ -3572,7 +3606,7 @@ if (!empty($getlogpodtl)) { echo form_dropdown('drpViewFreight', $options, set_value('drpViewFreight'), 'id="drpViewFreight"', 'class="form-control "'); ?>
- - +

Cost Of The Product Per UOM



-
- - + Duty Impact +
+
+
+ 'ViewDutyImpact', 'value' => set_value('ViewDutyImpact'), 'id' => 'ViewDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> - + ?> +
-
- - + Quantity +
+ 'ViewPurQuantity', 'value' => set_value('ViewPurQuantity'), 'id' => 'ViewPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> + ?> +
+
-
- - + Custom Duty Expenses +
+
+
+ 'ViewCustomDutyExpenses ', 'value' => set_value('ViewCustomDutyExpenses'), 'id' => 'ViewCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> + ?> +
- -
- - + Clearing Charges +
+
+
+ 'ViewClearingCharges', 'value' => set_value('ViewClearingCharges'), 'id' => 'ViewClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); echo form_input($data); - ?> + ?> +
-
- - + + +
+ 'ViewNett', 'value' => set_value('ViewNett'), 'id' => 'ViewNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); - echo form_input($data); - ?> -
+ echo form_input($data); + ?> +
+
+
+ +
+ + +
@@ -3655,9 +3715,10 @@ if (!empty($getlogpodtl)) {
- - -
+ + + +
@@ -3665,604 +3726,19 @@ if (!empty($getlogpodtl)) { $data = array('name' => 'ViewItemDescription', 'value' => set_value('ViewItemDescription'), 'id' => 'ViewItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40'); echo form_textarea($data); ?>
-
- + + - - - - - - - - + diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index b67a6c30..267149cc 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -68,7 +68,7 @@ $pf_applicable = 0; $TDS_Rate = ''; $tds_apllicable = 0; $is_driver = 0; - +$reason = ''; if (!empty($EmpDetails)) { foreach ($EmpDetails as $Emp) { $EmpID = $Emp->EmpID; @@ -153,6 +153,7 @@ if (!empty($EmpDetails)) { $is_management_team = $Emp->is_management_team; $esi_applicable = $Emp->esi_applicable; $pf_applicable = $Emp->pf_applicable; + $reason = $Emp->reason; } } ?> @@ -246,7 +247,7 @@ if (!empty($EmpDetails)) { ProfilePic){ ?>
-