FEAT_ADDON_POLICY_POLICY_LIST_FIX_DATE_FORMATE_CHANGE_SESSION_TIMEOUT_FEAT_INSURER_CATAGORY : RV
This commit is contained in:
parent
5c4ca76ac3
commit
5d69cc47df
@ -16,6 +16,7 @@ $routes->get('/login', 'LoginController::index');///auth/google
|
|||||||
$routes->get('/logout', 'LoginController::logout');
|
$routes->get('/logout', 'LoginController::logout');
|
||||||
$routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
|
$routes->get('/oauth2callback', 'LoginController::receiveGoogleOAuthResponse');
|
||||||
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
|
$routes->get('/auth/google', 'LoginController::initiateGoogleOAuth');
|
||||||
|
$routes->get('/update-policy', 'ClientController::checkPolicyEndDateUpdateClientPolicyStatusExpired');
|
||||||
|
|
||||||
|
|
||||||
$routes->group("/user", ["filter" => "authMVC"], function($routes){
|
$routes->group("/user", ["filter" => "authMVC"], function($routes){
|
||||||
@ -209,6 +210,8 @@ $routes->group("/util", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("download-excel/(:any)", "EmployeeController::downloadSampleExcelFile/$1");
|
$routes->get("download-excel/(:any)", "EmployeeController::downloadSampleExcelFile/$1");
|
||||||
$routes->get("get-emp-endorsement/(:any)", "EmployeeController::getEmpEndoresmentEntry/$1");
|
$routes->get("get-emp-endorsement/(:any)", "EmployeeController::getEmpEndoresmentEntry/$1");
|
||||||
$routes->post("import-export", "EmployeeController::importExport");
|
$routes->post("import-export", "EmployeeController::importExport");
|
||||||
|
$routes->get("featch-client-policy-list/(:any)", "ClientController::getClientPolicyList/$1");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
$routes->cli('cli/processjob', 'JobWorker::processJob');
|
||||||
|
|||||||
@ -40,7 +40,8 @@ class Session extends BaseConfig
|
|||||||
* The number of SECONDS you want the session to last.
|
* The number of SECONDS you want the session to last.
|
||||||
* Setting to 0 (zero) means expire when the browser is closed.
|
* Setting to 0 (zero) means expire when the browser is closed.
|
||||||
*/
|
*/
|
||||||
public int $expiration = 7200;
|
// public int $expiration = 7200;
|
||||||
|
public int $expiration = 86400; //24 Hours
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------------------------------------------------------------------
|
* --------------------------------------------------------------------------
|
||||||
|
|||||||
@ -29,6 +29,8 @@ use App\Models\PolicyGridModel;
|
|||||||
use App\Models\PolicyPremium1Model;
|
use App\Models\PolicyPremium1Model;
|
||||||
use App\Models\PolicyPremium2Model;
|
use App\Models\PolicyPremium2Model;
|
||||||
use App\Models\EmployeeModel;
|
use App\Models\EmployeeModel;
|
||||||
|
use App\Models\EmployeePolicyModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -57,6 +59,7 @@ class ClientController extends AdminController
|
|||||||
protected $policyPremium2Model;
|
protected $policyPremium2Model;
|
||||||
protected $clientDepositModel;
|
protected $clientDepositModel;
|
||||||
protected $employeeModel;
|
protected $employeeModel;
|
||||||
|
protected $employeePolicyModel;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -83,6 +86,9 @@ class ClientController extends AdminController
|
|||||||
$this->policyPremium1Model = new PolicyPremium1Model();
|
$this->policyPremium1Model = new PolicyPremium1Model();
|
||||||
$this->policyPremium2Model = new PolicyPremium2Model();
|
$this->policyPremium2Model = new PolicyPremium2Model();
|
||||||
$this->employeeModel = new EmployeeModel();
|
$this->employeeModel = new EmployeeModel();
|
||||||
|
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -103,6 +109,14 @@ class ClientController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function checkPolicyEndDateUpdateClientPolicyStatusExpired(){
|
||||||
|
|
||||||
|
$return = $this->clientPolicyModel->updateStatus();
|
||||||
|
$this->myLogger->logme('error', 'Client Policy Status Update Count: {data}', ['data' => $return['client']]);
|
||||||
|
$this->myLogger->logme('error', 'Employee Policy Status Update Count: {data}', ['data' => $return['emp']]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function removeClient($id = null)
|
public function removeClient($id = null)
|
||||||
{
|
{
|
||||||
@ -248,10 +262,21 @@ class ClientController extends AdminController
|
|||||||
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
$editData['client_kyc'] = $this->clientKYCDocsModel->where('client_id', $id)->findAll();
|
||||||
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
$editData['client_branch'] = $this->clientBranchModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||||
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
$editData['client_relation'] = $this->clientRMModel->where(['client_id' => $id, 'is_active' => 1])->findAll();
|
||||||
$editData['client_policy'] = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
|
||||||
|
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($id);
|
||||||
|
|
||||||
|
foreach ($clientPoliceData as $key => $value) {
|
||||||
|
|
||||||
|
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||||
|
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||||
|
}
|
||||||
|
|
||||||
|
$editData['client_policy'] = $clientPoliceData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// echo "<pre>";
|
// echo "<pre>";
|
||||||
// print_r($editData); die;
|
// print_r($clientPoliceData); die;
|
||||||
|
|
||||||
echo view('layout/header', $headerData);
|
echo view('layout/header', $headerData);
|
||||||
echo view('client_onboarding', $editData);
|
echo view('client_onboarding', $editData);
|
||||||
@ -577,6 +602,7 @@ class ClientController extends AdminController
|
|||||||
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
||||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||||
|
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||||
|
|
||||||
if (!isset($data['is_addon'])) {
|
if (!isset($data['is_addon'])) {
|
||||||
$data['is_addon'] = 0;
|
$data['is_addon'] = 0;
|
||||||
@ -594,6 +620,11 @@ class ClientController extends AdminController
|
|||||||
$insert = $this->clientPolicyModel->insert($data);
|
$insert = $this->clientPolicyModel->insert($data);
|
||||||
if($insert){
|
if($insert){
|
||||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
|
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($this->request->getPost('client_id'));
|
||||||
|
foreach ($clientPoliceData as $key => $value) {
|
||||||
|
|
||||||
|
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||||
|
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||||
|
}
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'CERATE'], 200);
|
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'CERATE'], 200);
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||||
@ -637,6 +668,8 @@ class ClientController extends AdminController
|
|||||||
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
$data['earned_premium_amount'] = $this->request->getPost('earned_premium_amount');
|
||||||
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
$data['claims_incurred_amount'] = $this->request->getPost('claims_incurred_amount');
|
||||||
$data['is_addon'] = $this->request->getPost('is_addon');
|
$data['is_addon'] = $this->request->getPost('is_addon');
|
||||||
|
$data['base_policy'] = $this->request->getPost('base_policy');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!isset($data['is_addon'])) {
|
if (!isset($data['is_addon'])) {
|
||||||
@ -654,6 +687,11 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
if($insert){
|
if($insert){
|
||||||
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($client_id);
|
$clientPoliceData = $this->clientPolicyModel->getClientPolicyByClientId($client_id);
|
||||||
|
foreach ($clientPoliceData as $key => $value) {
|
||||||
|
|
||||||
|
$clientPoliceData[$key]->policy_start_date = date('d-M-Y', strtotime($value->policy_start_date));
|
||||||
|
$clientPoliceData[$key]->policy_end_date = date('d-M-Y', strtotime($value->policy_end_date));
|
||||||
|
}
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'EDIT'], 200);
|
return $this->respond(['status' => true,'code' => 200,'data' => $clientPoliceData, 'method' => 'EDIT'], 200);
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||||
@ -903,8 +941,13 @@ class ClientController extends AdminController
|
|||||||
if($id){
|
if($id){
|
||||||
$client_policy_data = $this->clientPolicyModel->where(['id' => $id, 'is_active' => 1])->first();
|
$client_policy_data = $this->clientPolicyModel->where(['id' => $id, 'is_active' => 1])->first();
|
||||||
$insurer_id = $client_policy_data['insurer_id'];
|
$insurer_id = $client_policy_data['insurer_id'];
|
||||||
|
$client_id = $client_policy_data['client_id'];
|
||||||
$polices = $this->policesModel->where(['insurer_id' => $insurer_id, 'is_active' => 1])->findAll();
|
$polices = $this->policesModel->where(['insurer_id' => $insurer_id, 'is_active' => 1])->findAll();
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $client_policy_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200);
|
$client_policy_list = $this->clientPolicyModel->select('policies.*')
|
||||||
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
|
->where('client_id', $client_id)
|
||||||
|
->findAll();
|
||||||
|
return $this->respond(['status' => true,'code' => 200, 'client_policy_list' => $client_policy_list, 'data' => $client_policy_data, "insurer_id" => $client_policy_data['insurer_id'], 'policy' => $polices], 200);
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
return $this->respond(['status' => false,'code' => 404, 'message' => 'no data found'], 200);
|
||||||
}
|
}
|
||||||
@ -1393,4 +1436,19 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getClientPolicyList($client_id = null){
|
||||||
|
|
||||||
|
$record = $this->clientPolicyModel->select('policies.*')
|
||||||
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
|
->where('client_id', $client_id)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
if ($record) {
|
||||||
|
return $this->respond(['Status' => true,'code' => 200,'data' => $record], 200);
|
||||||
|
} else {
|
||||||
|
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.'], 200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ if (!function_exists('generate_excel')) {
|
|||||||
|
|
||||||
if($totals == 1){
|
if($totals == 1){
|
||||||
// Call the helper function for Calculate GST, Pro Rata Premium, and Total sums for inception
|
// Call the helper function for Calculate GST, Pro Rata Premium, and Total sums for inception
|
||||||
add_totals_row($spreadsheet, $data);
|
add_totals_row($spreadsheet, $data, $headers);
|
||||||
}else if($totals == 2){
|
}else if($totals == 2){
|
||||||
add_totals_for_deletion($spreadsheet, $data);
|
add_totals_for_deletion($spreadsheet, $data);
|
||||||
}
|
}
|
||||||
@ -268,25 +268,39 @@ if (! function_exists('transform_objects_to_array_for_deletion')) {
|
|||||||
|
|
||||||
|
|
||||||
if (!function_exists('add_totals_row')) {
|
if (!function_exists('add_totals_row')) {
|
||||||
function add_totals_row(Spreadsheet $spreadsheet, array $data)
|
function add_totals_row(Spreadsheet $spreadsheet, array $data, array $headers)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//find the index value
|
||||||
|
$rata = array_search('PRO RATA PREMIUM', $headers);
|
||||||
|
$gst = array_search('GST', $headers);
|
||||||
|
$total = array_search('TOTAL', $headers);
|
||||||
|
|
||||||
|
|
||||||
// Calculate GST, Pro Rata Premium, and Total sums
|
// Calculate GST, Pro Rata Premium, and Total sums
|
||||||
$gstSum = 0;
|
$gstSum = 0;
|
||||||
$proRataPremiumSum = 0;
|
$proRataPremiumSum = 0;
|
||||||
$totalSum = 0;
|
$totalSum = 0;
|
||||||
|
|
||||||
foreach ($data as $row) {
|
foreach ($data as $row) {
|
||||||
$gstSum += $row[18];
|
$gstSum += $row[$gst];
|
||||||
$proRataPremiumSum += $row[19];
|
$proRataPremiumSum += $row[$rata];
|
||||||
$totalSum += $row[20];
|
$totalSum += $row[$total];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$cellValue = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
||||||
|
$prev_index = $rata - 1;
|
||||||
|
$cellValueTotal = $cellValue[$prev_index];
|
||||||
|
$cellValueRata = $cellValue[$rata];
|
||||||
|
$cellValueGST = $cellValue[$gst];
|
||||||
|
$cellValueTotalSum = $cellValue[$total];
|
||||||
|
|
||||||
// Add a new row with sums
|
// Add a new row with sums
|
||||||
$lastRow = count($data) + 1; // To get the last row number
|
$lastRow = count($data) + 1; // To get the last row number
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('R' . ($lastRow + 1), 'TOTALS');
|
$spreadsheet->getActiveSheet()->setCellValue($cellValueTotal . ($lastRow + 1), 'TOTALS');
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('S' . ($lastRow + 1), $gstSum);
|
$spreadsheet->getActiveSheet()->setCellValue($cellValueRata . ($lastRow + 1), $proRataPremiumSum);
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('T' . ($lastRow + 1), $proRataPremiumSum);
|
$spreadsheet->getActiveSheet()->setCellValue($cellValueGST . ($lastRow + 1), $gstSum);
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('U' . ($lastRow + 1), $totalSum);
|
$spreadsheet->getActiveSheet()->setCellValue($cellValueTotalSum . ($lastRow + 1), $totalSum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class ClientPolicyModel extends Model
|
|||||||
"policy_terms",
|
"policy_terms",
|
||||||
"open_for_enrollment",
|
"open_for_enrollment",
|
||||||
"is_addon",
|
"is_addon",
|
||||||
|
"base_policy",
|
||||||
"created_by",
|
"created_by",
|
||||||
"updated_by",
|
"updated_by",
|
||||||
"Is_active",
|
"Is_active",
|
||||||
@ -249,4 +250,21 @@ public function getDepositlistsummary($id)
|
|||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function updateStatus(){
|
||||||
|
|
||||||
|
// Update client_policy table
|
||||||
|
$client = $this->db->query("UPDATE client_policy SET policy_status = 0 WHERE policy_end_date < CURDATE()");
|
||||||
|
$client_count = $this->db->affectedRows();
|
||||||
|
// Update employee_polices table
|
||||||
|
$employee = $this->db->query("UPDATE employee_polices SET status = 'expired' WHERE policy_end_date < CURDATE()");
|
||||||
|
$emp_count = $this->db->affectedRows();
|
||||||
|
|
||||||
|
return ['client'=>$client_count, 'emp' => $emp_count];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class InsurerModel extends Model
|
|||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"id",
|
"id",
|
||||||
"type",
|
"type",
|
||||||
|
"category",
|
||||||
"name",
|
"name",
|
||||||
"short_name",
|
"short_name",
|
||||||
"created_by",
|
"created_by",
|
||||||
|
|||||||
@ -75,12 +75,21 @@ $(document).ready(function() {
|
|||||||
buttons: [{
|
buttons: [{
|
||||||
extend: 'csv',
|
extend: 'csv',
|
||||||
text: 'CSV',
|
text: 'CSV',
|
||||||
title: 'Client_Deposit',
|
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||||
className: 'my_class',
|
className: 'my_class',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ':not(:last-child)'
|
columns: ':not(:last-child)'
|
||||||
},
|
},
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
title: 'Client Deposit Details - ' + ' <?php echo $clientName[0]['client_name'];?>',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':not(:last-child)'
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
language: {
|
language: {
|
||||||
|
|||||||
@ -28,6 +28,10 @@ body {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navtab-bg .nav-link {
|
||||||
|
margin: 0 5px 10px!important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="client_add">
|
<div class="row" id="client_add">
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="row float-right" style="padding-bottom: 10px; position: relative;right: 13px;">
|
<div class="row float-right" style="padding-bottom: 10px; position: relative;right: 13px;">
|
||||||
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
<button type="button" id="BtnAdd" class="btn btn-primary waves-effect waves-light btnAdd btn-sm"><span
|
||||||
|
class="fa fa-plus-square" aria-hidden="true" style="padding: 5px 10px;"></span>Add Policy</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive" id="table_list">
|
<div class="table-responsive" id="table_list">
|
||||||
@ -28,45 +29,46 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
<div class="row float-right" style="position: relative; bottom: 20px; right: 13px;">
|
||||||
<button type="button" id="btnPolicyBack" class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list" aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
<button type="button" id="btnPolicyBack"
|
||||||
|
class="btn btn-primary waves-effect waves-light btn-sm btnBack btn-sm"><span class="fa fa-list"
|
||||||
|
aria-hidden="true" style="padding: 5px 10px;"></span>Back To List</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form role="form" class="parsley-examples" method="post" id="policy_form"
|
<form role="form" class="parsley-examples" method="post" id="policy_form" enctype="multipart/form-data">
|
||||||
enctype="multipart/form-data">
|
|
||||||
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||||
<input type="hidden" name="PrimaryKey" id="policy_PrimaryKey" />
|
<input type="hidden" name="PrimaryKey" id="policy_PrimaryKey" />
|
||||||
<input type="hidden" id="policy_form_action" />
|
<input type="hidden" id="policy_form_action" />
|
||||||
<input type="hidden" name="policy_type_id" id="policy_type_id" />
|
<input type="hidden" name="policy_type_id" id="policy_type_id" />
|
||||||
<input type="hidden" name="client_id" id="client_id_policy" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
<input type="hidden" name="client_id" id="client_id_policy"
|
||||||
|
value="<?= isset($client['id']) ? $client['id'] : '' ?>" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="email">Insurer<span
|
<label for="email">Insurer<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<select class="form-control" id="insurer" name="insurer" required>
|
<select class="form-control" id="insurer" name="insurer" required>
|
||||||
<option value="">Select Insurer</option>
|
<option value="">Select Insurer</option>
|
||||||
<?php foreach($insurer as $value) { ?>
|
<?php foreach($insurer as $value) { ?>
|
||||||
<option value="<?= $value['id'] . '-' . $value['insurer_id']?>"><?= $value['insurer_name'] . '-' . $value['branch_code'] ?></option>
|
<option value="<?= $value['id'] . '-' . $value['insurer_id']?>">
|
||||||
|
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="policy">Policies<span
|
<label for="policy">Policies<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<select class="form-control" id="policy" name="policy_id" required>
|
<select class="form-control" id="policy" name="policy_id" required>
|
||||||
<option value="" selected>Select Policy</option>
|
<option value="" selected>Select Policy</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="mobile">TPA<span
|
<label for="mobile">TPA<span class="text-danger">*</span></label>
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<select class="form-control" id="tpa" name="tpa" required>
|
<select class="form-control" id="tpa" name="tpa" required>
|
||||||
<option value="">Select TPA</option>
|
<option value="">Select TPA</option>
|
||||||
<?php foreach($tpa as $value) { ?>
|
<?php foreach($tpa as $value) { ?>
|
||||||
<option value="<?= $value['id']. '-' . $value['tpa_id'] ?>"><?= $value['tpa_short_name'] . '-' . $value['branch_code'] ?></option>
|
<option value="<?= $value['id']. '-' . $value['tpa_id'] ?>">
|
||||||
|
<?= $value['tpa_short_name'] . '-' . $value['branch_code'] ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -74,23 +76,38 @@
|
|||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="policy_start_date">Policy Start Date<span class="text-danger">*</span></label>
|
<label for="policy_start_date">Policy Start Date<span
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter Start Date " name="policy_start_date" id="start_date" required>
|
class="text-danger">*</span></label>
|
||||||
|
<input value="" type="text" class="form-control" placeholder="Enter Start Date "
|
||||||
|
name="policy_start_date" id="start_date" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
|
<input value="" type="text" class="form-control" placeholder="Enter End Date "
|
||||||
|
name="policy_end_date" id="end_date" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4" id="policy_status_field">
|
<div class="form-group col-md-4" id="policy_status_field">
|
||||||
<label for="policy_status">Policy Status</label>
|
<label for="policy_status">Policy Status</label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
<input value="" type="text" class="form-control" placeholder="Policy Status"
|
||||||
|
id="policy_status" readonly>
|
||||||
</div>
|
</div>
|
||||||
<div >
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-4" style="margin-top: 49px;">
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input id="is_addon" type="checkbox" name="is_addon" <?= (isset($client['is_addon']) && $client['is_addon'] == 1) ? 'checked' : '' ?>>
|
<input id="is_addon" type="checkbox" name="is_addon"
|
||||||
|
<?= (isset($client['is_addon']) && $client['is_addon'] == 1) ? 'checked' : '' ?>>
|
||||||
<span class="slider round" style="height: 27px;"></span>
|
<span class="slider round" style="height: 27px;"></span>
|
||||||
</label>
|
</label>
|
||||||
<label for="is_addon" style=" position: relative;bottom: 5px;">Is AddOn Policy</label>
|
<label for="is_addon" style="position: absolute;left: 70px;bottom: 2px;">Is AddOn Policy</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-4" id="base_policy_id" style="display: none;">
|
||||||
|
<label for="addon_policy">Base Policy<span class="text-danger">*</span></label>
|
||||||
|
<select class="form-control" id="base_policy" name="base_policy">
|
||||||
|
<option value="" selected>Select Base Policy</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -116,7 +133,6 @@
|
|||||||
<?php include('policy_gpa_terms.php'); ?>
|
<?php include('policy_gpa_terms.php'); ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var policy_PrimaryKey = $('#client_id_policy').val();
|
var policy_PrimaryKey = $('#client_id_policy').val();
|
||||||
var policy_client = $('#policy_PrimaryKey').val();
|
var policy_client = $('#policy_PrimaryKey').val();
|
||||||
|
|
||||||
@ -157,6 +173,9 @@
|
|||||||
|
|
||||||
|
|
||||||
$('.btnAdd').click(function() {
|
$('.btnAdd').click(function() {
|
||||||
|
|
||||||
|
fetchClientPolicyList()
|
||||||
|
|
||||||
$('#policy_form')[0].reset();
|
$('#policy_form')[0].reset();
|
||||||
$('#add_form').show();
|
$('#add_form').show();
|
||||||
$('#table_list').hide();
|
$('#table_list').hide();
|
||||||
@ -170,6 +189,8 @@
|
|||||||
$('#is_addon').prop('checked', false);
|
$('#is_addon').prop('checked', false);
|
||||||
$('#policy_form_action').val('<?= base_url("client/policy/create"); ?>');
|
$('#policy_form_action').val('<?= base_url("client/policy/create"); ?>');
|
||||||
$('#policy_status_field').hide()
|
$('#policy_status_field').hide()
|
||||||
|
$('#base_policy_id').hide();
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -185,6 +206,7 @@
|
|||||||
$('#start_date').val('');
|
$('#start_date').val('');
|
||||||
$('#end_date').val('');
|
$('#end_date').val('');
|
||||||
$('#policy').html('<option value="" selected>Select Policy</option>');
|
$('#policy').html('<option value="" selected>Select Policy</option>');
|
||||||
|
$('#base_policy_id').hide();
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -214,7 +236,7 @@
|
|||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${item.policy_name} (${item.policy_type_name})</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
||||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${(item.policy_start_date)} / ${(item.policy_end_date)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
@ -225,9 +247,11 @@
|
|||||||
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
|
<a href="#" data-id="${item.id}" id="${search_term}"class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
|
||||||
`;
|
`;
|
||||||
if (item.open_for_enrollment == 0) {
|
if (item.open_for_enrollment == 0) {
|
||||||
policyTable +=`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
policyTable +=
|
||||||
|
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a> `;
|
||||||
} else {
|
} else {
|
||||||
policyTable +=`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="pointer-events:none; background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
policyTable +=
|
||||||
|
`<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll" style="pointer-events:none; background-color: lightgrey;"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle" ></i>Open Enrollment</a> `;
|
||||||
}
|
}
|
||||||
policyTable += ` </div>
|
policyTable += ` </div>
|
||||||
</div>
|
</div>
|
||||||
@ -245,7 +269,6 @@
|
|||||||
searching: false
|
searching: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/******** for form submit using AJAX *******/
|
/******** for form submit using AJAX *******/
|
||||||
@ -301,7 +324,8 @@
|
|||||||
$('#table_list').show();
|
$('#table_list').show();
|
||||||
$('.btnBack').hide();
|
$('.btnBack').hide();
|
||||||
$('.btnAdd').show();
|
$('.btnAdd').show();
|
||||||
var message = (policy_PrimaryKey === '') ? 'Policy Created successfully' : 'Policy Updated Successfully';
|
var message = (policy_PrimaryKey === '') ?
|
||||||
|
'Policy Created successfully' : 'Policy Updated Successfully';
|
||||||
toastr.success(message, 'Success');
|
toastr.success(message, 'Success');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@ -320,7 +344,8 @@
|
|||||||
} else if (patternGPA.test(subject)) {
|
} else if (patternGPA.test(subject)) {
|
||||||
search_term = 'GPA';
|
search_term = 'GPA';
|
||||||
} else {
|
} else {
|
||||||
search_term = subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
search_term =
|
||||||
|
subject; // Set default value if neither 'GMC' nor 'GPA' exists
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('search_term :', search_term)
|
console.log('search_term :', search_term)
|
||||||
@ -386,7 +411,8 @@
|
|||||||
var OptionsHTML = '';
|
var OptionsHTML = '';
|
||||||
OptionsHTML += '<option value="" selected>Select Policy</option>';
|
OptionsHTML += '<option value="" selected>Select Policy</option>';
|
||||||
$.each(res.data, function(index, item) {
|
$.each(res.data, function(index, item) {
|
||||||
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id + '">' + item.name + '</option>';
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||||
|
'">' + item.name + '</option>';
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#policy').html(OptionsHTML);
|
$('#policy').html(OptionsHTML);
|
||||||
@ -399,10 +425,20 @@
|
|||||||
/********* set the Policy_Type_id for Form Submit *******/
|
/********* set the Policy_Type_id for Form Submit *******/
|
||||||
$('#policy').change(function() {
|
$('#policy').change(function() {
|
||||||
|
|
||||||
|
var id = $(this).val();
|
||||||
var dataId = $(this).children('option:selected').attr('data-id');
|
var dataId = $(this).children('option:selected').attr('data-id');
|
||||||
// console.log('dataId', dataId)
|
console.log('id', id)
|
||||||
$('#policy_type_id').val(dataId);
|
$('#policy_type_id').val(dataId);
|
||||||
|
|
||||||
|
$('#base_policy option').each(function() {
|
||||||
|
var val = $(this).val();
|
||||||
|
if (val == id) {
|
||||||
|
$(this).hide(); // Hide the option if its value matches the selected value of #policy
|
||||||
|
} else {
|
||||||
|
$(this).show(); // Show all other options
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// if(dataId == 1){
|
// if(dataId == 1){
|
||||||
// appendPolicyFormFields(1);
|
// appendPolicyFormFields(1);
|
||||||
// }else if (dataId >= 1){
|
// }else if (dataId >= 1){
|
||||||
@ -458,8 +494,10 @@
|
|||||||
|
|
||||||
if (res.data.is_addon == 1) {
|
if (res.data.is_addon == 1) {
|
||||||
$('#is_addon').prop('checked', true);
|
$('#is_addon').prop('checked', true);
|
||||||
|
$('#base_policy_id').show();
|
||||||
} else {
|
} else {
|
||||||
$('#is_addon').prop('checked', false);
|
$('#is_addon').prop('checked', false);
|
||||||
|
$('#base_policy_id').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** do not delete this comment condition
|
/** do not delete this comment condition
|
||||||
@ -475,9 +513,22 @@
|
|||||||
var policeOptionHTML = '';
|
var policeOptionHTML = '';
|
||||||
$.each(res.policy, function(index, item) {
|
$.each(res.policy, function(index, item) {
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
policeOptionHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id + '" ' + (res.data.policy_id === item.id ? 'selected="selected"' : '') + '>' + item.name + '</option>';
|
policeOptionHTML += '<option data-id="' + item.policy_type_id +
|
||||||
|
'" value="' + item.id + '" ' + (res.data.policy_id === item.id ?
|
||||||
|
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||||
});
|
});
|
||||||
$('#policy').html(policeOptionHTML);
|
$('#policy').html(policeOptionHTML);
|
||||||
|
|
||||||
|
var OptionsHTML = '';
|
||||||
|
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||||
|
$.each(res.client_policy_list, function(index, item) {
|
||||||
|
if (res.data.policy_id !== item.id) {
|
||||||
|
OptionsHTML += '<option data-id="' + item.policy_type_id +
|
||||||
|
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
|
||||||
|
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#base_policy').html(OptionsHTML);
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
@ -522,7 +573,10 @@
|
|||||||
// console.log($('[data-id="' + client_policy_id + '"]');
|
// console.log($('[data-id="' + client_policy_id + '"]');
|
||||||
$('.btnOpenEnroll').each(function(index, element) {
|
$('.btnOpenEnroll').each(function(index, element) {
|
||||||
if ($(element).data('id') == client_policy_id) {
|
if ($(element).data('id') == client_policy_id) {
|
||||||
$(element).css({'background-color': 'lightgrey', 'pointer-events': 'none'});
|
$(element).css({
|
||||||
|
'background-color': 'lightgrey',
|
||||||
|
'pointer-events': 'none'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -733,9 +787,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const numberWords = {
|
const numberWords = {
|
||||||
0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine",
|
0: "Zero",
|
||||||
10: "Ten", 11: "Eleven", 12: "Twelve", 13: "Thirteen", 14: "Fourteen", 15: "Fifteen", 16: "Sixteen", 17: "Seventeen", 18: "Eighteen", 19: "Nineteen",
|
1: "One",
|
||||||
20: "Twenty", 30: "Thirty", 40: "Forty", 50: "Fifty", 60: "Sixty", 70: "Seventy", 80: "Eighty", 90: "Ninety"
|
2: "Two",
|
||||||
|
3: "Three",
|
||||||
|
4: "Four",
|
||||||
|
5: "Five",
|
||||||
|
6: "Six",
|
||||||
|
7: "Seven",
|
||||||
|
8: "Eight",
|
||||||
|
9: "Nine",
|
||||||
|
10: "Ten",
|
||||||
|
11: "Eleven",
|
||||||
|
12: "Twelve",
|
||||||
|
13: "Thirteen",
|
||||||
|
14: "Fourteen",
|
||||||
|
15: "Fifteen",
|
||||||
|
16: "Sixteen",
|
||||||
|
17: "Seventeen",
|
||||||
|
18: "Eighteen",
|
||||||
|
19: "Nineteen",
|
||||||
|
20: "Twenty",
|
||||||
|
30: "Thirty",
|
||||||
|
40: "Forty",
|
||||||
|
50: "Fifty",
|
||||||
|
60: "Sixty",
|
||||||
|
70: "Seventy",
|
||||||
|
80: "Eighty",
|
||||||
|
90: "Ninety"
|
||||||
};
|
};
|
||||||
|
|
||||||
function convertNumberToWords(number) {
|
function convertNumberToWords(number) {
|
||||||
@ -879,4 +958,58 @@
|
|||||||
console.log(element);
|
console.log(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#is_addon').change(function() {
|
||||||
|
|
||||||
|
if ($(this).is(':checked')) {
|
||||||
|
$('#base_policy_id').show();
|
||||||
|
$('#base_policy').prop('required', true);
|
||||||
|
}else{
|
||||||
|
$('#base_policy_id').hide();
|
||||||
|
$('#base_policy').prop('required', false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function fetchClientPolicyList(){
|
||||||
|
|
||||||
|
var client_id = $('#client_id_policy').val()
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '<?= base_url("util/featch-client-policy-list/") ?>' + client_id,
|
||||||
|
type: "GET",
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(res) {
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
if (res.status === false) {
|
||||||
|
toastr.error(res.status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var OptionsHTML = '';
|
||||||
|
OptionsHTML += '<option value="" selected>Select Base Policy</option>';
|
||||||
|
$.each(res.data, function(index, item) {
|
||||||
|
OptionsHTML += '<option data-id="' + item.policy_type_id + '" value="' + item.id +
|
||||||
|
'">' + item.name + '</option>';
|
||||||
|
});
|
||||||
|
$('#base_policy').html(OptionsHTML);
|
||||||
|
},
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -2,38 +2,56 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form role="form" class="parsley-examples" method="post" id="insurer_general_form" enctype="multipart/form-data">
|
<form role="form" class="parsley-examples" method="post" id="insurer_general_form"
|
||||||
|
enctype="multipart/form-data">
|
||||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
|
||||||
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey" value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>"/>
|
<input type="hidden" name="PrimaryKey" id="insurer_General_PrimaryKey"
|
||||||
|
value="<?= isset($insurer['id']) ? $insurer['id'] : '' ?>" />
|
||||||
<input type="hidden" name="insurer_id" id="insurer_id" />
|
<input type="hidden" name="insurer_id" id="insurer_id" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="entity_type_id">Insurer Type <span class="text-danger">*</span></label>
|
<label for="insurer_name">Insurer Name<span class="text-danger">*</span></label>
|
||||||
<select class="form-control" id="type" name="type" required>
|
|
||||||
<option value="">Select Type</option>
|
|
||||||
<?php foreach ($types as $type): ?>
|
|
||||||
<option value="<?= $type->id; ?>" <?= isset($insurer['type']) && $insurer['type'] == $type->id ? 'selected' : ''; ?>>
|
|
||||||
<?= $type->name; ?>
|
|
||||||
</option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-4">
|
|
||||||
<label for="insurer_name">Insurer Name<span
|
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<input type="text" class="form-control" id="insurer_name"
|
<input type="text" class="form-control" id="insurer_name"
|
||||||
placeholder="Enter Insurer Name" value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
placeholder="Enter Insurer Name"
|
||||||
</div>
|
value="<?= isset($insurer['name']) ? $insurer['name'] : '' ?>" name="name" required>
|
||||||
<div class="form-group col-md-4">
|
</div>
|
||||||
<label for="short_name">Insurer Short Name<span
|
</div>
|
||||||
class="text-danger">*</span></label>
|
|
||||||
<input type="text" class="form-control" id="short_name"
|
<div class="form-row">
|
||||||
placeholder="Enter Short Name" value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>" name="short_name" required>
|
<div class="form-group col-md-2">
|
||||||
|
<label for="short_name">Insurer Short Name<span class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" id="short_name" placeholder="Enter Short Name"
|
||||||
|
value="<?= isset($insurer['short_name']) ? $insurer['short_name'] : '' ?>"
|
||||||
|
name="short_name" required minlength="3" maxlength="8">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="html">Insurer Type</label><br>
|
||||||
|
<div style="margin-top: 10px;">
|
||||||
|
<input type="radio" id="html" name="type" value="pvt" <?= isset($insurer['type']) && $insurer['type'] == 'pvt' ? 'checked' : '' ?>>
|
||||||
|
<label for="html">PVT</label>
|
||||||
|
<input type="radio" id="css" name="type" value="psu" <?= isset($insurer['type']) && $insurer['type'] == 'psu' ? 'checked' : '' ?>>
|
||||||
|
<label for="css">PSU</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-4" style="position: relative;right: 0px;">
|
||||||
|
<label for="html">Insurer Category</label><br>
|
||||||
|
<div style="margin-top: 10px;">
|
||||||
|
<input type="radio" id="html" name="category" value="life" <?= isset($insurer['category']) && $insurer['category'] == 'life' ? 'checked' : '' ?>>
|
||||||
|
<label for="html">Life</label>
|
||||||
|
<input type="radio" id="css" name="category" value="general" <?= isset($insurer['category']) && $insurer['category'] == 'general' ? 'checked' : '' ?>>
|
||||||
|
<label for="css" style="position: absolute;left: 70px;">General(Non Life)</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group text-right m-b-0">
|
<div class="form-group text-right m-b-0">
|
||||||
@ -50,7 +68,6 @@
|
|||||||
<!-- end -->
|
<!-- end -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$("#insurer_general_form").submit(function(events) {
|
$("#insurer_general_form").submit(function(events) {
|
||||||
@ -158,5 +175,4 @@ function validateForm() {
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -111,11 +111,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach($depositdata as $row) { ?>
|
<?php foreach($depositdata as $row) { ?>
|
||||||
<tr id="<?php echo $row->id;?>">
|
<tr id="<?php echo $row->id;?>">
|
||||||
<td class=""><?php echo date('d-m-y h:i A', strtotime($row->created_at)); ?></td>
|
<td><?php echo date('d-M-Y h:i A', strtotime($row->created_at)); ?></td>
|
||||||
<td><?php echo $row->username; ?></td>
|
<td><?php echo $row->username; ?></td>
|
||||||
<td><?php echo $row->description; ?></td>
|
<td><?php echo $row->description; ?></td>
|
||||||
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?>
|
<td><?php echo isset($subTypeOptions[$row->sub_type]) ? $subTypeOptions[$row->sub_type] : ''; ?></td>
|
||||||
</td>
|
|
||||||
<td><?php echo ($row->transaction_type == 'Credit') ? $row->amount : ''; ?></td>
|
<td><?php echo ($row->transaction_type == 'Credit') ? $row->amount : ''; ?></td>
|
||||||
<td><?php echo ($row->transaction_type == 'Debit') ? $row->amount : ''; ?></td>
|
<td><?php echo ($row->transaction_type == 'Debit') ? $row->amount : ''; ?></td>
|
||||||
<td><?php echo $row->balance; ?></td>
|
<td><?php echo $row->balance; ?></td>
|
||||||
@ -229,7 +228,16 @@ $(document).ready(function() {
|
|||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ''
|
columns: ''
|
||||||
}
|
}
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdf',
|
||||||
|
text: 'PDF',
|
||||||
|
title: 'TransactionDetails',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
language: {
|
language: {
|
||||||
|
|||||||
40
tests/unit/CheckFormateDataTest.php
Normal file
40
tests/unit/CheckFormateDataTest.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tests;
|
||||||
|
|
||||||
|
use CodeIgniter\Test\CIUnitTestCase;
|
||||||
|
|
||||||
|
use App\Controllers\EmpDataServiceController;
|
||||||
|
use App\Models\EmployeePolicyModel;
|
||||||
|
|
||||||
|
use App\Models\EmployeeModel;
|
||||||
|
use App\Models\ClientModel;
|
||||||
|
use App\Models\ClientPolicyModel;
|
||||||
|
use App\Models\FileModel;
|
||||||
|
use App\Models\BatchListModel;
|
||||||
|
use App\Models\BatchFileModel;
|
||||||
|
use App\Models\EmpEndorsementModel;
|
||||||
|
use App\Models\ClientDepositModel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class CheckFormateDataTest extends CIUnitTestCase
|
||||||
|
{
|
||||||
|
public function testGenerateExcelForAdditionAndInception()
|
||||||
|
{
|
||||||
|
$batch_data = [
|
||||||
|
'client_id' => 12,
|
||||||
|
'client_policy_id' => 12,
|
||||||
|
'insurer_or_tpa' => 'insurer',
|
||||||
|
'event_type' => 'inception',
|
||||||
|
'actions' => 'export',
|
||||||
|
'file_name' => 'TCS_HealthFlex_Advantage_Policy_IEI_06-04-2024_17-42-31.xlsx',
|
||||||
|
];
|
||||||
|
|
||||||
|
$empServiceController = new EmpDataServiceController();
|
||||||
|
$result = $empServiceController->generateExcelForAdditionAndInception($batch_data);
|
||||||
|
|
||||||
|
// You can add assertions here to verify the result if needed
|
||||||
|
$this->assertTrue($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user