Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2025-12-12 10:16:08 +05:30
commit c0cb14228f
60 changed files with 1783 additions and 610 deletions

View File

@ -842,3 +842,13 @@ $routes->group('bds_upload', function($routes) {
$routes->get('getBdsDumpFileErrorData',"PolicyTransactionController::getBdsDumpFileErrorData");
$routes->get('getBdsDumpExcelFileErrors/(:any)',"PolicyTransactionController::getBdsDumpExcelFileErrors/$1");
});
// -----------------------------------------------------------------------------------------------------------------
$routes->group('logs', function($routes) {
$routes->get('/', 'LogController::index');
$routes->get('view/(:segment)', 'LogController::view/$1');
$routes->get('download/(:segment)', 'LogController::download/$1');
$routes->get('delete/(:segment)', 'LogController::delete/$1');
$routes->get('clearAll', 'LogController::clearAll');
});

View File

@ -45,9 +45,14 @@ class ApiServiceController extends BaseController
$tpaID = $data['tpa_id'];
if ($tpaID == $this->medi_assist_primary_key) { // MediAssist
if ($tpaID == $this->medi_assist_primary_key)
{ // MediAssist
$mediAssistController = new MediAssistApiController();
return $mediAssistController->SubmitClaim($claimId);
}else if ($tpaID == $this->vidal_primary_key)
{ // Vidal
$vidalApiController = new VidalApiController;
return $vidalApiController->SubmitClaim($claimId);
}else{
log_message('error', "This ticket id ( {$claimId} ) TPA has no API service enabled. TPA ID : {$tpaID}");
}
@ -271,76 +276,65 @@ class ApiServiceController extends BaseController
}
public function getWellnessUrl()
//wellness sso url generator landing
public function getWellnessUrl($emp_id)
{
$emp_id = $this->request->getGet('emp_id');
$client_policy_id = $this->request->getGet('client_policy_id');
// $emp_id = $this->request->getGet('emp_id');
$db = \Config\Database::connect();
// $data = $db->table('employees e')
// ->select('pt.policy_type,
// e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation,
// cp.policy_no as policyNumber, cp.policy_no as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate')
// ->join('employee_polices ep', 'e.id = ep.employee_id')
// ->join('client_policy cp', 'ep.client_policy_id = cp.id')
// ->join('policy_type pt', 'cp.policy_type_id = pt.id')
// ->where('e.id', $emp_id)
// ->where('e.emp_status', 'active')
// ->where('ep.status', 'active')
// ->where('e.is_active', 1)
// ->where('ep.is_active', 1)
// ->get()
// ->getResultArray();
$data = $db->table('employee_polices ep')
$data = $db->table('employees e')
->select('pt.policy_type,
e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation, e.id as employeeId
cp.policy_no as policyNumber, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate, cp.wellness_plan_id as planId')
->join('employees e', 'e.id = ep.employee_id')
e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation,
cp.policy_no as policyNumber, ep.employee_id as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId , cp.wellness_vendor_id')
->join('employee_polices ep', 'e.id = ep.employee_id')
->join('client_policy cp', 'ep.client_policy_id = cp.id')
->join('policy_type pt', 'cp.policy_type_id = pt.id')
->where('ep.employee_id', $emp_id)
->where('ep.client_policy_id', $client_policy_id)
->where('e.id', $emp_id)
->where('e.emp_status', 'active')
->where('ep.status', 'active')
->where('e.is_active', 1)
->where('ep.is_active', 1)
->get()
->getRow();
->getResultArray();
$userParams = [];
if(!empty($data))
{
$userParams['name'] = $data->name;
$userParams['email'] = $data->email;
$userParams['phone'] = $data->phone;
$userParams['memberId'] = $data->employeeId; // memberId is unique primary key.
$userParams['gender'] = $data->gender;
$userParams['dob'] = $data->dob;
$userParams['relation'] = $data->relation;
$userParams['policyNumber'] = $data->policyNumber;
$userParams['employeeId'] = $data->memberId;
$userParams['policyStartDate']= $data->policyStartDate;
$userParams['policyEndDate'] = $data->policyEndDate;
$userParams['policyName'] = 'Nhance ' . $data->policy_type;
$userParams['planId'] = $data->planId;
$userParams['moduleName'] = 'home';
foreach ($data as $row) {
if($row['wellness_vendor_id'] != null)
{
$vidalApiController = new VidalApiController();
return $vidalApiController->getWellnessSSORedirectUrl($row['email']);
}
else if ($row['planId'] != null) // VISIT
{
$userParams['name'] = $row['name'];
$userParams['email'] = $row['email'];
$userParams['phone'] = $row['phone'];
$userParams['memberId'] = $row['employeeId']; // memberId is unique primary key.
$userParams['gender'] = $row['gender'];
$userParams['dob'] = $row['dob'];
$userParams['relation'] = $row['relation'];
$userParams['policyNumber'] = $row['policyNumber'];
$userParams['employeeId'] = $row['memberId'];
$userParams['policyStartDate']= $row['policyStartDate'];
$userParams['policyEndDate'] = $row['policyEndDate'];
$userParams['policyName'] = $row['policy_type'];
$userParams['planId'] = $row['planId'];
$userParams['moduleName'] = 'home';
break; // stop after first GMC match
}
}
// dd($userParams);
if (empty($userParams)) {
return $this->respond(['status' => 'failed','message' => 'Coming soon........!'], 200);
return ['status' => 'failed','message' => 'Coming soon........!'];
}
// echo 'coming';die();
// Derive 32-byte key from SHA256
$derivedKey = hash('sha256', env('VISIT_SECRET_KEY'), true);
// Build query string like Node.js
$plainText = '';
foreach ($userParams as $k => $v) {
@ -354,153 +348,114 @@ class ApiServiceController extends BaseController
// Base64URL encode (same as Node.js output)
$output = rtrim(strtr(base64_encode($encrypted), '+/', '-_'), '=');
$baseURL = env('VISIT_BASE_URL');
$clientId = env('VISIT_CLIENT_ID');
$finalUrl = $baseURL . '/sso?userParams=' . $output . '&clientId=' . $clientId;
if (!empty($finalUrl)) {
log_message('error', 'VISIT SSO | emp_id: '.$emp_id.' | URL: '.$finalUrl);
return $this->respond(['status' => 'success','data' => $finalUrl], 200);
return ['status' => 'success','data' => $finalUrl];
} else {
return $this->respond(['status' => 'failed','message' => 'Coming soon........!'], 200);
return ['status' => 'failed','message' => 'Coming soon........!'];
}
}
function getSSORedirectUrl($email = 'test@getvisitapp.com')
{
log_message('info', "SSO: Starting authentication for email: $email");
// ---------- CONFIG ----------
$authUrl = env('VIDAL_WELLNESS_BASE_URL');
$subscriptionKey = env('VIDAL_WELLNESS_SUBSCRIPTION_KEY');
$apiVersion = "1";
// Provided Base64 AES key
$base64Key = env('VIDAL_WELLNESS_BASE64_KEY');
$key = base64_decode($base64Key);
log_message('info', "SSO: Config loaded, Auth URL: $authUrl");
// ---------- STEP 1: Build plaintext payload ----------
$plainPayload = json_encode([
"email" => $email,
// "corporateId" => env('VIDAL_WELLNESS_CORPORATE_ID'),
"urlIdentifier" => env('VIDAL_WELLNESS_URL_IDENTIFIER')
]);
// public function getWellnessUrl()
// {
// ---------- STEP 2: Encrypt payload ----------
$iv = random_bytes(16);
$encryptedRaw = openssl_encrypt($plainPayload, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $iv);
// $emp_id = $this->request->getGet('emp_id');
// $client_policy_id = $this->request->getGet('client_policy_id');
$encryptedPayload = base64_encode($iv) . ":" . base64_encode($encryptedRaw);
log_message('info', "SSO: Payload encrypted successfully");
// $db = \Config\Database::connect();
// ---------- STEP 3: Call Authentication API ----------
$requestBody = json_encode([
"payload" => $encryptedPayload,
"source" => env('VIDAL_WELLNESS_SUB_PARTNER_ID'),
"subPartnerId" => env('VIDAL_WELLNESS_SUB_PARTNER_ID')
]);
// // $data = $db->table('employees e')
// // ->select('pt.policy_type,
// // e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation,
// // cp.policy_no as policyNumber, cp.policy_no as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate')
// // ->join('employee_polices ep', 'e.id = ep.employee_id')
// // ->join('client_policy cp', 'ep.client_policy_id = cp.id')
// // ->join('policy_type pt', 'cp.policy_type_id = pt.id')
// // ->where('e.id', $emp_id)
// // ->where('e.emp_status', 'active')
// // ->where('ep.status', 'active')
// // ->where('e.is_active', 1)
// // ->where('ep.is_active', 1)
// // ->get()
// // ->getResultArray();
$headers = [
"Ocp-Apim-Subscription-Key: $subscriptionKey",
"apiver: $apiVersion",
"mode: encrypt",
"Content-Type: application/json"
];
// $data = $db->table('employee_polices ep')
// ->select('pt.policy_type,
// e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation, e.id as employeeId
// cp.policy_no as policyNumber, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate, cp.wellness_plan_id as planId')
// ->join('employees e', 'e.id = ep.employee_id')
// ->join('client_policy cp', 'ep.client_policy_id = cp.id')
// ->join('policy_type pt', 'cp.policy_type_id = pt.id')
// ->where('ep.employee_id', $emp_id)
// ->where('ep.client_policy_id', $client_policy_id)
// ->where('ep.status', 'active')
// ->where('ep.is_active', 1)
// ->get()
// ->getRow();
$ch = curl_init($authUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// $userParams = [];
// if(!empty($data))
// {
// $userParams['name'] = $data->name;
// $userParams['email'] = $data->email;
// $userParams['phone'] = $data->phone;
// $userParams['memberId'] = $data->employeeId; // memberId is unique primary key.
// $userParams['gender'] = $data->gender;
// $userParams['dob'] = $data->dob;
// $userParams['relation'] = $data->relation;
// $userParams['policyNumber'] = $data->policyNumber;
// $userParams['employeeId'] = $data->memberId;
// $userParams['policyStartDate']= $data->policyStartDate;
// $userParams['policyEndDate'] = $data->policyEndDate;
// $userParams['policyName'] = 'Nhance ' . $data->policy_type;
// $userParams['planId'] = $data->planId;
// $userParams['moduleName'] = 'home';
$apiResponse = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
curl_close($ch);
log_message('info', "SSO: API response received, HTTP Code: $httpCode");
// }
// // dd($userParams);
// Check for cURL errors
if ($curlError) {
log_message('error', "SSO: cURL error - $curlError");
return ["error" => "cURL error: $curlError"];
}
// if (empty($userParams)) {
// return $this->respond(['status' => 'failed','message' => 'Coming soon........!'], 200);
// }
// Check HTTP status
if ($httpCode !== 200) {
log_message('error', "SSO: HTTP error - Code: $httpCode, Response: $apiResponse");
return ["error" => "HTTP error: $httpCode", "response" => $apiResponse];
}
// // Derive 32-byte key from SHA256
// $derivedKey = hash('sha256', env('VISIT_SECRET_KEY'), true);
$jsonResponse = json_decode($apiResponse, true);
// Check JSON decode error
if (json_last_error() !== JSON_ERROR_NONE) {
log_message('error', "SSO: JSON decode error - " . json_last_error_msg());
return ["error" => "JSON decode error: " . json_last_error_msg(), "response" => $apiResponse];
}
// Check API response status
if (!isset($jsonResponse["status"]) || $jsonResponse["status"] !== "success") {
log_message('error', "SSO: API error - " . json_encode($jsonResponse));
return ["error" => "API error", "response" => $jsonResponse];
}
if (!isset($jsonResponse["data"])) {
log_message('error', "SSO: Missing data field in response");
return ["error" => "Invalid API response - missing data field", "response" => $jsonResponse];
}
log_message('info', "SSO: API response validated successfully");
// ---------- STEP 4: Decrypt response ----------
log_message('info', "SSO: Starting response decryption");
$dataParts = explode(":", $jsonResponse["data"]);
if (count($dataParts) !== 2) {
log_message('error', "SSO: Invalid encrypted data format");
return ["error" => "Invalid encrypted data format", "data" => $jsonResponse["data"]];
}
list($ivBase64, $cipherBase64) = $dataParts;
$respIv = base64_decode($ivBase64);
$respCipher = base64_decode($cipherBase64);
if ($respIv === false || $respCipher === false) {
log_message('error', "SSO: Base64 decode error");
return ["error" => "Base64 decode error"];
}
$decryptedJson = openssl_decrypt($respCipher, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $respIv);
if ($decryptedJson === false) {
log_message('error', "SSO: Decryption failed");
return ["error" => "Decryption failed"];
}
$decryptedData = json_decode($decryptedJson, true);
if (json_last_error() !== JSON_ERROR_NONE) {
log_message('error', "SSO: Decrypted JSON decode error - " . json_last_error_msg());
return ["error" => "Decrypted JSON decode error: " . json_last_error_msg()];
}
if (!isset($decryptedData["redirectUrl"])) {
log_message('error', "SSO: redirectUrl missing in decrypted data");
return ["error" => "redirectUrl missing", "decrypted" => $decryptedData];
}
// ---------- FINAL ----------
log_message('info', "SSO: Authentication successful, redirectUrl obtained");
return $decryptedData["redirectUrl"];
}
// // Build query string like Node.js
// $plainText = '';
// foreach ($userParams as $k => $v) {
// $plainText .= "&{$k}={$v}";
// }
// $plainText = ltrim($plainText, '&');
// // Encrypt
// $algorithm = "aes-256-cbc";
// $encrypted = openssl_encrypt($plainText, $algorithm, $derivedKey, OPENSSL_RAW_DATA, env('VISIT_IV'));
// // Base64URL encode (same as Node.js output)
// $output = rtrim(strtr(base64_encode($encrypted), '+/', '-_'), '=');
// $baseURL = env('VISIT_BASE_URL');
// $clientId = env('VISIT_CLIENT_ID');
// $finalUrl = $baseURL . '/sso?userParams=' . $output . '&clientId=' . $clientId;
// if (!empty($finalUrl)) {
// log_message('error', 'VISIT SSO | emp_id: '.$emp_id.' | URL: '.$finalUrl);
// return $this->respond(['status' => 'success','data' => $finalUrl], 200);
// } else {
// return $this->respond(['status' => 'failed','message' => 'Coming soon........!'], 200);
// }
// }
// function getSSORedirectUrl($email = 'user@example.com')

View File

@ -28,11 +28,11 @@ class AppContentManagementController extends AdminController
$this->feContentModel = new FEContentModel();
$this->clientModel = new ClientModel();
}
//listing
public function add_image_index()
{
$this->myLogger->logme('error','Addvertisement Image list function called');
$headerData['tab_name'] = 'Addvertisement Images';
$headerData['page_name'] = 'Addvertisement Images';
$headerData['tab_name'] = 'Advertisement Images';
$headerData['page_name'] = 'Advertisement Images';
// $data['addImageList'] = $this->addImgModel->findAll();
$data['addImageList'] = $this->addImgModel->select('advertisement_images.*,
clients.client_name,
@ -53,7 +53,7 @@ class AppContentManagementController extends AdminController
// $this->loadLayout('client_onboarding', $data);
}
// using add and edit
// add and edit
public function add_advertise_image() {
try {
$file = $this->request->getFile('advertise_image');
@ -70,7 +70,8 @@ class AppContentManagementController extends AdminController
return $this->respond(['status' => false, 'message' => 'No file uploaded or invalid file.'], 400);
}
$uploadPath = WRITEPATH . 'uploads/advertiseImage/';
// $uploadPath = WRITEPATH . 'uploads/advertiseImage/';
$uploadPath = ROOTPATH . 'public/uploads/add_image_upload/';
if (!is_dir($uploadPath)) mkdir($uploadPath, 0755, true);
@ -91,6 +92,7 @@ class AppContentManagementController extends AdminController
}
}
// soft delete
public function remove_advertise_image()
{
try {
@ -111,47 +113,34 @@ class AppContentManagementController extends AdminController
}
// public function showAdvertiseImage($fileName)
// {
// $filePath = WRITEPATH . 'uploads/advertiseImage/' . $fileName;
// if (!file_exists($filePath)) {
// return $this->response->setStatusCode(404, 'File not found');
// }
// $mimeType = mime_content_type($filePath);
// header('Content-Type: ' . $mimeType);
// readfile($filePath);
// exit;
// }
// In AppContentManagementController.php (This is what needs to be fixed if the direct path fails)
// Preview image Went Edit.
public function showAdvertiseImage($filename)
{
$path = WRITEPATH . 'uploads/advertiseImage/' . $filename;
// $path = WRITEPATH . 'uploads/advertiseImage/' . $filename;
$path = ROOTPATH . 'public/uploads/add_image_upload/' . $filename;
if (!file_exists($path)) {
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
// return $this->response->setStatusCode(404, 'File not found');
}
$mime = mime_content_type($path);
// header('Content-Type: ' . $mimeType);
// readfile($path);
// exit;
return $this->response->setHeader('Content-Type', $mime)->setBody(file_get_contents($path));
}
public function getAdvertiseImage($image_id){
$image_data = $this->addImgModel->select('name')->where(['id' => $image_id])->first();
if($image_data){
return $image_data['name'];
}else{
return ;
}
}
// public function getAdvertiseImage($image_id){
// $image_data = $this->addImgModel->select('name')->where(['id' => $image_id])->first();
// if($image_data){
// return $image_data['name'];
// }else{
// return ;
// }
// }

View File

@ -3028,7 +3028,8 @@ class EmployeeRestController extends AdminController
}
$emp_reatail_policy_data = $this->getEmpRetailPolicy($employeeSelfData);
$emp_wellness_data = $this->getWellnessUrl($employeeSelfData->id ?? null);
$apiServiceController = new ApiServiceController;
$emp_wellness_data = $apiServiceController->getWellnessUrl($employeeSelfData->id ?? null);
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $result, 'emp_name' => $employeeName, 'pre_policy_count' => $prePolicyCount, 'emp_not_enrolled_count' => $empNotEnrolledCount, 'retail_policy_data' => $emp_reatail_policy_data, 'wellness_data' => $emp_wellness_data], 200);
} else {
@ -3176,32 +3177,58 @@ class EmployeeRestController extends AdminController
}
}
// public function getAdvertisementImage_old()
// {
// try {
// $client_id = $this->request->getGet('client_id');
// $img = $this->addImgModel->where('is_active', 1)->where('client_id',$client_id)->findAll();
// if (count($img) > 0) {
// $data = [];
// foreach ($img as $key => $value) {
// $url = base_url('public/uploads/add_image_upload/') . $value['name'];
// array_push($data, $url);
// }
// return $this->respond(['status' => 'success', 'code' => 200, 'data' => $data], 200);
// } else {
// return $this->respond(['status' => 'failed', 'code' => 404, 'data' => 'No Data'], 404);
// }
// } catch (\Throwable $th) {
// return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $th], 500);
// }
// }
public function getAdvertisementImage()
{
try {
$client_id = $this->request->getGet('client_id');
// get client_id & convert empty/null/undefined → 0
// $client_id = ($client_id === null || $client_id === '' || $client_id === 'undefined') ? 0 : $client_id;
$img = $this->addImgModel->where('is_active', 1)->where('client_id',$client_id)->findAll();
// fetch images for client
$images = $this->addImgModel->where('is_active', 1)->where('client_id', $client_id)->findAll();
if (count($img) > 0) {
$data = [];
foreach ($img as $key => $value) {
$url = base_url('public/uploads/add_image_upload/') . $value['name'];
array_push($data, $url);
}
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $data], 200);
} else {
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => 'No Data'], 404);
// if no client images → load default client 0
if (count($images) == 0) {
$images = $this->addImgModel->where('is_active', 1)->where('client_id', 0)->findAll();
}
// prepare URLs
$data = array_map(function($img){ return base_url('public/uploads/add_image_upload/' . $img['name']); }, $images);
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $data], 200);
} catch (\Throwable $th) {
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $th], 500);
}
}
public function storeFireBase()
{
try {
@ -5012,81 +5039,7 @@ class EmployeeRestController extends AdminController
}
}
public function getWellnessUrl($emp_id)
{
// $emp_id = $this->request->getGet('emp_id');
$db = \Config\Database::connect();
$data = $db->table('employees e')
->select('pt.policy_type,
e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation,
cp.policy_no as policyNumber, ep.employee_id as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId')
->join('employee_polices ep', 'e.id = ep.employee_id')
->join('client_policy cp', 'ep.client_policy_id = cp.id')
->join('policy_type pt', 'cp.policy_type_id = pt.id')
->where('e.id', $emp_id)
->where('e.emp_status', 'active')
->where('ep.status', 'active')
->where('e.is_active', 1)
->where('ep.is_active', 1)
->get()
->getResultArray();
$userParams = [];
foreach ($data as $row) {
if ($row['planId'] != null) {
$userParams['name'] = $row['name'];
$userParams['email'] = $row['email'];
$userParams['phone'] = $row['phone'];
$userParams['memberId'] = $row['employeeId']; // memberId is unique primary key.
$userParams['gender'] = $row['gender'];
$userParams['dob'] = $row['dob'];
$userParams['relation'] = $row['relation'];
$userParams['policyNumber'] = $row['policyNumber'];
$userParams['employeeId'] = $row['memberId'];
$userParams['policyStartDate']= $row['policyStartDate'];
$userParams['policyEndDate'] = $row['policyEndDate'];
$userParams['policyName'] = $row['policy_type'];
$userParams['planId'] = $row['planId'];
$userParams['moduleName'] = 'home';
break; // stop after first GMC match
}
}
if (empty($userParams)) {
return ['status' => 'failed','message' => 'Coming soon........!'];
}
// echo 'coming';die();
// Derive 32-byte key from SHA256
$derivedKey = hash('sha256', env('VISIT_SECRET_KEY'), true);
// Build query string like Node.js
$plainText = '';
foreach ($userParams as $k => $v) {
$plainText .= "&{$k}={$v}";
}
$plainText = ltrim($plainText, '&');
// Encrypt
$algorithm = "aes-256-cbc";
$encrypted = openssl_encrypt($plainText, $algorithm, $derivedKey, OPENSSL_RAW_DATA, env('VISIT_IV'));
// Base64URL encode (same as Node.js output)
$output = rtrim(strtr(base64_encode($encrypted), '+/', '-_'), '=');
$baseURL = env('VISIT_BASE_URL');
$clientId = env('VISIT_CLIENT_ID');
$finalUrl = $baseURL . '/sso?userParams=' . $output . '&clientId=' . $clientId;
if (!empty($finalUrl)) {
log_message('error', 'VISIT SSO | emp_id: '.$emp_id.' | URL: '.$finalUrl);
return ['status' => 'success','data' => $finalUrl];
} else {
return ['status' => 'failed','message' => 'Coming soon........!'];
}
}
public function getPolicyTypeAndInsurer()
{

View File

@ -0,0 +1,259 @@
<?php
namespace App\Controllers;
use CodeIgniter\Controller;
use App\Controllers\BaseController;
class LogController extends BaseController
{
private $logPath;
public $dModel;
public $session;
public function __construct()
{
// Path to log files
$this->logPath = WRITEPATH . 'logs/';
$this->session = session();
}
/**
* Display list of all log files
*/
public function index()
{
$logFiles = $this->getLogFiles();
$data = [
'title' => 'Log Files',
'logFiles' => $logFiles
];
return $this->loadLayout('logs/index', $data);
// return view('logs/index', $data);
}
/**
* Get all log files sorted by date (latest first)
*/
private function getLogFiles()
{
$files = [];
if (!is_dir($this->logPath)) {
return $files;
}
$iterator = new \DirectoryIterator($this->logPath);
foreach ($iterator as $fileInfo) {
if ($fileInfo->isFile() && $fileInfo->getExtension() === 'log') {
$files[] = [
'name' => $fileInfo->getFilename(),
'path' => $fileInfo->getPathname(),
'size' => $this->formatBytes($fileInfo->getSize()),
'modified' => $fileInfo->getMTime(),
'modified_date' => date('Y-m-d H:i:s', $fileInfo->getMTime())
];
}
}
// Sort by modified time (latest first)
usort($files, function($a, $b) {
return $b['modified'] - $a['modified'];
});
return $files;
}
/**
* View specific log file content
*/
public function view($filename = null)
{
if (!$filename) {
return redirect()->to('/logs')->with('error', 'No log file specified');
}
// Security: prevent directory traversal
$filename = basename($filename);
$filePath = $this->logPath . $filename;
if (!file_exists($filePath)) {
return redirect()->to('/logs')->with('error', 'Log file not found');
}
// ✅ extract date from filename: log-YYYY-MM-DD.log
if (preg_match('/log-(\d{4}-\d{2}-\d{2})\.log/', $filename, $match)) {
$currentDate = $match[1];
$prevDate = date('Y-m-d', strtotime('-1 day', strtotime($currentDate)));
$nextDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate)));
$prevFile = "log-$prevDate.log";
$nextFile = "log-$nextDate.log";
$prevExists = file_exists($this->logPath . $prevFile);
$nextExists = file_exists($this->logPath . $nextFile);
}
// Read log file content
$content = file_get_contents($filePath);
$logEntries = $this->parseLogFile($content);
$data = [
'title' => 'View Log: ' . $filename,
'filename' => $filename,
'logEntries' => $logEntries,
'prevFile' => $prevExists ? $prevFile : null,
'nextFile' => $nextExists ? $nextFile : null,
'fileSize' => $this->formatBytes(filesize($filePath)),
'lastModified' => date('Y-m-d H:i:s', filemtime($filePath))
];
// print_r( $data); die;
return $this->loadLayout('logs/view', $data);
// return view('logs/view', $data);
}
/**
* Parse log file into structured array
*/
private function parseLogFile($content)
{
$entries = [];
$lines = explode("\n", $content);
$currentEntry = null;
// Messages to filter out
$skipPatterns = [
'/Session: Class initialized using/',
'/Session class already loaded/',
];
foreach ($lines as $line) {
// Match CI4 log format: LEVEL - date --> message
if (preg_match('/^(\w+)\s*-\s*(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s*-->\s*(.*)$/', $line, $matches)) {
// Save previous entry if exists (before checking skip)
if ($currentEntry !== null) {
$entries[] = $currentEntry;
$currentEntry = null;
}
// Check if this message should be skipped
$shouldSkip = false;
foreach ($skipPatterns as $pattern) {
if (preg_match($pattern, $matches[3])) {
$shouldSkip = true;
break;
}
}
if ($shouldSkip) {
continue;
}
// Start new entry
$currentEntry = [
'level' => $matches[1],
'date' => $matches[2],
'message' => $matches[3]
];
} elseif ($currentEntry !== null && trim($line) !== '') {
// Continuation of previous message
$currentEntry['message'] .= "\n" . $line;
}
}
// Add last entry
if ($currentEntry !== null) {
$entries[] = $currentEntry;
}
return array_reverse($entries); // Latest first
}
/**
* Download log file
*/
public function download($filename = null)
{
if (!$filename) {
return redirect()->to('/logs')->with('error', 'No log file specified');
}
$filename = basename($filename);
$filePath = $this->logPath . $filename;
if (!file_exists($filePath)) {
return redirect()->to('/logs')->with('error', 'Log file not found');
}
return $this->response->download($filePath, null);
}
/**
* Delete log file
*/
public function delete($filename = null)
{
if (!$filename) {
return redirect()->to('/logs')->with('error', 'No log file specified');
}
$filename = basename($filename);
$filePath = $this->logPath . $filename;
if (!file_exists($filePath)) {
return redirect()->to('/logs')->with('error', 'Log file not found');
}
if (unlink($filePath)) {
return redirect()->to('/logs')->with('success', 'Log file deleted successfully');
} else {
return redirect()->to('/logs')->with('error', 'Failed to delete log file');
}
}
/**
* Format bytes to human readable format
*/
private function formatBytes($bytes, $precision = 2)
{
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
$bytes /= pow(1024, $pow);
return round($bytes, $precision) . ' ' . $units[$pow];
}
/**
* Clear all log files
*/
public function clearAll()
{
$logFiles = $this->getLogFiles();
$deleted = 0;
foreach ($logFiles as $file) {
if (unlink($file['path'])) {
$deleted++;
}
}
return redirect()->to('/logs')->with('success', $deleted . ' log file(s) deleted successfully');
}
}

View File

@ -150,7 +150,7 @@ class MediAssistApiController extends BaseController
return;
} else {
log_message('error', 'TPA CLAIM PUSH SUCCESS BUT claimReferenceNo EMPTY | claimId: '.$claimId.' | response: '.json_encode($response));
log_message('error', 'TPA CLAIM PUSH API SUCCESS BUT claimReferenceNo EMPTY | claimId: '.$claimId.' | response: '.json_encode($response));
return;
}
@ -223,7 +223,7 @@ class MediAssistApiController extends BaseController
$client_policy_id = $requestData['client_policy_id'] ?? null;
if (empty($policyNo)) {
log_message('error', 'GetBenefDetails: policy_no missing in request');
log_message('error', 'TPA ID PULL | policy_no missing in request');
if($function_calling_type == "job"){
return ['status' => false, 'message' => 'policy_no required'];
}else{
@ -232,7 +232,7 @@ class MediAssistApiController extends BaseController
}
if (empty($client_policy_id)) {
log_message('error', 'GetBenefDetails: client_policy_id missing in request');
log_message('error', 'TPA ID PULL | client_policy_id missing in request');
if($function_calling_type == "job"){
return ['status' => false, 'message' => 'client_policy_id required'];
}else{
@ -240,8 +240,7 @@ class MediAssistApiController extends BaseController
}
}
log_message('error', "GetBenefDetails called for policy_no: {$policyNo}");
log_message('error', "GetBenefDetails called for client_policy_id: {$client_policy_id}");
log_message('error', "TPA ID PULL | called for policy_no: {$policyNo} , client_policy_id: {$client_policy_id}");
$employeePolicyModel = new EmployeePolicyModel();
$employeePolicyData = $employeePolicyModel
@ -260,7 +259,7 @@ class MediAssistApiController extends BaseController
->findAll();
if (empty($employeePolicyData)) {
log_message('error', 'GetBenefDetails: employeePolicyData is empty');
log_message('error', 'TPA ID PULL FAILED | employeePolicyData is empty (tpa_id IS NULL from nhance) for this tpa id pull request');
if($function_calling_type == "job"){
return ['status' => false, 'message' => 'employeePolicyData not found'];
}else{
@ -284,8 +283,8 @@ class MediAssistApiController extends BaseController
"employeeId" => ""
];
log_message('error', "GetBenefDetails API Request (startIndex={$startIndex}): " . json_encode($body));
log_message('error', "GetBenefDetails API parems " . json_encode([$url, $method, $headers, $body]));
log_message('error', "TPA ID PULL | API Request (startIndex={$startIndex}): " . json_encode($body));
log_message('error', "TPA ID PULL | API parems " . json_encode([$url, $method, $headers, $body]));
$response = call_third_party_api($url, $method, $headers, $body);
@ -300,7 +299,7 @@ class MediAssistApiController extends BaseController
log_message('error', "Failed to update file table status.");
}
log_message('error', 'GetBenefDetails API failed: ' . json_encode($response));
log_message('error', 'TPA ID PULL API FAILED | API failed: ' . json_encode($response));
if($function_calling_type == "job"){
return ['status' => false, 'message' => 'API call failed', 'data' => $response];
@ -312,7 +311,7 @@ class MediAssistApiController extends BaseController
$data = $response['data'] ?? [];
if (!isset($data['benefDetails'])) {
log_message('error', "GetBenefDetails: 'benefDetails' missing in API response: " . json_encode($data));
log_message('error', "TPA ID PULL FAILED |: 'benefDetails' missing in API response: " . json_encode($data));
break;
}
@ -406,7 +405,7 @@ class MediAssistApiController extends BaseController
}
log_message('error', "GetBenefDetails completed. Total fetched={$totalCount}, updated={$updated}");
log_message('error', "TPA ID PULL SUCCESS | completed. Total fetched={$totalCount}, updated={$updated}");
if($function_calling_type == "job"){
return [
@ -532,7 +531,7 @@ class MediAssistApiController extends BaseController
$response = call_third_party_api($url, $method, $headers, $body);
if ($response['status'] != true || empty($response['data']['claimsData'][0])) {
log_message('error', 'Claim status API failed for ticket ID: ' . $claimId);
log_message('error', 'CLAIM STATUS FAILED | for ticket ID: ' . $claimId.' | response: '.json_encode($response));
return $this->response->setJSON([
'status' => false,
@ -598,7 +597,7 @@ class MediAssistApiController extends BaseController
$this->db->table('ticket_master')->where('id', $claimId)->update($updateArray);
// LOG UPDATE
log_message('info', "Updated ticket ID $claimId with claim status: $currentStatus");
log_message('info', "CLAIM STATUS SUCCESS | Updated ticket ID $claimId with claim status: $currentStatus");
return $this->response->setJSON([
'status' => true,
@ -633,10 +632,10 @@ class MediAssistApiController extends BaseController
if (!$ticket || empty($ticket['ClaimID'])) {
log_message('error', "IRSubmission FAILED → ClaimID NOT FOUND for ticket_id={$claimId}");
return $this->response->setJSON([
'status' => false,
'message' => "ClaimID not found for ticket {$claimId}"
]);
return [
'status' => false,
'message' => "ClaimID not found for ticket {$claimId}"
];
}
// 2. FETCH IR ATTACHMENTS

View File

@ -63,6 +63,19 @@ class RuleImportController extends AdminController
public function commissionFileUploadList()
{
// print_rr($this->ruleImportService->processUpload([
// 'id' => 60,
// 'file_name' => 'Sample_commission_file-New.xlsx',
// 'insurer_id' => 77,
// 'department' => 'motor',
// 'commission_month' => '2025-11-10',
// 'created_by' => 10
// ]));
// die();
$data['page_name'] = "Commision File Upload";
$data['departments'] = $this->departments;
$data['insurers'] = $this->insurerModel->where('is_active', 1)->findAll();

View File

@ -7,15 +7,18 @@ use CodeIgniter\HTTP\ResponseInterface;
class VidalApiController extends BaseController
{
public function index()
protected $db;
public function __construct()
{
//
$this->db = \Config\Database::connect();
}
function uploadFileToVidal($filePath,$filename)
{
$apiUrl = "https://devapigw.vidalhealthtpa.com/partner-integration/api/files/upload-url";
// $apiUrl = "https://devapigw.vidalhealthtpa.com/partner-integration/api/files/upload-url";
$apiUrl = getenv('VIDAL_API_BASE_URL').'/files/upload-url';
$subscriptionKey = getenv('VIDAL_API_SUBSCRIPTION_KEY');
log_message('error', "Starting file upload process for filename: $filename | Path: $filePath");
@ -105,10 +108,8 @@ class VidalApiController extends BaseController
{
helper('api');
//Prepare body data
$db = \Config\Database::connect();
// Fetch the data from DB
$data = $db->table('ticket_master tm')
$data = $this->db->table('ticket_master tm')
->select('
tm.id,
tm.emp_mobile as mobileNo,
@ -116,9 +117,14 @@ class VidalApiController extends BaseController
tm.doa as admissionDate,
tm.dod as dischargeDate,
tm.hospital_name as hospitalName,
tm.hospital_address as hospitalAddress,
tm.hospital_state as hospitalState,
tm.hospital_city as hospitalCity,
tm.hospital_pin_code as hospitalPinCode,
tm.hospital_phone_no as hospitalPhoneNo,
tm.claim_amount as requestedAmount,
tm.tpa_no as dependentUniqueId,
cp.policy_no as policyNo,
e.id as dependentUniqueIdOld,
e.emp_code as memberId,
tn.note as disease,
tn.note as reasonForHospitalization,
@ -126,7 +132,7 @@ class VidalApiController extends BaseController
cf.url as filePath,
pt.policy_type as typeOfClaim,
ep.tpa_id as empanelmentNo,
ep.tpa_id as dependentUniqueId,
')
->join('employees e', 'e.id = tm.emp_id', 'left')
->join('client_policy cp', 'tm.client_policy_id = cp.id', 'left')
@ -196,7 +202,9 @@ class VidalApiController extends BaseController
],
];
// dd($body);
log_message('error', "Submit claim failed - payload ". json_encode($body ));
log_message('error', 'TPA CLAIM PUSH | claimId: '.$claimId.' | payload: '.json_encode($body));
// $body = [
// 'policyNo' => "351500/D0534/PP/20-20/PC",
// 'dependentUniqueId' => "EN000000182-C-41",
@ -227,16 +235,175 @@ class VidalApiController extends BaseController
$response = call_third_party_api($url, $method, $headers, $body);
if($response['status'] != true){
return $this->response->setJSON([
'status' => false,
'message' => 'failed.',
'data' => $response
]);
log_message('error', 'TPA CLAIM PUSH FAILED | claimId: '.$claimId.' | response: '.json_encode($response));
return;
}
return $this->response->setJSON($response);
// return $this->response->setJSON($response);
if($response['data']['status'] == 'SUCCESS')
{
$claimNO = $response['data']['data']['claimNO'] ?? null;
$claimInwardNO = $response['data']['data']['claimInwardNO'] ?? null;
if(!empty($claimNO) && !empty($claimInwardNO)){
log_message('error', 'TPA CLAIM PUSH SUCCESS | claimId: '.$claimId.' | claimNO: '.$claimNO.' | claimInwardNO: '.$claimInwardNO);
$this->db->table('ticket_master')
->where('id',$claimId)
->update([ 'tpa_claim_push_reference_no' => $claimInwardNO , 'tpa_claim_id' => $claimNO ]);
return;
} else {
log_message('error', 'TPA CLAIM PUSH API SUCCESS BUT claimNO,claimInwardNO EMPTY | claimId: '.$claimId.' | response: '.json_encode($response));
return;
}
}else{
log_message('error', 'TPA CLAIM PUSH API FAILED | claimId: '.$claimId.' | response: '.json_encode($response));
return;
}
}
function getWellnessSSORedirectUrl($email = 'test@getvisitapp.com')
{
log_message('info', "SSO: Starting authentication for email: $email");
// ---------- CONFIG ----------
$authUrl = env('VIDAL_WELLNESS_BASE_URL');
$subscriptionKey = env('VIDAL_WELLNESS_SUBSCRIPTION_KEY');
$apiVersion = "1";
// Provided Base64 AES key
$base64Key = env('VIDAL_WELLNESS_BASE64_KEY');
$key = base64_decode($base64Key);
log_message('info', "SSO: Config loaded, Auth URL: $authUrl");
// ---------- STEP 1: Build plaintext payload ----------
$plainPayload = json_encode([
"email" => $email,
// "corporateId" => env('VIDAL_WELLNESS_CORPORATE_ID'),
"urlIdentifier" => env('VIDAL_WELLNESS_URL_IDENTIFIER')
]);
// ---------- STEP 2: Encrypt payload ----------
$iv = random_bytes(16);
$encryptedRaw = openssl_encrypt($plainPayload, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $iv);
$encryptedPayload = base64_encode($iv) . ":" . base64_encode($encryptedRaw);
log_message('info', "SSO: Payload encrypted successfully");
// ---------- STEP 3: Call Authentication API ----------
$requestBody = json_encode([
"payload" => $encryptedPayload,
"source" => env('VIDAL_WELLNESS_SUB_PARTNER_ID'),
"subPartnerId" => env('VIDAL_WELLNESS_SUB_PARTNER_ID')
]);
$headers = [
"Ocp-Apim-Subscription-Key: $subscriptionKey",
"apiver: $apiVersion",
"mode: encrypt",
"Content-Type: application/json"
];
$ch = curl_init($authUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$apiResponse = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
curl_close($ch);
log_message('info', "SSO: API response received, HTTP Code: $httpCode");
// Check for cURL errors
if ($curlError) {
log_message('error', "SSO: cURL error - $curlError");
return ['status' => 'failed','message' => $curlError];
}
// Check HTTP status
if ($httpCode !== 200) {
log_message('error', "SSO: HTTP error - Code: $httpCode, Response: $apiResponse");
return ['status' => 'failed','message' => "HTTP error: $httpCode" , "response" => $apiResponse ];
}
$jsonResponse = json_decode($apiResponse, true);
// Check JSON decode error
if (json_last_error() !== JSON_ERROR_NONE) {
log_message('error', "SSO: JSON decode error - " . json_last_error_msg());
return ['status' => 'failed','message' => "JSON decode error: " . json_last_error_msg(), "response" => $apiResponse];
}
// Check API response status
if (!isset($jsonResponse["status"]) || $jsonResponse["status"] !== "success") {
log_message('error', "SSO: API error - " . json_encode($jsonResponse));
return ['status' => 'failed','message' => "API error", "response" => $jsonResponse];
}
if (!isset($jsonResponse["data"])) {
log_message('error', "SSO: Missing data field in response");
return ['status' => 'failed','message' => "Invalid API response - missing data field", "response" => $jsonResponse];
}
log_message('info', "SSO: API response validated successfully");
// ---------- STEP 4: Decrypt response ----------
log_message('info', "SSO: Starting response decryption");
$dataParts = explode(":", $jsonResponse["data"]);
if (count($dataParts) !== 2) {
log_message('error', "SSO: Invalid encrypted data format");
return ['status' => 'failed','message' => "Invalid encrypted data format", "data" => $jsonResponse["data"]];
}
list($ivBase64, $cipherBase64) = $dataParts;
$respIv = base64_decode($ivBase64);
$respCipher = base64_decode($cipherBase64);
if ($respIv === false || $respCipher === false) {
log_message('error', "SSO: Base64 decode error");
return ['status' => 'failed','message' => "Base64 decode error"];
}
$decryptedJson = openssl_decrypt($respCipher, "AES-256-CBC", $key, OPENSSL_RAW_DATA, $respIv);
if ($decryptedJson === false) {
log_message('error', "SSO: Decryption failed");
return ['status' => 'failed','message' => "Decryption failed"];
}
$decryptedData = json_decode($decryptedJson, true);
if (json_last_error() !== JSON_ERROR_NONE) {
log_message('error', "SSO: Decrypted JSON decode error - " . json_last_error_msg());
return ['status' => 'failed','message' => "Decrypted JSON decode error: " . json_last_error_msg()];
}
if (!isset($decryptedData["redirectUrl"])) {
log_message('error', "SSO: redirectUrl missing in decrypted data");
return ['status' => 'failed','message' => "redirectUrl missing", "decrypted" => $decryptedData];
}
// ---------- FINAL ----------
log_message('info', "SSO: Authentication successful, redirectUrl obtained");
return ['status' => 'success','data' => $decryptedData["redirectUrl"]];
}
//----------yet to start only submit claim given
public function fileUpload()
{

View File

@ -10,11 +10,19 @@ class CommissionApiFilter implements FilterInterface
{
public function before(RequestInterface $request, $arguments = null)
{
return null;
// return null;
// Read API key from header
// $authHeader = $request->getHeaderLine('X');
$authHeader = $request->getHeaderLine('AUTHORIZATION');
if(empty($authHeader))
{
$authHeader = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
// echo $authHeader;die();
}
// $requestHeaders = getallheaders();
// // $authHeader = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
// // $authHeader = $_SERVER['Authorization'];
// print_r($authHeader);
// print_r($_SERVER);die();
if (empty($authHeader)) {
return service('response')->setJSON([
'success' => false,

View File

@ -36,6 +36,7 @@ class RuleImportService
];
// Column name constants
private const COL_SNO = 'S.No';
private const COL_RULE_NAME = 'Rule Name';
private const COL_POLICY_BUSINESS_TYPE = 'Policy Business Type';
private const COL_POLICY_NAME = 'Policy Name';
@ -52,12 +53,17 @@ class RuleImportService
private const COL_VEHICLE_WEIGHT_MIN = 'Vehicle Weight Min';
private const COL_VEHICLE_WEIGHT_MAX = 'Vehicle Weight Max';
private const COL_RTO_STATE = 'RTO State';
private const COL_RTO_CITY = 'RTO City';
private const COL_RTO_CITY = 'RTO Code';
private const COL_RENEWAL_TYPE = 'Renewal Type';
private const COL_RENEWAL_SUB_TYPE = 'Renewal Sub Type';
private const COL_COMMISSION_TYPE = 'Commission Type';
private const COL_COMMISSION_VALUE = 'Commission Value';
private const COL_COMMISSION_PARAMS = 'Commission Params(TP:OD:PA)';
private const COL_COMMISSION_PARAMS_OD = 'Commission Params (OD)';
private const COL_COMMISSION_PARAMS_PA = 'Commission Params (PA)';
private const COL_COMMISSION_PARAMS_TP = 'Commission Params (TP)';
private const COL_NOTES = 'Notes';
protected array $expectedColumns;
@ -82,9 +88,10 @@ class RuleImportService
private function initializeExpectedColumns(): void
{
$this->expectedColumns = [
self::COL_RULE_NAME,
self::COL_POLICY_BUSINESS_TYPE,
self::COL_POLICY_NAME,
// self::COL_RULE_NAME,
// self::COL_POLICY_BUSINESS_TYPE,
// self::COL_POLICY_NAME,
self::COL_SNO,
self::COL_PREMIUM_TYPE,
self::COL_VEHICLE_TYPE,
self::COL_VEHICLE_SUB_TYPE,
@ -100,11 +107,13 @@ class RuleImportService
self::COL_RTO_STATE,
self::COL_RTO_CITY,
self::COL_RENEWAL_TYPE,
self::COL_RENEWAL_SUB_TYPE,
// self::COL_RENEWAL_SUB_TYPE,
self::COL_COMMISSION_TYPE,
self::COL_COMMISSION_VALUE,
self::COL_COMMISSION_PARAMS,
self::COL_NOTES
self::COL_COMMISSION_PARAMS_TP,
self::COL_COMMISSION_PARAMS_OD,
self::COL_COMMISSION_PARAMS_PA,
// self::COL_NOTES
];
}
@ -123,7 +132,7 @@ class RuleImportService
self::COL_FUEL_TYPE => 'validateCommaList',
self::COL_COMMISSION_TYPE => 'validateCommissionType',
self::COL_COMMISSION_VALUE => 'validateNumeric',
self::COL_COMMISSION_PARAMS => 'validateCompositeParams',
// self::COL_COMMISSION_PARAMS => 'validateCompositeParams',
];
}
@ -402,13 +411,16 @@ class RuleImportService
{
$commissionType = strtolower($rowData[self::COL_COMMISSION_TYPE] ?? '');
$commissionValue = $rowData[self::COL_COMMISSION_VALUE] ?? '';
$commissionParams = $rowData[self::COL_COMMISSION_PARAMS] ?? '';
// $commissionParams = $rowData[self::COL_COMMISSION_PARAMS] ?? '';
$commissionParams_od = $rowData[self::COL_COMMISSION_PARAMS_OD] ?? '';
$commissionParams_pa = $rowData[self::COL_COMMISSION_PARAMS_PA] ?? '';
$commissionParams_tp = $rowData[self::COL_COMMISSION_PARAMS_TP] ?? '';
// Composite commission requires params
if ($commissionType === self::COMMISSION_COMPOSITE && empty($commissionParams)) {
if ($commissionType === self::COMMISSION_COMPOSITE && empty($commissionParams_od) && empty($commissionParams_pa) && empty($commissionParams_tp)) {
$this->validationResult->addError(
$rowNum,
self::COL_COMMISSION_PARAMS,
self::COL_COMMISSION_PARAMS_OD,
"Required when commission type is composite"
);
}
@ -1255,10 +1267,14 @@ class RuleImportService
$commissionType = strtolower(trim($rowData[self::COL_COMMISSION_TYPE] ?? ''));
$commissionValue = $rowData[self::COL_COMMISSION_VALUE] ?? '';
$commissionParams = $rowData[self::COL_COMMISSION_PARAMS] ?? '';
$commissionParams_od = $rowData[self::COL_COMMISSION_PARAMS_OD] ?? '';
$commissionParams_pa = $rowData[self::COL_COMMISSION_PARAMS_PA] ?? '';
$commissionParams_tp = $rowData[self::COL_COMMISSION_PARAMS_TP] ?? '';
$commission = $commissionParams_tp.':'.$commissionParams_od.':'. $commissionParams_pa;
switch ($commissionType) {
case 'composite':
return $this->buildCompositeCalculation($commissionParams);
return $this->buildCompositeCalculation($commission);
case 'percentage':
return $this->buildPercentageCalculation($commissionValue);

View File

@ -51,15 +51,15 @@ table.dataTable thead th {
<?php foreach($addImageList as $row){ ?>
<tr >
<td class="client_info" data-id="<?php echo $row['id']; ?>"><?php echo $row['name']; ?></td>
<td class="client_info" ><?php echo $row['client_name']; ?></td>
<td class="client_info" ><?php echo $row['short_name']; ?></td>
<td class="client_info" ><?php echo $row['client_id'] != 0 ? $row['client_name'] : '-' ; ?></td>
<td class="client_info" ><?php echo $row['client_id'] != 0 ? $row['short_name'] : '-'; ?></td>
<td class="client_info" ><?php echo $row['status']; ?></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>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item advertise_image_edit" href="#" data-toggle="modal" data-wholearray='<?php echo json_encode($row, JSON_HEX_APOS); ?>' data-target="#bike_make_login-modal"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a class="dropdown-item" onclick="remove_advertise_image('<?= $row['id'];?>')"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
<?php if($row['client_id'] != 0) { ?> <a class="dropdown-item" onclick="remove_advertise_image('<?= $row['id'];?>')"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a> <?php } ?>
</div>
</div>
</td>
@ -136,6 +136,7 @@ table.dataTable thead th {
<label for="client_branch">Client <span class="text-danger">*</span></label>
<select class="form-control" id="client_id" name="client_id" required>
<option value="">Select Client</option>
<option value="0">Default Image</option>
<?php
if (isset($client) && count($client)) {
foreach ($client as $value) {
@ -209,7 +210,7 @@ table.dataTable thead th {
if (response.status) {
$('#bike_make_login-modal').modal('hide');
$('#advertise_image').val('');
$('#client_id').val('');
$('#client_id').val(null).trigger('change');
$('#uploadPreview').attr('src', '<?= base_url('public/assets/images/avatar_2x.png') ?>');
toastr.success('Image uploaded successfully!');
window.location.reload();
@ -292,9 +293,9 @@ table.dataTable thead th {
var table;
$(document).ready(function() {
$('#add_image_id').val('');
$('#client_id').val('');
$('#client_id').select2();
$('#add_image_id').val('');
$('#client_id').val(null).trigger('change');
$('#advertise_image').val('');
table = $('#tickets-table').DataTable({
// dom: "<'row'<'col-sm-1'f><'col-sm-11 text-right'B>>" + // Filter left, button right
@ -333,6 +334,7 @@ table.dataTable thead th {
// ✅ Define your modal function separately
function callmodal() {
$('#add_image_id').val(0);
$('#client_id').val(null).trigger('change');
$('#advertise_add_edit').html('Add Advertise Image');
$('#uploadPreview').attr('src', '<?= base_url()."public/assets/images/avatar_2x.png" ?>');
$('#bike_model_login-modal').modal('show'); // ✅ this shows the modal
@ -394,7 +396,7 @@ table.dataTable thead th {
// 1. Clear fields first for a clean state (Good practice)
$('#add_image_id').val('');
$('#client_id').val('');
$('#client_id').val(null).trigger('change');
$('#advertise_image').val('');
// Reset preview to default before processing to avoid flicker/old image
$('#uploadPreview').attr('src', '<?= base_url("public/assets/images/avatar_2x.png") ?>');
@ -404,8 +406,8 @@ table.dataTable thead th {
let ad_id = wholearray.id;
let c_id = wholearray.client_id; // This holds the Client ID for the dropdown
console.log('Whole array:', wholearray);
console.log('Clicked ID:', c_id);
// console.log('Whole array:', wholearray);
// console.log('Clicked ID:', ad_id);
// 2. Set the data fields and title
$('#add_image_id').val(ad_id);
@ -413,14 +415,13 @@ table.dataTable thead th {
// 🎯 CRITICAL FIX: Set the value of the Client SELECT dropdown
// This pre-selects the client associated with the image.
$('#client_id').val(c_id);
$('#client_id').val(c_id).trigger('change');
// 3. Construct the image URL
// NOTE: If this path fails (404/403), revert to the previous controller path:
const imgUrl = '<?= base_url("showAdvertiseImage/"); ?>' + ad_name;
// const imgUrl = '<?= base_url("writable/uploads/advertiseImage/"); ?>' + ad_name;
// const imgUrl = '<?= base_url('public/uploads/add_image_upload/'); ?>' + ad_name;
// 4. Set the image source AND add robust error handling for default image
$('#uploadPreview').attr('src', imgUrl).on('error', function() {

303
app/Views/logs/index.php Normal file
View File

@ -0,0 +1,303 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= esc($title) ?></title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
} */
.container {
max-width: 1200px;
margin: 0 auto;
background: white;
border-radius: 10px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
overflow: hidden;
}
.header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
text-align: center;
}
.header h1 {
font-size: 2rem;
margin-bottom: 10px;
}
.header p {
opacity: 0.9;
}
.content {
padding: 30px;
}
.alert {
padding: 15px 20px;
margin-bottom: 20px;
border-radius: 5px;
font-weight: 500;
}
.alert-success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.alert-error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 2px solid #e9ecef;
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
font-weight: 600;
text-decoration: none;
display: inline-block;
transition: all 0.3s ease;
}
.btn-danger {
background: #dc3545;
color: white;
}
.btn-danger:hover {
background: #c82333;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}
.btn-primary {
background: #667eea;
color: white;
}
.btn-primary:hover {
background: #5568d3;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}
.btn-success {
background: #28a745;
color: white;
}
.btn-success:hover {
background: #218838;
}
.btn-sm {
padding: 6px 12px;
font-size: 12px;
}
.table-wrapper {
overflow-x: auto;
}
table {
width: 100%;
border-collapse: collapse;
background: white;
}
thead {
background: #f8f9fa;
}
th {
padding: 15px;
text-align: left;
font-weight: 600;
color: #495057;
border-bottom: 2px solid #dee2e6;
}
td {
padding: 15px;
border-bottom: 1px solid #dee2e6;
}
tbody tr {
transition: background 0.2s ease;
}
tbody tr:hover {
background: #f8f9fa;
}
.no-logs {
text-align: center;
padding: 60px 20px;
color: #6c757d;
}
.no-logs svg {
width: 100px;
height: 100px;
margin-bottom: 20px;
opacity: 0.5;
}
.action-buttons {
display: flex;
gap: 8px;
}
.file-name {
font-weight: 600;
color: #667eea;
}
.stats {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.stat-card {
flex: 1;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
border-radius: 8px;
text-align: center;
}
.stat-card h3 {
font-size: 2rem;
margin-bottom: 5px;
}
.stat-card p {
opacity: 0.9;
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<!-- <div class="header">
<h1>📋 Log File Manager</h1>
<p>View and manage your CodeIgniter 4 log files</p>
</div> -->
<div class="content">
<?php if (session()->getFlashdata('success')): ?>
<div class="alert alert-success">
<?= session()->getFlashdata('success') ?>
</div>
<?php endif; ?>
<?php if (session()->getFlashdata('error')): ?>
<div class="alert alert-error">
<?= session()->getFlashdata('error') ?>
</div>
<?php endif; ?>
<!-- <div class="stats">
<div class="stat-card">
<h3><?= count($logFiles) ?></h3>
<p>Total Log Files</p>
</div>
</div> -->
<div class="actions">
<h2 style="color: #495057;">Log Files</h2>
<?php if (!empty($logFiles)): ?>
<!-- <a href="<?= base_url('logs/clearAll') ?>"
class="btn btn-danger"
onclick="return confirm('Are you sure you want to delete all log files?')">
🗑️ Clear All Logs
</a> -->
<?php endif; ?>
</div>
<?php if (empty($logFiles)): ?>
<div class="no-logs">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<h3>No Log Files Found</h3>
<p>There are no log files to display at the moment.</p>
</div>
<?php else: ?>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>File Name</th>
<th>Size</th>
<th>Last Modified</th>
<th style="text-align: center;">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($logFiles as $file): ?>
<tr>
<td>
<span class="file-name">
📄 <?= esc($file['name']) ?>
</span>
</td>
<td><?= esc($file['size']) ?></td>
<td><?= esc($file['modified_date']) ?></td>
<td>
<div class="action-buttons" style="justify-content: center;">
<a href="<?= base_url('logs/view/' . urlencode($file['name'])) ?>"
class="btn btn-primary btn-sm">
View
</a>
<a href="<?= base_url('logs/download/' . urlencode($file['name'])) ?>"
class="btn btn-success btn-sm">
Download
</a>
<!-- <a href="<?= base_url('logs/delete/' . urlencode($file['name'])) ?>"
class="btn btn-danger btn-sm"
onclick="return confirm('Are you sure you want to delete this log file?')">
Delete
</a> -->
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
</div>
</body>
</html>

483
app/Views/logs/view.php Normal file
View File

@ -0,0 +1,483 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= esc($title) ?></title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
} */
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 10px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
overflow: hidden;
}
.header {
/* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
color: black;
padding: 5px;
}
.header h1 {
font-size: 1.8rem;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 10px;
}
.file-info {
display: flex;
gap: 30px;
margin-top: 15px;
opacity: 0.9;
}
.file-info-item {
display: flex;
align-items: center;
gap: 8px;
}
.content {
padding: 30px;
}
.controls {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
flex-wrap: wrap;
gap: 15px;
}
.filter-group {
display: flex;
gap: 10px;
align-items: center;
flex-wrap: wrap;
}
.filter-btn {
padding: 8px 16px;
border: 2px solid #dee2e6;
background: white;
border-radius: 5px;
cursor: pointer;
font-size: 13px;
font-weight: 600;
transition: all 0.3s ease;
}
.filter-btn:hover {
border-color: #667eea;
color: #667eea;
}
.filter-btn.active {
background: #667eea;
color: white;
border-color: #667eea;
}
.search-box {
padding: 10px 15px;
border: 2px solid #dee2e6;
border-radius: 5px;
font-size: 14px;
width: 300px;
transition: border-color 0.3s ease;
}
.search-box:focus {
outline: none;
border-color: #667eea;
}
.log-entries {
background: #f8f9fa;
border-radius: 8px;
padding: 20px;
max-height: 600px;
overflow-y: auto;
}
.log-entry {
background: white;
border-left: 4px solid #6c757d;
padding: 15px;
margin-bottom: 15px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.log-entry:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transform: translateX(5px);
}
.log-entry.critical {
border-left-color: #dc3545;
background: #fff5f5;
}
.log-entry.error {
border-left-color: #fd7e14;
background: #fff8f5;
}
.log-entry.warning {
border-left-color: #ffc107;
background: #fffef5;
}
.log-entry.info {
border-left-color: #17a2b8;
background: #f5fcfd;
}
.log-entry.debug {
border-left-color: #6c757d;
background: #f8f9fa;
}
.log-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #e9ecef;
}
.log-level {
padding: 4px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.level-critical {
background: #dc3545;
color: white;
}
.level-error {
background: #fd7e14;
color: white;
}
.level-warning {
background: #ffc107;
color: #333;
}
.level-info {
background: #17a2b8;
color: white;
}
.level-debug {
background: #6c757d;
color: white;
}
.log-date {
color: #6c757d;
font-size: 13px;
font-family: 'Courier New', monospace;
}
.log-message {
color: #333;
line-height: 1.6;
font-size: 14px;
white-space: pre-wrap;
word-wrap: break-word;
font-family: 'Courier New', monospace;
}
.no-logs {
text-align: center;
padding: 60px 20px;
color: #6c757d;
}
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.stat-card {
background-color: #fff;
color: #333;
padding: 0px;
border: 1px solid #007bff;
border-radius: 5px;
text-align: center;
border-width: 1px;
transition: all 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
border-color: #0056b3;
}
.stat-card h3 {
font-size: 2rem;
margin-bottom: 5px;
}
.stat-card p {
opacity: 0.9;
font-size: 15px;
}
.hidden {
display: none;
}
@media (max-width: 768px) {
.search-box {
width: 100%;
}
.controls {
flex-direction: column;
align-items: stretch;
}
.filter-group {
justify-content: center;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<div style="display: flex; justify-content: space-between; align-items: center;">
<h1>
📄 <?= esc($filename) ?>
</h1>
<div style="display:flex; gap:10px; margin-bottom:15px;">
<?php if ($prevFile): ?>
<a href="<?= base_url('logs/view/' . $prevFile) ?>" class="btn btn-primary">Previous</a>
<?php else: ?>
<button class="btn btn-secondary" disabled> Previous Day</button>
<?php endif; ?>
<?php if ($nextFile): ?>
<a href="<?= base_url('logs/view/' . $nextFile) ?>" class="btn btn-primary">Next</a>
<?php else: ?>
<button class="btn btn-secondary" disabled>Next Day </button>
<?php endif; ?>
</div>
</div>
<!-- <div class="file-info">
<div class="file-info-item">
<strong>Size:</strong> <?= esc($fileSize) ?>
</div>
<div class="file-info-item">
<strong>Last Modified:</strong> <?= esc($lastModified) ?>
</div>
<div class="file-info-item">
<strong>Total Entries:</strong> <?= count($logEntries) ?>
</div>
</div> -->
</div>
<div class="content">
<div class="stats">
<!--<div class="stat-card">
<h3 id="total-count"><?= count($logEntries) ?></h3>
<p>Total Entries</p>
</div>
<div class="stat-card">
<h3 id="critical-count">
<?= count(array_filter($logEntries, fn($e) => strtoupper($e['level']) === 'CRITICAL')) ?>
</h3>
<p>Critical</p>
</div>
<div class="stat-card">
<h3 id="error-count">
<?= count(array_filter($logEntries, fn($e) => strtoupper($e['level']) === 'ERROR')) ?>
</h3>
<p>Errors</p>
</div>
<div class="stat-card">
<h3 id="warning-count">
<?= count(array_filter($logEntries, fn($e) => strtoupper($e['level']) === 'WARNING')) ?>
</h3>
<p>Warnings</p>
</div> -->
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'TPA CLAIM PUSH SUCCESS') !== false)) ?>
</h3>
<p>Claim success</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'TPA CLAIM PUSH FAILED') !== false)) ?>
</h3>
<p>Claim failed</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'TPA ID PULL SUCCESS') !== false)) ?>
</h3>
<p>Tpa no pull success</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'TPA ID PULL FAILED') !== false)) ?>
</h3>
<p>Tpa no pull Failed</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'CLAIM STATUS SUCCESS') !== false)) ?>
</h3>
<p>Claim status fetch success</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'CLAIM STATUS FAILED') !== false)) ?>
</h3>
<p>Claim status fetch failed</p>
</div>
<div class="stat-card">
<h3 id="newtoken-count">
<?= count(array_filter($logEntries, fn($e) => stripos($e['message'], 'Ecard Request PUSH SUCCESS') !== false)) ?>
</h3>
<p>Ecard Request</p>
</div>
</div>
<div class="controls">
<div class="filter-group">
<strong>Filter:</strong>
<button class="filter-btn active" data-level="all">All</button>
<button class="filter-btn" data-level="critical">Critical</button>
<button class="filter-btn" data-level="error">Error</button>
<button class="filter-btn" data-level="warning">Warning</button>
<button class="filter-btn" data-level="info">Info</button>
<button class="filter-btn" data-level="debug">Debug</button>
</div>
<input type="text" class="search-box" id="searchBox" placeholder="🔍 Search log messages...">
</div>
<?php if (empty($logEntries)): ?>
<div class="no-logs">
<h3>No Log Entries Found</h3>
<p>This log file is empty or couldn't be parsed.</p>
</div>
<?php else: ?>
<div class="log-entries" id="logEntries">
<?php foreach ($logEntries as $entry): ?>
<?php
$level = strtolower($entry['level']);
$levelClass = 'level-' . $level;
?>
<div class="log-entry <?= $level ?>" data-level="<?= $level ?>">
<div class="log-header">
<span class="log-level <?= $levelClass ?>">
<?= esc(strtoupper($entry['level'])) ?>
</span>
<span class="log-date"><?= esc($entry['date']) ?></span>
</div>
<div class="log-message"><?= esc($entry['message']) ?></div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
<script>
// Filter functionality
const filterBtns = document.querySelectorAll('.filter-btn');
const logEntries = document.querySelectorAll('.log-entry');
const searchBox = document.getElementById('searchBox');
let currentFilter = 'all';
filterBtns.forEach(btn => {
btn.addEventListener('click', () => {
filterBtns.forEach(b => b.classList.remove('active'));
btn.classList.add('active');
currentFilter = btn.dataset.level;
applyFilters();
});
});
searchBox.addEventListener('input', applyFilters);
function applyFilters() {
const searchTerm = searchBox.value.toLowerCase();
logEntries.forEach(entry => {
const level = entry.dataset.level;
const message = entry.querySelector('.log-message').textContent.toLowerCase();
const matchesFilter = currentFilter === 'all' || level === currentFilter;
const matchesSearch = message.includes(searchTerm);
if (matchesFilter && matchesSearch) {
entry.classList.remove('hidden');
} else {
entry.classList.add('hidden');
}
});
}
</script>
</body>
</html>

View File

@ -189,7 +189,7 @@
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 style="position: relative;">Add Endorsement</h4>
<h4 id="page_title" style="position: relative;">Add Endorsement</h4>
</div>
<div class="col-6" style="text-align: right;">
<a href="<?= base_url('policy_tranction/endorsement/list2') ?>" id="btnAdd" class="btn btn-primary waves-effect waves-light"
@ -2166,7 +2166,7 @@
</div>
</div>
<div class="form-row mb-2 card_group_7" style="display:none;">
<div class="form-row mb-2 card_group_7">
<div class="col-6"><label class="card_label_7">Base </label></div>
<div class="col-6">
<input type="text" class="form-control right-align-input" id="co_premium_${insurerCount}" name="co_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)">
@ -2234,31 +2234,31 @@
<div class="form-row">
<div class="col-12">
<div class="form-row mb-1 text-success small font-weight-bold">
<div class="col-4">Remuneration</div>
<div class="col-4"></div>
<div class="col-4 hidetp"></div>
<div class="col-4 hideter" style="display:none;"></div>
<div class="col-4 csslabel">Remuneration</div>
<div class="col-4 cssbp"></div>
<div class="col-4 hidetp csstp"></div>
<div class="col-4 hideter csstep" style="display:none;"></div>
</div>
</div>
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_14">Agreed (%)</label></div>
<div class="col-4 card_group_14">
<div class="col-4 csslabel"><label class="card_label_14">Agreed (%)</label></div>
<div class="col-4 card_group_14 cssbp">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_bp_${insurerCount}" name="agreed_bp[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)" >
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_15 hidetp">
<div class="col-4 card_group_15 hidetp csstp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_16 hideter" style="display:none;">
<div class="col-4 card_group_16 hideter csstep" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_tep_${insurerCount}" name="agreed_ter[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)" >
@ -2281,22 +2281,22 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_18">Standard</label></div>
<div class="col-4 card_group_18">
<div class="col-4 csslabel"><label class="card_label_18">Standard</label></div>
<div class="col-4 card_group_18 cssbp">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly>
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_19 hidetp">
<div class="col-4 card_group_19 hidetp csstp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_tp_${insurerCount}" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly >
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_20 hideter" style="display:none;">
<div class="col-4 card_group_20 hideter csstep" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_tep_${insurerCount}" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>
@ -2320,22 +2320,22 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_24">Actual (%)</label></div>
<div class="col-4 card_group_24">
<div class="col-4 csslabel"><label class="card_label_24">Actual (%)</label></div>
<div class="col-4 card_group_24 cssbp">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_22 hidetp">
<div class="col-4 card_group_22 hidetp csstp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_23 hideter" style="display:none;">
<div class="col-4 card_group_23 hideter csstep" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_tep_per_${insurerCount}" name="actual_tep_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)">
@ -2347,20 +2347,20 @@
` : ''}
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_21">Actual brokerage Amount</label></div>
<div class="col-4 card_group_21">
<div class="col-4 csslabel "><label class="card_label_21">Actual Amount</label></div>
<div class="col-4 card_group_21 cssbp">
<div class="input-wrap">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_broker_amt')" onkeypress="return onlyNumbers(event)">
</div>
</div>
<div class="col-4 card_group_22 hidetp">
<div class="col-4 card_group_22 hidetp csstp">
<div class="input-wrap">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_broker_amt' )" onkeypress="return onlyNumbers(event)">
</div>
</div>
<div class="col-4 card_group_23 hideter" style="display:none;">
<div class="col-4 card_group_23 hideter csstep" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_broker_amt')" onkeypress="return onlyNumbers(event)">
@ -2449,38 +2449,68 @@
// Instead of manipulating global classes like $('.hideter').show(), we manipulate classes on the card elements.
// General reset/hide for the current card
if(allocg == "EB"){
$('.hideter').hide();
$('.hidetp').hide();
$('.hidecoter').hide()
$('.hidecotp').hide()
}else{
console.log(allocg);
console.log("*(");
var $allPremiumCols = $('.csslabel, .cssbp , .csstp,.csstep');
$('.hidetp').show();
if(is_co_pay_yes == 1){
$('.hidecotp').show();
$('#table_tr_7').show();
$('#table_tr_35').show();
$('#table_tr_3').show();
}else{
$('.hidecotp').hide();
$('#table_tr_7').hide();
$('#table_tr_35').hide();
$('#table_tr_3').hide();
}
if (allocg == "EB") {
// ----------------------------------------------------
// CASE: 2 Columns Visible (Label, BP)
// Goal: Both must be col-6 to fill the row (6 + 6 = 12)
// ----------------------------------------------------
$('.hideter').hide();
$('.hidetp').hide();
$('.hidecoter').hide();
$('.hidecotp').hide();
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
$('.hideter').show();
if(is_co_pay_yes == 1){
$('.hidecoter').show();
}else{
$('.hidecoter').hide();
}
}else{
$('.hideter').hide();
}
// Select ONLY the currently visible columns and set them to col-6
// Since TP and TEP have the hidetp/hideter classes, they are hidden and excluded by :visible.
$allPremiumCols.filter(':visible').removeClass('col-3 col-4').addClass('col-6');
} else {
// TP column is visible here
$('.hidetp').show();
if (is_co_pay_yes == 1) {
$('.hidecotp').show();
$('#table_tr_7').show();
$('#table_tr_35').show();
$('#table_tr_3').show();
} else {
$('.hidecotp').hide();
$('#table_tr_7').hide();
$('#table_tr_35').hide();
$('#table_tr_3').hide();
}
if (bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull') {
// ----------------------------------------------------
// CASE: 4 Columns Visible (Label, BP, TP, TEP)
// Goal: All must be col-3 (3 + 3 + 3 + 3 = 12)
// ----------------------------------------------------
$('.hideter').show();
if (is_co_pay_yes == 1) {
$('.hidecoter').show();
} else {
$('.hidecoter').hide();
}
// Action for 4 visible columns: Select ALL and set them to col-3
$allPremiumCols.removeClass('col-4 col-6').addClass('col-3');
} else {
// ----------------------------------------------------
// CASE: 3 Columns Visible (Label, BP, TP)
// Goal: All three must be col-4 (4 + 4 + 4 = 12)
// ----------------------------------------------------
$('.hideter').hide();
// Action for 3 visible columns: Select ONLY visible and set them to col-4
// TEP is hidden and excluded by :visible.
$allPremiumCols.filter(':visible').removeClass('col-3 col-6').addClass('col-4');
}
}
// --- 3. Set Standard Percentages ---
var std_bp = 0;
var std_tp = 0;
@ -2973,7 +3003,7 @@
if (tpValueField) {
tpValueField.forEach((field) => { field.value = inputValue; });
console.log("Updated", tpValueFields.length, "hidden tp premiums");
console.log("Updated", tpValueField.length, "hidden tp premiums");
} else {
console.error("Error: Element with class '.tp_value' not found.");
}

View File

@ -318,7 +318,7 @@
<div class="col-1" style="text-align: right; position: relative; left: 193px;">
<a href="<?= base_url('policy_tranction/inception/list2') ?>" type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light">Back</a>
</div>
</div>
</div><!-- row -->
<form role="form" class="parsley-examples" method="post" id="inception_form_id" enctype="multipart/form-data">
<input type="hidden" name="id" id="policy_tranction_primarykey">
@ -520,10 +520,10 @@
</div>
</div>
</div>
</div>
</div> <!-- default_row -->
<!-- Vehicle Quick Add DIV -->
<div class="row" id="vehicle_row_div"></div>
<div class="row" id="vehicle_row_div"></div><!-- vehicle_row_div -->
<!-- Client Details Row -->
<div class="row">
@ -535,8 +535,8 @@
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label>
</a><!-- toggleIcon -->
</label><!-- policyAccordion -->
<div class="card mb-1">
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_0">
<div class="card-body">
@ -581,7 +581,7 @@
</select>
</div> -->
</div>
</div><!-- actcual_clients -->
<div class="row" id="policyholdernamediv" style="display: none;">
<div class="form-group col-md-3">
@ -597,7 +597,7 @@
<label for="same_as_proposer"
style="position: relative;top: 31px;left: 17px;">Insured (Same as Proposer)</label>
</div>
</div>
</div><!-- policyholdernamediv -->
<div class="row" id="family_details" style="display: none;">
<div class="col-md-12">
<div class="form-section">
@ -605,16 +605,16 @@
<div id="dynamic-form-container-for-insured"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- family_details -->
</div><!-- card-body -->
</div><!-- collapseOne -->
</div><!-- card mb-1 -->
</div><!-- accordion_0 closed -->
</div> <!-- Section 1 closed -->
</div><!-- Client Details Row closed -->
<!-- Client Quick Add DIV -->
<div class="row" id="client_row_div"></div>
<div class="row" id="client_row_div"></div><!-- client_row_div -->
<!-- Sales Row -->
<div class="row" id="sales_row" style="display: none;">
@ -629,153 +629,136 @@
</label>
<div class="card mb-1">
<div id="collapseThree" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_2">
<div class="card-body">
<div class="row">
<div class="card-body">
<div class="row">
<div class="form-group col-md-12" id="renewal" style="display: none;">
<label for="addon_policy"> Renewal Source Policy <span id="base_danger"class="text-danger"></span></label>
<select class="form-control" id="source_client_policy_id"name="source_client_policy_id" onchange="setRenewalPolicyData(this)">
<option value="" selected>Select Renewal Source Policy</option>
</select>
</div>
<div class="form-group col-md-12" id="renewal" style="display: none;">
<label for="addon_policy"> Renewal Source Policy <span id="base_danger"class="text-danger"></span></label>
<select class="form-control" id="source_client_policy_id"name="source_client_policy_id" onchange="setRenewalPolicyData(this)">
<option value="" selected>Select Renewal Source Policy</option>
</select>
</div> <!-- renewal -->
<div class="form-group col-md-3" id="base_policy_id" style="display: none;">
<label for="addon_policy">Base Policy<span id="base_danger"
class="text-danger">*</span></label>
<select class="form-control" id="base_policy" name="base_policy">
<option value="" selected>Select Base Policy</option>
</select>
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Policy No<span id="base_danger"class="text-danger">*</span></label>
<input type="text" class="form-control" id="policy_no" name="policy_no"placeholder="Enter Policy No" >
</div>
<div class="form-group col-md-3">
<div class="form-group col-md-3" id="base_policy_id" style="display: none;">
<label for="addon_policy">Base Policy<span id="base_danger"
class="text-danger">*</span></label>
<select class="form-control" id="base_policy" name="base_policy">
<option value="" selected>Select Base Policy</option>
</select>
</div><!-- base_policy_id -->
<label for="addon_policy" class="d-flex align-items-center">
<span class="flex-grow-1">Policy Issue Date<span id="base_danger" class="text-danger">*</span></span>
<small id="policy_issue_month_info"
class="text-right"
style="font-size: x-small;">
</small>
</label>
<input type="text" class="form-control" id="policy_issue_date" name="policy_issue_date" placeholder="DD/MM/YYYY" >
</div>
<div class="d-none">
<label for="addon_policy">Policy Issue Month<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control readonly-select" id="month" name="month" placeholder="MM/YYYY" >
</div>
<div class="form-group col-md-3">
<label for="addon_policy">Policy No<span id="base_danger"class="text-danger">*</span></label>
<input type="text" class="form-control" id="policy_no" name="policy_no"placeholder="Enter Policy No" >
</div><!-- form-group col-md-3 Policy No -->
<div class="form-group col-md-3">
<label for="bp_cgst">D.O.C</label>
<input id="policy_start_date" type="text" class="form-control" name="policy_start_date" placeholder="DD/MM/YYYY" >
</div>
<div class="form-group col-md-3">
<label for="addon_policy" class="d-flex align-items-center">
<span class="flex-grow-1">Policy Issue Date<span id="base_danger" class="text-danger">*</span></span>
<small id="policy_issue_month_info"
class="text-right"
style="font-size: x-small;">
</small>
</label>
<input type="text" class="form-control" id="policy_issue_date" name="policy_issue_date" placeholder="DD/MM/YYYY" >
</div><!-- form-group col-md-3 Policy Issue Date -->
<div class="form-group col-md-3">
<label for="bp_igst">D.O.E</label>
<input id="policy_end_date" type="text" class="form-control" name="policy_end_date" placeholder="DD/MM/YYYY" >
</div>
<!--
<div class="form-group col-md-3" id="tpa_div">
<label for="tpa"> TPA <span id="tpa_danger"class="text-danger"></span></label>
<select class="form-control" id="tpa" name="tpa" >
<option value="" selected>Select TPA</option>
<?php foreach ($tpa as $value) { ?>
<option value="<?= $value['id'] . '-' . $value['tpa_id'] ?>">
<?= $value['tpa_short_name'] . '-' . $value['branch_code'] ?>
</option>
<?php } ?>
</select>
</div> -->
<div class="d-none">
<label for="addon_policy">Policy Issue Month<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control readonly-select" id="month" name="month" placeholder="MM/YYYY" >
</div><!-- Policy Issue Month -->
<div class="form-group col-md-3" id="no_of_insured_div">
<label for="addon_policy">No of Insured<span id="base_danger"class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_count" name="emp_count" placeholder="Enter Employeee" onkeypress="return onlyNumbers(event)">
</div>
<div class="form-group col-md-3">
<label for="bp_cgst">D.O.C</label>
<input id="policy_start_date" type="text" class="form-control" name="policy_start_date" placeholder="DD/MM/YYYY" >
</div><!-- D.O.C -->
<div class="form-group col-md-3" id="no_of_dependents_div">
<label for="addon_policy">No of Dependents<span id="base_danger" class="text-danger"></span></label>
<input type="text" class="form-control" id="dependent_count" name="dependent_count" placeholder="Enter Dependent" onkeypress="return onlyNumbers(event)">
</div>
<div class="form-group col-md-3">
<label for="bp_igst">D.O.E</label>
<input id="policy_end_date" type="text" class="form-control" name="policy_end_date" placeholder="DD/MM/YYYY" >
</div><!-- D.O.E -->
<div class="form-group col-md-3">
<label for="installment">Installment &nbsp; <i id="infoIcon" class="mdi mdi-information-outline info-icon" data-toggle="tooltip" title="Click for Installment details" style="margin-left: 5px;"></i></label>
<input id="installment" value="" type="text" class="form-control" name="installment">
</div>
<div class="form-group col-md-3" id="no_of_insured_div">
<label for="addon_policy">No of Insured<span id="base_danger"class="text-danger"></span></label>
<input type="text" class="form-control" id="emp_count" name="emp_count" placeholder="Enter Employeee" onkeypress="return onlyNumbers(event)">
</div><!-- no_of_insured_div -->
<div class="form-group col-md-3">
<label for="installment_data">
Installment Data
</label>
<input id="installment_data" class="form-control" name="installment_data">
</div>
<div class="form-group col-md-3" id="no_of_dependents_div">
<label for="addon_policy">No of Dependents<span id="base_danger" class="text-danger"></span></label>
<input type="text" class="form-control" id="dependent_count" name="dependent_count" placeholder="Enter Dependent" onkeypress="return onlyNumbers(event)">
</div><!-- no_of_dependents_div -->
<!-- <div class="form-group col-md-3">
<label for="spl">SPL</label>
<input id="spl" value="" type="text" class="form-control" name="spl">
</div> -->
<div class="form-group col-md-3">
<label for="installment">Installment &nbsp; <i id="infoIcon" class="mdi mdi-information-outline info-icon" data-toggle="tooltip" title="Click for Installment details" style="margin-left: 5px;"></i></label>
<input id="installment" value="" type="text" class="form-control" name="installment">
</div><!-- Installment -->
<div class="form-group col-md-3">
<label class="card_label_4">Base Premium<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control right-align-input" id="base_premium" name="base_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setBPValue(this.value)" required>
</div>
<div class="form-group col-md-3 hidetp">
<label class="card_label_5">TP Premium</label>
<input type="text" class="form-control right-align-input" id="tp_premium" name="tp_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setTPValue(this.value)">
</div>
<div class="form-group col-md-3">
<label for="installment_data">
Installment Data
</label>
<input id="installment_data" class="form-control" name="installment_data">
</div><!-- Installment Data -->
<div class="form-group col-md-3 hideter card_group_6" style="display:none;">
<label class="card_label_6">TEP Premium</label>
<input type="text" class="form-control right-align-input" id="ter_premium" name="ter_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setTEPValue(this.value)">
</div>
<div class="form-group col-md-2">
<label class="switch" style="position: relative;top: 30px;left: 4px;">
<input id="cop_yes" type="checkbox" name="co_share">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="inception_type"
style="position: relative;top: 31px;left: 17px;">CoP Yes</label>
</div>
<div class="form-group col-md-4 payby d-none">
<label class="switch" style="position: relative;top: 30px;left: 4px;">
<input id="bro_payable_by" type="checkbox" name="bro_payable_by" checked>
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="inception_type" style="position: relative;top: 31px;left: 17px;">Remuneration Pay By Leader</label>
</div>
<div class="form-group col-md-4">
<label for="renewal_date">Renewal Date<span id="base_danger"
class="text-danger">*</span></label>
<input type="text" class="form-control" id="renewal_date"
name="renewal_date" placeholder="DD/MM/YYYY">
</div>
<div class="form-group col-md-3">
<label class="card_label_4">Base Premium<span id="base_danger" class="text-danger">*</span></label>
<input type="text" class="form-control right-align-input" id="base_premium" name="base_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setBPValue(this.value)" required>
</div><!-- Base Premium -->
<div class="form-group col-md-3 hidetp">
<label class="card_label_5">TP Premium</label>
<input type="text" class="form-control right-align-input" id="tp_premium" name="tp_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setTPValue(this.value)">
</div><!-- TP Premium -->
</div>
<!-- <div class="row"> -->
<!-- <div class="form-group col-md-3">
<label for="location">Location<span id="base_danger"class="text-danger"></span></label>
<input type="text" class="form-control" id="location" name="location"placeholder="Enter location" >
</div> -->
<!-- </div> -->
</div>
</div>
<div class="form-group col-md-3 hideter card_group_6" style="display:none;">
<label class="card_label_6">TEP Premium</label>
<input type="text" class="form-control right-align-input" id="ter_premium" name="ter_premium" oninput="" onkeypress="return onlyNumbers(event)" onchange="setTEPValue(this.value)">
</div><!-- TEP Premium -->
<div class="form-group col-md-2">
<label class="switch" style="position: relative;top: 30px;left: 4px;">
<input id="cop_yes" type="checkbox" name="co_share">
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="inception_type"
style="position: relative;top: 31px;left: 17px;">CoP Yes</label>
</div><!-- CoP Yes -->
<div class="form-group col-md-4 payby d-none">
<label class="switch" style="position: relative;top: 30px;left: 4px;">
<input id="bro_payable_by" type="checkbox" name="bro_payable_by" checked>
<span class="slider round" style="height: 27px;"></span>
</label>
<label for="inception_type" style="position: relative;top: 31px;left: 17px;">Remuneration Pay By Leader</label>
</div><!-- Remuneration Pay By Leader -->
<div class="form-group col-md-4">
<label for="renewal_date">Renewal Date<span id="base_danger"
class="text-danger">*</span></label>
<input type="text" class="form-control" id="renewal_date"
name="renewal_date" placeholder="DD/MM/YYYY">
</div><!-- Renewal Date -->
</div><!-- collapseThree card-body row -->
</div><!-- collapseThree card-body -->
</div><!-- collapseThree -->
</div><!-- card mb-1 -->
</div> <!-- accordion_2 div closed here -->
</div><!-- 1st col-md-12 div closed here -->
<!-- Premium Details -->
</div> <!-- sales_row div closed here -->
<!-- Premium Details Row -->
<div class="row" id="premium_details_row">
<div class="col-md-12">
<div id="accordion_3" class="mb-0">
<label id="policyAccordion" class="m-1 d-flex justify-content-between align-items-center">
<span class="font-color-black">Premium Details</span>
@ -783,36 +766,31 @@
aria-expanded="true">
<i id="icon" class="mdi mdi-chevron-up mr-1 text-primary" style="font-size: 28px;"></i>
</a>
</label>
</label><!-- Premium Details policyAccordion -->
<div class="card mb-0">
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
<div class="card-body">
<div id="allInsurerCards"></div>
</div>
</div> <!-- collapseFour div closed here -->
</div>
</div> <!-- accordion_3 div closed here -->
<!-- ends Premium Details -->
</div> <!-- sales_row div closed here -->
<div class="row">
<div class="col-12">
<div class="form-group text-right mt-2 m-b-0" id="submitButton">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnSubmit">Submit</button>
</div>
</div> <!-- Premium Details collapseFour div card-body closed here -->
</div> <!-- Premium Details collapseFour div closed here -->
</div><!-- Premium Details policyAccordion card -->
</div> <!-- Premium Details accordion_3 div closed here -->
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- end form row -->
</div><!-- ends Premium Details -->
<div class="form-group text-right mt-3 m-b-0" id="submitButton">
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
</div><!-- submitButton -->
</form><!-- role="form" -->
</div><!-- card-body -->
</div><!-- card -->
</div><!-- col-xl-12 -->
</div><!-- end inception_form row -->
</div><!-- tab-pane -->
<!-- Vehicle form content modal-->
<div class="modal fade" id="vehicle_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" data-backdrop="static">
@ -4482,31 +4460,31 @@
<div class="form-row">
<div class="col-12">
<div class="form-row mb-1 text-success small font-weight-bold">
<div class="col-4">Remuneration</div>
<div class="col-4"></div>
<div class="col-4 hidetp"></div>
<div class="col-4 hideter" style="display:none;"></div>
<div class="col-4 csslabel">Remuneration</div>
<div class="col-4 cssbp"></div>
<div class="col-4 csstp hidetp"></div>
<div class="col-4 csstep hideter" style="display:none;"></div>
</div>
</div>
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_14">Agreed (%)</label></div>
<div class="col-4 card_group_14">
<div class="col-4 csslabel "><label class="card_label_14">Agreed (%)</label></div>
<div class="col-4 cssbp card_group_14">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_bp_${insurerCount}" name="agreed_bp[]" oninput="validateRange(this);" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_15 hidetp">
<div class="col-4 card_group_15 csstp hidetp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="validateRange(this);" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_16 hideter" style="display:none;">
<div class="col-4 card_group_16 csstep hideter" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp; </span>
<input type="text" class="form-control right-align-input input-content" id="agreed_ter_${insurerCount}" name="agreed_ter[]" oninput="validateRange(this);" onkeypress="return onlyNumbers(event)">
@ -4529,22 +4507,22 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_18">Standard</label></div>
<div class="col-4 card_group_18">
<div class="col-4 csslabel "><label class="card_label_18">Standard</label></div>
<div class="col-4 cssbp card_group_18">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_bp_${insurerCount}" name="standard_bp[]" readonly>
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_19 hidetp">
<div class="col-4 card_group_19 csstp hidetp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_tp_${insurerCount}" name="standard_tp[]" readonly>
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_20 hideter" style="display:none;">
<div class="col-4 card_group_20 csstep hideter" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-color right-align-input input-content" id="standard_tep_${insurerCount}" name="standard_ter[]" readonly>
@ -4567,22 +4545,22 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_24">Actual (%)</label></div>
<div class="col-4 card_group_24">
<div class="col-4 csslabel "><label class="card_label_24">Actual (%)</label></div>
<div class="col-4 cssbp card_group_24">
<div class="input-wrap mr-2">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_22 hidetp">
<div class="col-4 card_group_22 csstp hidetp">
<div class="input-wrap mr-2">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)">
<span class="input-symbol">%</span>
</div>
</div>
<div class="col-4 card_group_23 hideter" style="display:none;">
<div class="col-4 card_group_23 csstep hideter" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input input-content" id="actual_tep_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)">
@ -4596,20 +4574,20 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_21">Actual Amount</label></div>
<div class="col-4 card_group_21">
<div class="col-4 csslabel "><label class="card_label_21">Actual Amount</label></div>
<div class="col-4 cssbp card_group_21">
<div class="input-wrap">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]">
</div>
</div>
<div class="col-4 card_group_22 hidetp">
<div class="col-4 card_group_22 csstp hidetp">
<div class="input-wrap">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]">
</div>
</div>
<div class="col-4 card_group_23 hideter" style="display:none;">
<div class="col-4 card_group_23 csstep hideter" style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]">
@ -4620,20 +4598,20 @@
<div class="col-12">
<div class="form-row mb-2 align-items-center">
<div class="col-4"><label class="card_label_27">Remuneration Amount</label></div>
<div class="col-4 card_group_27">
<div class="col-4 csslabel "><label class="card_label_27">Remuneration Amount</label></div>
<div class="col-4 cssbp card_group_27">
<div class="input-wrap">
<span class="input-prefix">BP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]">
</div>
</div>
<div class="col-4 card_group_28 hidetp">
<div class="col-4 card_group_28 csstp hidetp">
<div class="input-wrap">
<span class="input-prefix">TP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]">
</div>
</div>
<div class="col-4 card_group_29" style="display:none;">
<div class="col-4 card_group_29 csstep hideter " style="display:none;">
<div class="input-wrap">
<span class="input-prefix">TEP &nbsp;</span>
<input type="text" class="form-control readonly-select right-align-input" id="actual_tep_brokerage_amt_dup_${insurerCount}" name="actual_tep_brokerage_amt_dup[]">
@ -4683,8 +4661,10 @@
let allocg = selectedOption.data('allocg');
let is_co_pay_yes = $('#cop_yes').prop('checked') ? 1 : 0;
var $allPremiumCols = $('.csslabel, .cssbp , .csstp,.csstep');
if (allocg == "EB") {
$('.hideter,.hidetp,.hidecoter,.hidecotp').hide();
$allPremiumCols.filter(':visible').removeClass('col-3 col-4').addClass('col-6');
} else {
$('.hidetp').show();
is_co_pay_yes ? $('.hidecotp').show() : $('.hidecotp').hide();
@ -4692,8 +4672,10 @@
if (['Fire','Marine Cargo','Marine Hull'].includes(bap)) {
$('.hideter').show();
is_co_pay_yes ? $('.hidecoter').show() : $('.hidecoter').hide();
$allPremiumCols.removeClass('col-4 col-6').addClass('col-3');
} else {
$('.hideter').hide();
$allPremiumCols.filter(':visible').removeClass('col-3 col-6').addClass('col-4');
}
}
@ -6642,7 +6624,7 @@
if (tpValueField) {
tpValueField.forEach((field) => { field.value = inputValue; });
console.log("Updated", tpValueFields.length, "hidden tp premiums");
console.log("Updated", tpValueField.length, "hidden tp premiums");
} else {
console.error("Error: Element with class '.tp_value' not found.");
}

0
public/assets/images/action_on_policies_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
public/assets/images/active_bds.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

0
public/assets/images/active_claims.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
public/assets/images/active_leads_and_bds_renewal.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
public/assets/images/active_pending_actions.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 826 B

0
public/assets/images/app_content_mng_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
public/assets/images/background_theme.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 665 KiB

After

Width:  |  Height:  |  Size: 665 KiB

0
public/assets/images/bg_image.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 10 MiB

After

Width:  |  Height:  |  Size: 10 MiB

0
public/assets/images/chatbot.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

0
public/assets/images/claims_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
public/assets/images/clients_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
public/assets/images/inactive_bds.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 664 B

After

Width:  |  Height:  |  Size: 664 B

0
public/assets/images/inactive_claims.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
public/assets/images/inactive_pending_actions.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 775 B

0
public/assets/images/leads_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
public/assets/images/login_bg.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 219 KiB

0
public/assets/images/masters_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

0
public/assets/images/policy_transactions_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

0
public/assets/images/ticket.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

0
public/assets/images/user_manual_sb.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
public/claim_sample_forms/DIGITLIF.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/ICICIPRU.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/MAXLIFE.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/NIA.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/OIC.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/PIFL.pdf Normal file → Executable file
View File

0
public/claim_sample_forms/RELIANCE.pdf Normal file → Executable file
View File

0
public/oauth-412703-c47b73db19c0.json Normal file → Executable file
View File

0
public/sample_excel/Sample_Member_Data.xlsx Normal file → Executable file
View File

0
public/sample_excel/Sample_Member_Data_1.xlsx Normal file → Executable file
View File

0
public/sample_excel/insurer_stament_sample.xlsx Normal file → Executable file
View File

0
public/sample_excel/insurer_stament_sample_old.xlsx Normal file → Executable file
View File

0
public/sample_excel/sample_bds_bulk_upload_excel.xlsx Normal file → Executable file
View File

10
public/sample_excel/sample_commission.csv Normal file → Executable file
View File

@ -1,5 +1,5 @@
Rule Name,Policy Business Type,Policy Name,Premium Type,Vehicle Type,Vehicle Sub Type,Make,Model,CC Min,CC Max,Fuel Type,Vehicle Age Min,Vehicle Age Max,Vehicle Weight Min,Vehicle Weight Max,RTO State,RTO City,Renewal Type,Renewal Sub Type,Commission Type,Commission Value,Commission Params(TP:OD:PA),Notes
Motor sample 1,Retail,,,Two Wheeler,,,,100,100,,,,,,,,,,composite,,10:25:0,"id: rule_68bc096e6d7df; conditions: vehicle_type == Two Wheeler; cubic_capcity == 100; calculation: composite 10% on tp_premium, 25% on od_premium"
Motor sample 2,Retail,,,Four Wheeler,,,,1000,1000,,5,5,,,,,,,percentage,10,,id: rule_68fb5ad42f3c4; conditions: vehicle_type == Four Wheeler; cubic_capcity >= 1000; vehicle_age <= 5; calculation: 10% on premium
Sample 2,Retail,,TP,Four Wheeler,,,,1000,1000,,,,,,,,,,composite,,10:0:0,id: rule_691438a7cb08b; conditions: vehicle_type == Four Wheeler; policy_type == TP; is_new_vehicle == true; cubic_capcity > 1000; calculation: composite 10% on tp_premium
Sample 2 test,Retail,,,"Two Wheeler,Four Wheeler",,,,2500,2500,,,,,,,,,,flat,500,,"id: rule_6916ad2837807; conditions: vehicle_type in [Two Wheeler, Four Wheeler]; cubic_capcity == 2500; calculation: fixed 500 on premium"
S.No,Premium Type,Vehicle Type,Vehicle Sub Type,Make,Model,CC Min,CC Max,Fuel Type,Vehicle Age Min,Vehicle Age Max,Vehicle Weight Min,Vehicle Weight Max,RTO State,RTO Code,Renewal Type,Commission Type,Commission Value,Commission Params (TP),Commission Params (OD),Commission Params (PA)
1,OD,Car,Honda i10,Honda,2014,1000,3000,Petrol,5,10,2000,3000,RJ,41,Online,percentage,15,,,
2,TP,Two Wheeler,Passion Pro,Hero,2019,100,150,Petrol,1,5,100,150,RJ,57,Cash,composite,,18,10,
3,COM,PCV,Toyota,Toyota,2020,2000,8000,Diesel,5,20,3000,5000,GJ,33,Card,percentage,25,,,
4,COM,GCV,Tata,Tata,2023,2000,8000,Diesel,5,20,5000,10000,PB,19,Cash,composite,,,10,

1 Rule Name S.No Policy Business Type Premium Type Policy Name Vehicle Type Vehicle Sub Type Make Model CC Min CC Max Fuel Type Vehicle Age Min Vehicle Age Max Vehicle Weight Min Vehicle Weight Max RTO State RTO Code Renewal Type RTO City Commission Type Commission Value Renewal Sub Type Commission Params (TP) Commission Params (OD) Commission Params (PA) Commission Params(TP:OD:PA) Notes
2 Motor sample 1 1 Retail OD Two Wheeler Car Honda i10 Honda 2014 100 1000 100 3000 Petrol 5 10 2000 3000 RJ 41 Online composite percentage 15 10:25:0 id: rule_68bc096e6d7df; conditions: vehicle_type == Two Wheeler; cubic_capcity == 100; calculation: composite 10% on tp_premium, 25% on od_premium
3 Motor sample 2 2 Retail TP Four Wheeler Two Wheeler Passion Pro Hero 2019 1000 100 1000 150 Petrol 5 1 5 100 150 RJ 57 Cash percentage composite 10 18 10 id: rule_68fb5ad42f3c4; conditions: vehicle_type == Four Wheeler; cubic_capcity >= 1000; vehicle_age <= 5; calculation: 10% on premium
4 Sample 2 3 Retail TP COM Four Wheeler PCV Toyota Toyota 2020 1000 2000 1000 8000 Diesel 5 20 3000 5000 GJ 33 Card composite percentage 25 10:0:0 id: rule_691438a7cb08b; conditions: vehicle_type == Four Wheeler; policy_type == TP; is_new_vehicle == true; cubic_capcity > 1000; calculation: composite 10% on tp_premium
5 Sample 2 test 4 Retail COM Two Wheeler,Four Wheeler GCV Tata Tata 2023 2500 2000 2500 8000 Diesel 5 20 5000 10000 PB 19 Cash flat composite 500 10 id: rule_6916ad2837807; conditions: vehicle_type in [Two Wheeler, Four Wheeler]; cubic_capcity == 2500; calculation: fixed 500 on premium

View File

@ -0,0 +1,5 @@
Rule Name,Policy Business Type,Policy Name,Premium Type,Vehicle Type,Vehicle Sub Type,Make,Model,CC Min,CC Max,Fuel Type,Vehicle Age Min,Vehicle Age Max,Vehicle Weight Min,Vehicle Weight Max,RTO State,RTO City,Renewal Type,Renewal Sub Type,Commission Type,Commission Value,Commission Params(TP:OD:PA),Notes
Motor sample 1,Retail,,,Two Wheeler,,,,100,100,,,,,,,,,,composite,,10:25:0,"id: rule_68bc096e6d7df; conditions: vehicle_type == Two Wheeler; cubic_capcity == 100; calculation: composite 10% on tp_premium, 25% on od_premium"
Motor sample 2,Retail,,,Four Wheeler,,,,1000,1000,,5,5,,,,,,,percentage,10,,id: rule_68fb5ad42f3c4; conditions: vehicle_type == Four Wheeler; cubic_capcity >= 1000; vehicle_age <= 5; calculation: 10% on premium
Sample 2,Retail,,TP,Four Wheeler,,,,1000,1000,,,,,,,,,,composite,,10:0:0,id: rule_691438a7cb08b; conditions: vehicle_type == Four Wheeler; policy_type == TP; is_new_vehicle == true; cubic_capcity > 1000; calculation: composite 10% on tp_premium
Sample 2 test,Retail,,,"Two Wheeler,Four Wheeler",,,,2500,2500,,,,,,,,,,flat,500,,"id: rule_6916ad2837807; conditions: vehicle_type in [Two Wheeler, Four Wheeler]; cubic_capcity == 2500; calculation: fixed 500 on premium"
1 Rule Name Policy Business Type Policy Name Premium Type Vehicle Type Vehicle Sub Type Make Model CC Min CC Max Fuel Type Vehicle Age Min Vehicle Age Max Vehicle Weight Min Vehicle Weight Max RTO State RTO City Renewal Type Renewal Sub Type Commission Type Commission Value Commission Params(TP:OD:PA) Notes
2 Motor sample 1 Retail Two Wheeler 100 100 composite 10:25:0 id: rule_68bc096e6d7df; conditions: vehicle_type == Two Wheeler; cubic_capcity == 100; calculation: composite 10% on tp_premium, 25% on od_premium
3 Motor sample 2 Retail Four Wheeler 1000 1000 5 5 percentage 10 id: rule_68fb5ad42f3c4; conditions: vehicle_type == Four Wheeler; cubic_capcity >= 1000; vehicle_age <= 5; calculation: 10% on premium
4 Sample 2 Retail TP Four Wheeler 1000 1000 composite 10:0:0 id: rule_691438a7cb08b; conditions: vehicle_type == Four Wheeler; policy_type == TP; is_new_vehicle == true; cubic_capcity > 1000; calculation: composite 10% on tp_premium
5 Sample 2 test Retail Two Wheeler,Four Wheeler 2500 2500 flat 500 id: rule_6916ad2837807; conditions: vehicle_type in [Two Wheeler, Four Wheeler]; cubic_capcity == 2500; calculation: fixed 500 on premium

0
public/sample_excel/sample_multievent_file.xls Normal file → Executable file
View File

0
public/sample_excel/sample_multievent_file.xlsx Normal file → Executable file
View File

0
public/sample_import_excel/sample_import_Addition.xlsx Normal file → Executable file
View File

0
public/sample_import_excel/sample_import_Deletion.xlsx Normal file → Executable file
View File

View File

View File

View File

View File