MERGE_UAT_LIVE_ISSUE&AUTHLOGS
This commit is contained in:
commit
de3f0952c6
@ -440,6 +440,9 @@ class LeadsController extends BaseController
|
||||
'earned_claims_ratio' => $data['earned_claims_ratio'][$index] ?? 0,
|
||||
'total_si_at_incept' => $data['total_si_at_incept'][$index] ?? 0,
|
||||
'total_si_at_renewal' => $data['total_si_at_renewal'][$index] ?? 0,
|
||||
|
||||
'total_lives_at_incept' => $data['total_lives_at_incept'][$index] ?? 0,
|
||||
'premium_at_incept' => $data['premium_at_incept'][$index] ?? 0,
|
||||
'fin_years_claims' => $last_3_years_claims,
|
||||
|
||||
// 'file_name' => $file_name,
|
||||
@ -1319,6 +1322,10 @@ class LeadsController extends BaseController
|
||||
} else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) {
|
||||
$lead_data = [
|
||||
'Insured' => $rfq_data['client_name'],
|
||||
'No of Employees at Inception' => $rfq_data['incept_emp_count'],
|
||||
'Total Lives at Inception' => $rfq_data['total_lives_at_incept'],
|
||||
'Total Sum Insured at Inception' => $rfq_data['total_si_at_incept'],
|
||||
'Premium at inception' => $rfq_data['premium_at_incept'],
|
||||
'No of Employees at Renewal' => $rfq_data['renewal_emp_count'],
|
||||
'Total Sum Insured at Renewal ' => $rfq_data['total_si_at_renewal'],
|
||||
'Policy Period' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d-m-Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d-m-Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
|
||||
@ -2273,6 +2280,31 @@ class LeadsController extends BaseController
|
||||
$from_mail = "bs@nhanceindia.in";
|
||||
}
|
||||
|
||||
if ($recipient_type === 'placement') {
|
||||
|
||||
$lead_data = $this->leadsModel->find($lead_id);
|
||||
|
||||
$data = [];
|
||||
|
||||
if (!empty($params['policy_start_date'])) {
|
||||
$converted_start = change_date_format($params['policy_start_date']); // converts to Y-m-d
|
||||
if ($converted_start !== $lead_data['policy_start_date']) {
|
||||
$data['policy_start_date'] = $converted_start;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($params['policy_end_date'])) {
|
||||
$converted_end = change_date_format($params['policy_end_date']); // converts to Y-m-d
|
||||
if ($converted_end !== $lead_data['policy_end_date']) {
|
||||
$data['policy_end_date'] = $converted_end;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($data)) {
|
||||
$this->leadsModel->update($lead_id, $data);
|
||||
}
|
||||
}
|
||||
|
||||
$result_data = [];
|
||||
// dd($recipient_mail);
|
||||
if ($recipient_type == 'insurer' && (!is_array($recipient_mail) || count($recipient_mail) == 0)) {
|
||||
|
||||
@ -134,16 +134,17 @@ class PolicyTransactionController extends BaseController
|
||||
'send' => 'Sent',
|
||||
'recived' => 'Payment Received',
|
||||
];
|
||||
$data['vehicle_type'] = [
|
||||
'two_wheeler' => 'Two Wheeler',
|
||||
'four_wheeler' => 'Four Wheeler',
|
||||
'truck' => 'Truck',
|
||||
'bus' => 'Bus',
|
||||
'van' => 'Van',
|
||||
'suv' => 'SUV',
|
||||
'motorcycle' => 'Motorcycle',
|
||||
'bicycle' => 'Bicycle'
|
||||
];
|
||||
// $data['vehicle_type'] = [
|
||||
// 'two_wheeler' => 'Two Wheeler',
|
||||
// 'four_wheeler' => 'Four Wheeler',
|
||||
// 'truck' => 'Truck',
|
||||
// 'bus' => 'Bus',
|
||||
// 'van' => 'Van',
|
||||
// 'suv' => 'SUV',
|
||||
// 'motorcycle' => 'Motorcycle',
|
||||
// 'bicycle' => 'Bicycle'
|
||||
// ];
|
||||
$data['vehicle_type'] = db_connect()->table('vehicle_type')->where('is_active', 1)->get()->getResultArray();
|
||||
$data['vehicle_des'] = [
|
||||
'commercial' => 'Commercial',
|
||||
'private' => 'Private',
|
||||
@ -1810,6 +1811,8 @@ class PolicyTransactionController extends BaseController
|
||||
$data['insurer'] = $this->insurerModel->where('is_active', 1)->findAll();
|
||||
$data['policy_types'] = $this->policyTypeModel->where('is_active', 1)->findAll();
|
||||
$data['clients'] = $this->clientModel->where('is_active', 1)->findAll();
|
||||
$data['users'] = $this->userModel->where('is_active', 1)->findAll();
|
||||
$data['policy_count'] = $this->policyTransactionModel->where('is_active', 1)->countAllResults();
|
||||
|
||||
|
||||
//filter datas
|
||||
@ -1823,6 +1826,7 @@ class PolicyTransactionController extends BaseController
|
||||
$client_branch_id = $this->request->getGet('client_branch_id');
|
||||
$insurer_branch_id = $this->request->getGet('insurer_branch_id');
|
||||
$client_policy_id = $this->request->getGet('client_policy_id');
|
||||
$user_id = $this->request->getGet('user_id');
|
||||
|
||||
if ($date_type == 'statement_month') {
|
||||
$start_date = (string)date('Y-m-01', strtotime($start_date));
|
||||
@ -1842,6 +1846,7 @@ class PolicyTransactionController extends BaseController
|
||||
$client_branch_id = (!isset($client_branch_id) || $client_branch_id === '' || $client_branch_id === null) ? 0 : $client_branch_id;
|
||||
$insurer_branch_id = (!isset($insurer_branch_id) || $insurer_branch_id === '' || $insurer_branch_id === null) ? 0 : $insurer_branch_id;
|
||||
$client_policy_id = (!isset($client_policy_id) || $client_policy_id === '' || $client_policy_id === null) ? 0 : $client_policy_id;
|
||||
$user_id = (!isset($user_id) || $user_id === '' || $user_id === null) ? 0 : $user_id;
|
||||
if ($this->request->is('post')) {
|
||||
$isFromDashboard = $this->request->getPost("is_dashboard");
|
||||
|
||||
@ -1860,8 +1865,8 @@ class PolicyTransactionController extends BaseController
|
||||
// dd($ids);
|
||||
}
|
||||
//Actual data for the list
|
||||
$data['report_list'] = $this->policyTransactionModel->getBDSReportList($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $client_branch_id, $insurer_branch_id, $client_policy_id, isset($where) ? $where : '');
|
||||
//!dd($data['report_list']);
|
||||
$data['report_list'] = $this->policyTransactionModel->getBDSReportList($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $client_branch_id, $insurer_branch_id, $client_policy_id, $user_id, isset($where) ? $where : '');
|
||||
// dd($data);
|
||||
|
||||
$this->loadLayout('report_bds_filter', $data);
|
||||
}
|
||||
|
||||
@ -26,6 +26,9 @@ use App\Models\ClientModel;
|
||||
use App\Models\UserActivityHistoryModel;
|
||||
|
||||
use Firebase\JWT\JWT;
|
||||
use Firebase\JWT\JWK;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
// require_once('../vendor/autoload.php');
|
||||
|
||||
|
||||
@ -81,9 +84,16 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
public function verifyEmployeeWithMobileNumber()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Verify Employee With Mobile Number: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
$mobile_number = $this->request->getJSON()->mobile_number;
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Received mobile_number = " . $mobile_number);
|
||||
|
||||
|
||||
$employeeData = $this->employeeModel->select('employees.relationship,EP.employee_id')
|
||||
@ -95,30 +105,48 @@ class RestAuthenticationController extends AdminController
|
||||
->where('EP.is_active', 1)
|
||||
->whereIn('EP.status', ['active', 'expired'])
|
||||
->first();
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
|
||||
|
||||
if (isset($employeeData['employee_id']))
|
||||
{
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Employee found: employee_id = " . $employeeData['employee_id']);
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: No matching employee found");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => false , 'message' => "User not found"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$this->myLogger->logme("error", ($th->getMessage().' --- '.$th->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Exception: " . $th->getMessage() . " --- Line: " . $th->getLine() . " --- Trace: " . $th->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
public function verifyEmployeeWithEmailId()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Verify Employee With EmailId: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
|
||||
try {
|
||||
|
||||
log_message('error', json_encode($this->request->getJSON()));
|
||||
$email = $this->request->getJSON()->email;
|
||||
$client_id = $this->request->getJSON()->client_id ?? null;
|
||||
|
||||
@ -146,6 +174,11 @@ class RestAuthenticationController extends AdminController
|
||||
$builder->orderBy('employees.id', 'desc');
|
||||
$employeeData = $builder->first();
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
|
||||
if (isset($employeeData['employee_id'])) {
|
||||
|
||||
$otp = random_int(100000, 999999);
|
||||
@ -165,9 +198,12 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
|
||||
$update = $builder->set(['otp' => $otp])->update();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: OTP update query executed. SQL = " . db_connect()->getLastQuery());
|
||||
|
||||
|
||||
if ($update) {
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: OTP updated successfully in POST DATABASE");
|
||||
$common = [
|
||||
'client_id' => $employeeData['client_id'],
|
||||
'client_branch_id' => $employeeData['client_branch_id'],
|
||||
@ -178,35 +214,56 @@ class RestAuthenticationController extends AdminController
|
||||
];
|
||||
$subject = 'Nhance user verification - OTP';
|
||||
$mail_content = $otp . ' is your verification code for Nhance.';
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Sending OTP email to " . $employeeData['email_corporate']);
|
||||
$res = MailHelper::send_email(['mail' => $employeeData['email_corporate'], 'subject' => $subject, 'common' => $common, 'message' => $mail_content]);
|
||||
$this->myLogger->logme("info", $res);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Mail response = " . $res);
|
||||
|
||||
if (json_decode($res)->status == 'success') {
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result], 200);
|
||||
} else {
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => false, 'message' => "Mail sending failed , try again"];
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
|
||||
}
|
||||
} else {
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: OTP update failed in POST DATABASE");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => false, 'message' => "Verification failed , try again"];
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Employee not found with email in the POST DATABASE");
|
||||
$result = ['user_verification' => false, 'message' => "User not found"];
|
||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => $result], 200);
|
||||
}
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
$this->myLogger->logme("error", ($th->getMessage().' --- '.$th->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithEmailId: Exception: " . $th->getMessage() . " --- Line: " . $th->getLine() . " --- Trace: " . $th->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $th], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateEmpOTP()
|
||||
{
|
||||
{
|
||||
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Update Employee OTP: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateEmpOTP: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
|
||||
$email = $this->request->getJSON()->email;
|
||||
$otp = $this->request->getJSON()->otp;
|
||||
@ -236,7 +293,14 @@ class RestAuthenticationController extends AdminController
|
||||
$builder->where('id', $employee_id);
|
||||
}
|
||||
|
||||
$builder->set(['otp' => $otp])->update();
|
||||
$update = $builder->set(['otp' => $otp])->update();
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateEmpOTP: Update result = " . json_encode($update));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateEmpOTP: Last SQL = " . db_connect()->getLastQuery());
|
||||
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
|
||||
return true;
|
||||
|
||||
@ -341,11 +405,14 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getVerifiedUserData()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Get Verified User Data: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
|
||||
$otp_verification = isset($this->request->getJSON()->otp_verification) ? $this->request->getJSON()->otp_verification : null;
|
||||
@ -399,6 +466,10 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
|
||||
if ($employeeData && $otp_verification == true || $employeeData && isset($this->request->getJSON()->login_by_hr) || $employeeData && isset($this->request->getJSON()->otp) ) {
|
||||
$auth = HttpRequestHelper::getRequestInfo();
|
||||
@ -418,14 +489,27 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
if(isset($this->request->getJSON()->otp)){
|
||||
$this->employeeModel->where('id', $employeeData['id'])->where('otp', $otp)->where('relationship', 'self')->set(['otp'=>null])->update();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Reset the otp to null");
|
||||
}
|
||||
|
||||
log_message('error', ' ');
|
||||
log_message('error', '************************ POST END ********************************');
|
||||
log_message('error', ' ');
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Employee not verified POST");
|
||||
log_message('error', ' ');
|
||||
log_message('error', '************************ POST END ********************************');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []],200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - getVerifiedUserData: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' =>[], 'error' => $e->getMessage()],500);
|
||||
}
|
||||
}
|
||||
@ -501,7 +585,7 @@ class RestAuthenticationController extends AdminController
|
||||
$subject = 'Nhance user verification - OTP';
|
||||
$mail_content = $otp . ' is your verification code for Nhance.';
|
||||
$res = MailHelper::send_email(['mail' => $email, 'subject' => $subject, 'common' => $common, 'message' => $mail_content]);
|
||||
$this->myLogger->logme("info", $res);
|
||||
$this->myLogger->logme("error", $res);
|
||||
|
||||
if (json_decode($res)->status == 'success') {
|
||||
$result = ['user_verification' => true, 'message' => "Verified Successfully"];
|
||||
@ -648,7 +732,13 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
public function saveMpin()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Save Mpin: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
|
||||
@ -692,6 +782,10 @@ class RestAuthenticationController extends AdminController
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
}
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
$mpin = $this->request->getJSON()->mpin;
|
||||
$is_mpin_skipped = $this->request->getJSON()->is_mpin_skipped;
|
||||
$is_biometric_enabled = $this->request->getJSON()->is_biometric_enabled;
|
||||
@ -702,33 +796,51 @@ class RestAuthenticationController extends AdminController
|
||||
'is_biometric_enabled' => $is_biometric_enabled
|
||||
];
|
||||
|
||||
|
||||
|
||||
if ($employeeData) {
|
||||
$id= $employeeData["id"];
|
||||
$updateMpin = $this->employeeModel->where('id', $id)->set( $mpin_data_to_updata)->update();
|
||||
|
||||
if($updateMpin){
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: MPIN updated successfully");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => true , 'message' => "Mpin Updated"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
}else{
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: MPIN update failed");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => true , 'message' => "Mpin Not Updated"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: Employee not found in the POST");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['user_verification' => false , 'message' => "User not found"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$this->myLogger->logme("error", ($th->getMessage().' --- '.$th->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - saveMpin: Exception: " . $th->getMessage() . " --- Line: " . $th->getLine() . " --- Trace: " . $th->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
public function updateMpin()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Update Mpin: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
|
||||
@ -783,26 +895,44 @@ class RestAuthenticationController extends AdminController
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
}
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
if ($employeeData) {
|
||||
$id= $employeeData["id"];
|
||||
$updateMpin = $this->employeeModel->where('id', $id)->set('mpin', $mpin)->update();
|
||||
if($updateMpin){
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: MPIN updated successfully");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['mpin_verification' => true , 'message' => "Mpin Updated"];
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
}else{
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: MPIN update failed");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['mpin_verification' => true , 'message' => "Mpin Not Updated"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Employee not found in the POST. Wrong MPIN");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$result = ['mpin_verification' => false , 'message' => "Wrong Mpin"];
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200);
|
||||
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$this->myLogger->logme("error", ($th->getMessage().' --- '.$th->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateMpin: Exception: " . $th->getMessage() . " --- Line: " . $th->getLine() . " --- Trace: " . $th->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
@ -869,7 +999,13 @@ class RestAuthenticationController extends AdminController
|
||||
// }
|
||||
|
||||
public function verifyMpin()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Verify Mpin: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
$requestData = $this->request->getJSON(true);
|
||||
|
||||
@ -924,10 +1060,16 @@ class RestAuthenticationController extends AdminController
|
||||
return $this->respond(['status' => 'failed', 'code' => 400, 'data' => 'Mobile number or Email ID is required'], 400);
|
||||
}
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
// print_r($employeeData); die;
|
||||
|
||||
if ($employeeData && isset($employeeData['mpin']) && $mpin === $employeeData['mpin']) {
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Verified employee found");
|
||||
|
||||
$auth = HttpRequestHelper::getRequestInfo();
|
||||
if ($auth) {
|
||||
$this->authHistoryModel->insert([
|
||||
@ -941,30 +1083,36 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
$token = JWTToken::encode($employeeData);
|
||||
|
||||
return $this->respond([
|
||||
'status' => 'success',
|
||||
'code' => 200,
|
||||
'data' => $token
|
||||
], 200);
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $token], 200);
|
||||
} else {
|
||||
return $this->respond([
|
||||
'status' => 'failed',
|
||||
'code' => 404,
|
||||
'data' => 'Invalid MPIN'
|
||||
], 200);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Employee not verified in POST. Invalid MPIN");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => 'Invalid MPIN'], 200);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine()));
|
||||
return $this->respond([
|
||||
'status' => 'failed',
|
||||
'code' => 500,
|
||||
'data' => $e->getMessage()
|
||||
], 500);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 500, 'data' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkMpin()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Check Mpin: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
$mobile_number = isset($this->request->getJSON()->mobile_number) ? $this->request->getJSON()->mobile_number : null;
|
||||
$email_id = isset($this->request->getJSON()->email_id) ? $this->request->getJSON()->email_id : null;
|
||||
@ -1008,32 +1156,50 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
}
|
||||
|
||||
|
||||
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
if ($employeeData && $employeeData["mpin"] != null) {
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Mpin - Exist");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"], 'is_mpin_skipped' => $employeeData['is_mpin_skipped'], 'is_biometric_enabled' => $employeeData['is_biometric_enabled']],200);
|
||||
} else {
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Mpin - not found");
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
$this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - checkMpin: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
|
||||
}
|
||||
}
|
||||
|
||||
public function forgotMPIN()
|
||||
{
|
||||
{
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST START **************************************** ');
|
||||
log_message('error', ' ');
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - Forgot MPIN: Function called");
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - forgotMPIN: Received payload = " . json_encode($this->request->getJSON() ?? []));
|
||||
|
||||
try {
|
||||
log_message('info', 'forgotMPIN() called.');
|
||||
|
||||
$json = $this->request->getJSON();
|
||||
$mobile_number = $json->mobile_number ?? null;
|
||||
$email_id = $json->email_id ?? null;
|
||||
$client_id = $json->client_id ?? null;
|
||||
|
||||
log_message('info', 'Received input - Mobile: ' . var_export($mobile_number, true) . ', Email: ' . var_export($email_id, true));
|
||||
|
||||
// Step 1: Check input
|
||||
if (!$mobile_number && !$email_id) {
|
||||
log_message('error', 'Mobile number and email ID are both missing.');
|
||||
@ -1084,11 +1250,14 @@ class RestAuthenticationController extends AdminController
|
||||
$employeeData = $builder->orderBy('employees.id', 'desc')->first();
|
||||
}
|
||||
|
||||
log_message('info', '$employeeData : ' . json_encode($employeeData));
|
||||
$lastQuery = $this->employeeModel->db->getLastQuery();
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - forgotMPIN: Last Executed Query: " . $lastQuery);
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - forgotMPIN: employeeData: " . json_encode($employeeData ?? []));
|
||||
|
||||
|
||||
// Step 3: Found employee
|
||||
if (!empty($employeeData)) {
|
||||
log_message('info', 'Employee found: ID = ' . $employeeData['id']);
|
||||
log_message('error', 'Employee found: ID = ' . $employeeData['id']);
|
||||
|
||||
$updateData = [
|
||||
'mpin' => null,
|
||||
@ -1096,7 +1265,7 @@ class RestAuthenticationController extends AdminController
|
||||
'is_biometric_enabled' => null
|
||||
];
|
||||
|
||||
log_message('info', 'Updating employee MPIN fields to null for ID: ' . $employeeData['id']);
|
||||
log_message('error', 'Updating employee MPIN fields to null for ID: ' . $employeeData['id']);
|
||||
|
||||
$updated = $this->employeeModel
|
||||
->where('id', $employeeData['id'])
|
||||
@ -1120,10 +1289,14 @@ class RestAuthenticationController extends AdminController
|
||||
}
|
||||
} else {
|
||||
// Step 4: Not found in local DB — call external fallback
|
||||
log_message('warning', 'Employee not found locally. Falling back to third-party API.');
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Employee not found"],200); }
|
||||
log_message('error', 'Employee not found locally');
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => "Employee not found"],200);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$this->myLogger->logme("error", ($e->getMessage().' --- '.$e->getLine()));
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - forgotMPIN: Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
log_message('error', ' ');
|
||||
log_message('error', ' ************************************* POST END **************************************** ');
|
||||
log_message('error', ' ');
|
||||
return $this->respond([
|
||||
'status' => 'failed',
|
||||
'code' => 500,
|
||||
@ -1243,6 +1416,34 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
}
|
||||
|
||||
public function verifyToken()
|
||||
{
|
||||
$json = $this->request->getJSON();
|
||||
$idToken = $json->token ?? null;
|
||||
|
||||
|
||||
if (!$idToken) {
|
||||
return $this->fail("Token is missing", 400);
|
||||
}
|
||||
|
||||
try {
|
||||
$client = new Client();
|
||||
|
||||
// Get JWK keys from Firebase
|
||||
$jwk = json_decode($client->get("https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com")->getBody(), true);
|
||||
|
||||
// Decode JWT using the JWK set
|
||||
$decoded = JWT::decode($idToken, JWK::parseKeySet($jwk));
|
||||
|
||||
// Optional: Check audience and issuer
|
||||
$aud = "nhance-ee8d1"; // replace with your Firebase project ID
|
||||
if ($decoded->aud !== $aud || $decoded->iss !== "https://securetoken.google.com/{$aud}") {
|
||||
return $this->fail("Invalid token audience or issuer", 401);
|
||||
}
|
||||
|
||||
// You can now use $decoded->uid or $decoded->phone_number
|
||||
return $this->respond(['status' => 'success', 'uid' => $decoded->user_id ?? '', 'phone' => $decoded->phone_number ?? ''], 200);
|
||||
} catch (\Exception $e) {
|
||||
return $this->fail("Invalid Token: " . $e->getMessage(), 401);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,9 @@ namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
|
||||
use App\Models\TicketMasterModel;
|
||||
use App\Models\TicketClaimStatusModel;
|
||||
use App\Models\ClientModel;
|
||||
@ -14,15 +17,15 @@ use App\Models\TicketNoteModel;
|
||||
use App\Models\UserModel;
|
||||
use App\Models\ClientPolicyModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use App\Models\InsurerModel;
|
||||
use App\Models\EmployeeModel;
|
||||
use App\Models\TPAModel;
|
||||
|
||||
use DOMDocument;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Kint\Kint;
|
||||
use App\Models\EmployeeModel;
|
||||
|
||||
use App\Helpers\MailHelper;
|
||||
use App\Models\InsurerModel;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
class TicketController extends BaseController
|
||||
{
|
||||
@ -51,6 +54,8 @@ class TicketController extends BaseController
|
||||
protected $clientPolicyModel;
|
||||
protected $employeePolicyModel;
|
||||
protected $extraFieldsDisplayForFrontend;
|
||||
protected $insurerModel;
|
||||
protected $TPAModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -109,6 +114,7 @@ class TicketController extends BaseController
|
||||
6 => "Trigger 6",
|
||||
7 => "Trigger 7",
|
||||
8 => "Trigger 8",
|
||||
9 => "Trigger 9",
|
||||
];
|
||||
$this->placeHolders = [
|
||||
|
||||
@ -292,6 +298,8 @@ class TicketController extends BaseController
|
||||
$this->employeeModel = new EmployeeModel();
|
||||
$this->clientPolicyModel = new ClientPolicyModel();
|
||||
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||
$this->insurerModel = new InsurerModel();
|
||||
$this->TPAModel = new TPAModel();
|
||||
}
|
||||
|
||||
public function ticketList()
|
||||
@ -304,6 +312,8 @@ class TicketController extends BaseController
|
||||
$data['page_name'] = "Claims";
|
||||
$data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll();
|
||||
$data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active', 1)->findAll();
|
||||
$data['insurer_list'] = $this->insurerModel->where('is_active', 1)->findAll();
|
||||
$data['tpa_list'] = $this->TPAModel->where('is_active', 1)->findAll();
|
||||
$data['ticket_data'] = $this->ticketSearch(1);
|
||||
return $this->loadLayout('ticket_search', $data);
|
||||
} else {
|
||||
|
||||
@ -97,7 +97,10 @@ class LeadsModel extends Model
|
||||
'is_installment',
|
||||
'no_of_installment',
|
||||
'is_policy_created',
|
||||
'claim_history'
|
||||
'claim_history',
|
||||
|
||||
'total_lives_at_incept',
|
||||
'premium_at_incept',
|
||||
];
|
||||
|
||||
|
||||
|
||||
@ -592,7 +592,7 @@ class PolicyTransactionModel extends Model
|
||||
// return $result;
|
||||
// }
|
||||
|
||||
public function getBDSReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $client_branch_id = 0, $insurer_branch_id = 0, $client_policy_id = 0, $where = [])
|
||||
public function getBDSReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $client_branch_id = 0, $insurer_branch_id = 0, $client_policy_id = 0, $user_id = 0, $where = [])
|
||||
{
|
||||
|
||||
$date_condition = '';
|
||||
@ -764,7 +764,8 @@ class PolicyTransactionModel extends Model
|
||||
)
|
||||
),
|
||||
2
|
||||
) AS unbilled_amt
|
||||
) AS unbilled_amt,
|
||||
created_user.first_name as user_name
|
||||
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
@ -781,6 +782,7 @@ class PolicyTransactionModel extends Model
|
||||
->join('tpa_branch', 'policy_transaction.tpa_branch_id = tpa_branch.id', 'left')
|
||||
->join('user_profiles AS sales_user', 'policy_transaction.sales_generated_by = sales_user.id', 'left')
|
||||
->join('user_profiles AS service_user', 'policy_transaction.serviced_by = service_user.id', 'left')
|
||||
->join('user_profiles AS created_user', 'policy_transaction.created_by = created_user.id', 'left')
|
||||
->where('policy_transaction.is_active', 1)
|
||||
->where('pt_co_share_details.is_active', 1);
|
||||
|
||||
@ -851,6 +853,10 @@ class PolicyTransactionModel extends Model
|
||||
$builder->where('policy_transaction.client_policy_id', $client_policy_id);
|
||||
}
|
||||
|
||||
if ($user_id != 0) {
|
||||
$builder->where('policy_transaction.created_by', $user_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($policy_type_id != 0) {
|
||||
@ -965,7 +971,7 @@ class PolicyTransactionModel extends Model
|
||||
public function getInceptionTranctionListData($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0, $where = null)
|
||||
{
|
||||
$builder = $this->db->table('policy_transaction')
|
||||
->select('
|
||||
->select("
|
||||
policy_transaction.*,
|
||||
clients.short_name AS client_short_name,
|
||||
clients.client_code,
|
||||
@ -978,14 +984,17 @@ class PolicyTransactionModel extends Model
|
||||
pt_co_share_details.agreed_amt AS amount,
|
||||
pt_co_share_details.bp_amt AS bp,
|
||||
pt_co_share_details.tp_amt AS tp,
|
||||
clients.pan
|
||||
')
|
||||
clients.pan,
|
||||
DATE_FORMAT(policy_transaction.created_at, '%d %b %Y %h:%i %p') AS created_at,
|
||||
user_profiles.first_name as user_name
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
->join('client_branch', 'policy_transaction.client_branch_id = client_branch.id', 'left')
|
||||
->join('insurers', 'pt_co_share_details.insurer_id = insurers.id', 'left')
|
||||
->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
|
||||
->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
|
||||
->join('user_profiles', 'policy_transaction.created_by = user_profiles.id', 'left')
|
||||
->where('policy_transaction.is_active', 1)
|
||||
->where('policy_transaction.action_type', 'inception');
|
||||
|
||||
@ -1118,7 +1127,7 @@ class PolicyTransactionModel extends Model
|
||||
|
||||
if ($client_id == 0 && $insurer_id == 0 && $policy_type_id == 0 && $date_type == 0 && $issuer == 0) {
|
||||
|
||||
$fromDate = date('Y-m-d', strtotime('-30 days'));
|
||||
$fromDate = date('Y-m-d', strtotime('-60 days'));
|
||||
$toDate = date('Y-m-d 23:59:59');
|
||||
|
||||
$builder->where('policy_transaction.created_at >=', $fromDate)
|
||||
|
||||
@ -72,10 +72,12 @@ class VehicleModel extends Model
|
||||
ELSE '-'
|
||||
END AS owner_type,
|
||||
clients.client_name as owner_name,
|
||||
client_branch.branch_name as owner_branch
|
||||
client_branch.branch_name as owner_branch,
|
||||
vehicle_type.vehicle_type
|
||||
")
|
||||
->join('clients', 'vehicle.owner = clients.id')
|
||||
->join('client_branch', 'vehicle.branch_id = client_branch.id', 'left')
|
||||
->join('vehicle_type', 'vehicle.type = vehicle_type.id', 'left')
|
||||
->where('vehicle.is_active', 1)
|
||||
->orderBy('vehicle.id', 'desc')
|
||||
->get()
|
||||
|
||||
@ -207,7 +207,7 @@
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_short_name" name="client_short_name"
|
||||
placeholder="Enter Client Short Name" required>
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
@ -344,7 +344,7 @@
|
||||
|
||||
<div class="form-group text-right m-b-0" id="submitButton">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
id="lead_form_submit_btn" >Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@ -438,24 +438,39 @@ if (isset($selected_lead_type)) {
|
||||
$('#salse_person_id').trigger('change');
|
||||
}
|
||||
|
||||
// function validateInput(input, table, field){
|
||||
function validateInput(input, table, field){
|
||||
|
||||
// let value = $(input).val();
|
||||
// let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||
let client_type = $('#client_type').val();
|
||||
|
||||
// let message = "Value is duplicate!";
|
||||
// if(label){
|
||||
// message = label + " already exists!";
|
||||
// }
|
||||
if(client_type == 2){
|
||||
return;
|
||||
}
|
||||
|
||||
// checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||
// if (isDuplicate) {
|
||||
// toastr.warning(message, 'WARNING');
|
||||
// $(input).val('')
|
||||
// }
|
||||
// });
|
||||
if(client_type == ""){
|
||||
toastr.warning('Please select the client type', 'WARNING');
|
||||
$('#client_short_name').val('')
|
||||
return;
|
||||
}
|
||||
|
||||
// }
|
||||
let value = $(input).val();
|
||||
let label = $(input).closest('.form-group').find('label').text().replace('*', '').trim();
|
||||
|
||||
let message = "Value is duplicate!";
|
||||
if(label){
|
||||
message = label + " already exists!";
|
||||
}
|
||||
|
||||
checkDuplicateTableFieldValue(table, field, value, function(isDuplicate) {
|
||||
if (isDuplicate) {
|
||||
toastr.warning(message, 'WARNING');
|
||||
// $(input).val('')
|
||||
$('#lead_form_submit_btn').prop('disabled', true);
|
||||
} else{
|
||||
$('#lead_form_submit_btn').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@
|
||||
<div class="form-group col-md-3 freshFields">
|
||||
<label for="client_short_name">Client Short Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="client_short_name" name="client_short_name"
|
||||
placeholder="Enter Client Short Name" required>
|
||||
placeholder="Enter Client Short Name" onkeyup="validateInput(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields" style="display: none;">
|
||||
@ -369,7 +369,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
<button type="submit" id="lead_form_submit_btn" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="short_name">Client Short name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="short_name" name="short_name" required>
|
||||
<input type="text" class="form-control" id="short_name" name="short_name" onkeyup="validateInputForClient(this, 'clients', 'short_name')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
@ -104,7 +104,7 @@
|
||||
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0" id="hide_smbt_btn">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</button>
|
||||
<button type="submit" id="client_add_modal_submit_btn" class="btn btn-primary waves-effect waves-light mr-1 your">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -117,6 +117,17 @@
|
||||
let isGSTValid = false;
|
||||
|
||||
function validateInputForClient(input, table, field) {
|
||||
|
||||
let owner_type = $('#Owner_type').val();
|
||||
let client_type = $('#client_type').val();
|
||||
|
||||
console.log('owner_type', owner_type);
|
||||
console.log('client_type', client_type);
|
||||
|
||||
if((client_type == 2 || owner_type == 2) && field == 'short_name'){
|
||||
return;
|
||||
}
|
||||
|
||||
let value = $(input).val();
|
||||
if (!value) return;
|
||||
|
||||
@ -132,12 +143,15 @@
|
||||
isGSTValidating = false;
|
||||
if (isDuplicate) {
|
||||
toastr.warning(message, 'WARNING');
|
||||
$(input).val('');
|
||||
// $(input).val('');
|
||||
isGSTValid = false;
|
||||
} else {
|
||||
isGSTValid = true;
|
||||
}
|
||||
$('#client_add_modal_submit_btn').prop('disabled', true);
|
||||
} else {
|
||||
isGSTValid = true;
|
||||
$('#client_add_modal_submit_btn').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#hide_smbt_btn button').prop('disabled', false);
|
||||
}
|
||||
|
||||
|
||||
@ -833,15 +833,20 @@
|
||||
<option value="2">Individual</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="new_vehicle_switch">New Vehicle</label>
|
||||
<input id="new_vehicle_switch" type="checkbox" name="new_vehicle" value="1" data-toggle="toggle" data-on="Yes" data-off="No" data-onstyle="info" data-offstyle="dark" data-style="border" data-width="218">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cost_center">Vehicle No<span class="text-danger">*</span></label>
|
||||
<label for="modal_vehicle_no">Vehicle No<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="modal_vehicle_no" placeholder="Enter Vehicle No" name="vehicle_no" onchange="validateInput(this, 'vehicle', 'vehicle_no')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="rc">RC Book <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="rc" placeholder="Enter RC Book No" name="rc" onchange="validateInput(this, 'vehicle', 'rc')" required>
|
||||
<label for="rc">Chassis No <span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="rc" placeholder="Enter Chassis No" name="rc" onchange="validateInput(this, 'vehicle', 'rc')" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
@ -851,7 +856,7 @@
|
||||
<?php
|
||||
if (isset($vehicle_type) && count($vehicle_type)) {
|
||||
foreach ($vehicle_type as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
echo "<option value=" . $value['id'] . ">" . $value['vehicle_type'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -966,6 +971,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$("#infoIcon").click(function() {
|
||||
@ -4898,4 +4904,18 @@ function getColumnIndexes(count = 0) {
|
||||
});
|
||||
}
|
||||
|
||||
$('#new_vehicle_switch').change(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#modal_vehicle_no').prop('required', false);
|
||||
$('label[for="modal_vehicle_no"] span.text-danger').remove(); // Remove the asterisk
|
||||
} else {
|
||||
$('#modal_vehicle_no').prop('required', true);
|
||||
// Add asterisk only if not already present
|
||||
if ($('label[for="modal_vehicle_no"] span.text-danger').length === 0) {
|
||||
$('label[for="modal_vehicle_no"]').append('<span class="text-danger">*</span>');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@ -249,13 +249,10 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -291,6 +288,7 @@ table.dataTable tbody td {
|
||||
<th><div class="column-header">No of Insured</div></th>
|
||||
<th><div class="column-header">No of Dependents</div></th>
|
||||
<th><div class="column-header">Status</div></th>
|
||||
<th><div class="column-header">User</div></th>
|
||||
<th><div class="column-header">Action</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -312,6 +310,7 @@ table.dataTable tbody td {
|
||||
<td class="right-align-input"><?php echo $row['emp_count']; ?></td>
|
||||
<td class="right-align-input"><?php echo $row['dependent_count']; ?></td>
|
||||
<td><?php echo $policy_status[$row['status']]; ?></td>
|
||||
<td><?php echo $row['user_name']; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||
@ -770,7 +769,7 @@ function appendVehicles(data, vehicle_id)
|
||||
$.each(data, function(index, item) {
|
||||
var option = $('<option>', {
|
||||
value: item.id,
|
||||
text: item.vehicle_no,
|
||||
text: item.vehicle_no ?? item.rc,
|
||||
'data-cid': item.owner,
|
||||
'data-bid': item.branch_id,
|
||||
'data-cty': item.client_type,
|
||||
|
||||
@ -37,12 +37,14 @@ table.dataTable tbody td {
|
||||
<strong>Total Rewards:</strong> <span id="total_rewards">0.00</span> |
|
||||
<strong>Total IRDA Revenue INR:</strong> <span id="total_irda">0.00</span> |
|
||||
<strong>Total Billed Amount:</strong> <span id="total_billed">0.00</span> |
|
||||
<strong>Total Unbilled Amount:</strong> <span id="total_unbilled">0.00</span>
|
||||
<strong>Total Unbilled Amount:</strong> <span id="total_unbilled">0.00</span> |
|
||||
<strong>Total Policy Count:</strong> <span id="total_policy_count"><?= $policy_count ?></span>
|
||||
</div>
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
<th>User</th>
|
||||
<th>Month</th>
|
||||
<th>Business Type</th>
|
||||
<th>Client Type</th>
|
||||
@ -80,6 +82,7 @@ table.dataTable tbody td {
|
||||
<?php foreach($report_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
<td><?php echo $row['user_name']; ?></td>
|
||||
<td><?php echo $row['policy_issue_month']; ?></td>
|
||||
<td><?php echo $row['revenue_type']; ?></td>
|
||||
<td><?php echo $row['client_type']; ?></td>
|
||||
|
||||
@ -83,6 +83,19 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="user_id">Users<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="user_id" name="user_id" >
|
||||
<option value="0">Select user</option>
|
||||
<?php
|
||||
if (isset($users) && count($users)) {
|
||||
foreach ($users as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['first_name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label>Date Type<span class="text-danger"></span></label>
|
||||
@ -155,6 +168,8 @@ $(document).ready(function() {
|
||||
$('#insurer_branch_id').select2();
|
||||
$('#policy_type_id').select2();
|
||||
$('#client_policy_id').select2();
|
||||
$('#user_id').select2();
|
||||
|
||||
})
|
||||
|
||||
function fetchEmpolyeeList(event)
|
||||
@ -171,6 +186,8 @@ function fetchEmpolyeeList(event)
|
||||
var client_branch_id = $('#client_branch_id').val();
|
||||
var insurer_branch_id = $('#insurer_branch_id').val();
|
||||
var client_policy_id = $('#client_policy_id').val();
|
||||
var user_id = $('#user_id').val();
|
||||
|
||||
|
||||
console.log(start_date + '-' + end_date);
|
||||
|
||||
@ -185,6 +202,7 @@ function fetchEmpolyeeList(event)
|
||||
client_branch_id: client_branch_id,
|
||||
insurer_branch_id: insurer_branch_id,
|
||||
client_policy_id: client_policy_id,
|
||||
user_id: user_id,
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
@ -213,6 +231,7 @@ function getURLParams()
|
||||
const client_branch_id = params.get('client_branch_id') || 0; // Default to 0 if not found
|
||||
const insurer_branch_id = params.get('insurer_branch_id') || 0; // Default to 0 if not found
|
||||
const client_policy_id = params.get('client_policy_id') || 0; // Default to 0 if not found
|
||||
const user_id = params.get('user_id') || 0; // Default to 0 if not found
|
||||
|
||||
hideDateField(date_type)
|
||||
|
||||
@ -226,6 +245,7 @@ function getURLParams()
|
||||
console.log('client_branch_id', client_branch_id)
|
||||
console.log('insurer_branch_id', insurer_branch_id)
|
||||
console.log('client_policy_id', client_policy_id)
|
||||
console.log('user_id', user_id)
|
||||
|
||||
// Log the values or use them as needed
|
||||
console.log('Start Date:', startDate);
|
||||
@ -237,6 +257,7 @@ function getURLParams()
|
||||
$('#end_date').val(endDate)
|
||||
$('#client_id').val(client_id).select2()
|
||||
$('#insurer_id').val(insurer_id).select2()
|
||||
$('#user_id').val(user_id).select2()
|
||||
$('#policy_type_id').val(policy_type_id).select2()
|
||||
$('#date_type').val(date_type).trigger('change');
|
||||
$('#issuer').val(issuer)
|
||||
|
||||
@ -8,8 +8,18 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="total_si_at_incept" class="total_title"> Total Sum Insured at Inception <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_si_at_incept']) ? $lead_edit_data['total_si_at_incept'] : '' ?>" type="text" class="form-control" id="total_si_at_incept" name="total_si_at_incept[]" placeholder="Enter Lives" required>
|
||||
<label for="total_lives_at_incept" class="total_title"> Total Lives at Inception <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_lives_at_incept']) ? $lead_edit_data['total_lives_at_incept'] : '' ?>" type="text" class="form-control" id="total_lives_at_incept" name="total_lives_at_incept[]" placeholder="Enter Lives" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
<label for="total_si_at_incept"> Total Sum Insured at Inception <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_si_at_incept']) ? $lead_edit_data['total_si_at_incept'] : '' ?>" type="text" class="form-control" id="total_si_at_incept" name="total_si_at_incept[]" placeholder="Enter Sum Insured" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
<label for="premium_at_incept"> Premium at inception <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['premium_at_incept']) ? $lead_edit_data['premium_at_incept'] : '' ?>" type="text" class="form-control" id="premium_at_incept" name="premium_at_incept[]" placeholder="Enter Premium" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
@ -19,7 +29,7 @@
|
||||
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
<label for="total_si_at_renewal"> Total Sum Insured at Renewal <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_si_at_renewal']) ? $lead_edit_data['total_si_at_renewal'] : '' ?>" type="text" class="form-control" id="total_si_at_renewal" name="total_si_at_renewal[]" placeholder="Enter Lives" >
|
||||
<input value="<?= isset($lead_edit_data['total_si_at_renewal']) ? $lead_edit_data['total_si_at_renewal'] : '' ?>" type="text" class="form-control" id="total_si_at_renewal" name="total_si_at_renewal[]" placeholder="Enter Sum Insured" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -41,9 +41,38 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="pod_no">POD No<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="pod_no" name="pod_no">
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="insurer_id">Insurer<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="insurer_id" name="insurer_id">
|
||||
<option value="0">Select Insurer</option>
|
||||
<?php
|
||||
if (isset($insurer_list) && count($insurer_list)) {
|
||||
foreach ($insurer_list as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="tpa_id">TPA<span class="text-danger"></span></label>
|
||||
<select class="form-control" id="tpa_id" name="tpa_id">
|
||||
<option value="0">Select TPA</option>
|
||||
<?php
|
||||
if (isset($tpa_list) && count($tpa_list)) {
|
||||
foreach ($tpa_list as $key => $value) {
|
||||
echo "<option value='" . $value['id'] . "'>" . $value['name'] . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -70,10 +99,10 @@
|
||||
<input type="text" class="form-control" id="emp_code" name="emp_code">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="tpa_id">TPA ID<span class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="tpa_id" name="tpa_id">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="emp_mobile_no">Employee Mobile No<span
|
||||
@ -123,6 +152,8 @@ $(document).ready(function() {
|
||||
// Initialize select2
|
||||
$('#client_id').select2();
|
||||
$('#claim_status').select2();
|
||||
$('#insurer_id').select2();
|
||||
$('#tpa_id').select2();
|
||||
|
||||
|
||||
});
|
||||
@ -157,6 +188,8 @@ function fetchTicketListData() {
|
||||
var emp_mobile_no = $('#emp_mobile_no').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
var client_id = $('#client_id').val();
|
||||
var insurer_id = $('#insurer_id').val();
|
||||
var tpa_id = $('#tpa_id').val();
|
||||
|
||||
var requestData = {
|
||||
ticket_type_id: ticket_type,
|
||||
@ -167,6 +200,8 @@ function fetchTicketListData() {
|
||||
emp_mobile: emp_mobile_no,
|
||||
tpa_id: tpa_id,
|
||||
client_id: client_id,
|
||||
insurer_id: insurer_id,
|
||||
tpa_id: tpa_id,
|
||||
};
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
@ -85,7 +85,7 @@ table.dataTable tbody td {
|
||||
<td><?php echo $row['owner_name']; ?></td>
|
||||
<td><?php echo $row['rc']; ?></td>
|
||||
<td><?php echo $row['vehicle_no']; ?></td>
|
||||
<td><?php echo $vehicle_type[$row['type']] ?? ""; ?></td>
|
||||
<td><?php echo $row['vehicle_type']; ?></td>
|
||||
<td><?php echo $vehicle_des[$row['description']] ?? ""; ?></td>
|
||||
<td>
|
||||
<div class="btn-group dropdown">
|
||||
|
||||
@ -491,6 +491,16 @@
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_start_date">Policy Start Date</label>
|
||||
<input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_start_date']) ? date('d-m-Y', strtotime($lead_data['policy_start_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_end_date">Policy End Date</label>
|
||||
<input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_end_date']) ? date('d-m-Y', strtotime($lead_data['policy_end_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="placement_date">Placement Date</label>
|
||||
<input type="text" class="form-control" id="placement_date" name="placement_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['placement_date']) ? date('d-m-Y', strtotime($lead_data['placement_date'])) : "" ?>">
|
||||
@ -854,6 +864,16 @@
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_start_date_datePicker = flatpickr("#policy_start_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_end_date_datePicker = flatpickr("#policy_end_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
@ -1487,7 +1507,7 @@ addQuoteButton.addEventListener('click', function() {
|
||||
newQuoteHeader.innerHTML = `${new_proposal_name} <span class="dropdown" onclick="showThreeDottedMenu(event)">
|
||||
<button class="dropbtn">⋮</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#" class="addInsurer">Add Insurer</a>
|
||||
<!-- <a href="#" class="addInsurer">Add Insurer</a> -->
|
||||
<a href="#" class="qcrProposal" style="background-color: rgb(221, 221, 221);">QCR <i class="fa fa-check-square" style="color: green; margin-left: 8px;"></i></a>
|
||||
<a href="#" class="sendClientProposal" style="background-color: rgb(221, 221, 221);">Send to Client <i class="fa fa-check-square" style="color: green; margin-left: 8px;"></i></a>
|
||||
<a href="#" class="removeProposal">Remove</a>
|
||||
@ -3729,6 +3749,8 @@ function constructURL_ForPlacementMailSend() {
|
||||
var lead_id = $('#lead_id').val();
|
||||
let to = $('#placement_to').val();
|
||||
let placement_date = $('#placement_date').val();
|
||||
let policy_end_date = $('#policy_end_date').val();
|
||||
let policy_start_date = $('#policy_start_date').val();
|
||||
let payment_date = $('#payment_date').val();
|
||||
let is_cd = $("#is_cd_switch").is(":checked") ? 1 : 0;
|
||||
let utr_no = $('#utr_no').val();
|
||||
@ -3790,6 +3812,8 @@ function constructURL_ForPlacementMailSend() {
|
||||
formData.append('insurer_and_branch', insurer_and_branch);
|
||||
formData.append('placement_date', placement_date);
|
||||
formData.append('payment_date', payment_date);
|
||||
formData.append('policy_end_date', policy_end_date);
|
||||
formData.append('policy_start_date', policy_start_date);
|
||||
formData.append("is_cd",is_cd);
|
||||
formData.append('utr_no', utr_no);
|
||||
formData.append('premium_amount', premium_amount);
|
||||
|
||||
@ -431,6 +431,15 @@
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_start_date">Policy Start Date</label>
|
||||
<input type="text" class="form-control" id="policy_start_date" name="policy_start_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_start_date']) ? date('d-m-Y', strtotime($lead_data['policy_start_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="policy_end_date">Policy End Date</label>
|
||||
<input type="text" class="form-control" id="policy_end_date" name="policy_end_date" placeholder="DD/MM/YYY" value="<?= isset($lead_data['policy_end_date']) ? date('d-m-Y', strtotime($lead_data['policy_end_date'])) : "" ?>">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -4466,6 +4475,21 @@
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var payment_date_datePicker = flatpickr("#payment_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_start_date_datePicker = flatpickr("#policy_start_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
var policy_end_date_datePicker = flatpickr("#policy_end_date", {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: false,
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
|
||||
@ -4912,6 +4936,9 @@
|
||||
let is_cd = $("#is_cd_switch").is(":checked") ? 1 : 0;
|
||||
let no_of_installment = $('#no_of_installment').val();
|
||||
let is_installment = $("#is_installment_switch").is(":checked") ? 1 : 0;
|
||||
let policy_end_date = $('#policy_end_date').val();
|
||||
let policy_start_date = $('#policy_start_date').val();
|
||||
|
||||
|
||||
|
||||
// Process `to` field
|
||||
@ -4974,6 +5001,8 @@
|
||||
formData.append('installments', JSON.stringify(data));
|
||||
formData.append('no_of_installment', no_of_installment);
|
||||
formData.append('is_installment', is_installment);
|
||||
formData.append('policy_end_date', policy_end_date);
|
||||
formData.append('policy_start_date', policy_start_date);
|
||||
|
||||
|
||||
ajaxRequest(formData);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user