CHANGE_MPIN_FUNCTION : RV
This commit is contained in:
parent
cd260d4ffd
commit
20e7428753
@ -430,6 +430,8 @@ $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController
|
||||
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
|
||||
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
|
||||
$routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationController::verifyEmployeeWithEmailId");
|
||||
// $routes->post("/employeeRest/saveMpin", "RestAuthenticationController::saveMpin");
|
||||
|
||||
|
||||
//HR login api's
|
||||
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
|
||||
|
||||
@ -346,6 +346,7 @@ class RestAuthenticationController extends AdminController
|
||||
$id= $employeeData["id"];
|
||||
$updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update();
|
||||
if($updateMpin){
|
||||
$this->callThirdPartyAPI($this->request->getJSON(), 'updateEmpMPIN');
|
||||
$result = ['user_verification' => true , 'message' => "Mpin Updated"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
}else{
|
||||
@ -355,10 +356,10 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
} else {
|
||||
$result = ['user_verification' => false , 'message' => "User not found"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
|
||||
return $this->callThirdPartyAPI($this->request->getJSON(), 'saveMpin');
|
||||
}
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
@ -386,6 +387,7 @@ class RestAuthenticationController extends AdminController
|
||||
$id= $employeeData["id"];
|
||||
$updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update();
|
||||
if($updateMpin){
|
||||
$this->callThirdPartyAPI($this->request->getJSON(), 'updateEmpMPIN');
|
||||
$result = ['mpin_verification' => true , 'message' => "Mpin Updated"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
}else{
|
||||
@ -395,8 +397,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
} else {
|
||||
$result = ['mpin_verification' => false , 'message' => "Wrong Mpin"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
return $this->callThirdPartyAPI($this->request->getJSON(), 'updateMpin');
|
||||
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
@ -465,7 +466,9 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"]],200);
|
||||
} else {
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200);
|
||||
// return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200);
|
||||
return $this->callThirdPartyAPI($this->request->getJSON(), 'checkMpin');
|
||||
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
|
||||
@ -112,10 +112,40 @@ class EmployeePolicyModel extends Model
|
||||
'emp.basic_pay',
|
||||
'emp.band as grade',
|
||||
'policy_type.policy_type',
|
||||
'policy_type.id as policy_type_id',
|
||||
'client_branch.branch_name as client_branch_name',
|
||||
'client_branch.branch_code as client_branch_code',
|
||||
'cp.policy_no',
|
||||
'cp.policy_type_id',
|
||||
|
||||
// Name audit trail
|
||||
'(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "name" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS name_first_old',
|
||||
'(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "name" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS name_last_new',
|
||||
|
||||
// DOB audit trail
|
||||
'(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "dob" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS dob_first_old',
|
||||
'(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "dob" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS dob_last_new',
|
||||
|
||||
// Gender audit trail
|
||||
'(SELECT old_value FROM auditing_history WHERE pk = emp.id AND field_name = "gender" AND table_name = "employees" ORDER BY id ASC LIMIT 1) AS gender_first_old',
|
||||
'(SELECT new_value FROM auditing_history WHERE pk = emp.id AND field_name = "gender" AND table_name = "employees" ORDER BY id DESC LIMIT 1) AS gender_last_new',
|
||||
|
||||
'(CASE
|
||||
WHEN emp.relationship = "Self"
|
||||
THEN (SELECT COUNT(id) FROM employees WHERE emp_code = emp.emp_code AND is_active = 0 AND emp_status != "truncated")
|
||||
ELSE NULL
|
||||
END) AS removed_count',
|
||||
|
||||
'(CASE
|
||||
WHEN emp.relationship != "Self" AND emp.created_at != (
|
||||
SELECT created_at
|
||||
FROM employees
|
||||
WHERE emp_code = emp.emp_code AND relationship = "Self" AND is_active = 1
|
||||
LIMIT 1
|
||||
)
|
||||
THEN "Newly Added"
|
||||
ELSE NULL
|
||||
END) AS newly_added',
|
||||
|
||||
])
|
||||
->join('employees emp', 'employee_polices.employee_id = emp.id')
|
||||
->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||
@ -129,7 +159,9 @@ class EmployeePolicyModel extends Model
|
||||
->join('client_branch', 'emp.client_branch_id = client_branch.id') //cm - client master
|
||||
->orderBy('emp.emp_code', 'ASC')
|
||||
->orderBy('employee_polices.employee_id', 'ASC');
|
||||
// Conditionally add where clauses
|
||||
|
||||
|
||||
// Conditionally add where clauses
|
||||
if ($client_id != 0 && !empty($client_id)) {
|
||||
$result->where('emp.client_id', $client_id);
|
||||
}
|
||||
@ -187,6 +219,114 @@ class EmployeePolicyModel extends Model
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
// public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "")
|
||||
// {
|
||||
// // dd($status);
|
||||
|
||||
// $result = $this->select([
|
||||
// 'employee_polices.*',
|
||||
// 'policy_type.policy_type as policy_name',
|
||||
// 'im.short_name as insurer_short_name',
|
||||
// 'ib.branch_name as insurer_branch_name',
|
||||
// 'ib.branch_code as insurer_branch_code',
|
||||
// 'tpam.name as tpa_name',
|
||||
// 'tpam.short_name as tpa_short_name',
|
||||
// 'tpab.branch_code as tpa_branch_code',
|
||||
// 'cm.client_name',
|
||||
// 'cm.short_name as client_short_name',
|
||||
// // 'emp.id as employee_primary_id',
|
||||
// 'emp.relationship',
|
||||
// 'emp.relationship_code',
|
||||
// 'emp.change_event',
|
||||
// 'emp.emp_code',
|
||||
// 'emp.name',
|
||||
// 'emp.email_corporate',
|
||||
// 'emp.dob',
|
||||
// 'DATE_FORMAT(emp.dob, "%d/%m/%Y") AS formatted_dob',
|
||||
// 'emp.gender',
|
||||
// 'emp.emp_status',
|
||||
// 'emp.is_active as emp_is_active',
|
||||
// 'emp.mobile as mobile',
|
||||
// 'emp.doj',
|
||||
// 'emp.basic_pay',
|
||||
// 'emp.band as grade',
|
||||
// 'policy_type.policy_type',
|
||||
// 'policy_type.id as policy_type_id',
|
||||
// 'client_branch.branch_name as client_branch_name',
|
||||
// 'client_branch.branch_code as client_branch_code',
|
||||
// 'cp.policy_no',
|
||||
// ])
|
||||
// ->join('employees emp', 'employee_polices.employee_id = emp.id')
|
||||
// ->join('client_policy cp', 'employee_polices.client_policy_id = cp.id') //cp - client policy
|
||||
// ->join('policies pm', 'cp.policy_id = pm.id', 'left') //pm - policy master
|
||||
// ->join('policy_type', 'policy_type.id = cp.policy_type_id')
|
||||
// ->join('insurers im', 'cp.insurer_id = im.id') //im - insurer master
|
||||
// ->join('insurer_branch ib', 'cp.insurer_branch_id = ib.id') //ib - insurer branch
|
||||
// ->join('tpa tpam', 'cp.tpa_id = tpam.id', 'left') //tpam - tpa master
|
||||
// ->join('tpa_branch tpab', 'cp.tpa_branch_id = tpab.id', 'left') //tpab - tpa branch
|
||||
// ->join('clients cm', 'cp.client_id = cm.id') //cm - client master
|
||||
// ->join('client_branch', 'emp.client_branch_id = client_branch.id') //cm - client master
|
||||
// ->orderBy('emp.emp_code', 'ASC')
|
||||
// ->orderBy('employee_polices.employee_id', 'ASC');
|
||||
// // Conditionally add where clauses
|
||||
// if ($client_id != 0 && !empty($client_id)) {
|
||||
// $result->where('emp.client_id', $client_id);
|
||||
// }
|
||||
// if ($branch_id != 0 && !empty($branch_id)) {
|
||||
// $result->where('emp.client_branch_id', $branch_id);
|
||||
// }
|
||||
// if ($policy_id != 0 && !empty($policy_id)) {
|
||||
// $result->where('employee_polices.client_policy_id', $policy_id);
|
||||
// }
|
||||
|
||||
// if (is_array($status) && count($status) > 0) {
|
||||
|
||||
// $result->where('employee_polices.status !=', 'expired');
|
||||
|
||||
// if (in_array("active", $status)) {
|
||||
|
||||
// $result->where('employee_polices.tpa_id IS NOT NULL');
|
||||
// $result->where('employee_polices.uhid IS NOT NULL');
|
||||
// $result->whereIn('employee_polices.status', $status);
|
||||
// } elseif (in_array("pending", $status)) {
|
||||
|
||||
// $result->where('employee_polices.tpa_id IS NULL');
|
||||
// $result->where('employee_polices.uhid IS NULL');
|
||||
// $result->whereIn('employee_polices.status', array_merge($status, ['active']));
|
||||
// } else {
|
||||
|
||||
// $result->whereIn('employee_polices.status', $status);
|
||||
// }
|
||||
|
||||
// // if($status == 'active'){
|
||||
// // $result->where('employee_polices.tpa_id IS NOT NULL');
|
||||
// // $result->where('employee_polices.uhid IS NOT NULL');
|
||||
// // }else if($status == 'pending'){
|
||||
// // $status = 'active';
|
||||
// // $result->where('employee_polices.status', $status);
|
||||
// // }else{
|
||||
// // $result->where('employee_polices.status', $status);
|
||||
// // }
|
||||
// }
|
||||
|
||||
// if (!empty($emp_code)) {
|
||||
// $result->where('emp.emp_code', $emp_code);
|
||||
// }
|
||||
// if (!empty($emp_name)) {
|
||||
// $result->like('emp.name', $emp_name);
|
||||
// }
|
||||
|
||||
// // Always check these conditions
|
||||
// $result->where('employee_polices.is_active', 1)
|
||||
// ->where('emp.is_active', 1);
|
||||
|
||||
// $res = $result->findAll();
|
||||
|
||||
// // dd($this->db->getLastQuery());
|
||||
|
||||
// return $res;
|
||||
// }
|
||||
|
||||
public function getEmployeePolicyForEcard($policy_id = 0)
|
||||
{
|
||||
|
||||
@ -117,6 +117,7 @@
|
||||
(₹)Pro Rata <br> Premium</th>
|
||||
<th class="font-weight-medium" id="gst" data-toggle="tooltip" data-placement="top">(₹)GST
|
||||
</th>
|
||||
<th class="font-weight-medium">Remarks</th>
|
||||
<th class="font-weight-medium"> Action </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -179,6 +180,28 @@
|
||||
</td>
|
||||
<td><?php $gst_total += $employee['gst']; echo format_indian_number($employee['gst']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($employee['name_first_old']) ){
|
||||
echo "<p> Name : " . $employee['name_first_old'] . ' => ' . $employee['name_last_new'] . "</p>";
|
||||
}
|
||||
if(!empty($employee['dob_first_old'])){
|
||||
echo "<p> DOB : " . change_date_format($employee['dob_first_old'], null, 'd/m/Y') . ' => ' . change_date_format($employee['dob_last_new'], null, 'd/m/Y') . "</p>";
|
||||
}
|
||||
if(!empty($employee['gender_first_old'])){
|
||||
echo "<p> Gender : " . $employee['gender_first_old'] . ' => ' . $employee['gender_last_new'] . "</p>";
|
||||
}
|
||||
if(!empty($employee['newly_added'])){
|
||||
echo "<p>" . $employee['newly_added'] . "</p>";
|
||||
}
|
||||
if(!empty($employee['removed_count'])){
|
||||
echo "<p>" . $employee['removed_count'] . " People removed </p>";
|
||||
}
|
||||
if(empty($employee['name_first_old']) && empty($employee['dob_first_old']) && empty($employee['gender_first_old']) && empty($employee['removed_count'] ) && empty($employee['newly_added'] )){
|
||||
echo " - ";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);"
|
||||
@ -360,21 +383,52 @@ $(document).ready(function() {
|
||||
$(document).ready(function() {
|
||||
var ticketsTable = $('#tickets-table');
|
||||
|
||||
if (ticketsTable.length) {
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
scrollX: true,
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Member-List',
|
||||
}, {
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Member-List',
|
||||
}],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Member-List',
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Excel',
|
||||
title: 'Member-List',
|
||||
exportOptions: {
|
||||
columns: function (idx, data, node) {
|
||||
return idx < $('#tickets-table thead th').length - 1;
|
||||
},
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
// Only apply formatting for column Q (index 16)
|
||||
if (column === 16) {
|
||||
return $('<div>').html(data).find('p').map(function () {
|
||||
return $(this).text().trim();
|
||||
}).get().join('\n');
|
||||
}
|
||||
// Return other columns as-is (text only, no HTML tags)
|
||||
return $('<div>').html(data).text().trim();
|
||||
}
|
||||
}
|
||||
},
|
||||
customize: function (xlsx) {
|
||||
var sheet = xlsx.xl.worksheets['sheet1.xml'];
|
||||
// Wrap only column Q
|
||||
$('row c[r]', sheet).each(function () {
|
||||
var cell = $(this);
|
||||
var address = cell.attr('r'); // Example: Q2, Q3
|
||||
if (address.startsWith('Q')) {
|
||||
cell.attr('s', '55'); // Wrap text style
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user