Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
4f4d78a3aa
@ -131,6 +131,13 @@ $routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post("edit", "ClientController::editClientPolicyPremium");
|
||||
$routes->post("other_terms", "ClientController::otherPolicyTermsFormSubmit");
|
||||
});
|
||||
|
||||
$routes->group("vehicle", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->post("create", "ClientController::uploadVehicleFile");
|
||||
$routes->post("edit", "ClientController::editUploadVehicleFile");
|
||||
$routes->get("list/(:any)", "ClientController::listVehicleFiles/$1");
|
||||
$routes->get("delete/(:any)", "ClientController::deleteVehicleFiles/$1");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -294,6 +301,10 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->get("getPTCOShareCount/(:any)", "PolicyTransactionController::getPTCOShareCount/$1");
|
||||
$routes->get("test_mail", "MasterController::testGmailAPI");
|
||||
$routes->post("test_mail", "MasterController::testGmailAPI");
|
||||
$routes->get("check_policy_no/(:any)", "ClientController::check_policy_no/$1");
|
||||
$routes->get("get_client_policy_data_using_policy_no/(:any)", "ClientController::get_client_policy_data_using_policy_no/$1");
|
||||
$routes->get("get_client_policy_data_using_policy_no_and_endo_no/(:any)", "ClientController::get_client_policy_data_using_policy_no_and_endo_no/$1");
|
||||
$routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1");
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ use App\Models\PolicyTransactionModel;
|
||||
use App\Models\PolicyTransactionStatusModel;
|
||||
use App\Models\VehicleModel;
|
||||
|
||||
use App\Controllers\EmpDataServiceController;
|
||||
|
||||
|
||||
class ClientController extends AdminController
|
||||
{
|
||||
@ -117,12 +119,8 @@ class ClientController extends AdminController
|
||||
|
||||
public function Testing() //this function for only tsesting some logics not use for business logic
|
||||
{
|
||||
$params['mail'] = 'venkateshraman786@gmail.com';
|
||||
$params['subject'] = 'testing';
|
||||
$params['message'] = 'testing';
|
||||
|
||||
$result = MailHelper::send_email($params);
|
||||
dd($result);
|
||||
// $empDataServiceController = new EmpDataServiceController();
|
||||
// $empDataServiceController->storeEndorsementNumber(23, '00000000000000000560');
|
||||
}
|
||||
|
||||
public function index()
|
||||
@ -487,6 +485,7 @@ class ClientController extends AdminController
|
||||
{
|
||||
$this->myLogger->logme('error','create Client kyc function called');
|
||||
$data = $this->request->getPost();
|
||||
// print_r($data); die;
|
||||
unset($data['file_name']);
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
$File = file_Upload($this->request->getFile('file_name'), $uploadFilePath);
|
||||
@ -646,11 +645,21 @@ class ClientController extends AdminController
|
||||
|
||||
$this->myLogger->logme('error','Client branch CREATE function called');
|
||||
$data = $this->request->getPost();
|
||||
// var_dump($data); die;
|
||||
if (!isset($data['sez'])) {
|
||||
$data['sez'] = 0;
|
||||
} elseif ($data['sez']) {
|
||||
$data['sez'] = 1;
|
||||
}
|
||||
|
||||
$units = json_decode($data['units'], true) ?? [];
|
||||
|
||||
if (!is_array($units) || empty($units)) {
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||
$default_unit = trim(($client_data['short_name'] ?? '') . '-' . ($data['branch_code'] ?? ''), '-');
|
||||
$data['units'] = json_encode([$default_unit]);
|
||||
}
|
||||
|
||||
$data['created_by'] = get_session_userid();
|
||||
$insert = $this->clientBranchModel->insert($data);
|
||||
|
||||
@ -704,6 +713,12 @@ class ClientController extends AdminController
|
||||
|
||||
$list_of_branch_units = $this->clientBranchModel->find($id);
|
||||
$units = json_decode($list_of_branch_units['units']);
|
||||
|
||||
if (!is_array($units) || empty($units)) {
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||
$default_unit = trim(($client_data['short_name'] ?? '') . '-' . ($data['branch_code'] ?? ''), '-');
|
||||
$data['units'] = json_encode([$default_unit]);
|
||||
}
|
||||
|
||||
if (!empty($units)) {
|
||||
foreach ($units as $unit) {
|
||||
@ -714,6 +729,7 @@ class ClientController extends AdminController
|
||||
|
||||
$total_count = $emp_unit_count + $rr_unit_count + $rr_unit_count2;
|
||||
}
|
||||
|
||||
$uncommonValues = [];
|
||||
|
||||
if ($total_count > 0) {
|
||||
@ -739,7 +755,6 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isset($data['sez'])) {
|
||||
$data['sez'] = 0;
|
||||
} elseif ($data['sez']) {
|
||||
@ -1519,6 +1534,78 @@ class ClientController extends AdminController
|
||||
|
||||
|
||||
|
||||
public function uploadVehicleFile()
|
||||
{
|
||||
$this->myLogger->logme('error','uploadVehicleFile function called');
|
||||
$data = $this->request->getPost();
|
||||
$files = $this->request->getFiles();
|
||||
// $data['client_id'] = 12;
|
||||
// $data['vehicle_id'] = 1;
|
||||
|
||||
// upload path
|
||||
$uploadFilePath = WRITEPATH . 'uploads/client_kyc_documents';
|
||||
|
||||
$insertedDocs = [];
|
||||
|
||||
// Check document names and files
|
||||
if (isset($data['other_docs_name']) && isset($files['file_name'])) {
|
||||
foreach ($data['other_docs_name'] as $key => $docName) {
|
||||
// Get the corresponding file for this document name
|
||||
$file = $files['file_name'][$key];
|
||||
|
||||
if (!empty($docName) && $file->isValid() && !$file->hasMoved()) {
|
||||
// Upload the file
|
||||
$uploadedFileName = file_Upload($file, $uploadFilePath);
|
||||
|
||||
if ($uploadedFileName) {
|
||||
// Prepare data for each document upload
|
||||
$docData = [
|
||||
'client_id' => $data['client_id'],
|
||||
'vehicle_id' => $data['vehicle_id'],
|
||||
'other_docs_name' => $docName,
|
||||
'file_name' => $uploadedFileName,
|
||||
'created_by' => get_session_userid(),
|
||||
];
|
||||
|
||||
// Insert into database
|
||||
$insert = $this->clientKYCDocsModel->insert($docData);
|
||||
|
||||
if ($insert) {
|
||||
$insertedDocs[] = $docData; // Collect successfully inserted docs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($insertedDocs)) {
|
||||
// Fetch all documents for the client
|
||||
$vehicleDocs = $this->clientKYCDocsModel
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('vehicle_id',$data['vehicle_id'])
|
||||
->findAll();
|
||||
return $this->respond(['status' => true, 'code' => 200, 'vehicle_docs' => $vehicleDocs, 'inserted_docs' => $insertedDocs], 200);
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No documents uploaded or inserted'], 200);
|
||||
}
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'Invalid data submission'], 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editUploadVehicleFile()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function listVehicleFiles()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function deleteVehicleFiles(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3255,6 +3342,55 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function check_policy_no($policy_no)
|
||||
{
|
||||
$uniqueAC = $this->clientPolicyModel
|
||||
->where('policy_no', $policy_no)
|
||||
->where('is_active', 1)
|
||||
->findAll();
|
||||
|
||||
if($uniqueAC != null){
|
||||
return $this->respond(['status' => true, 'message' => 'The Policy Number is Already Exist', 'code' => 200], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false, 'code' => 404], 200);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_client_policy_data_using_policy_no($policy_no)
|
||||
{
|
||||
$data = $this->clientPolicyModel
|
||||
->select('client_policy.*, clients.client_type')
|
||||
->join('clients', 'client_policy.client_id = clients.id')
|
||||
->where('client_policy.policy_no', $policy_no)
|
||||
->where('client_policy.is_active', 1)
|
||||
->first();
|
||||
|
||||
if($data){
|
||||
return $this->respond(['status' => true, 'data'=> $data, 'code' => 200], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false, 'message' => 'No Data Found', 'code' => 404], 200);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_client_policy_data_using_policy_no_and_endo_no($policy_no, $endorsement_no)
|
||||
{
|
||||
$data = $this->clientPolicyModel
|
||||
->select('client_policy.*, endorsement.endorsement_type')
|
||||
->join('endorsement', 'client_policy.id = endorsement.client_policy_id')
|
||||
->where('client_policy.policy_no', $policy_no)
|
||||
->where('endorsement.endorsement_no', $endorsement_no)
|
||||
->where('client_policy.is_active', 1)
|
||||
->first();
|
||||
|
||||
if($data){
|
||||
return $this->respond(['status' => true, 'data'=> $data, 'code' => 200], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false, 'message' => 'No Data Found', 'code' => 404], 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -27,6 +27,7 @@ use App\Models\UserMessageModel;
|
||||
use App\Models\CDMasterModel;
|
||||
use App\Models\InsurerExcelExportTemplateModel;
|
||||
use App\Models\ClientBranchModel;
|
||||
use App\Models\EndorsementModel;
|
||||
|
||||
use App\Controllers\Jobs;
|
||||
use App\Controllers\JobWorker;
|
||||
@ -58,6 +59,7 @@ class EmpDataServiceController extends BaseController
|
||||
protected $CDMasterModel;
|
||||
protected $excelExportTemplateModel;
|
||||
protected $clientBranchModel;
|
||||
protected $endorsementModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
@ -80,6 +82,7 @@ class EmpDataServiceController extends BaseController
|
||||
$this->CDMasterModel = new CDMasterModel();
|
||||
$this->excelExportTemplateModel = new InsurerExcelExportTemplateModel();
|
||||
$this->clientBranchModel = new ClientBranchModel();
|
||||
$this->endorsementModel = new EndorsementModel();
|
||||
|
||||
}
|
||||
|
||||
@ -2145,6 +2148,7 @@ class EmpDataServiceController extends BaseController
|
||||
$status = $file['status'];
|
||||
$batch_code = $file['batch_code'];
|
||||
$user_id = $file['created_by'];
|
||||
$event_type = $file['event_type'];
|
||||
|
||||
|
||||
$status_val = 'success';
|
||||
@ -2206,6 +2210,8 @@ class EmpDataServiceController extends BaseController
|
||||
|
||||
$this->empEndorsementModel->updateBatch($endorsement_details, 'group_key');
|
||||
$this->employeePolicyModel->bulkUpdateForCorrection($emp_details);
|
||||
$this->storeEndorsementNumber($file_id, $endorsement_id[0]);
|
||||
|
||||
|
||||
// Update batch file status and amount
|
||||
$this->batchFileModel->update($file_id, [
|
||||
@ -2801,6 +2807,8 @@ class EmpDataServiceController extends BaseController
|
||||
// }
|
||||
|
||||
$this->employeePolicyModel->bulkUpdateForEndorsement($endorsement_details);
|
||||
$this->storeEndorsementNumber($file_id, $endorsement_id);
|
||||
|
||||
|
||||
// Update batch file status and amount
|
||||
$this->batchFileModel->update($file_id, [
|
||||
@ -3320,6 +3328,7 @@ class EmpDataServiceController extends BaseController
|
||||
$this->employeeModel->updateBatch($employees_table_data, 'id');
|
||||
$this->employeePolicyModel->updateBatch($employee_policy_table_data, 'id');
|
||||
$this->employeePolicyModel->bulkUpdateForEndorsement($emp_endorsement_table_data);
|
||||
$this->storeEndorsementNumber($file_id, $endorsement_id);
|
||||
|
||||
// Update batch file status and amount
|
||||
$this->batchFileModel->update($file_id, [
|
||||
@ -4367,34 +4376,58 @@ class EmpDataServiceController extends BaseController
|
||||
$this->messageModel->insert($msg_data);
|
||||
}
|
||||
|
||||
public function updatajson()
|
||||
{
|
||||
|
||||
// $columns = [
|
||||
// ["column_index" => 0, "column_name" => "SR NO", "db_column_name" => 'index'],
|
||||
// ["column_index" => 1, "column_name" => "EmployeeId", "db_column_name" => "emp_code"],
|
||||
// ["column_index" => 2, "column_name" => "UHID", "db_column_name" => "uhid"],
|
||||
// ["column_index" => 3, "column_name" => "DOJ", "db_column_name" => "emp_doj"],
|
||||
// ["column_index" => 4, "column_name" => "Name OF Insured", "db_column_name" => "emp_name"],
|
||||
// ["column_index" => 5, "column_name" => "Age", "db_column_name" => "emp_age"],
|
||||
// ["column_index" => 6, "column_name" => "Gender", "db_column_name" => "emp_gender"],
|
||||
// ["column_index" => 7, "column_name" => "DOC", "db_column_name" => null],
|
||||
// ["column_index" => 8, "column_name" => "TOTALSI", "db_column_name" => "basic_cover_si"],
|
||||
// ["column_index" => 9, "column_name" => "DOS", "db_column_name" => "dateofexit"],
|
||||
// ["column_index" => 10, "column_name" => "Mobile", "db_column_name" => 'emp_mobile'],
|
||||
// ["column_index" => 11, "column_name" => "EmailID", "db_column_name" => 'emp_email_c'],
|
||||
// ["column_index" => 12, "column_name" => "REMARKS", "db_column_name" => "remarks"],
|
||||
// ["column_index" => 13, "column_name" => "FLAG STATUS", "db_column_name" => null],
|
||||
// ["column_index" => 14, "column_name" => "EXCEPTIONS", "db_column_name" => null],
|
||||
// ["column_index" => 15, "column_name" => "ABHA", "db_column_name" => null]
|
||||
// ];
|
||||
|
||||
|
||||
|
||||
|
||||
// $json = json_encode($columns);
|
||||
// $this->excelExportTemplateModel->where('id', 37)->set('jsoncolumns', $json)->update();
|
||||
public function storeEndorsementNumber($file_id, $endorsement_no)
|
||||
{
|
||||
// Log the function entry with input parameters
|
||||
$this->myLogger->logme('error', "storeEndorsementNumber --- Starting function with file_id: $file_id and endorsement_no: $endorsement_no");
|
||||
|
||||
// Log before querying the database
|
||||
$this->myLogger->logme('error', "storeEndorsementNumber --- Fetching file data for file_id: $file_id");
|
||||
|
||||
$filedata = $this->batchFileModel
|
||||
->select('
|
||||
batch_files.client_id,
|
||||
batch_files.client_policy_id,
|
||||
batch_files.event_type, .
|
||||
batch_files.created_by,
|
||||
client_policy.insurer_id,
|
||||
client_policy.tpa_id
|
||||
')
|
||||
->join('client_policy', 'batch_files.client_policy_id = client_policy.id')
|
||||
->where('batch_files.id', $file_id)
|
||||
->first();
|
||||
|
||||
// dd($filedata);
|
||||
|
||||
// Log after fetching data
|
||||
if ($filedata) {
|
||||
$this->myLogger->logme('error', 'File data fetched successfully: ' . json_encode($filedata));
|
||||
|
||||
// Log before inserting data
|
||||
$this->myLogger->logme('error', 'storeEndorsementNumber --- Inserting endorsement data into endorsementModel');
|
||||
|
||||
$this->endorsementModel->insert([
|
||||
'client_id' => $filedata['client_id'],
|
||||
'client_policy_id' => $filedata['client_policy_id'],
|
||||
'insurer_id' => $filedata['insurer_id'],
|
||||
'tpa_id' => $filedata['tpa_id'],
|
||||
'endorsement_no' => $endorsement_no,
|
||||
'endorsement_type' => $filedata['event_type'],
|
||||
'created_by' => $filedata['created_by'],
|
||||
]);
|
||||
|
||||
// Log after data insertion
|
||||
$this->myLogger->logme('error', 'storeEndorsementNumber --- Endorsement data inserted successfully for file_id: ' . $file_id);
|
||||
} else {
|
||||
// Log if no file data is found
|
||||
$this->myLogger->logme('error', "storeEndorsementNumber --- No file data found for file_id: $file_id");
|
||||
}
|
||||
|
||||
// Log function exit
|
||||
$this->myLogger->logme('error',"storeEndorsementNumber --- Function execution completed for file_id: $file_id");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1028,6 +1028,7 @@ class EmployeeRestController extends AdminController
|
||||
$self['data']['basic_cover_si'] = $employee_policy->basic_cover_si;
|
||||
|
||||
$array->mapped_family_floaters = $self;
|
||||
$array->type = 'GPA';
|
||||
|
||||
|
||||
|
||||
@ -1155,7 +1156,7 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
|
||||
$array->mapped_family_floaters = $data;
|
||||
$array->type = "Group Medical Coverage";
|
||||
$array->type = "GMC";
|
||||
|
||||
$checkGmcParentsPolicyExist = $this->clientPolicyModel->select('client_policy.id as ClientPolicyId , client_policy.client_id as ClientId, client_policy.policy_type_id as policy_type_id, policy_type.long_name as Policy_Name , client_policy.is_addon as is_addon , client_policy.open_for_enrollment as OpenForEnrollment , client_policy.inception_type as inception_type , client_policy.policy_terms as Policy_Terms')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
||||
@ -1344,7 +1345,7 @@ class EmployeeRestController extends AdminController
|
||||
}
|
||||
|
||||
$array->mapped_family_floaters = $data;
|
||||
$array->type = "Group Medical Coverage - Parents";
|
||||
$array->type = "GMC - Parents";
|
||||
|
||||
return $array;
|
||||
|
||||
@ -1791,7 +1792,7 @@ class EmployeeRestController extends AdminController
|
||||
$responce['family_floaters_of_only_si_value'] = $only_si_value;
|
||||
$responce['family_floaters_of_only_si_premium_value'] = $only_si_premium_value;
|
||||
$responce['family_floaters_of_only_si_gst_value'] = $only_si_gst_value;
|
||||
$responce['type'] = "Group Medical Coverage - Top Up";
|
||||
|
||||
|
||||
if($this->request->getGet('policy') == 'GMC-SI-TOPUP'){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => ['gmc_si_topup'=>$responce]], 200);
|
||||
@ -1840,7 +1841,7 @@ class EmployeeRestController extends AdminController
|
||||
$responce['family_floaters_of_only_si_value'] = $only_si_value;
|
||||
$responce['family_floaters_of_only_si_premium_value'] = $only_si_premium_value;
|
||||
$responce['family_floaters_of_only_si_gst_value'] = $only_si_gst_value;
|
||||
$responce['type'] = "Group Medical Coverage - Parents Top Up";
|
||||
|
||||
|
||||
if($this->request->getGet('policy') == 'GMC-SI-PARENT-TOPUP'){
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => ['gmc_si_parent_topup'=>$responce]], 200);
|
||||
|
||||
@ -157,7 +157,7 @@ class PolicyTransactionController extends BaseController
|
||||
->join('client_branch', 'policy_transaction.client_branch_id = client_branch.id', 'left')
|
||||
->join('insurers', 'pt_co_share_details.insurer_id = insurers.id', 'left')
|
||||
->join('client_policy', 'policy_transaction.client_policy_id = client_policy.id', 'left')
|
||||
->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left')
|
||||
->join('policy_type', 'policy_transaction.policy_type_id = policy_type.id', 'left')
|
||||
->where('policy_transaction.is_active', 1)
|
||||
->where('policy_transaction.action_type', 'inception')
|
||||
->orderBy('policy_transaction.id', 'desc')
|
||||
@ -264,18 +264,26 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
$pt_co_share_details = $this->insertOrUpdateCoShareDetails($data, $insert);
|
||||
|
||||
$client_policy_insert_data = $this->prepareClientPolicyInsertData($data);
|
||||
$client_policy_id = $this->clientPolicyModel->insert($client_policy_insert_data);
|
||||
$this->policyTransactionModel->update($insert, ['client_policy_id' => $client_policy_id]);
|
||||
$emp_policy_insert = $this->InsertIndividualEmpPolicyTable($emp_data, $client_policy_id);
|
||||
if ($data['ct_type'] == 2) {
|
||||
|
||||
if ($data['status'] == 'completed') {
|
||||
$this->processCompletedStatus($data, $client_policy_id, $data['insurer_id']);
|
||||
$client_policy_insert_data = $this->prepareClientPolicyInsertData($data);
|
||||
$client_policy_id = $this->clientPolicyModel->insert($client_policy_insert_data);
|
||||
$this->policyTransactionModel->update($insert, ['client_policy_id' => $client_policy_id]);
|
||||
$emp_policy_insert = $this->InsertIndividualEmpPolicyTable($emp_data, $client_policy_id);
|
||||
|
||||
if ($data['status'] == 'completed') {
|
||||
$this->processCompletedStatus($data, $client_policy_id, $data['insurer_id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$data['pt_co_share_details'] = $this->PTCOShareDetailsModel->where('pt_id', $insert)->where('is_active', 1)->findAll();
|
||||
}
|
||||
|
||||
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->first();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
$data['entity_type_id'] = $client_data['entity_type_id'];
|
||||
|
||||
return $this->respondSuccess($insert, "Policy transaction created successfully", $data);
|
||||
}
|
||||
return $this->respondError("Failed to create policy transaction");
|
||||
@ -294,13 +302,12 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
if (empty($data['client_policy_id']) || $data['client_policy_id'] == 0) {
|
||||
|
||||
$client_policy_insert_data = $this->prepareClientPolicyInsertData($data);
|
||||
// print_r($client_policy_insert_data); die;
|
||||
$client_policy_id = $this->clientPolicyModel->insert($client_policy_insert_data);
|
||||
|
||||
$this->policyTransactionModel->update($id, ['client_policy_id' => $client_policy_id]);
|
||||
|
||||
$this->InsertIndividualEmpPolicyTable($emp_data, $client_policy_id);
|
||||
if ($data['ct_type'] == 2) {
|
||||
$client_policy_insert_data = $this->prepareClientPolicyInsertData($data);
|
||||
$client_policy_id = $this->clientPolicyModel->insert($client_policy_insert_data);
|
||||
$this->policyTransactionModel->update($id, ['client_policy_id' => $client_policy_id]);
|
||||
$this->InsertIndividualEmpPolicyTable($emp_data, $client_policy_id);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (isset($data['emp_policy_id']) && !empty($data['emp_policy_id'][0])) {
|
||||
@ -308,7 +315,7 @@ class PolicyTransactionController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['status'] == 'completed') {
|
||||
if ($data['status'] == 'completed' && $data['ct_type'] == 2) {
|
||||
$this->processCompletedStatus($data, $data['client_policy_id'], $data['insurer_id']);
|
||||
}
|
||||
|
||||
@ -345,27 +352,30 @@ class PolicyTransactionController extends BaseController
|
||||
'bp_igst' => $data['igst'][$index] ?? 0,
|
||||
'bp_sgst' => $data['sgst'][$index] ?? 0,
|
||||
'bp_cgst' => $data['cgst'][$index] ?? 0,
|
||||
'tp_amt' => $data['tp_ter_premium'][$index] ?? 0,
|
||||
'tep_amt' => $data['tp_ter_premium'][$index] ?? 0,
|
||||
'tp_amt' => $data['tp_premium'][$index] ?? 0,
|
||||
'tep_amt' => $data['ter_premium'][$index] ?? 0,
|
||||
'agreed_amt' => $data['agreed_amount'][$index] ?? 0,
|
||||
'agreed_bp_per' => $data['agreed_bp'][$index] ?? 0,
|
||||
'agreed_tp_per' => $data['agreed_tp_ter'][$index] ?? 0,
|
||||
'agreed_tep_per' => $data['agreed_tp_ter'][$index] ?? 0,
|
||||
'agreed_tp_per' => $data['agreed_tp'][$index] ?? 0,
|
||||
'agreed_tep_per' => $data['agreed_ter'][$index] ?? 0,
|
||||
'standerd_bp_per' => $data['standard_bp'][$index] ?? 0,
|
||||
'standerd_tp_per' => $data['standard_tp'][$index] ?? 0,
|
||||
'standerd_tep_per' => $data['standard_tep'][$index] ?? 0,
|
||||
'standerd_tep_per' => $data['standard_ter'][$index] ?? 0,
|
||||
'actual_bp_amt' => $data['actual_bp_amt'][$index] ?? 0,
|
||||
'actual_tp_amt' => $data['actual_tp_amt'][$index] ?? 0,
|
||||
'actual_tep_amt' => $data['actual_tep_amt'][$index] ?? 0,
|
||||
'actual_bp_per' => $data['actual_bp_per'][$index] ?? 0,
|
||||
'actual_tp_per' => $data['actual_tp_per'][$index] ?? 0,
|
||||
'actual_tep_per' => $data['actual_tep_per'][$index] ?? 0,
|
||||
'actual_bp_brokerage_amt' => $data['actual_bp_brokerage_amt'][$index] ?? 0,
|
||||
'actual_tp_brokerage_amt' => $data['actual_tp_brokerage_amt'][$index] ?? 0,
|
||||
'actual_tep_brokerage_amt' => $data['actual_tep_brokerage_amt'][$index] ?? 0,
|
||||
'exp_amt' => $data['exp_amt'][$index] ?? 0,
|
||||
'amount' => $data['total'][$index] ?? 0,
|
||||
'stamp_duty' => $data['stamp_duty'][$index] ?? 0,
|
||||
'cop_amt' => $data['co_premium'][$index] ?? 0,
|
||||
'variance' => $data['variance'][$index] ?? 0,
|
||||
'remark' => $data['remark'][$index] ?? null,
|
||||
'reward' => $data['reward'][$index] ?? null,
|
||||
'created_by' => get_session_userid() ?? null,
|
||||
'updated_by' => get_session_userid() ?? null,
|
||||
'id' => $data['co_share_id'][$index] ?? null, // Assuming this is the ID to identify existing records
|
||||
@ -564,6 +574,7 @@ class PolicyTransactionController extends BaseController
|
||||
policy_transaction.*,
|
||||
clients.short_name as client_short_name,
|
||||
clients.client_type,
|
||||
clients.entity_type_id,
|
||||
policy_type.policy_type,
|
||||
client_policy.tpa_id as master_tpa_id,
|
||||
client_policy.tpa_branch_id as master_tpa_branch_id,
|
||||
@ -586,7 +597,6 @@ class PolicyTransactionController extends BaseController
|
||||
$data['updated_at'] = !empty($data['updated_at']) ? date('d-m-Y h:i:s A', strtotime($data['updated_at'])) : null;
|
||||
|
||||
// print_r($data); die;
|
||||
|
||||
$data['renewal_policy'] = $this->clientPolicyModel
|
||||
->select('client_policy.*, policy_type.policy_type')
|
||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||
@ -611,6 +621,11 @@ class PolicyTransactionController extends BaseController
|
||||
->join('employee_polices', 'employees.id = employee_polices.employee_id', 'left')
|
||||
->where('employees.client_id', $data['client_id'])
|
||||
->where('employees.is_active', 1)->findAll();
|
||||
$data['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $data['client_id'])->findAll();
|
||||
$data['vehicle_docs'] = $this->clientKYCDocsModel
|
||||
->where('client_id', $data['client_id'])
|
||||
->where('vehicle_id', $data['vehicle_id'])
|
||||
->findAll();
|
||||
|
||||
// print_r( $data['pt_co_share_details']); die;
|
||||
|
||||
@ -819,7 +834,7 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
private function handleCompletedStatus($data, $policy_tran_id)
|
||||
{
|
||||
if ($data['status'] == 'completed') {
|
||||
if ($data['status'] == 'completed' && $data['ct_type'] == 2) {
|
||||
|
||||
$tolamt = $data['total'][0];
|
||||
|
||||
@ -964,6 +979,23 @@ class PolicyTransactionController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
public function checkInvoiceStatus($pt_id)
|
||||
{
|
||||
$data = $this->policyTransactionModel
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id')
|
||||
->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id')
|
||||
->where('policy_transaction.id', $pt_id)
|
||||
->where('pt_co_share_details.statement_id IS NOT NULL')
|
||||
->where('insurer_statements.invoice_no IS NOT NULL')
|
||||
->countAllResults();
|
||||
|
||||
if($data){
|
||||
return $this->respond(['status' => true, 'count'=> $data, 'code' => 200], 200);
|
||||
}else{
|
||||
return $this->respond(['status' => false, 'count'=> 0, 'message' => 'No Data Found', 'code' => 404], 200);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
|
||||
//get BDS Reports data
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
use App\Models\ClientModel;
|
||||
use App\Models\UserTeamsModel;
|
||||
|
||||
|
||||
// File: app/Helpers/Uuid_helper.php
|
||||
@ -236,6 +237,33 @@ if (!function_exists('get_role_id')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('teams')) {
|
||||
function teams() {
|
||||
// Load the UserTeamsModel
|
||||
$teamModel = new \App\Models\UserTeamsModel();
|
||||
// Get the user ID from the session
|
||||
$user_id = get_session_userid();
|
||||
|
||||
// Fetch the team IDs associated with the user
|
||||
$user_teams = $teamModel->select('team_id')->where('user_id', $user_id)->findAll();
|
||||
|
||||
// Debugging: Log or print the query result to check its structure
|
||||
// var_dump($user_teams); // You can use this temporarily for testing
|
||||
// log_message('info', 'User Teams: ' . json_encode($user_teams)); // Optionally log it
|
||||
|
||||
// Check if the result is not empty
|
||||
if (!empty($user_teams)) {
|
||||
// Extract only the 'team_id' values
|
||||
$team_ids = array_column($user_teams, 'team_id');
|
||||
return $team_ids; // Return array of team IDs
|
||||
} else {
|
||||
return []; // Return empty array if no teams found
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('generate_client_code')) {
|
||||
function generate_client_code($string = 'GC') {
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ class ClientKYCDocsModel extends Model
|
||||
'is_active',
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"vehicle_id",
|
||||
];
|
||||
|
||||
public function getKycDocsName($client_id){
|
||||
|
||||
30
app/Models/EndorsementModel.php
Normal file
30
app/Models/EndorsementModel.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class EndorsementModel extends Model
|
||||
{
|
||||
protected $table = 'endorsement';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
'id',
|
||||
'client_id',
|
||||
'client_policy_id',
|
||||
'insurer_id',
|
||||
'tpa_id',
|
||||
'endorsement_no',
|
||||
'endorsement_type',
|
||||
'created_by',
|
||||
'created_at',
|
||||
'updated_by',
|
||||
'updated_at',
|
||||
'is_active'
|
||||
];
|
||||
|
||||
}
|
||||
@ -72,6 +72,9 @@ class PolicyTransactionModel extends Model
|
||||
'endorse_eff_date',
|
||||
'sales_generated_by',
|
||||
'serviced_by',
|
||||
'ct_type',
|
||||
'ct_tran_id',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
|
||||
|
||||
@ -30,43 +30,42 @@
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
|
||||
|
||||
<div class="row" id="others">
|
||||
<div class="col-12">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_form"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_id" id="client_id_kyc" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="kyc_doc_type_id" value="0" />
|
||||
<div class="form-group">
|
||||
<div class="card" style="margin-left: 12px;margin-right: -12px;">
|
||||
<div class="card-body">
|
||||
<form role="form" class="parsley-examples" method="post" id="kyc_form"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||
<input type="hidden" name="PrimaryKey" id="kyc_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="client_id" id="client_id_kyc" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||
<input type="hidden" name="kyc_doc_type_id" value="0" />
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="emp_code">Other Documents<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="other_docs_name" placeholder="Document Name" name="other_docs_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="kyc_docs">File<span
|
||||
class="text-danger">*</span></label>
|
||||
<input class="form-control" type="file" name="file_name" multiple="true" id="kyc_docs_file" required accept=".pdf, .jpeg, .jpg, .png">
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-4 align-self-end"> -->
|
||||
<div class="form-group col-md-4" style="margin-top: 42px;">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Upload</button>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="emp_code">Other Documents<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="other_docs_name" placeholder="Document Name" name="other_docs_name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="kyc_docs">File<span
|
||||
class="text-danger">*</span></label>
|
||||
<input class="form-control" type="file" name="file_name" multiple="true" id="kyc_docs_file" required accept=".pdf, .jpeg, .jpg, .png">
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-4 align-self-end"> -->
|
||||
<div class="form-group col-md-4" style="<?= isset($client['id']) ? 'margin-top: 41px;' : 'margin-top: 30px;' ?>">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"id="btnSubmit">Upload</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div> <!-- end row -->
|
||||
|
||||
|
||||
<div class="col-lg-12" id="other_docs_table">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@ -88,8 +87,6 @@
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end -->
|
||||
|
||||
@ -160,7 +157,7 @@
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
// res = JSON.parse(res)
|
||||
// console.log(res);
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(function() {
|
||||
@ -219,131 +216,12 @@
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var entity_type_id = '<?= isset($client['entity_type_id']) ? $client['entity_type_id'] : '' ?>'
|
||||
var client_id = '<?= isset($client['id']) ? $client['id'] : '' ?>'
|
||||
getKYCEntityDocument(entity_type_id, client_id);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/list/"); ?>' + '<?= isset($client['entity_type_id']) ? $client['entity_type_id'] : '' ?>',
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
var tbody = $('#tbody');
|
||||
tbody.empty();
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
var row = `<tr>
|
||||
<td>${item.file_name}</td>
|
||||
<td id="form_${item.id}">
|
||||
<form class="ajax">
|
||||
<input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
|
||||
<input type="hidden" name="client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>">
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
<td>
|
||||
<i id="delete_${item.id}" data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px; display: none"></i>
|
||||
<a id="download_${item.id}" data-id="${item.id}" class="fa fa-download" style="font-size:18px; display: none" download></a>
|
||||
</td>
|
||||
</tr>`;
|
||||
tbody.append(row);
|
||||
});
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var table = '';
|
||||
var data = <?= isset($client_kyc) ? json_encode($client_kyc) : '[]' ?>;
|
||||
|
||||
// console.log('other documents data', data)
|
||||
|
||||
|
||||
$('#other_docs tr').remove();
|
||||
|
||||
var other_docs_count = 0;
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
if(item.other_docs_name != ""){
|
||||
|
||||
other_docs_count++;
|
||||
}
|
||||
|
||||
if(item.kyc_doc_type_id == '0'){
|
||||
table += `
|
||||
<tr id="kyc-${item.id}">
|
||||
<td>${item.other_docs_name}</td>
|
||||
<td>${item.file_name}</td>
|
||||
<td>
|
||||
<i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
|
||||
<a href = "<?= base_url('download-kyc-docs/') ?>${item.file_name}" data-id="${item.id}" class="fa fa-download" style="font-size:18px;" download></a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
}
|
||||
});
|
||||
$('#other_docs').append(table);
|
||||
|
||||
if(other_docs_count > 0){
|
||||
$('#others').show()
|
||||
$('#other_docs_table').show();
|
||||
}
|
||||
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
// console.log(item.kyc_doc_type_id);
|
||||
// console.log('name_' + item.kyc_doc_type_id);
|
||||
// console.log(document.getElementById('name_' + item.kyc_doc_type_id));
|
||||
setTimeout(function() {
|
||||
$('#name_'+item.kyc_doc_type_id).show();
|
||||
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
|
||||
$('#form_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
// console.log('step 1')
|
||||
|
||||
if(item.file_name != null && item.file_name != ""){
|
||||
// console.log('step 2')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).show();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', '<?= base_url('download-kyc-docs/') ?>' + item.file_name);
|
||||
$('#delete_'+item.kyc_doc_type_id).show();
|
||||
}
|
||||
else{
|
||||
// console.log('step 3')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).hide();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', '#');
|
||||
$('#delete_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
|
||||
}
|
||||
// console.log('step 4')
|
||||
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
|
||||
appendKycTableListData(data)
|
||||
|
||||
}
|
||||
|
||||
@ -355,7 +233,6 @@
|
||||
$('#other_docs_table').toggle();
|
||||
});
|
||||
|
||||
|
||||
/*** for Others documents form submit ***/
|
||||
$("#kyc_form").submit(function(event) {
|
||||
event.preventDefault();
|
||||
@ -447,7 +324,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnKycDelete', function () {
|
||||
|
||||
Swal.fire({
|
||||
@ -474,7 +350,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.btnKycOtherDelete', function () {
|
||||
|
||||
Swal.fire({
|
||||
@ -499,5 +374,134 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function getKYCEntityDocument(entity_type_id, client_id){
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("client/kyc/list/"); ?>' + entity_type_id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
|
||||
var tbody = $('#tbody');
|
||||
tbody.empty();
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
var row = `<tr>
|
||||
<td>${item.file_name}</td>
|
||||
<td id="form_${item.id}">
|
||||
<form class="ajax">
|
||||
<input class="file-input__input" type="file" name="file_name">
|
||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
|
||||
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
|
||||
<input type="hidden" name="client_id" value="${client_id}">
|
||||
<button class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
|
||||
</form>
|
||||
</td>
|
||||
<td id="name_${item.id}" style="display:none;"></td>
|
||||
<td>
|
||||
<i id="delete_${item.id}" data-id="${item.id}" class="mdi mdi-delete btnKycDelete" style="font-size:18px; display: none"></i>
|
||||
<a id="download_${item.id}" data-id="${item.id}" class="fa fa-download" style="font-size:18px; display: none" download></a>
|
||||
</td>
|
||||
</tr>`;
|
||||
tbody.append(row);
|
||||
});
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function appendKycTableListData(data){
|
||||
|
||||
console.log('-----------------------------------------------------------')
|
||||
console.log('appendKycTableListData function called')
|
||||
console.log('-----------------------------------------------------------')
|
||||
|
||||
var table = '';
|
||||
|
||||
$('#other_docs tr').remove();
|
||||
|
||||
var other_docs_count = 0;
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
|
||||
if(item.other_docs_name != ""){
|
||||
|
||||
other_docs_count++;
|
||||
}
|
||||
|
||||
if(item.kyc_doc_type_id == '0'){
|
||||
table += `
|
||||
<tr id="kyc-${item.id}">
|
||||
<td>${item.other_docs_name}</td>
|
||||
<td>${item.file_name}</td>
|
||||
<td>
|
||||
<i data-id="${item.id}" class="mdi mdi-delete btnKycOtherDelete" style="font-size:18px;"></i>
|
||||
<a href = "<?= base_url('download-kyc-docs/') ?>${item.file_name}" data-id="${item.id}" class="fa fa-download" style="font-size:18px;" download></a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$('#other_docs').append(table);
|
||||
|
||||
if(other_docs_count > 0){
|
||||
$('#others').show()
|
||||
$('#other_docs_table').show();
|
||||
}
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
// console.log(item.kyc_doc_type_id);
|
||||
// console.log('name_' + item.kyc_doc_type_id);
|
||||
// console.log(document.getElementById('name_' + item.kyc_doc_type_id));
|
||||
setTimeout(function() {
|
||||
$('#name_'+item.kyc_doc_type_id).show();
|
||||
$('#name_'+item.kyc_doc_type_id).html(item.file_name);
|
||||
$('#form_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
// console.log('step 1')
|
||||
|
||||
if(item.file_name != null && item.file_name != ""){
|
||||
// console.log('step 2')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).show();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', '<?= base_url('download-kyc-docs/') ?>' + item.file_name);
|
||||
$('#delete_'+item.kyc_doc_type_id).show();
|
||||
}
|
||||
else{
|
||||
// console.log('step 3')
|
||||
|
||||
$('#download_'+item.kyc_doc_type_id).hide();
|
||||
$('#download_' + item.kyc_doc_type_id).attr('href', '#');
|
||||
$('#delete_'+item.kyc_doc_type_id).hide();
|
||||
|
||||
|
||||
}
|
||||
// console.log('step 4')
|
||||
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -1695,4 +1695,33 @@
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('#policy_no').change(function(){
|
||||
|
||||
var policy_no = $(this).val();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
policy_no = policy_no.trim();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/check_policy_no/');?>'+policy_no,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
toastr.warning(res.message, 'warning');
|
||||
$('#policy_no').val('');
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
@ -142,6 +142,8 @@
|
||||
|
||||
|
||||
<script src="https://cdn.datatables.net/plug-ins/2.0.8/sorting/scientific.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
toastr.options = {
|
||||
|
||||
@ -1341,7 +1341,6 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
}
|
||||
|
||||
if(unit_length == 1 || unit_length == 0){
|
||||
|
||||
$('.unitDiv').hide();
|
||||
$('.unitDiv').find('input').removeAttr('required');
|
||||
}else{
|
||||
@ -1349,6 +1348,10 @@ function addGridHTML(event = false, data = false, ui_type = false, si_or_bp = fa
|
||||
$('.unitDiv').find('input').attr('required', true);
|
||||
}
|
||||
|
||||
if(unit_length == 1){
|
||||
toAddUnitInManuall(unique_id, branch_units[0], 'addGridHTML')
|
||||
}
|
||||
|
||||
$('#gpa_sum_insured').hide();
|
||||
$('#btnGridSubmit').show();
|
||||
|
||||
@ -1837,13 +1840,18 @@ function appendGridtHtml(ui_type = false, secondary = false, data = false)
|
||||
// Count++
|
||||
|
||||
if(unit_length == 1 || unit_length == 0){
|
||||
$('.unitDiv').hide();
|
||||
$('.unitDiv').find('input').removeAttr('required');
|
||||
}else{
|
||||
$('.unitDiv').show();
|
||||
$('.unitDiv').find('input').attr('required', true);
|
||||
}
|
||||
|
||||
$('.unitDiv').hide();
|
||||
$('.unitDiv').find('input').removeAttr('required');
|
||||
}else{
|
||||
$('.unitDiv').show();
|
||||
$('.unitDiv').find('input').attr('required', true);
|
||||
}
|
||||
if(unit_length == 1){
|
||||
console.log(typeof secondary);
|
||||
let unique_id = secondary == 'false' ? null : secondary;
|
||||
toAddUnitInManuall(unique_id, branch_units[0], 'appendGridtHtml')
|
||||
}
|
||||
|
||||
|
||||
// Number to word
|
||||
@ -3031,12 +3039,6 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
|
||||
$relationshipElement.append(html);
|
||||
|
||||
if(policy_type == 1 || policy_type == 6 || policy_type == 7)
|
||||
{
|
||||
$('.radio-group .form-check').css('margin-right', '-50px');
|
||||
}
|
||||
|
||||
|
||||
if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) {
|
||||
$('.radio-group .form-check').css('margin-right', '-60px');
|
||||
} else if (obj['self'] == 0 && obj['spouse'] > 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) {
|
||||
@ -3054,15 +3056,12 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
||||
} else if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){
|
||||
$('.radio-group .form-check').css('margin-right', '-60px');
|
||||
} else {
|
||||
$('.radio-group .form-check').css('margin-right', '-110px');
|
||||
$('.radio-group .form-check').css('margin-right', '-60px');
|
||||
}
|
||||
|
||||
|
||||
// if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0)
|
||||
// {
|
||||
// $('.radio-group .form-check').css('margin-right', '-60px');
|
||||
// }
|
||||
|
||||
if(policy_type == 1 || policy_type == 6 || policy_type == 7){
|
||||
$('.radio-group .form-check').css('margin-right', '-50px');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3891,6 +3890,10 @@ function appendFourthAndSixthRackRate(data = null, uniqueId = null)
|
||||
$('.unitDiv').show();
|
||||
$('.unitDiv').find('input').attr('required', true);
|
||||
}
|
||||
|
||||
if(unit_length == 1){
|
||||
toAddUnitInManuall(unique_id, branch_units[0], 'appendFourthAndSixthRackRate')
|
||||
}
|
||||
}
|
||||
|
||||
function checkValideUnits(unique_id = null)
|
||||
@ -4319,6 +4322,134 @@ function applyStyles(tabId) {
|
||||
}
|
||||
}
|
||||
|
||||
function toAddUnitInManuall(unique_id = null, branch_unit = '', whichFunction) {
|
||||
|
||||
console.log('toAddUnitInManuall unique_id', unique_id)
|
||||
console.log('toAddUnitInManuall whichFunction', whichFunction)
|
||||
|
||||
var id = $('#grid')[0];
|
||||
console.log(id);
|
||||
var container = $('#grid_content_input');
|
||||
|
||||
if (unique_id) {
|
||||
id = $('#grid_'+unique_id)[0];
|
||||
container = $('#grid_content_input_for_additional_'+unique_id);
|
||||
}
|
||||
|
||||
console.log('checkValideUnits id', id);
|
||||
console.log('checkValideUnits container', container);
|
||||
|
||||
if (id.value === '3') {
|
||||
|
||||
var units = container.find('input[name="3_unit[]"]');
|
||||
var unitValues = [];
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '4') {
|
||||
|
||||
var units = container.find('input[name="4_unit[]"]');
|
||||
var unitValues = [];
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '2' || id.value === '9') {
|
||||
|
||||
var units = container.find('input[name="gpa_unit29[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '5') {
|
||||
|
||||
var units = container.find('input[name="5_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '6') {
|
||||
|
||||
var units = container.find('input[name="6_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '7') {
|
||||
|
||||
var units = container.find('input[name="7_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '10') {
|
||||
|
||||
var units = container.find('input[name="10_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '8') {
|
||||
|
||||
var units = container.find('input[name="8_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '11') {
|
||||
|
||||
var units = container.find('input[name="11_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '12') {
|
||||
|
||||
var units = container.find('input[name="12_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '13') {
|
||||
|
||||
var units = container.find('input[name="13_unit[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (id.value === '1') {
|
||||
|
||||
var selectedValue = $('#si_or_bp').val();
|
||||
if (selectedValue == 1) {
|
||||
|
||||
var units = container.find('input[name="gpa_unit_1[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
} else if (selectedValue == 3) {
|
||||
|
||||
var units = container.find('input[name="gpa_unit_3[]"]');
|
||||
|
||||
units.each(function() {
|
||||
var value = $(this).val(branch_unit);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -89,6 +89,8 @@
|
||||
<input type="hidden" name="client_id" id="client_id_for_edit">
|
||||
<input type="hidden" name="insurer_id" id="insurer_id">
|
||||
<input type="hidden" name="cd_ac_no" id="cd_ac_no">
|
||||
<input type="hidden" name="ct_type" id="ct_type">
|
||||
|
||||
|
||||
<!-- Client Row -->
|
||||
<div class="row">
|
||||
@ -200,8 +202,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="addon_policy">Endorsement No<span id="base_danger" class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="endorsement_no" name="endorsement_no" placeholder="Enter Endorsement No" required>
|
||||
<label for="addon_policy">Endorsement No<span id="base_danger" class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="endorsement_no" name="endorsement_no" placeholder="Enter Endorsement No" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
@ -215,12 +217,12 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="endorse_eff_date">Endorsement Effective Date<span id="base_danger" class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="endorse_eff_date" name="endorse_eff_date" placeholder="DD/MM/YYYY" required>
|
||||
<label for="endorse_eff_date">Endorsement Effective Date<span id="base_danger" class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="endorse_eff_date" name="endorse_eff_date" placeholder="DD/MM/YYYY" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="addon_policy">No of Employee<span id="base_danger"class="text-danger">*</span></label>
|
||||
<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>
|
||||
|
||||
@ -228,7 +230,7 @@
|
||||
<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>
|
||||
|
||||
count
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -267,10 +269,10 @@
|
||||
</a>
|
||||
</h4>
|
||||
<div id="collapseFour" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion_3">
|
||||
<div class="row" id="add_more_row">
|
||||
<!-- <div class="col-md-2">
|
||||
<div class="row d-none" id="add_more_row">
|
||||
<div class="col-md-2">
|
||||
<input type="number" id="setInsurerCount" class="form-control" placeholder="Enter count">
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- <div class="col-md-2">
|
||||
<a id="addInsurer" class="btn btn-primary mb-3">Add Insurer</a>
|
||||
</div> -->
|
||||
@ -284,64 +286,109 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Premium Details</th>
|
||||
<!-- Add additional header columns if needed for insurers -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<tr id="table_tr_1">
|
||||
<td>Insurer</td>
|
||||
<!-- Columns for dynamic insurers will be added here -->
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_2" style="display: none;">
|
||||
<td>Is Leader?</td>
|
||||
</tr>
|
||||
<tr id="co_share_per_tr" style="display: none;">
|
||||
<tr id="table_tr_3" style="display: none;">
|
||||
<td>Co-Share %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_4">
|
||||
<td>Base Premium</td>
|
||||
</tr>
|
||||
<tr id="tp_premium_tr">
|
||||
<tr class="hidetp" id="table_tr_5">
|
||||
<td id="tp_premium_td">TP Premium</td>
|
||||
</tr>
|
||||
<tr id="co_premium_tr" style="display: none;">
|
||||
<tr class="hideter" id="table_tr_6" style="display: none;">
|
||||
<td>TEP Premium</td>
|
||||
</tr>
|
||||
<tr id="table_tr_7" style="display: none;">
|
||||
<td>Co-Premium</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_8">
|
||||
<td>CGST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_9">
|
||||
<td>SGST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_10">
|
||||
<td>IGST</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_11">
|
||||
<td>GST Amount</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_12">
|
||||
<td>Stamp Duty</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_13">
|
||||
<td>Total</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_14">
|
||||
<td>Agreed BP %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="hidetp" id="table_tr_15">
|
||||
<td id="agree_tp_td">Agreed TP %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="hideter" id="table_tr_16" style="display: none;">
|
||||
<td id="agree_tp_td">Agreed TEP %</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr id="table_tr_17">
|
||||
<td>Agreed Amount</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="table_tr_18">
|
||||
<td>Standard BP %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="std_head">Standard TP %</td>
|
||||
<tr class="hidetp" id="table_tr_19">
|
||||
<td>Standard TP %</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
<td>id</td>
|
||||
<tr class="hideter" id="table_tr_20" style="display: none;">
|
||||
<td>Standard TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_21">
|
||||
<td>Actual BP Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_22">
|
||||
<td>Actual TP Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_23" style="display: none;">
|
||||
<td>Actual TEP Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_24">
|
||||
<td>Actual BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_25">
|
||||
<td>Actual TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_26" style="display: none;">
|
||||
<td>Actual TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_27">
|
||||
<td>Actual BP Brokerage Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_28">
|
||||
<td>Actual TP Brokerage Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_29" style="display: none;">
|
||||
<td>Actual TEP Brokerage Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_30">
|
||||
<td>Expected Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_31">
|
||||
<td>Variance</td>
|
||||
</tr>
|
||||
<tr id="table_tr_32">
|
||||
<td>Reward</td>
|
||||
</tr>
|
||||
<tr id="table_tr_33" style="display: none;">
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -360,7 +407,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<div class="form-group text-right m-b-0" id="submitButton">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||
</div>
|
||||
|
||||
@ -442,6 +489,8 @@ $(document).ready(function(){
|
||||
$('#policy_start_date').val(start_date);
|
||||
$('#policy_end_date').val(end_date);
|
||||
|
||||
removeAllColumnsExceptFirst('insurerTable');
|
||||
|
||||
if(!policy_tranction_primarykey && client_id && client_policy_id){
|
||||
|
||||
form_action = '<?= base_url("util/getPTCOShareCount/"); ?>' + client_id + '/' + client_policy_id;
|
||||
@ -687,14 +736,49 @@ $('#client_type').on('change', function() {
|
||||
$('#client_id').select2();
|
||||
});
|
||||
|
||||
$('#endorsement_no').on('change', function(){
|
||||
|
||||
var policy_no = $('#policy_no').val();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
policy_no = policy_no.trim();
|
||||
console.log(policy_no +'-'+policy_no.length);
|
||||
|
||||
var endorsement_no = $(this).val();
|
||||
console.log(endorsement_no +'-'+endorsement_no.length);
|
||||
endorsement_no = endorsement_no.trim();
|
||||
console.log(endorsement_no +'-'+endorsement_no.length);
|
||||
|
||||
if(policy_no && endorsement_no){
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/get_client_policy_data_using_policy_no_and_endo_no/');?>'+ policy_no + '/' + endorsement_no,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
$('#ct_type').val(1)
|
||||
}else{
|
||||
$('#ct_type').val(2)
|
||||
console.log(res.message, 'warning');
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
//edit function
|
||||
function getPolicyTransactionDataForEndorsementEdit(input){
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
|
||||
$('#endorsement_form_id')[0].reset();
|
||||
var id = $(input).attr('data-id');
|
||||
|
||||
@ -758,21 +842,38 @@ function getPolicyTransactionDataForEndorsementEdit(input){
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
checkInvoiceStatusToHideSubmitBtn(id)
|
||||
|
||||
}
|
||||
//end edit function
|
||||
|
||||
function amountCalculation(input) {
|
||||
|
||||
console.log(input);
|
||||
// console.log(input);
|
||||
let selectedOption = $('#policy_type_id').find('option:selected');
|
||||
let bap = selectedOption.data('bap');
|
||||
|
||||
|
||||
// Retrieve and parse the values or default to 0 if not a number
|
||||
let bp = parseFloat($('#base_premium_' + input).val()) || 0;
|
||||
let tp = parseFloat($('#tp_ter_premium_' + input).val()) || 0;
|
||||
|
||||
var tp = 0;
|
||||
if(bap == 'Motor'){
|
||||
tp = parseFloat($('#tp_premium_' + input).val()) || 0;
|
||||
}
|
||||
|
||||
var tep = 0;
|
||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||
tep = parseFloat($('#ter_premium_' + input).val()) || 0;
|
||||
}
|
||||
|
||||
let cop = parseFloat($('#co_premium_' + input).val()) || 0;
|
||||
let cgst = parseFloat($('#cgst_' + input).val()) || 0;
|
||||
let sgst = parseFloat($('#sgst_' + input).val()) || 0;
|
||||
let igst = parseFloat($('#igst_' + input).val()) || 0;
|
||||
let stamp_duty_amt = parseFloat($('#stamp_duty_' + input).val()) || 0;
|
||||
let agreed_amount = parseFloat($('#agreed_amount_' + input).val()) || 0;
|
||||
|
||||
// Calculate GST percentage
|
||||
let gst_per = igst;
|
||||
@ -781,16 +882,137 @@ function amountCalculation(input) {
|
||||
}
|
||||
|
||||
// Calculate the total premium (Base + TP + Co-Premium)
|
||||
let tpTotal = bp + tp + cop;
|
||||
let tpTotal = bp + tp + tep + cop;
|
||||
|
||||
let gst_per_amt = (tpTotal * gst_per) / 100;
|
||||
$('#gst_amount_' + input).val(gst_per_amt.toFixed(2));
|
||||
|
||||
let finalTotal = tpTotal + gst_per_amt + stamp_duty_amt;
|
||||
|
||||
console.log('Summed Amount:', finalTotal);
|
||||
// console.log('Summed Amount:', finalTotal);
|
||||
|
||||
$('#total_amt_' + input).val(finalTotal.toFixed(2));
|
||||
|
||||
var expectedAmount = 0;
|
||||
|
||||
if(agreed_amount != 0 || agreed_amount != ""){
|
||||
expectedAmount = agreed_amount;
|
||||
}else{
|
||||
expectedAmount = bp + tp + tep;
|
||||
}
|
||||
|
||||
//Expected Amount
|
||||
$('#exp_amt_' + input).val(expectedAmount.toFixed(2));
|
||||
|
||||
let actual_bp_brokerage_amount = $('#actual_bp_brokerage_amt_' + input).val();
|
||||
let actual_tp_brokerage_amount = $('#actual_tp_brokerage_amt_' + input).val();
|
||||
let actual_tep_brokerage_amount = $('#actual_tep_brokerage_amt_' + input).val();
|
||||
|
||||
let variance = expectedAmount - (actual_bp_brokerage_amount + actual_tp_brokerage_amount + actual_tep_brokerage_amount)
|
||||
|
||||
$('#variance_' + input).val(variance.toFixed(2));
|
||||
|
||||
console.log('expectedAmount', expectedAmount);
|
||||
console.log('variance', variance);
|
||||
}
|
||||
|
||||
function actualAmountCalculation(input){
|
||||
|
||||
let selectedOption = $('#policy_type_id').find('option:selected');
|
||||
let bap = selectedOption.data('bap');
|
||||
|
||||
|
||||
let actual_bp_amt = parseFloat($('#actual_bp_amt_' + input).val()) || 0;
|
||||
let actual_tp_amt = parseFloat($('#actual_tp_amt_' + input).val()) || 0;
|
||||
let actual_tep_amt = parseFloat($('#actual_tep_amt_' + input).val()) || 0;
|
||||
let actual_bp_per = parseFloat($('#actual_bp_per_' + input).val()) || 0;
|
||||
let actual_tp_per = parseFloat($('#actual_tp_per_' + input).val()) || 0;
|
||||
let actual_tep_per = parseFloat($('#actual_tep_per_' + input).val()) || 0;
|
||||
let actual_bp_brokerage_amt = parseFloat($('#actual_bp_brokerage_amt_' + input).val()) || 0;
|
||||
let actual_tp_brokerage_amt = parseFloat($('#actual_tp_brokerage_amt_' + input).val()) || 0;
|
||||
let actual_tep_brokerage_amt = parseFloat($('#actual_tep_brokerage_amt_' + input).val()) || 0;
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
|
||||
let actual_bp_brokerage_amount = (actual_bp_amt * actual_bp_per) / 100;
|
||||
let actual_bp_percentage = (actual_bp_brokerage_amt / actual_bp_amt) * 100;
|
||||
|
||||
if(actual_bp_brokerage_amt == 0 || actual_bp_brokerage_amt == 0.00 || actual_bp_brokerage_amt == ""){
|
||||
$('#actual_bp_brokerage_amt_' + input).val(actual_bp_brokerage_amount.toFixed(2));
|
||||
}
|
||||
|
||||
if(actual_bp_per == 0 || actual_bp_per == 0.00 || actual_bp_per == ""){
|
||||
$('#actual_bp_per_' + input).val(actual_bp_percentage.toFixed(2));
|
||||
}
|
||||
|
||||
console.log('actual_bp_brokerage_amount', actual_bp_brokerage_amount);
|
||||
console.log('actual_bp_percentage', actual_bp_percentage);
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
var actual_tp_brokerage_amount = 0;
|
||||
var actual_tp_percentage = 0;
|
||||
|
||||
if(bap == 'Motor'){
|
||||
|
||||
actual_tp_brokerage_amount = (actual_tp_amt * actual_tp_per) / 100;
|
||||
actual_tp_percentage = (actual_tp_brokerage_amt / actual_tp_amt) * 100;
|
||||
|
||||
if(actual_tp_brokerage_amt == 0 || actual_tp_brokerage_amt == ""){
|
||||
$('#actual_tp_brokerage_amt_' + input).val(actual_tp_brokerage_amount.toFixed(2));
|
||||
}
|
||||
|
||||
if(actual_tp_per == 0 || actual_tp_per == ""){
|
||||
$('#actual_tp_per_' + input).val(actual_bp_percentage.toFixed(2));
|
||||
}
|
||||
|
||||
console.log('actual_tp_brokerage_amount', actual_tp_brokerage_amount);
|
||||
console.log('actual_tp_percentage', actual_tp_percentage);
|
||||
}else{
|
||||
|
||||
$('#actual_tp_brokerage_amt_' + input).val(0);
|
||||
$('#actual_tp_per_' + input).val(0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
var actual_tep_brokerage_amount = 0;
|
||||
var actual_tep_percentage = 0;
|
||||
|
||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||
|
||||
actual_tep_brokerage_amount = (actual_tep_amt * actual_tep_per) / 100;
|
||||
actual_tep_percentage = (actual_tep_brokerage_amt / actual_tep_amt) * 100;
|
||||
|
||||
if(actual_tep_brokerage_amt == 0 || actual_tep_brokerage_amt == ""){
|
||||
$('#actual_tep_brokerage_amt_' + input).val(actual_tep_brokerage_amount.toFixed(2));
|
||||
}
|
||||
|
||||
if(actual_tep_per == 0 || actual_tp_per == ""){
|
||||
$('#actual_tep_per_' + input).val(actual_bep_percentage.toFixed(2));
|
||||
}
|
||||
|
||||
console.log('actual_tep_brokerage_amount', actual_tep_brokerage_amount);
|
||||
console.log('actual_tep_percentage', actual_tep_percentage);
|
||||
|
||||
}else{
|
||||
|
||||
$('#actual_tep_brokerage_amt_' + input).val(0);
|
||||
$('#actual_tep_per_' + input).val(0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
let expectedAmount = parseFloat($('#exp_amt_' + input).val()) || 0;
|
||||
var actual_bp_brokerage_amount2 = parseFloat($('#actual_bp_brokerage_amt_' + input).val()) || 0;
|
||||
let actual_tp_brokerage_amount2 = parseFloat($('#actual_tp_brokerage_amt_' + input).val()) || 0;
|
||||
let actual_tep_brokerage_amount2 = parseFloat($('#actual_tep_brokerage_amt_' + input).val()) || 0;
|
||||
let variance = expectedAmount - (actual_bp_brokerage_amount2 + actual_tp_brokerage_amount2 + actual_tep_brokerage_amount2)
|
||||
|
||||
$('#variance_' + input).val(variance.toFixed(2));
|
||||
|
||||
console.log('expectedAmount', expectedAmount);
|
||||
console.log('variance', variance);
|
||||
}
|
||||
|
||||
function validateRange(input) {
|
||||
@ -798,6 +1020,35 @@ function validateRange(input) {
|
||||
if (input.value > 100) input.value = 100;
|
||||
}
|
||||
|
||||
function checkInvoiceStatusToHideSubmitBtn(id){
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('util/checkInvoiceStatus/');?>'+ id,
|
||||
type: "GET",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
|
||||
console.log(res)
|
||||
if(res.status == true){
|
||||
|
||||
if(res.count > 0){
|
||||
$('#submitButton').hide()
|
||||
}else{
|
||||
$('#submitButton').show()
|
||||
}
|
||||
|
||||
}else{
|
||||
console.log(res.message, 'warning');
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
var insurerCount = 0;
|
||||
@ -816,9 +1067,6 @@ $('#setInsurerCount').on('input', function() {
|
||||
|
||||
function addInsurerColumn() {
|
||||
insurerCount++;
|
||||
|
||||
console.log('------------------------------------------------------------------------------')
|
||||
console.log('addInsurerColumn', insurerCount, 'time called')
|
||||
|
||||
// Update header
|
||||
$('#insurerTable thead tr').append(`
|
||||
@ -828,6 +1076,7 @@ function addInsurerColumn() {
|
||||
</th>
|
||||
`);
|
||||
|
||||
|
||||
// Add a new column for each data row
|
||||
$('#insurerTable tbody tr').each(function(index) {
|
||||
let newCell = '';
|
||||
@ -835,123 +1084,163 @@ function addInsurerColumn() {
|
||||
switch(index) {
|
||||
case 0: // Insurer selection
|
||||
newCell = `<td>
|
||||
<select class="form-control follow_insurer" data-count="${insurerCount}" id="follow_insurer_id_${insurerCount}" name="follow_insurer_id[]">
|
||||
<option value="" selected>Select Insurer</option>
|
||||
<?php foreach ($insurer_branch as $value) { ?>
|
||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>">
|
||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>`;
|
||||
<select class="form-control follow_insurer" data-count="${insurerCount}" id="follow_insurer_id_${insurerCount}" name="follow_insurer_id[]">
|
||||
<option value="" selected>Select Insurer</option>
|
||||
<?php foreach ($insurer_branch as $value) { ?>
|
||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>">
|
||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
||||
</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>`;
|
||||
break;
|
||||
case 1: // Is Leader?
|
||||
newCell = `<td>
|
||||
<label class="switch" style="position: relative; top: 5px; left: 35px;">
|
||||
<input data-id="${insurerCount}" id="co_share_type_${insurerCount}" type="checkbox" name="co_share_type[]" disabled>
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="inception_type" style="position: relative; top: 5px; left: 40px;">Leader Yes</label>
|
||||
<label class="switch" style="position: relative; top: 5px; left: 35px;">
|
||||
<input data-id="${insurerCount}" id="co_share_type_${insurerCount}" type="checkbox" name="co_share_type[]">
|
||||
<span class="slider round" style="height: 27px;"></span>
|
||||
</label>
|
||||
<label for="inception_type" style="position: relative; top: 5px; left: 40px;">Leader Yes</label>
|
||||
</td>`;
|
||||
break;
|
||||
case 2: // Co-Share %
|
||||
newCell = `<td><input type="text" name="co_share_per[]" oninput="validateRange(this)"></td>`;
|
||||
newCell = `<td><input type="text" name="co_share_per[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 3: // Base Premium
|
||||
newCell = `<td><input type="text" id="base_premium_${insurerCount}" name="base_premium[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
newCell = `<td><input type="text" id="base_premium_${insurerCount}" name="base_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 4: // TP / Ter Premium
|
||||
newCell = `<td><input type="text" id="tp_ter_premium_${insurerCount}" name="tp_ter_premium[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 4: // TP Premium
|
||||
newCell = `<td><input type="text" id="tp_premium_${insurerCount}" name="tp_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 5: // Co Premium
|
||||
newCell = `<td><input type="text" id="co_premium_${insurerCount}" name="co_premium[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 5: // Ter Premium
|
||||
newCell = `<td><input type="text" id="ter_premium_${insurerCount}" name="ter_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 6: // CGST
|
||||
newCell = `<td><input type="text" id="cgst_${insurerCount}" name="cgst[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 6: // co Premium
|
||||
newCell = `<td><input type="text" id="co_premium_${insurerCount}" name="co_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 7: // SGST
|
||||
newCell = `<td><input type="text" id="sgst_${insurerCount}" name="sgst[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 7: // CGST
|
||||
newCell = `<td><input type="text" id="cgst_${insurerCount}" name="cgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 8: // IGST
|
||||
newCell = `<td><input type="text" id="igst_${insurerCount}" name="igst[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 8: // SGST
|
||||
newCell = `<td><input type="text" id="sgst_${insurerCount}" name="sgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 9: // GST Amount
|
||||
newCell = `<td><input type="text" class="readonly-color" id="gst_amount_${insurerCount}" name="gst_amount[]" readonly></td>`;
|
||||
case 9: // IGST
|
||||
newCell = `<td><input type="text" id="igst_${insurerCount}" name="igst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 10: // Stamp Duty
|
||||
newCell = `<td><input type="text" id="stamp_duty_${insurerCount}" name="stamp_duty[]" oninput="amountCalculation('${insurerCount}')"></td>`;
|
||||
case 10: // GST Amount
|
||||
newCell = `<td><input type="text" class="readonly-color" id="gst_amount_${insurerCount}" name="gst_amount[]" oninput="amountCalculation('${insurerCount}')" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 11: // Total
|
||||
newCell = `<td><input type="text" class="readonly-color" id="total_amt_${insurerCount}" name="total[]" readonly></td>`;
|
||||
case 11: // Stamp Duty
|
||||
newCell = `<td><input type="text" id="stamp_duty_${insurerCount}" name="stamp_duty[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 12: // Agreed BP %
|
||||
newCell = `<td><input type="text" name="agreed_bp[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
case 12: // Total
|
||||
newCell = `<td><input type="text" class="readonly-color" id="total_amt_${insurerCount}" name="total[]" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 13: // Agreed TP / Ter %
|
||||
newCell = `<td><input type="text" name="agreed_tp_ter[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
case 13: // Agreed BP %
|
||||
newCell = `<td><input type="text" name="agreed_bp[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 14: // Agreed Amount
|
||||
newCell = `<td><input type="text" name="agreed_amount[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
case 14: // Agreed TP %
|
||||
newCell = `<td><input type="text" name="agreed_tp[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 15: // Standard BP %
|
||||
case 15: // Agreed Ter %
|
||||
newCell = `<td><input type="text" name="agreed_ter[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
newCell = `<td><input type="text" id="agreed_amount_${insurerCount}" name="agreed_amount[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 17: // Standard BP %
|
||||
newCell = `<td><input type="text" class="readonly-color" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 18: // Standard TP %
|
||||
newCell = `<td class="std_tp_td"><input type="text" class="readonly-color" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly ></td>`;
|
||||
break;
|
||||
case 19: // Standard Ter %
|
||||
newCell = `<td class="std_tp_td"><input type="text" class="readonly-color" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
newCell = `<td><input type="text" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
newCell = `<td><input type="text" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 22: // Actual TEP Amount
|
||||
newCell = `<td><input type="text" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
newCell = `<td><input type="text" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
newCell = `<td><input type="text" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 25: // Actual TEP %
|
||||
newCell = `<td><input type="text" id="actual_tep_per_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
newCell = `<td><input type="text" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
newCell = `<td><input type="text" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 28: // Actual TEP Brokerage Amount
|
||||
newCell = `<td><input type="text" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
newCell = `<td><input type="text" id="exp_amt_${insurerCount}" name="exp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 30: // Variance
|
||||
newCell = `<td><input type="text" class="readonly-color" id="variance_${insurerCount}" name="variance[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 31: // Reward
|
||||
newCell = `<td><input type="text" id="reward_${insurerCount}" name="reward[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 32: // ID For Update
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
|
||||
case 16: // Standard TP %
|
||||
newCell = `<td class="std_tp_td"><input type="text" class="readonly-color" name="standard_tp[]" readonly></td>`;
|
||||
newCell += `<td class="std_ter_td" style="display: none;"><input type="text" class="readonly-color" name="standard_tep[]" readonly></td>`;
|
||||
break;
|
||||
case 17: // id
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]"></td>`;
|
||||
break;
|
||||
}
|
||||
|
||||
// Append new cell to the current row
|
||||
$(this).append(newCell);
|
||||
|
||||
// Initialize select2 for newly added insurer select dropdown
|
||||
$('#follow_insurer_id_' + insurerCount).select2();
|
||||
$('#follow_insurer_id_' + insurerCount).select2()
|
||||
|
||||
// Get selected policy type data
|
||||
const selectedOption = $('#policy_type_id').find('option:selected');
|
||||
const bap = selectedOption.data('bap');
|
||||
var selectedOption = $('#policy_type_id').find('option:selected');
|
||||
|
||||
// Update column headers and visibility based on policy type
|
||||
if (bap === 'Fire' || bap === 'Marine Cargo' || bap === 'Marine Hull') {
|
||||
$('#tp_premium_td').text('Ter Premium');
|
||||
$('#agree_tp_td').text('Agreed Ter %');
|
||||
$('#std_head').text('Standard Ter %');
|
||||
$('.std_ter_td').show();
|
||||
$('.std_tp_td').hide();
|
||||
} else {
|
||||
$('#tp_premium_td').text('TP Premium');
|
||||
$('#agree_tp_td').text('Agreed TP %');
|
||||
$('#std_head').text('Standard TP %');
|
||||
$('.std_ter_td').hide();
|
||||
$('.std_tp_td').show();
|
||||
var ebp = selectedOption.data('ebp');
|
||||
var etp = selectedOption.data('etp');
|
||||
var etep = selectedOption.data('etep');
|
||||
var iep = selectedOption.data('iep');
|
||||
var itp = selectedOption.data('itp');
|
||||
var itep = selectedOption.data('itep');
|
||||
|
||||
var bap = selectedOption.data('bap');
|
||||
|
||||
|
||||
if(bap == 'Fire' || bap == 'Marine Cargo' || bap == 'Marine Hull'){
|
||||
$('.hideter').show();
|
||||
$('.hidetp').hide();
|
||||
}else{
|
||||
if(bap == 'Motor'){
|
||||
$('.hidetp').show()
|
||||
$('.hideter').hide()
|
||||
}else{
|
||||
$('.hideter').hide()
|
||||
$('.hidetp').hide()
|
||||
}
|
||||
}
|
||||
|
||||
// Hide TP premium row for Motor policy type
|
||||
if (bap === 'Motor') {
|
||||
$('#tp_premium_tr').hide();
|
||||
} else {
|
||||
$('#tp_premium_tr').show();
|
||||
}
|
||||
|
||||
// Set standard values
|
||||
$('#standard_bp_' + insurerCount).val(selectedOption.data('ebp'));
|
||||
// $('[name="standard_bp[]"]').val(selectedOption.data('ebp'));
|
||||
$('[name="standard_tp[]"]').val(selectedOption.data('etp'));
|
||||
$('[name="standard_tep[]"]').val(selectedOption.data('etep'));
|
||||
$('#standard_bp_').val(ebp);
|
||||
// $('[name="standard_bp[]"]').val(ebp);
|
||||
$('[name="standard_tp[]"]').val(etp);
|
||||
$('[name="standard_tep[]"]').val(etep);
|
||||
|
||||
// Set 'follow_insurer' to required if more than 1 column exists
|
||||
if (insurerCount > 1) {
|
||||
if(insurerCount > 1){
|
||||
$('.follow_insurer').prop('required', true);
|
||||
} else {
|
||||
}else{
|
||||
$('.follow_insurer').prop('required', false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Add click event for delete button
|
||||
$('.delete-insurer').off('click').on('click', function() {
|
||||
@ -996,15 +1285,14 @@ function removeAllColumnsExceptFirst(tableId) {
|
||||
function populateTable(dataArray, status = false) {
|
||||
dataArray.forEach((data, index) => {
|
||||
// Add a new insurer column for each entry in the data array
|
||||
addInsurerColumn(); // Assuming this function adds a new column dynamically
|
||||
addInsurerColumn(); // This will add a new column dynamically
|
||||
|
||||
// Populate the fields with the provided data
|
||||
$('#insurerTable tbody tr').each(function(rowIndex, row) {
|
||||
const cell = $(row).find('td').eq(insurerCount); // Ensure insurerCount is correctly set or incremented
|
||||
const cell = $(row).find('td').eq(insurerCount); // Get the newly added column by `insurerCount`
|
||||
|
||||
// Split insurer id and branch id properly
|
||||
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
||||
|
||||
|
||||
switch (rowIndex) {
|
||||
case 0: // Insurer selection
|
||||
cell.find('select').val(insurer).prop('disabled', true).select2();
|
||||
@ -1018,56 +1306,95 @@ function populateTable(dataArray, status = false) {
|
||||
case 3: // Base Premium
|
||||
cell.find('input').val(status ? data.bp_amt : '');
|
||||
break;
|
||||
case 4: // TP / Ter Premium
|
||||
case 4: // TP Premium
|
||||
cell.find('input').val(status ? data.tp_amt : '');
|
||||
break;
|
||||
case 5: // Co Premium
|
||||
case 5: // Ter Premium
|
||||
cell.find('input').val(status ? data.tep_amt : '');
|
||||
break;
|
||||
case 6: // Co Premium
|
||||
cell.find('input').val(data.cop_amt);
|
||||
break;
|
||||
case 6: // CGST
|
||||
case 7: // CGST
|
||||
cell.find('input').val(data.bp_cgst);
|
||||
break;
|
||||
case 7: // SGST
|
||||
case 8: // SGST
|
||||
cell.find('input').val(data.bp_sgst);
|
||||
break;
|
||||
case 8: // IGST
|
||||
case 9: // IGST
|
||||
cell.find('input').val(data.bp_igst);
|
||||
break;
|
||||
case 9: // GST Amount
|
||||
case 10: // GST Amount
|
||||
cell.find('input').val(status ? data.bp_gst_amt : '');
|
||||
break;
|
||||
case 10: // Stamp Duty
|
||||
case 11: // Stamp Duty
|
||||
cell.find('input').val(status ? data.stamp_duty : '');
|
||||
break;
|
||||
case 11: // Total
|
||||
case 12: // Total
|
||||
cell.find('input').val(status ? data.amount : '');
|
||||
break;
|
||||
case 12: // Agreed BP %
|
||||
case 13: // Agreed BP %
|
||||
cell.find('input').val(data.agreed_bp_per);
|
||||
break;
|
||||
case 13: // Agreed TP / Ter %
|
||||
case 14: // Agreed TP %
|
||||
cell.find('input').val(data.agreed_tp_per);
|
||||
break;
|
||||
case 14: // Agreed Amount
|
||||
case 15: // Agreed Ter %
|
||||
cell.find('input').val(data.agreed_tep_per);
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
cell.find('input').val(data.agreed_amt);
|
||||
break;
|
||||
case 15: // Standard BP %
|
||||
case 17: // Standard BP %
|
||||
cell.find('input').val(data.standerd_bp_per);
|
||||
break;
|
||||
case 16: // Standard TP / Ter %
|
||||
if (data.standerd_tp_per) {
|
||||
$(this).find('.std_tp_td input').val(data.standerd_tp_per);
|
||||
} else {
|
||||
$(this).find('.std_ter_td input').val(data.standerd_tp_per);
|
||||
}
|
||||
case 18: // Standard TP %
|
||||
cell.find('input').val(data.standerd_tp_per);
|
||||
break;
|
||||
case 17: // id
|
||||
cell.find('input').val(status ? data.id : '');
|
||||
case 19: // Standard Ter %
|
||||
cell.find('input').val(data.standerd_tep_per);
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
cell.find('input').val(data.actual_bp_amt);
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
cell.find('input').val(data.actual_tp_amt);
|
||||
break;
|
||||
case 22: // Actual Ter Amount
|
||||
cell.find('input').val(data.actual_tep_amt);
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
cell.find('input').val(data.actual_bp_per);
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
cell.find('input').val(data.actual_tp_per);
|
||||
break;
|
||||
case 25: // Actual Ter %
|
||||
cell.find('input').val(data.actual_tep_per);
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
cell.find('input').val(data.actual_bp_brokerage_amt);
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
cell.find('input').val(data.actual_tp_brokerage_amt);
|
||||
break;
|
||||
case 28: // Actual Ter Brokerage Amount
|
||||
cell.find('input').val(data.actual_tep_brokerage_amt);
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
cell.find('input').val(data.exp_amt);
|
||||
break;
|
||||
case 30: // Variance
|
||||
cell.find('input').val(data.variance);
|
||||
break;
|
||||
case 31: // Reward
|
||||
cell.find('input').val(data.reward);
|
||||
break;
|
||||
case 32: // Co-share ID (hidden field)
|
||||
cell.find('input[type="hidden"]').val(data.id);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@ -52,11 +52,7 @@ table.dataTable thead th {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Endorsement List</h4>
|
||||
</div>
|
||||
<div class="col-2" id="add_div" style="text-align: right; position: relative;top: 56px; left: 314px;">
|
||||
<button type="button" id="change_status" class="btn btn-primary waves-effect waves-light" onclick="changeInvoiceStatus(this)">Invoice Status</button>
|
||||
</div>
|
||||
|
||||
<div class="col-1" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add()">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -64,7 +60,6 @@ table.dataTable thead th {
|
||||
<table class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Issuer</th>
|
||||
<th>Client</th>
|
||||
<th>Branch</th>
|
||||
@ -83,7 +78,6 @@ table.dataTable thead th {
|
||||
<tbody>
|
||||
<?php foreach($endorsement_data_list as $row){ ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="row-select" data-id="<?= $row['id']; ?>"></td>
|
||||
<td><?php echo $issuer[$row['issuer']] ?? ''; ?></td>
|
||||
<td><?php echo $row['client_short_name']; ?></td>
|
||||
<td><?php echo $row['client_branch_name']; ?></td>
|
||||
@ -118,54 +112,6 @@ table.dataTable thead th {
|
||||
|
||||
<?php include('policy_transaction_endorsement_form.php'); ?>
|
||||
|
||||
<!-- Invoice status content modal-->
|
||||
<div class="modal fade" id="invoice_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Update Invoice Status</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<div class="">
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="invoiceForm" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="addon_policy"> Invoice Status <spanclass="text-danger">*</spanclass=></label>
|
||||
<select class="form-control" id="invoice_status_modal" name="invoice_status" required>
|
||||
<option value="" selected>Select Invoice Status</option>
|
||||
<?php
|
||||
if (isset($invoice_status) && count($invoice_status)) {
|
||||
foreach ($invoice_status as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12" style="display: none;" id="invoice_no_div_modal">
|
||||
<label for="invoice_no">Invoice Number<span id="base_danger" class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="invoice_no_modal" name="invoice_no" placeholder="Enter Invoice Number" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var client_list = ''; // local variable for storing the client branch list
|
||||
@ -209,7 +155,7 @@ table.dataTable thead th {
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-3 text-right'B>>" + // Filter left, buttons right
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
@ -390,22 +336,6 @@ table.dataTable thead th {
|
||||
});
|
||||
}
|
||||
|
||||
function changeInvoiceStatus()
|
||||
{
|
||||
var ids = logSelectedIds();
|
||||
|
||||
console.log('changeInvoiceStatus Selected IDs:', ids);
|
||||
|
||||
if(ids.length > 0){
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('invoice_modal'));
|
||||
myModal.show();
|
||||
|
||||
} else {
|
||||
toastr.warning('Please select the transaction', 'Warning')
|
||||
}
|
||||
}
|
||||
|
||||
function logSelectedIds()
|
||||
{
|
||||
var selectedIds = [];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -113,11 +113,8 @@ table.dataTable tbody td {
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Policy List</h4>
|
||||
</div>
|
||||
<div class="col-2" id="add_div" style="text-align: right; position: relative;top: 56px; left: 314px;">
|
||||
<button type="button" id="change_status" class="btn btn-primary waves-effect waves-light" onclick="changeInvoiceStatus(this)">Invoice Status</button>
|
||||
</div>
|
||||
|
||||
<div class="col-1" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
<div class="col-3" id="status_change" style="text-align: right; position: relative;top: 56px; left: 291px;">
|
||||
<button type="button" id="btnAdd" class="btn btn-primary waves-effect waves-light" onclick="hide_list_show_add();">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -125,7 +122,6 @@ table.dataTable tbody td {
|
||||
<table class="table table-striped mb-0 nowrap" cellspacing="0" id="tickets-table">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><div class="column-header">Issuer</div></th>
|
||||
<th><div class="column-header">Issuing Type</div></th>
|
||||
<th><div class="column-header">Client Type</div></th>
|
||||
@ -146,7 +142,6 @@ table.dataTable tbody td {
|
||||
<tbody>
|
||||
<?php foreach($inception_data_list as $row){ ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="row-select" data-id="<?= $row['id']; ?>"></td>
|
||||
<td><?php echo $issuer[$row['issuer']]; ?></td>
|
||||
<td><?php echo $issuing_type[$row['issue_type']]; ?></td>
|
||||
<td><?php echo $client_type[$row['client_type']] ?? '-'; ?></td>
|
||||
@ -235,55 +230,6 @@ table.dataTable tbody td {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Invoice status content modal-->
|
||||
<div class="modal fade" id="invoice_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="title">Update Invoice Status</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body p-4">
|
||||
<div class="">
|
||||
|
||||
<form role="form" class="parsley-examples" method="post" id="invoiceForm" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="addon_policy"> Invoice Status <spanclass="text-danger">*</spanclass=></label>
|
||||
<select class="form-control" id="invoice_status_modal" name="invoice_status" required>
|
||||
<option value="" selected>Select Invoice Status</option>
|
||||
<?php
|
||||
if (isset($invoice_status_array) && count($invoice_status_array)) {
|
||||
foreach ($invoice_status_array as $key => $value) {
|
||||
echo "<option value=" . $key . ">" . $value . "</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12" style="display: none;" id="invoice_no_div_modal">
|
||||
<label for="invoice_no">Invoice Number<span id="base_danger" class="text-danger"></span></label>
|
||||
<input type="text" class="form-control" id="invoice_no_modal" name="invoice_no" placeholder="Enter Invoice Number" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="btnSubmit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="file_upload" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
@ -323,6 +269,7 @@ var count = 0
|
||||
|
||||
//for disable all field if client and client branch is empty
|
||||
$(document).ready(function() {
|
||||
|
||||
function checkAndDisableFields() {
|
||||
var clientId = $('#client_id').val();
|
||||
var clientBranchId = $('#client_branch_id').val();
|
||||
@ -355,6 +302,7 @@ $(document).ready(function(){
|
||||
|
||||
getClientAndBranchAndPolicy()
|
||||
addHTMLInput();
|
||||
addHTMLInputForVehicleFileUpload()
|
||||
|
||||
<?php if (session()->has('create_failed')) : ?>
|
||||
toastr.error('<?= session()->getFlashdata('create_failed') ?>', 'Failed');
|
||||
@ -391,7 +339,7 @@ $(document).ready(function() {
|
||||
|
||||
if (ticketsTable.length) {
|
||||
ticketsTable.DataTable({
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-3 text-right'B>>" + // Filter left, buttons right
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-5 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
@ -790,6 +738,9 @@ function removeHTMLInput(element)
|
||||
|
||||
function appendBasePolicyList(data, select = null)
|
||||
{
|
||||
console.log('---------------------------------------------------------------')
|
||||
console.log('first')
|
||||
console.log('---------------------------------------------------------------')
|
||||
|
||||
$('#base_policy').empty();
|
||||
$('#base_policy').append($('<option>', {
|
||||
@ -840,22 +791,6 @@ function fileupload(input)
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
function changeInvoiceStatus()
|
||||
{
|
||||
var ids = logSelectedIds();
|
||||
|
||||
console.log('changeInvoiceStatus Selected IDs:', ids);
|
||||
|
||||
if(ids.length > 0){
|
||||
|
||||
var myModal = new bootstrap.Modal(document.getElementById('invoice_modal'));
|
||||
myModal.show();
|
||||
|
||||
} else {
|
||||
toastr.warning('Please select the transaction', 'Warning')
|
||||
}
|
||||
}
|
||||
|
||||
function logSelectedIds()
|
||||
{
|
||||
var selectedIds = [];
|
||||
@ -930,6 +865,82 @@ function validateForm()
|
||||
return checkInputs(); // Call checkInputs before form submission
|
||||
}
|
||||
|
||||
function addHTMLInputForVehicleFileUpload(data = null)
|
||||
{
|
||||
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
|
||||
const newRow = document.createElement('div');
|
||||
newRow.className = 'form-row dynamic-form-row';
|
||||
newRow.innerHTML = `
|
||||
<div class="form-group col-md-5">
|
||||
<label for="file_name">Document Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="docs_name" name="other_docs_name[]" placeholder="Enter file name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-5">
|
||||
<label for="file">Upload File<span class="text-danger">*</span></label>
|
||||
<input type="file" class="form-control" id="file_name" name="file_name[]" required>
|
||||
</div>
|
||||
<div class="form-group col-md-2" style="position: relative;top: 28px;">
|
||||
<a class="btn btn-danger waves-effect waves-light" onclick="removeHTMLInputForVehicleFileUpload(this)">x</a>
|
||||
<a class="btn btn-primary waves-effect waves-light mr-1" onclick="addHTMLInputForVehicleFileUpload(this)">+</a>
|
||||
</div>
|
||||
`;
|
||||
container.appendChild(newRow);
|
||||
|
||||
if (data !== null && data.db_column_name !== undefined) {
|
||||
const selectElement = newRow.querySelector('.db-column-name-select');
|
||||
selectElement.value = data.db_column_name;
|
||||
}
|
||||
}
|
||||
|
||||
function appendVehicleFileTableBody(data)
|
||||
{
|
||||
console.log(data);
|
||||
|
||||
// Clear the table body
|
||||
$('#vehicle_table_bd').empty();
|
||||
|
||||
$.each(data, function(index, item) {
|
||||
var row = $('<tr>');
|
||||
|
||||
// Add row number, document name, and file name
|
||||
row.append($('<td>').text(index + 1));
|
||||
row.append($('<td>').text(item.other_docs_name));
|
||||
row.append($('<td>').text(item.file_name));
|
||||
|
||||
// Create the download link
|
||||
var downloadLink = $('<a>')
|
||||
.attr('href', '<?= base_url('download-kyc-docs/') ?>' + item.file_name)
|
||||
.attr('style', 'font-size:18px;')
|
||||
.attr('data-id', item.id)
|
||||
.addClass('fa fa-download')
|
||||
.text(' '); // Space after the icon
|
||||
|
||||
// Create the delete link
|
||||
var deleteLink = $('<a>')
|
||||
.attr('style', 'font-size:18px;')
|
||||
.attr('data-id', item.id)
|
||||
.addClass('fa fa-trash')
|
||||
.text(' '); // Space after the icon
|
||||
|
||||
// Append the download and delete icons inside the same <td>
|
||||
row.append($('<td>').append(downloadLink));
|
||||
|
||||
// Append the row to the table body
|
||||
$('#vehicle_table_bd').append(row);
|
||||
});
|
||||
}
|
||||
|
||||
function removeHTMLInputForVehicleFileUpload(element)
|
||||
{
|
||||
const container = document.getElementById('dynamic-form-container-for-vehicle-file-upload');
|
||||
const rows = container.querySelectorAll('.dynamic-form-row');
|
||||
|
||||
if (rows.length > 1) {
|
||||
const row = element.closest('.dynamic-form-row');
|
||||
row.remove();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -995,11 +1006,11 @@ $('#issue_type').change(function(){
|
||||
if(value == 2){
|
||||
$('#revenue_type').val('EA')
|
||||
$('#renewal').show()
|
||||
$('.sded_dates').show()
|
||||
// $('.sded_dates').show()
|
||||
$('#source_client_policy_id').attr('required', true)
|
||||
}else{
|
||||
$('#renewal').hide()
|
||||
$('.sded_dates').hide()
|
||||
// $('.sded_dates').hide()
|
||||
$('#source_client_policy_id').attr('required', false)
|
||||
$('#policy_start_date').val('');
|
||||
$('#policy_end_date').val('');
|
||||
@ -1239,7 +1250,7 @@ $('#issue_type').change(function(){
|
||||
let data = policy_list[branch_id];
|
||||
if(issue_type == 2)
|
||||
{
|
||||
appendRenewalPolicies(data)
|
||||
appendRenewalPolicies(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -14,10 +14,24 @@
|
||||
<span class="d-none d-sm-inline-block">File Upload</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#KYC-DOC-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="kyc_tab2">
|
||||
<span class="mr-1"><i class="fa fa-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">KYC Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item" id="hide_vehicle_tab" style="display: none;">
|
||||
<a href="#vehicle-docs-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="vehicle_tab">
|
||||
<span class="mr-1"><i class="fa fa-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Vehicle Docs</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<?php include('policy_transaction_inception_form.php'); ?>
|
||||
<?php include('drive_file_upload.php'); ?>
|
||||
<?php include('client_kyc.php'); ?>
|
||||
<?php include('vehicle_docs.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -27,6 +41,7 @@
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#kyc_tab').on('click', function(e) {
|
||||
var ptId = $('#policy_tranction_primarykey').val();
|
||||
|
||||
@ -38,6 +53,30 @@ $(document).ready(function() {
|
||||
$('#g_drive_file_upload_sbt_btn').show()
|
||||
}
|
||||
});
|
||||
|
||||
$('#kyc_tab2').on('click', function(e) {
|
||||
var ptId = $('#policy_tranction_primarykey').val();
|
||||
|
||||
if (!ptId) { // Check if ptId is empty or null
|
||||
e.preventDefault(); // Prevent the tab from opening
|
||||
$('#btn_other_docs').hide()
|
||||
toastr.warning('Please create Policy before proceeding to File Upload.');
|
||||
}else{
|
||||
$('#btn_other_docs').show()
|
||||
}
|
||||
});
|
||||
|
||||
$('#vehicle_tab').on('click', function(e) {
|
||||
var ptId = $('#policy_tranction_primarykey').val();
|
||||
|
||||
if (!ptId) { // Check if ptId is empty or null
|
||||
e.preventDefault(); // Prevent the tab from opening
|
||||
$('#vehicle_file_upload_sbt_btn').hide()
|
||||
toastr.warning('Please create Policy before proceeding to File Upload.');
|
||||
}else{
|
||||
$('#vehicle_file_upload_sbt_btn').show()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@ table.dataTable tbody td {
|
||||
.dataTables_filter {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="col-12" id="second_page">
|
||||
@ -29,60 +28,60 @@ table.dataTable tbody td {
|
||||
|
||||
</div>
|
||||
<div class="table-responsive" style="overflow-x: auto;">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
<th>User Name</th>
|
||||
<th>Month</th>
|
||||
<th>Business Type</th>
|
||||
<th>Date</th>
|
||||
<th>Sales Generated By (Name)</th>
|
||||
<th>Branch (JIBS)</th>
|
||||
<th>Serviced By (Name)</th>
|
||||
<th>Client Name</th>
|
||||
<th>Client Address</th>
|
||||
<th>Client Type</th>
|
||||
<th>Payment From</th>
|
||||
<th>Reference</th>
|
||||
<th>Remarks</th>
|
||||
<th>Policy/Endorsement</th>
|
||||
<th>Policy No</th>
|
||||
<th>Endorsement No</th>
|
||||
<th>Insurer Name</th>
|
||||
<th>Insurer Branch</th>
|
||||
<th>TPA</th>
|
||||
<th>Days Until Expiry</th>
|
||||
<th>Endorsement Effective Date</th>
|
||||
<th>Policy Effective Date</th>
|
||||
<th>Policy Expiry Date</th>
|
||||
<th>Policy Type</th>
|
||||
<th>BAP Group</th>
|
||||
<th>Vehicle Number</th>
|
||||
<th>Base Premium</th>
|
||||
<th>Terrorism/TP</th>
|
||||
<th>Premium (without GST)</th>
|
||||
<th>GST @ 18%</th>
|
||||
<th>Total Premium</th>
|
||||
<th>Base Revenue %</th>
|
||||
<th>TP / Terrorism Revenue %</th>
|
||||
<th>Total IRDA Revenue INR</th>
|
||||
<th>GST on Revenue</th>
|
||||
<th>Total Amount Receivable</th>
|
||||
<th>Rewards %</th>
|
||||
<th>Rewards</th>
|
||||
<th>Total Brokerage</th>
|
||||
<th>Payment Ref</th>
|
||||
<th>Invoice Number</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Invoice Amount</th>
|
||||
<th>Payment Status</th>
|
||||
<th>UTR</th>
|
||||
<th>Payment Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (isset($report_list)) { ?>
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S. No</th>
|
||||
<th>User Name</th>
|
||||
<th>Month</th>
|
||||
<th>Business Type</th>
|
||||
<th>Date</th>
|
||||
<th>Sales Generated By (Name)</th>
|
||||
<th>Branch (JIBS)</th>
|
||||
<th>Serviced By (Name)</th>
|
||||
<th>Client Name</th>
|
||||
<th>Client Address</th>
|
||||
<th>Client Type</th>
|
||||
<th>Payment From</th>
|
||||
<th>Reference</th>
|
||||
<th>Remarks</th>
|
||||
<th>Policy/Endorsement</th>
|
||||
<th>Policy No</th>
|
||||
<th>Endorsement No</th>
|
||||
<th>Insurer Name</th>
|
||||
<th>Insurer Branch</th>
|
||||
<th>TPA</th>
|
||||
<th>Days Until Expiry</th>
|
||||
<th>Endorsement Effective Date</th>
|
||||
<th>Policy Effective Date</th>
|
||||
<th>Policy Expiry Date</th>
|
||||
<th>Policy Type</th>
|
||||
<th>BAP Group</th>
|
||||
<th>Vehicle Number</th>
|
||||
<th>Base Premium</th>
|
||||
<th>Terrorism/TP</th>
|
||||
<th>Premium (without GST)</th>
|
||||
<th>GST @ 18%</th>
|
||||
<th>Total Premium</th>
|
||||
<th>Base Revenue %</th>
|
||||
<th>TP / Terrorism Revenue %</th>
|
||||
<th>Total IRDA Revenue INR</th>
|
||||
<th>GST on Revenue</th>
|
||||
<th>Total Amount Receivable</th>
|
||||
<th>Rewards %</th>
|
||||
<th>Rewards</th>
|
||||
<th>Total Brokerage</th>
|
||||
<th>Payment Ref</th>
|
||||
<th>Invoice Number</th>
|
||||
<th>Invoice Date</th>
|
||||
<th>Invoice Amount</th>
|
||||
<th>Payment Status</th>
|
||||
<th>UTR</th>
|
||||
<th>Payment Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (isset($report_list)) { ?>
|
||||
<?php foreach($report_list as $index => $row){ ?>
|
||||
<tr>
|
||||
<td><?= $index + 1 ?></td>
|
||||
@ -90,7 +89,7 @@ table.dataTable tbody td {
|
||||
<td><?php echo $row['policy_issue_month']; ?></td>
|
||||
<td><?php echo $row['revenue_type']; ?></td>
|
||||
<td><?php echo $row['policy_issue_date']; ?></td>
|
||||
<td><?php echo $row['salse_person_name']; ?></td> <!-- Sales Generated By (Name) -->
|
||||
<td><?php echo $row['salse_person_name']; ?></td> <!-- Sales Generated By (Name) -->
|
||||
<td><?php echo 'Chennai'; ?></td>
|
||||
<td><?php echo $row['service_person_name']; ?></td>
|
||||
<td><?php echo $row['client_name']; ?></td>
|
||||
@ -134,9 +133,9 @@ table.dataTable tbody td {
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div>
|
||||
</div>
|
||||
@ -155,11 +154,18 @@ $(document).ready(function() {
|
||||
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // Filter left, buttons right
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>", // Pagination at the bottom, without page length selector
|
||||
buttons: [{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
}, ],
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
text: 'CSV',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
text: 'Excel',
|
||||
title: 'Policy-Tranction-BDS-List',
|
||||
}
|
||||
],
|
||||
language: {
|
||||
search: "_INPUT_",
|
||||
searchPlaceholder: "Search..."
|
||||
@ -171,4 +177,5 @@ $(document).ready(function() {
|
||||
console.error("Table not found.");
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
119
app/Views/vehicle_docs.php
Normal file
119
app/Views/vehicle_docs.php
Normal file
@ -0,0 +1,119 @@
|
||||
<div class="tab-pane fade" id="vehicle-docs-tab">
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<a id="toggleIcon" class="text-dark float-right" data-toggle="collapse" href="#collapseOne"
|
||||
aria-expanded="true">
|
||||
<i id="icon" class="mdi mdi-chevron-down mr-1 text-primary" style="font-size: 28px;"></i>
|
||||
</a>
|
||||
</h5>
|
||||
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
|
||||
<div class="card-body">
|
||||
<form class="parsley-examples" id="vehicle_file_upload_form" method="post"
|
||||
enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" id="client_id_for_vehicle_file_upload" name="client_id">
|
||||
<input type="hidden" id="vehicle_id_for_file_upload" name="vehicle_id">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<div id="dynamic-form-container-for-vehicle-file-upload"></div>
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||||
id="vehicle_file_upload_sbt_btn">Submit</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="vehicle_file_table" class="card">
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
<h4 style="position: relative;">Vehicle File List</h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="table-responsive" style="overflow-x: auto;">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="bg-light">
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Docs Name</th>
|
||||
<th>File Name</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="vehicle_table_bd">
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$("#vehicle_file_upload_form").submit(function(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var isValid = $('#vehicle_file_upload_form').parsley().validate();
|
||||
if (!isValid) {
|
||||
console.log('Form is Empty', 'Warning');
|
||||
return ;
|
||||
}
|
||||
|
||||
form_action = '<?= base_url("client/vehicle/create"); ?>';
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
var formData = new FormData($('#vehicle_file_upload_form')[0]);
|
||||
|
||||
$.ajax({
|
||||
data:formData,
|
||||
url: form_action,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(res) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
console.log(res);
|
||||
|
||||
if(res.status == true){
|
||||
toastr.success(res.message, 'Success');
|
||||
appendVehicleFileTableBody(res.vehicle_docs);
|
||||
}else{
|
||||
toastr.error(res.message, 'Error');
|
||||
}
|
||||
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
13
public/oauth-412703-c47b73db19c0.json
Normal file
13
public/oauth-412703-c47b73db19c0.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "service_account",
|
||||
"project_id": "oauth-412703",
|
||||
"private_key_id": "c47b73db19c095378abf2560503ea131d962087d",
|
||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDlASZZ/3WHCpXQ\nSf3N5VfduTnR6d2HGlsntICO1HFZLratHK3Vl3qWu0IFsX300GlpW+vh3ksgx2d5\nqmk+gXSO6CzfdhPfA1O6+ldyESaeM7wN3CYLIBKwk2krD6y4EXwnX4HkUE0c1Zcx\njMX1nl5SXkViwd2BcP8SGksofR2HfZFkAxQ8bbJRZtVKjXYgJs/JMReR5YoCwEv5\nHAwwvdZBOiOJbW+90Z+Ao3YjnMkjhCdJLa8b5hH1HnPgu2La/5JEPHo7i62ygpVy\nuUJzMsAXvsN/3ZLUvpYIbHnqTkiES5SL4+UcBqjHfUfKt0IXafnIzJzKXIEiDHyj\nzxLlJVB/AgMBAAECggEAFNd0cpdlzlr/xHufbjgztXmwkfKrVyrmZegvFRCvmjK+\nrGWiSoClRweW3CbJtFitZ0nW33EYPEz5lWCVgHtOrNzjjJjV+SN34Nn80GRQM/C4\najiBe9y45robxbABA6WPu5OdIjbOtdOYlYle0NpPckajIPhM3QV4KWEcOvycDeML\nIFY711YzAhGbEaXufGDBGdgSGaqhgiuEUw7nuOXu21rMgsnRNEDV13vpqVJSym6I\niw6F8gOTtQCD1W00XWltnQgtSHiewTyh9dNw2bMaNNQb6WiEw3v+oYxGtWr+ocJX\naZOJSwwdpQaq9JXvC179GNalHGoCySBIMfFKYWIRjQKBgQDyt2ME4cXmQyq5QihS\nlu2KiP5fwETDCCTU2MZkn34uZkjpeXpRawT7IxM8b3e4S+gtbenL/dZiDb3SQlD2\nriL6CqA8zhQfhQbFUCoPeKBVqMnBgdJw9ElKxAo1rgrksx8eby0E1nIocS2v2Ibe\nOx68gID6qLA/+4JMFmzK7kVUawKBgQDxiaakAbNkbwmQh6eYez4klX7XE4tPN66m\nrdr/MsCUCPfMp2cGoNPOQ4VnNgBzHpYIVp29y94KOhNyFjSb61+sUEgJozUwvuHO\nLxMxpGksTw2ywpn2+j4M29VN4lt3W0WbAYa/BrSOBdJEIfbkcAZ14XKAB1B7TVZO\nalcAJpVZPQKBgQDoBjuYXSRMHQVomD/nw/RMrO1PJ4QUVWKwPpJZesarIIiu+Lvf\nvUjDsyIecgimm5nWY+5OXdhlX/GIYHD5gDpbgXDw76f5AbgZQ6sRoyTS/knwvGQq\nKr0txf5kln4/ZqRm+ay1pTL4Skl8gqdbJnUZilbCSCRE5fAHQKC71c9dBQKBgAmr\nuUBX0Rb0Wy2uQMeaJ6LPWYTDA5DoadXCoEIXhh5nPYS0LyvUxKY9jdnUD7CMSPWM\ngkRXJUzDhoPK39BeXDZKAJhiMH8DJYdb2yjhrFRZ1fKSWBfLbTCWnLPBnGfq/551\nMS/01MXa9dBEi94ZniiaHjuCD3bgYdRB7bnT0acBAoGAa1zFSvu1RLHctgSJneUG\n90Oslkz2TpS613B11ELRQaOfKwFigAA2oTZwMZrEU2XW1fTwQRSMVMBKLWLbgrbF\nLuEjdKxSU2k3k0VY3lLF4nNnTpBnG+M96clH5eKBzyTvlkdOxe1uvbb/y2CXNTkv\nwH1okHrkR5JXqZhAXzgXRMI=\n-----END PRIVATE KEY-----\n",
|
||||
"client_email": "venkatesh-drive@oauth-412703.iam.gserviceaccount.com",
|
||||
"client_id": "106762356572936299320",
|
||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
||||
"token_uri": "https://oauth2.googleapis.com/token",
|
||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/venkatesh-drive%40oauth-412703.iam.gserviceaccount.com",
|
||||
"universe_domain": "googleapis.com"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user