Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
710bcf1ed1
@ -12,7 +12,8 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
|||||||
// Reminder Mail Notification
|
// Reminder Mail Notification
|
||||||
|
|
||||||
$routes->get("reminder_mail", "NotificationController::reminder_mail");
|
$routes->get("reminder_mail", "NotificationController::reminder_mail");
|
||||||
$routes->get("testing", "ClientController::Testing");
|
// $routes->get("testing", "ClientController::Testing");
|
||||||
|
$routes->get("testing_for_review_mail/(:any)", "ClientController::testingForReviewMail/$1");
|
||||||
$routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections");
|
$routes->get("update-policy-terms-for-corrections", "ClientController::updatePolicyTermsForCorrections");
|
||||||
$routes->get("update_rack_rate_json", "ClientController::updateRackRateJson");
|
$routes->get("update_rack_rate_json", "ClientController::updateRackRateJson");
|
||||||
$routes->get("updatajson", "EmpDataServiceController::updatajson");
|
$routes->get("updatajson", "EmpDataServiceController::updatajson");
|
||||||
@ -312,6 +313,10 @@ $routes->group("/util", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$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("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");
|
$routes->get("checkInvoiceStatus/(:any)", "PolicyTransactionController::checkInvoiceStatus/$1");
|
||||||
$routes->get("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1");
|
$routes->get("base_policy_for_policy_inception/(:any)", "PolicyTransactionController::getBasePolicy/$1");
|
||||||
|
$routes->get("sentTestMail/(:any)", "NotificationController::sentTestMail/$1");
|
||||||
|
$routes->get("send_manual_reminder/(:any)", "DashboardController::sendManualReminder/$1");
|
||||||
|
$routes->get("get_client_policy_list_for_remainder/(:any)", "EmployeeController::get_client_policy_list_for_remainder/$1");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -115,23 +115,47 @@ class ClientController extends AdminController
|
|||||||
$this->vehicleModel = new VehicleModel();
|
$this->vehicleModel = new VehicleModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Testing() //this function for only tsesting some logics not use for business logic
|
public function testingForReviewMail($client_id = 77, $emp_code = 'MGL-004', $mail_active = 0) //this function for only tsesting some logics not use for business logic
|
||||||
{
|
{
|
||||||
$emp_code = 'MGL-004';
|
|
||||||
$client_id = 77;
|
|
||||||
$client_policy_id = 206;
|
|
||||||
$array_list = [];
|
|
||||||
|
|
||||||
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $client_policy_id, emp_code: $emp_code, client_id: $client_id, emp_status: ['draft', 'enrolled'], policy_status: ['draft', 'enrolled']);
|
$client_policy_ids = $this->employeeModel
|
||||||
|
->select('employee_polices.client_policy_id')
|
||||||
|
->join('employee_polices', 'employees.id = employee_polices.employee_id')
|
||||||
|
->where('employees.client_id', $client_id )
|
||||||
|
->where('employees.emp_code', $emp_code )
|
||||||
|
->where('employee_polices.is_active', 1 )
|
||||||
|
->where('employees.is_active', 1 )
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
$client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id');
|
||||||
|
|
||||||
|
$client_policy_id = array_unique($client_policy_ids2);
|
||||||
|
|
||||||
|
// echo '<pre>';
|
||||||
|
// dd($client_policy_id);
|
||||||
|
// print_r($unique_policy_ids); die;
|
||||||
|
// sort($client_policy_id);
|
||||||
|
|
||||||
|
$wholeData = '';
|
||||||
|
$mail_send_return = '';
|
||||||
|
$mail_send_return1 = '';
|
||||||
|
$mail_send_return2 = '';
|
||||||
|
|
||||||
|
if (!is_null($client_policy_id) && is_array($client_policy_id))
|
||||||
|
{
|
||||||
|
$array_list = [];
|
||||||
|
foreach ($client_policy_id as $key => $value)
|
||||||
|
{
|
||||||
|
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
|
||||||
if(count($find) > 0){
|
if(count($find) > 0){
|
||||||
$array_list[] = $find;
|
$array_list[] = $find;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// dd($array_list);
|
// dd($array_list);
|
||||||
|
|
||||||
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
|
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
|
||||||
|
|
||||||
// dd($notification);
|
|
||||||
|
|
||||||
if (isset($notification) && $notification['enabled'] == 1) {
|
if (isset($notification) && $notification['enabled'] == 1) {
|
||||||
|
|
||||||
@ -141,46 +165,71 @@ class ClientController extends AdminController
|
|||||||
$params ['client_id'] = $client_id;
|
$params ['client_id'] = $client_id;
|
||||||
$params ['notification'] = $notification;
|
$params ['notification'] = $notification;
|
||||||
|
|
||||||
// print_r($params);die;
|
// dd($params);
|
||||||
|
|
||||||
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
|
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
|
||||||
|
|
||||||
// print_r($wholeData); die;
|
// print_r($wholeData); die;
|
||||||
|
|
||||||
|
if($mail_active > 0){
|
||||||
$mail_send_return = MailHelper::send_email($wholeData[0]);
|
$mail_send_return = MailHelper::send_email($wholeData[0]);
|
||||||
$this->myLogger->logme("info", $mail_send_return);
|
$this->myLogger->logme("info", $mail_send_return);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($wholeData[0])) {
|
if (isset($wholeData[0])) {
|
||||||
|
|
||||||
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
|
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
|
||||||
|
|
||||||
// print_r($account_manager_wholeData); die;
|
// print_r($account_manager_wholeData); die;
|
||||||
|
|
||||||
if ($account_manager_wholeData) {
|
if($account_manager_wholeData != null && $account_manager_wholeData != '' && count($account_manager_wholeData))
|
||||||
|
{
|
||||||
|
if($mail_active > 0){
|
||||||
|
|
||||||
foreach ($account_manager_wholeData as $key => $value) {
|
foreach ($account_manager_wholeData as $key => $value) {
|
||||||
$mail_send_return1 = MailHelper::send_email($value);
|
$mail_send_return1 = MailHelper::send_email($value);
|
||||||
$this->myLogger->logme("info", $mail_send_return1);
|
$this->myLogger->logme("info", $mail_send_return1);
|
||||||
$this->myLogger->logme("info", $mail_send_return1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$this->myLogger->logme("error", 'Account Manager Mail Configuration not Enable for this client');
|
||||||
}
|
}
|
||||||
|
|
||||||
$client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
|
$client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
|
||||||
|
|
||||||
// print_r($client_hr_wholeData); die;
|
// print_r($client_hr_wholeData); die;
|
||||||
|
|
||||||
if ($client_hr_wholeData) {
|
if($client_hr_wholeData != null && $client_hr_wholeData != '' &&count($client_hr_wholeData))
|
||||||
|
{
|
||||||
|
if($mail_active > 0){
|
||||||
|
|
||||||
foreach ($client_hr_wholeData as $key => $value) {
|
foreach ($client_hr_wholeData as $key => $value) {
|
||||||
$mail_send_return2 = MailHelper::send_email($value);
|
$mail_send_return2 = MailHelper::send_email($value);
|
||||||
$this->myLogger->logme("info", $mail_send_return2);
|
$this->myLogger->logme("info", $mail_send_return2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$this->myLogger->logme("error", 'Client HR Mail Configuration not Enable for this client');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$this->myLogger->logme("error", 'Member Review Mail Configuration not Enable for this client');
|
||||||
|
}
|
||||||
|
|
||||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => []], 200);
|
}
|
||||||
|
|
||||||
|
print_r($wholeData);
|
||||||
|
|
||||||
|
echo '<pre>';
|
||||||
|
echo '<h3>member_review_and_summary_mail</h3> <br><br>';
|
||||||
|
print_r($mail_send_return);
|
||||||
|
echo '<h3>account_maneger_summary_mail</h3> <br><br>';
|
||||||
|
print_r($mail_send_return1);
|
||||||
|
echo '<h3>client_hr_summary_mail</h3> <br><br>';
|
||||||
|
print_r($mail_send_return2);
|
||||||
|
|
||||||
|
// return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
@ -915,6 +964,7 @@ class ClientController extends AdminController
|
|||||||
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
|
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
|
||||||
$data['cd_ac_no'] = $this->request->getPost('cd_ac_no');
|
$data['cd_ac_no'] = $this->request->getPost('cd_ac_no');
|
||||||
$data['gst'] = $this->request->getPost('gst');
|
$data['gst'] = $this->request->getPost('gst');
|
||||||
|
$data['disclaimer'] = $this->request->getPost('disclaimer');
|
||||||
|
|
||||||
|
|
||||||
if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) {
|
if ($policy_type_id == 1 || $policy_type_id == 2 || $policy_type_id == 6 || $policy_type_id == 7) {
|
||||||
@ -1041,6 +1091,7 @@ class ClientController extends AdminController
|
|||||||
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
|
$data['client_branch_id'] = $this->request->getPost('client_branch_id');
|
||||||
$data['cd_ac_no'] = $this->request->getPost('cd_ac_no');
|
$data['cd_ac_no'] = $this->request->getPost('cd_ac_no');
|
||||||
$data['gst'] = $this->request->getPost('gst');
|
$data['gst'] = $this->request->getPost('gst');
|
||||||
|
$data['disclaimer'] = $this->request->getPost('disclaimer');
|
||||||
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
|
$data['policy_start_date'] = change_date_format($this->request->getPost('policy_start_date'), 'd-m-Y', 'Y-m-d');
|
||||||
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
|
$data['policy_end_date'] = change_date_format($this->request->getPost('policy_end_date'), 'd-m-Y', 'Y-m-d');
|
||||||
|
|
||||||
|
|||||||
@ -467,7 +467,7 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendManualRemainder($client_id, $client_branch_id)
|
public function sendManualReminder($client_id, $client_branch_id)
|
||||||
{
|
{
|
||||||
$this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}");
|
$this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}");
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class CloseDbConnection implements FilterInterface
|
|||||||
// Get all database configurations
|
// Get all database configurations
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$log = \Config\Services::mylogger();
|
$log = \Config\Services::mylogger();
|
||||||
$log->logme('error','CloseDbConnections....!');
|
// $log->logme('error','CloseDbConnections....!');
|
||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class MailHelper
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$res = $gmailapi->sendMessage($emaill, $subject, $message, 'info@nhanceindia.in', $reply_to, $cc, $bcc);
|
$res = $gmailapi->sendMessage($emaill, $subject, $message, 'no-reply@nhanceindia.in', $reply_to, $cc, $bcc);
|
||||||
|
|
||||||
if($res['status'])
|
if($res['status'])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,10 +3,13 @@
|
|||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
|
||||||
use App\Models\ClientModel;
|
use App\Models\ClientModel;
|
||||||
|
use App\Models\ClientPolicyModel;
|
||||||
use App\Models\ClientRMModel;
|
use App\Models\ClientRMModel;
|
||||||
use App\Models\NotificationModel;
|
use App\Models\NotificationModel;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use App\Models\EmployeeModel;
|
use App\Models\EmployeeModel;
|
||||||
|
use App\Models\PolicyPremium1Model;
|
||||||
|
use App\Models\PolicyPremium2Model;
|
||||||
|
|
||||||
class sendMailNotification
|
class sendMailNotification
|
||||||
{
|
{
|
||||||
@ -169,6 +172,10 @@ class sendMailNotification
|
|||||||
|
|
||||||
$clientModel = new ClientModel();
|
$clientModel = new ClientModel();
|
||||||
$notificationModel = new NotificationModel();
|
$notificationModel = new NotificationModel();
|
||||||
|
$clientPolicyModel = new ClientPolicyModel();
|
||||||
|
$PolicyPremium1Model = new PolicyPremium1Model();
|
||||||
|
$PolicyPremium2Model = new PolicyPremium2Model();
|
||||||
|
|
||||||
|
|
||||||
$client_data =$clientModel->where('id', $client_id)->first();
|
$client_data =$clientModel->where('id', $client_id)->first();
|
||||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||||
@ -200,32 +207,59 @@ class sendMailNotification
|
|||||||
$name = '';
|
$name = '';
|
||||||
$emp_code = '';
|
$emp_code = '';
|
||||||
|
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($array_list); die;
|
||||||
|
|
||||||
foreach ($array_list as $item) {
|
foreach ($array_list as $item) {
|
||||||
|
|
||||||
|
|
||||||
if (count($item) != 0) {
|
if (count($item) != 0) {
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
|
||||||
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
$temp_data = '';
|
$temp_data = '';
|
||||||
$policy_name = '';
|
$policy_name = '';
|
||||||
$is_addon = '';
|
$is_addon = '';
|
||||||
|
|
||||||
foreach ($item as $inner_item) {
|
foreach ($item as $inner_item) {
|
||||||
|
|
||||||
|
//getting policy premium data
|
||||||
|
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
|
||||||
|
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
|
||||||
|
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}else{
|
||||||
|
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}
|
||||||
|
//end of getting policy premium data
|
||||||
|
|
||||||
$policy_name = $inner_item['policy_name'];
|
$policy_name = $inner_item['policy_name'];
|
||||||
|
|
||||||
if ($inner_item['relationship'] == 'Self') {
|
if ($inner_item['relationship'] == 'Self') {
|
||||||
$emp_code = ' (' . $inner_item['emp_code'] . ')';
|
$emp_code = ' (' . $inner_item['emp_code'] . ')';
|
||||||
|
$mail = $inner_item['email_corporate'];
|
||||||
} else {
|
} else {
|
||||||
$emp_code = '';
|
$emp_code = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$si = '';
|
||||||
|
$premium = '';
|
||||||
|
$gst_forself = '';
|
||||||
|
if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
|
||||||
|
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||||
|
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
|
||||||
|
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
|
||||||
|
}
|
||||||
|
|
||||||
$temp_data .= '<tr>';
|
$temp_data .= '<tr>';
|
||||||
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
||||||
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
||||||
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number($inner_item['basic_cover_si']) . '</td>';
|
$temp_data .= '<td>' . $si . '</td>';
|
||||||
|
|
||||||
// Only Display SI Topup and Dependent Addon
|
// Only Display SI Topup and Dependent Addon
|
||||||
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['premium'])) . '</td>';
|
$temp_data .= '<td>' . $premium . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['gst'])) . '</td>';
|
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_data .= '</tr>';
|
$temp_data .= '</tr>';
|
||||||
@ -238,7 +272,12 @@ class sendMailNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_content .= $policy_name . '</h4></div>';
|
$policy_name_for_policy_type = $inner_item['policy_name'];
|
||||||
|
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
|
||||||
|
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_content .= $policy_name_for_policy_type . '</h4></div>';
|
||||||
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
||||||
|
|
||||||
// Add text-align: center to the table head
|
// Add text-align: center to the table head
|
||||||
@ -264,7 +303,7 @@ class sendMailNotification
|
|||||||
|
|
||||||
if ($is_addon == 2 || $is_addon == 3) {
|
if ($is_addon == 2 || $is_addon == 3) {
|
||||||
$addon_list_array = [
|
$addon_list_array = [
|
||||||
'policy_name' => $policy_name,
|
'policy_name' => $policy_name_for_policy_type,
|
||||||
'addtional_premium' => round($addtional_premium),
|
'addtional_premium' => round($addtional_premium),
|
||||||
'gst' => round($gst)
|
'gst' => round($gst)
|
||||||
];
|
];
|
||||||
@ -316,8 +355,6 @@ class sendMailNotification
|
|||||||
// $table_content .= '<div style="width:100%; text-align:right; font-size: 12px;">' . $sum_total_words . '</div>';
|
// $table_content .= '<div style="width:100%; text-align:right; font-size: 12px;">' . $sum_total_words . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// print_r($table_content); die;
|
// print_r($table_content); die;
|
||||||
|
|
||||||
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
|
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
|
||||||
@ -337,10 +374,15 @@ class sendMailNotification
|
|||||||
} else if($action == 'account_maneger_summary_mail'){
|
} else if($action == 'account_maneger_summary_mail'){
|
||||||
|
|
||||||
$client_id = $params['client_id'];
|
$client_id = $params['client_id'];
|
||||||
|
$client_policy_id = $params['client_policy_id'];
|
||||||
|
|
||||||
$clientModel = new ClientModel();
|
$clientModel = new ClientModel();
|
||||||
$notificationModel = new NotificationModel();
|
$notificationModel = new NotificationModel();
|
||||||
$clientRMModel =new ClientRMModel();
|
$clientRMModel =new ClientRMModel();
|
||||||
|
$clientPolicyModel = new ClientPolicyModel();
|
||||||
|
$PolicyPremium1Model = new PolicyPremium1Model();
|
||||||
|
$PolicyPremium2Model = new PolicyPremium2Model();
|
||||||
|
|
||||||
|
|
||||||
$client_data =$clientModel->where('id', $client_id)->first();
|
$client_data =$clientModel->where('id', $client_id)->first();
|
||||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||||
@ -381,12 +423,22 @@ class sendMailNotification
|
|||||||
|
|
||||||
foreach ($array_list as $item) {
|
foreach ($array_list as $item) {
|
||||||
if (count($item) != 0) {
|
if (count($item) != 0) {
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
$temp_data = '';
|
$temp_data = '';
|
||||||
$policy_name = '';
|
$policy_name = '';
|
||||||
$is_addon = '';
|
$is_addon = '';
|
||||||
|
|
||||||
foreach ($item as $inner_item) {
|
foreach ($item as $inner_item) {
|
||||||
|
|
||||||
|
//getting policy premium data
|
||||||
|
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
|
||||||
|
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
|
||||||
|
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}else{
|
||||||
|
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}
|
||||||
|
//end of getting policy premium data
|
||||||
|
|
||||||
$policy_name = $inner_item['policy_name'];
|
$policy_name = $inner_item['policy_name'];
|
||||||
|
|
||||||
if ($inner_item['relationship'] == 'Self') {
|
if ($inner_item['relationship'] == 'Self') {
|
||||||
@ -395,16 +447,25 @@ class sendMailNotification
|
|||||||
$emp_code = '';
|
$emp_code = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$si = '';
|
||||||
|
$premium = '';
|
||||||
|
$gst_forself = '';
|
||||||
|
if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
|
||||||
|
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||||
|
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
|
||||||
|
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
|
||||||
|
}
|
||||||
|
|
||||||
$temp_data .= '<tr>';
|
$temp_data .= '<tr>';
|
||||||
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
||||||
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
||||||
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number($inner_item['basic_cover_si']) . '</td>';
|
$temp_data .= '<td>' . $si . '</td>';
|
||||||
|
|
||||||
// Only Display SI Topup and Dependent Addon
|
// Only Display SI Topup and Dependent Addon
|
||||||
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['premium'])) . '</td>';
|
$temp_data .= '<td>' . $premium . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['gst'])) . '</td>';
|
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_data .= '</tr>';
|
$temp_data .= '</tr>';
|
||||||
@ -417,7 +478,12 @@ class sendMailNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_content .= $policy_name . '</h4></div>';
|
$policy_name_for_policy_type = $inner_item['policy_name'];
|
||||||
|
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
|
||||||
|
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_content .= $policy_name_for_policy_type . '</h4></div>';
|
||||||
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
||||||
|
|
||||||
// Add text-align: center to the table head
|
// Add text-align: center to the table head
|
||||||
@ -443,7 +509,7 @@ class sendMailNotification
|
|||||||
|
|
||||||
if ($is_addon == 2 || $is_addon == 3) {
|
if ($is_addon == 2 || $is_addon == 3) {
|
||||||
$addon_list_array = [
|
$addon_list_array = [
|
||||||
'policy_name' => $policy_name,
|
'policy_name' => $policy_name_for_policy_type,
|
||||||
'addtional_premium' => round($addtional_premium),
|
'addtional_premium' => round($addtional_premium),
|
||||||
'gst' => round($gst)
|
'gst' => round($gst)
|
||||||
];
|
];
|
||||||
@ -513,8 +579,12 @@ class sendMailNotification
|
|||||||
} else if($action == 'client_hr_summary_mail'){
|
} else if($action == 'client_hr_summary_mail'){
|
||||||
|
|
||||||
$client_id = $params['client_id'];
|
$client_id = $params['client_id'];
|
||||||
|
$client_policy_id = $params['client_policy_id'];
|
||||||
|
|
||||||
$clientModel = new ClientModel();
|
$clientModel = new ClientModel();
|
||||||
|
$clientPolicyModel = new ClientPolicyModel();
|
||||||
|
$PolicyPremium1Model = new PolicyPremium1Model();
|
||||||
|
$PolicyPremium2Model = new PolicyPremium2Model();
|
||||||
|
|
||||||
$client_data =$clientModel->where('id', $client_id)->first();
|
$client_data =$clientModel->where('id', $client_id)->first();
|
||||||
$notificationModel = new NotificationModel();
|
$notificationModel = new NotificationModel();
|
||||||
@ -522,6 +592,7 @@ class sendMailNotification
|
|||||||
$clientRMModel =new ClientRMModel();
|
$clientRMModel =new ClientRMModel();
|
||||||
|
|
||||||
if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) {
|
if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) {
|
||||||
|
|
||||||
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
||||||
$user_list= [];
|
$user_list= [];
|
||||||
foreach ($client_rm_data as $key => $value) {
|
foreach ($client_rm_data as $key => $value) {
|
||||||
@ -558,12 +629,22 @@ class sendMailNotification
|
|||||||
|
|
||||||
foreach ($array_list as $item) {
|
foreach ($array_list as $item) {
|
||||||
if (count($item) != 0) {
|
if (count($item) != 0) {
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
$temp_data = '';
|
$temp_data = '';
|
||||||
$policy_name = '';
|
$policy_name = '';
|
||||||
$is_addon = '';
|
$is_addon = '';
|
||||||
|
|
||||||
foreach ($item as $inner_item) {
|
foreach ($item as $inner_item) {
|
||||||
|
|
||||||
|
//getting policy premium data
|
||||||
|
$client_policy_data = $clientPolicyModel->where('id', $inner_item['client_policy_id'])->first();
|
||||||
|
if($client_policy_data['policy_type_id'] == 1 || $client_policy_data['policy_type_id'] == 6 || $client_policy_data['policy_type_id'] == 7 ){
|
||||||
|
$policy_premium_data = $PolicyPremium1Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}else{
|
||||||
|
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $inner_item['client_policy_id'])->where('is_active', '1')->first();
|
||||||
|
}
|
||||||
|
//end of getting policy premium data
|
||||||
|
|
||||||
$policy_name = $inner_item['policy_name'];
|
$policy_name = $inner_item['policy_name'];
|
||||||
|
|
||||||
if ($inner_item['relationship'] == 'Self') {
|
if ($inner_item['relationship'] == 'Self') {
|
||||||
@ -572,16 +653,28 @@ class sendMailNotification
|
|||||||
$emp_code = '';
|
$emp_code = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$si = '';
|
||||||
|
$premium = '';
|
||||||
|
$gst_forself = '';
|
||||||
|
|
||||||
|
// dd($policy_premium_data, $client_policy_data, $inner_item);
|
||||||
|
|
||||||
|
if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
|
||||||
|
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||||
|
$premium = '₹ ' .format_indian_number(round($inner_item['premium']));
|
||||||
|
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
|
||||||
|
}
|
||||||
|
|
||||||
$temp_data .= '<tr>';
|
$temp_data .= '<tr>';
|
||||||
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
|
||||||
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
|
||||||
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number($inner_item['basic_cover_si']) . '</td>';
|
$temp_data .= '<td>' . $si . '</td>';
|
||||||
|
|
||||||
// Only Display SI Topup and Dependent Addon
|
// Only Display SI Topup and Dependent Addon
|
||||||
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['premium'])) . '</td>';
|
$temp_data .= '<td>' . $premium . '</td>';
|
||||||
$temp_data .= '<td>₹' . format_indian_number(round($inner_item['gst'])) . '</td>';
|
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp_data .= '</tr>';
|
$temp_data .= '</tr>';
|
||||||
@ -594,7 +687,12 @@ class sendMailNotification
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_content .= $policy_name . '</h4></div>';
|
$policy_name_for_policy_type = $inner_item['policy_name'];
|
||||||
|
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
|
||||||
|
$policy_name_for_policy_type = 'Add-On Group Medical Coverage for Parents';
|
||||||
|
}
|
||||||
|
|
||||||
|
$table_content .= $policy_name_for_policy_type . '</h4></div>';
|
||||||
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
|
||||||
|
|
||||||
// Add text-align: center to the table head
|
// Add text-align: center to the table head
|
||||||
@ -620,7 +718,7 @@ class sendMailNotification
|
|||||||
|
|
||||||
if ($is_addon == 2 || $is_addon == 3) {
|
if ($is_addon == 2 || $is_addon == 3) {
|
||||||
$addon_list_array = [
|
$addon_list_array = [
|
||||||
'policy_name' => $policy_name,
|
'policy_name' => $policy_name_for_policy_type,
|
||||||
'addtional_premium' => round($addtional_premium),
|
'addtional_premium' => round($addtional_premium),
|
||||||
'gst' => round($gst)
|
'gst' => round($gst)
|
||||||
];
|
];
|
||||||
@ -836,7 +934,7 @@ class sendMailNotification
|
|||||||
|
|
||||||
if (!empty($array_list)) {
|
if (!empty($array_list)) {
|
||||||
|
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
|
|
||||||
$policy_name = $array_list['policy_name'];
|
$policy_name = $array_list['policy_name'];
|
||||||
|
|
||||||
@ -985,7 +1083,7 @@ class sendMailNotification
|
|||||||
$emp_code = '';
|
$emp_code = '';
|
||||||
|
|
||||||
if (!empty($array_list)) {
|
if (!empty($array_list)) {
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
|
|
||||||
$policy_name = $array_list['policy_name'];
|
$policy_name = $array_list['policy_name'];
|
||||||
|
|
||||||
@ -1133,7 +1231,7 @@ class sendMailNotification
|
|||||||
|
|
||||||
if (!empty($array_list)) {
|
if (!empty($array_list)) {
|
||||||
|
|
||||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
|
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||||
|
|
||||||
$policy_name = $array_list['policy_name'];
|
$policy_name = $array_list['policy_name'];
|
||||||
|
|
||||||
|
|||||||
@ -375,7 +375,34 @@ if (!function_exists('excelFileGDriveUpload')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!function_exists('checkFamilyFloaters')){
|
||||||
|
|
||||||
|
function checkFamilyFloaters($policy_premium_data, $client_policy_data, $emp_data){
|
||||||
|
|
||||||
|
if($policy_premium_data['premium_type'] == 1){
|
||||||
|
|
||||||
|
//only family floater
|
||||||
|
if ($emp_data['relationship'] == 'Self') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($client_policy_data['policy_type_id'] == 3 && $client_policy_data['is_addon'] == 3){
|
||||||
|
if($emp_data['rata_premimum'] > 0){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
//individual
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function numberToWords($number)
|
function numberToWords($number)
|
||||||
|
|||||||
@ -161,7 +161,7 @@ class EmployeeModel extends Model
|
|||||||
// for EMP rest API process do not change
|
// for EMP rest API process do not change
|
||||||
public function checkExistingEmployee($arr,$client_branch_id)
|
public function checkExistingEmployee($arr,$client_branch_id)
|
||||||
{
|
{
|
||||||
return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->where('client_id', $arr['client_id'])->where('client_branch_id', $client_branch_id)->first();
|
return $this->where('emp_code',$arr['emp_code'])->where('name',$arr['name'])->where('client_id', $arr['client_id'])->where('client_branch_id', $client_branch_id)->where('emp_status !=', 'truncated')->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ option:disabled {
|
|||||||
<div class="form-group col-md-4" style="margin-top: 18px;">
|
<div class="form-group col-md-4" style="margin-top: 18px;">
|
||||||
<a class="btn btn-primary waves-effect waves-light justify-content-end"
|
<a class="btn btn-primary waves-effect waves-light justify-content-end"
|
||||||
id="fetch_enrolled_data" data-toggle="modal"
|
id="fetch_enrolled_data" data-toggle="modal"
|
||||||
data-target="#full-width-modal" title="Download Sample Excel">Featch
|
data-target="#full-width-modal" title="Download Sample Excel">Fetch
|
||||||
Enrolled Data</a>
|
Enrolled Data</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -714,12 +714,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url("util/send_manual_remainder/") ?>' + client_id + '/' + client_branch_id,
|
url: '<?= base_url("util/send_manual_reminder/") ?>' + client_id + '/' + client_branch_id,
|
||||||
type: "GET",
|
type: "GET",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
|
||||||
console.log('send_manual_remainder', res)
|
console.log('send_manual_reminder', res)
|
||||||
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.radio-group .form-check {
|
.radio-group .form-check {
|
||||||
margin-right: -110px;
|
margin-right: -335px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.radioalign{
|
.radioalign{
|
||||||
@ -2882,186 +2882,214 @@ function createCheckboxes(obj, additional_relationship = [], unique_id = null, p
|
|||||||
}
|
}
|
||||||
|
|
||||||
$relationshipElement.empty();
|
$relationshipElement.empty();
|
||||||
|
|
||||||
let html = `
|
let html = `
|
||||||
<div class="form-row">
|
|
||||||
<div class="form-col">
|
<div class="form-group col-md-12">
|
||||||
<label>Choose applicable family members</label>`;
|
<label>Choose applicable family members</label>
|
||||||
|
<table style="border-collapse: collapse;">
|
||||||
|
<tbody>`;
|
||||||
|
|
||||||
|
|
||||||
if (obj['self'] > 0) {
|
if (obj['self'] > 0) {
|
||||||
let selfValue = additional_relationship['self'] || '1';
|
let selfValue = additional_relationship['self'] || '1';
|
||||||
console.log('selfValue', selfValue);
|
console.log('selfValue', selfValue);
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
<tr>
|
||||||
|
<td><label>Self:</label></td>
|
||||||
|
<td>
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Self:</label>
|
<div class="form-check">
|
||||||
<div class="form-check col-lg-1">
|
|
||||||
<input class="form-check-input" type="radio" name="self" id="self-yes" value="1" ${selfValue == '1' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="self" id="self-yes" value="1" ${selfValue == '1' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="self-yes">Yes</label>
|
<label class="form-check-label radioalign" for="self-yes">Yes</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="self" id="self-no" value="0" ${selfValue == '0' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="self" id="self-no" value="0" ${selfValue == '0' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="self-no">No</label>
|
<label class="form-check-label radioalign" for="self-no">No</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="self" id="self-any" value="any" ${selfValue == 'any' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="self" id="self-any" value="any" ${selfValue == 'any' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="self-any">Maybe</label>
|
<label class="form-check-label radioalign" for="self-any">Maybe</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="self" id="self-na" value="NA" ${selfValue == 'NA' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="self" id="self-na" value="NA" ${selfValue == 'NA' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="self-any">NA</label>
|
<label class="form-check-label radioalign" for="self-na">NA</label>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj['spouse'] > 0) {
|
if (obj['spouse'] > 0) {
|
||||||
let spouseValue = additional_relationship['spouse'] || 'any';
|
let spouseValue = additional_relationship['spouse'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
<tr>
|
||||||
|
<td><label>Spouse:</label></td>
|
||||||
|
<td>
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Spouse:</label>
|
<div class="form-check">
|
||||||
<div class="form-check col-lg-1">
|
|
||||||
<input class="form-check-input" type="radio" name="spouse" id="spouse-yes" value="1" ${spouseValue == '1' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="spouse" id="spouse-yes" value="1" ${spouseValue == '1' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="spouse-yes">Yes</label>
|
<label class="form-check-label radioalign" for="spouse-yes">Yes</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="spouse" id="spouse-no" value="0" ${spouseValue == '0' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="spouse" id="spouse-no" value="0" ${spouseValue == '0' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="spouse-no">No</label>
|
<label class="form-check-label radioalign" for="spouse-no">No</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="spouse" id="spouse-any" value="any" ${spouseValue == 'any' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="spouse" id="spouse-any" value="any" ${spouseValue == 'any' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="spouse-any">Maybe</label>
|
<label class="form-check-label radioalign" for="spouse-any">Maybe</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="spouse" id="spouse-na" value="NA" ${spouseValue == 'NA' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="spouse" id="spouse-na" value="NA" ${spouseValue == 'NA' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="spouse-any">NA</label>
|
<label class="form-check-label radioalign" for="spouse-na">NA</label>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj['childrens'] > 0) {
|
if (obj['childrens'] > 0) {
|
||||||
|
|
||||||
let childrensValue = additional_relationship['childrens'] || 'any';
|
let childrensValue = additional_relationship['childrens'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
<tr>
|
||||||
|
<td><label>Children:</label></td>
|
||||||
|
<td>
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Children:</label>
|
<div class="form-check">
|
||||||
<div class="form-check col-lg-1">
|
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-all" value="4" ${childrensValue === '4' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-all" value="4" ${childrensValue === '4' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-4">4</label>
|
<label class="form-check-label radioalign" for="children-4">4</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-3" value="3" ${childrensValue === '3' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-3" value="3" ${childrensValue === '3' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-3">3</label>
|
<label class="form-check-label radioalign" for="children-3">3</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-2" value="2" ${childrensValue === '2' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-2" value="2" ${childrensValue === '2' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-2">2</label>
|
<label class="form-check-label radioalign" for="children-2">2</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-1" value="1" ${childrensValue === '1' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-1" value="1" ${childrensValue === '1' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-1">1</label>
|
<label class="form-check-label radioalign" for="children-1">1</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-no" value="0" ${childrensValue === '0' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-no" value="0" ${childrensValue === '0' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-unset">No</label>
|
<label class="form-check-label radioalign" for="children-no">No</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-any" value="any" ${childrensValue === 'any' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-any" value="any" ${childrensValue === 'any' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-any">Any</label>
|
<label class="form-check-label radioalign" for="children-any">Any</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="childrens" id="children-unset" value="NA" ${childrensValue === 'NA' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="childrens" id="children-unset" value="NA" ${childrensValue === 'NA' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="children-unset">NA</label>
|
<label class="form-check-label radioalign" for="children-unset">NA</label>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj['parents'] > 0) {
|
if (obj['parents'] > 0) {
|
||||||
let parentsValue = additional_relationship['parents'] || 'any';
|
let parentsValue = additional_relationship['parents'] || 'any';
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
<tr>
|
||||||
|
<td><label>Parents:</label></td>
|
||||||
|
<td>
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Parents:</label>
|
<div class="form-check">
|
||||||
<div class="form-check col-lg-1">
|
|
||||||
<input class="form-check-input" type="radio" name="parents" id="parents-single" value="1" ${parentsValue === '1' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents" id="parents-single" value="1" ${parentsValue === '1' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-single">1</label>
|
<label class="form-check-label radioalign" for="parents-single">1</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents" id="parents-double" value="2" ${parentsValue === '2' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents" id="parents-double" value="2" ${parentsValue === '2' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-double">2</label>
|
<label class="form-check-label radioalign" for="parents-double">2</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents" id="parents-no" value="0" ${parentsValue === '0' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents" id="parents-no" value="0" ${parentsValue === '0' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-no">No</label>
|
<label class="form-check-label radioalign" for="parents-no">No</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents" id="parents-any" value="any" ${parentsValue === 'any' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents" id="parents-any" value="any" ${parentsValue === 'any' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-any">Any</label>
|
<label class="form-check-label radioalign" for="parents-any">Any</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents" id="parents-unset" value="NA" ${parentsValue === 'NA' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents" id="parents-unset" value="NA" ${parentsValue === 'NA' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-unset">NA</label>
|
<label class="form-check-label radioalign" for="parents-unset">NA</label>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj['parents-in-law'] > 0) {
|
if (obj['parents-in-law'] > 0) {
|
||||||
let parentsInLawValue = additional_relationship['parents-in-law'] || 'any';
|
let parentsInLawValue = additional_relationship['parents-in-law'] || 'any';
|
||||||
html += `
|
html += `
|
||||||
|
<tr>
|
||||||
|
<td><label>Parents In Law:</label></td>
|
||||||
|
<td>
|
||||||
<div class="radio-group">
|
<div class="radio-group">
|
||||||
<label class="col-lg-1">Parents-in-law:</label>
|
<div class="form-check">
|
||||||
<div class="form-check col-lg-1">
|
|
||||||
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-single" value="1" ${parentsInLawValue === '1' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-single" value="1" ${parentsInLawValue === '1' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-in-law-single">1</label>
|
<label class="form-check-label radioalign" for="parents-in-law-single">1</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-double" value="2" ${parentsInLawValue === '2' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-double" value="2" ${parentsInLawValue === '2' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-in-law-double">2</label>
|
<label class="form-check-label radioalign" for="parents-in-law-double">2</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-no" value="0" ${parentsInLawValue === '0' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-no" value="0" ${parentsInLawValue === '0' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-in-law-no">No</label>
|
<label class="form-check-label radioalign" for="parents-in-law-no">No</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-any" value="any" ${parentsInLawValue === 'any' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-any" value="any" ${parentsInLawValue === 'any' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-in-law-any">Any</label>
|
<label class="form-check-label radioalign" for="parents-in-law-any">Any</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check col-lg-1">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-unset" value="NA" ${parentsInLawValue === 'NA' ? 'checked' : ''}>
|
<input class="form-check-input" type="radio" name="parents-in-law" id="parents-in-law-unset" value="NA" ${parentsInLawValue === 'NA' ? 'checked' : ''}>
|
||||||
<label class="form-check-label radioalign" for="parents-in-law-unset">NA</label>
|
<label class="form-check-label radioalign" for="parents-in-law-unset">NA</label>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
|
||||||
|
`;
|
||||||
|
|
||||||
|
console.log(html);
|
||||||
|
|
||||||
$relationshipElement.append(html);
|
$relationshipElement.append(html);
|
||||||
|
|
||||||
if (obj['self'] > 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) {
|
// 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');
|
// $('.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) {
|
// } 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', '-110px');
|
// $('.radio-group .form-check').css('margin-right', '-110px');
|
||||||
} else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] == 0) {
|
// } 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');
|
// $('.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) {
|
// } 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');
|
// $('.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) {
|
// } 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', '-110px');
|
// $('.radio-group .form-check').css('margin-right', '-110px');
|
||||||
} else if (obj['self'] == 0 && obj['spouse'] == 0 && obj['childrens'] > 0 && obj['parents'] == 0 && obj['parents-in-law'] == 0) {
|
// } 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', '-110px');
|
// $('.radio-group .form-check').css('margin-right', '-110px');
|
||||||
} else if (obj['self'] > 0 && obj['spouse'] > 0 && obj['childrens'] == 0 && obj['parents'] > 0 && obj['parents-in-law'] > 0){
|
// } 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');
|
// $('.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){
|
// } 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');
|
// $('.radio-group .form-check').css('margin-right', '-60px');
|
||||||
} else {
|
// } else {
|
||||||
$('.radio-group .form-check').css('margin-right', '-60px');
|
// $('.radio-group .form-check').css('margin-right', '-60px');
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(policy_type == 1 || policy_type == 6 || policy_type == 7){
|
// if(policy_type == 1 || policy_type == 6 || policy_type == 7){
|
||||||
$('.radio-group .form-check').css('margin-right', '-50px');
|
// $('.radio-group .form-check').css('margin-right', '-50px');
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -361,6 +361,9 @@
|
|||||||
<tr id="table_tr_13">
|
<tr id="table_tr_13">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<?php if (in_array(FINANCE_TEAM_ID, user_team())) { ?>
|
||||||
|
|
||||||
<tr id="table_tr_14">
|
<tr id="table_tr_14">
|
||||||
<td>Agreed BP %</td>
|
<td>Agreed BP %</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -418,9 +421,14 @@
|
|||||||
<tr id="table_tr_32">
|
<tr id="table_tr_32">
|
||||||
<td>Reward</td>
|
<td>Reward</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<tr id="table_tr_33" style="display: none;">
|
<tr id="table_tr_33" style="display: none;">
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -451,9 +459,21 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
var team_id = [];
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
team_id = <?php echo json_encode(user_team()); ?>;
|
||||||
|
console.log('team_id', team_id);
|
||||||
|
|
||||||
|
if (team_id.includes('4')) {
|
||||||
|
console.log('Finance Team Logged in.');
|
||||||
|
} else if (team_id.includes('3')) {
|
||||||
|
console.log('Business Team Logged in.');
|
||||||
|
}
|
||||||
|
|
||||||
getURLParamsForReport()
|
getURLParamsForReport()
|
||||||
hidePermiumDetailsBasedOnTheTeam()
|
// hidePermiumDetailsBasedOnTheTeam()
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
@ -1335,7 +1355,7 @@ $('#setInsurerCount').on('input', function() {
|
|||||||
function addInsurerColumn() {
|
function addInsurerColumn() {
|
||||||
insurerCount++;
|
insurerCount++;
|
||||||
|
|
||||||
hidePermiumDetailsBasedOnTheTeam();
|
// hidePermiumDetailsBasedOnTheTeam();
|
||||||
|
|
||||||
// Update header
|
// Update header
|
||||||
$('#insurerTable thead tr').append(`
|
$('#insurerTable thead tr').append(`
|
||||||
@ -1349,6 +1369,7 @@ function addInsurerColumn() {
|
|||||||
$('#insurerTable tbody tr').each(function(index) {
|
$('#insurerTable tbody tr').each(function(index) {
|
||||||
let newCell = '';
|
let newCell = '';
|
||||||
|
|
||||||
|
if(team_id.includes('4')){
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0: // Insurer selection
|
case 0: // Insurer selection
|
||||||
newCell = `<td>
|
newCell = `<td>
|
||||||
@ -1465,7 +1486,70 @@ function addInsurerColumn() {
|
|||||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}else if(team_id.includes('3')){
|
||||||
|
switch(index) {
|
||||||
|
case 0: // Insurer selection
|
||||||
|
newCell = `<td>
|
||||||
|
<select class="form-control follow_insurer readonly-select" 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[]">
|
||||||
|
<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 class="input-with-percentage"><input type="text" class="right-align-input" name="co_share_per[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 3: // Base Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="base_premium_${insurerCount}" name="base_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 4: // TP Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="tp_premium_${insurerCount}" name="tp_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 5: // Ter Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="ter_premium_${insurerCount}" name="ter_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 6: // co Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="co_premium_${insurerCount}" name="co_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 7: // CGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="cgst_${insurerCount}" name="cgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 8: // SGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="sgst_${insurerCount}" name="sgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 9: // IGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="igst_${insurerCount}" name="igst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 10: // GST Amount
|
||||||
|
newCell = `<td><input type="text" class="readonly-color right-align-input" id="gst_amount_${insurerCount}" name="gst_amount[]" oninput="amountCalculation('${insurerCount}')" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 11: // Stamp Duty
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="stamp_duty_${insurerCount}" name="stamp_duty[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 12: // Total
|
||||||
|
newCell = `<td><input type="text" class="readonly-color right-align-input" id="total_amt_${insurerCount}" name="total[]" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 13: // Agreed BP %
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_bp_${insurerCount}" name="agreed_bp[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||||
|
break;
|
||||||
|
case 14: // ID For Update
|
||||||
|
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// console.log(newCell);
|
// console.log(newCell);
|
||||||
|
|
||||||
$(this).append(newCell);
|
$(this).append(newCell);
|
||||||
@ -1578,6 +1662,7 @@ function populateTable(dataArray, status = false) {
|
|||||||
|
|
||||||
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
||||||
|
|
||||||
|
if(team_id.includes('4')){
|
||||||
switch (rowIndex) {
|
switch (rowIndex) {
|
||||||
case 0: // Insurer selection
|
case 0: // Insurer selection
|
||||||
cell.find('select').val(insurer);
|
cell.find('select').val(insurer);
|
||||||
@ -1679,6 +1764,55 @@ function populateTable(dataArray, status = false) {
|
|||||||
cell.find('input[type="hidden"]').val(status ? data.id : '');
|
cell.find('input[type="hidden"]').val(status ? data.id : '');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}else if(team_id.includes('3')){
|
||||||
|
switch (rowIndex) {
|
||||||
|
case 0: // Insurer selection
|
||||||
|
cell.find('select').val(insurer);
|
||||||
|
break;
|
||||||
|
case 1: // Is Leader?
|
||||||
|
cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1');
|
||||||
|
break;
|
||||||
|
case 2: // Co-Share %
|
||||||
|
cell.find('input').val(data.co_share_per);
|
||||||
|
break;
|
||||||
|
case 3: // Base Premium
|
||||||
|
cell.find('input').val(status ? data.bp_amt : '');
|
||||||
|
break;
|
||||||
|
case 4: // TP Premium
|
||||||
|
cell.find('input').val(status ? data.tp_amt : '');
|
||||||
|
break;
|
||||||
|
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 7: // CGST
|
||||||
|
cell.find('input').val(data.bp_cgst);
|
||||||
|
break;
|
||||||
|
case 8: // SGST
|
||||||
|
cell.find('input').val(data.bp_sgst);
|
||||||
|
break;
|
||||||
|
case 9: // IGST
|
||||||
|
cell.find('input').val(data.bp_igst);
|
||||||
|
break;
|
||||||
|
case 10: // GST Amount
|
||||||
|
cell.find('input').val(status ? data.bp_gst_amt : '');
|
||||||
|
break;
|
||||||
|
case 11: // Stamp Duty
|
||||||
|
cell.find('input').val(status ? data.stamp_duty : '');
|
||||||
|
break;
|
||||||
|
case 12: // Total
|
||||||
|
cell.find('input').val(status ? data.amount : '');
|
||||||
|
break;
|
||||||
|
case 13: // Agreed BP %
|
||||||
|
cell.find('input').val(data.agreed_bp_per);
|
||||||
|
break;
|
||||||
|
case 14: // Co-share ID (hidden field)
|
||||||
|
cell.find('input[type="hidden"]').val(status ? data.id : '');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -633,6 +633,9 @@
|
|||||||
<tr id="table_tr_13">
|
<tr id="table_tr_13">
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<?php if (in_array(FINANCE_TEAM_ID, user_team())) { ?>
|
||||||
|
|
||||||
<tr id="table_tr_14">
|
<tr id="table_tr_14">
|
||||||
<td>Agreed BP %</td>
|
<td>Agreed BP %</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -690,6 +693,9 @@
|
|||||||
<tr id="table_tr_32">
|
<tr id="table_tr_32">
|
||||||
<td>Reward</td>
|
<td>Reward</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<tr id="table_tr_33" style="display: none;">
|
<tr id="table_tr_33" style="display: none;">
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -971,9 +977,20 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
var team_id = [];
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
hidePermiumDetailsBasedOnTheTeam()
|
// hidePermiumDetailsBasedOnTheTeam()
|
||||||
|
|
||||||
|
team_id = <?php echo json_encode(user_team()); ?>;
|
||||||
|
console.log('team_id', team_id);
|
||||||
|
|
||||||
|
if (team_id.includes('4')) {
|
||||||
|
console.log('Finance Team Logged in.');
|
||||||
|
} else if (team_id.includes('3')) {
|
||||||
|
console.log('Business Team Logged in.');
|
||||||
|
}
|
||||||
|
|
||||||
$('#listed_insurers').select2({
|
$('#listed_insurers').select2({
|
||||||
placeholder: "Select Insurers", // Placeholder for a better UX
|
placeholder: "Select Insurers", // Placeholder for a better UX
|
||||||
@ -1080,7 +1097,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
$('#policy_type_id').change(function() {
|
$('#policy_type_id').change(function() {
|
||||||
|
|
||||||
hidePermiumDetailsBasedOnTheTeam();
|
// hidePermiumDetailsBasedOnTheTeam();
|
||||||
|
|
||||||
$('#client_type').val('');
|
$('#client_type').val('');
|
||||||
$('#client_id').val('').select2();
|
$('#client_id').val('').select2();
|
||||||
@ -1148,7 +1165,7 @@ $(document).ready(function(){
|
|||||||
$('#client_branch_id').removeClass('readonly-select ').select2();
|
$('#client_branch_id').removeClass('readonly-select ').select2();
|
||||||
}
|
}
|
||||||
|
|
||||||
hidePermiumDetailsBasedOnTheTeam();
|
// hidePermiumDetailsBasedOnTheTeam();
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -1439,7 +1456,7 @@ function getPolicyTransactionDataForEdit(input) {
|
|||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('#cd_ac_no').val(res.data.cd_ac_no);
|
$('#cd_ac_no').val(res.data.cd_ac_no);
|
||||||
$('#client_branch_id').val(res.data.client_branch_id).select2();
|
$('#client_branch_id').val(res.data.client_branch_id).change();
|
||||||
$('#source_client_policy_id').val(res.data.source_client_policy_id).change();
|
$('#source_client_policy_id').val(res.data.source_client_policy_id).change();
|
||||||
$('#base_policy').val(res.data.base_policy).select2();
|
$('#base_policy').val(res.data.base_policy).select2();
|
||||||
//console.log('---------------------------------------------------------------')
|
//console.log('---------------------------------------------------------------')
|
||||||
@ -1720,7 +1737,7 @@ function actualAmountCalculation(input, field = null){
|
|||||||
console.log('actualAmountCalculation function input', input)
|
console.log('actualAmountCalculation function input', input)
|
||||||
console.log('actualAmountCalculation function field', field)
|
console.log('actualAmountCalculation function field', field)
|
||||||
|
|
||||||
let selectedOption = $('#client_policy_id').find('option:selected');
|
let selectedOption = $('#policy_type_id').find('option:selected');
|
||||||
let bap = selectedOption.data('bap');
|
let bap = selectedOption.data('bap');
|
||||||
|
|
||||||
console.log('actualAmountCalculation function bap', bap)
|
console.log('actualAmountCalculation function bap', bap)
|
||||||
@ -2141,11 +2158,16 @@ function getCDAccountNumber(input)
|
|||||||
$('#cd_ac_no').val(res.data[0].cd_ac_no)
|
$('#cd_ac_no').val(res.data[0].cd_ac_no)
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
var pt_id = $('#policy_tranction_primarykey').val();
|
||||||
|
if(pt_id == ''){
|
||||||
toastr.warning('The insurer does not has a CD account number');
|
toastr.warning('The insurer does not has a CD account number');
|
||||||
|
}
|
||||||
|
console.log('The insurer does not has a CD account number');
|
||||||
|
|
||||||
$('#cd_ac_no_'+unique_id).empty();
|
$('#cd_ac_no_'+unique_id).empty();
|
||||||
$('#cd_ac_no_'+unique_id).append($('<option>', {
|
$('#cd_ac_no_'+unique_id).append($('<option>', {
|
||||||
value: '',
|
value: '',
|
||||||
text: 'Select Policy',
|
text: 'Select CD No',
|
||||||
}));
|
}));
|
||||||
$('#cd_ac_no_'+unique_id).append($('<option>', {
|
$('#cd_ac_no_'+unique_id).append($('<option>', {
|
||||||
value: 'add_cd',
|
value: 'add_cd',
|
||||||
@ -2301,6 +2323,31 @@ function hidePermiumDetailsBasedOnTheTeam(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeAllColumnsExceptFirst(tableId) {
|
||||||
|
|
||||||
|
console.log('######################################')
|
||||||
|
console.log('removeAllColumnsExceptFirst function called');
|
||||||
|
console.log('######################################');
|
||||||
|
|
||||||
|
// Remove all headers except the first one
|
||||||
|
$('#' + tableId + ' thead tr th').each(function(index) {
|
||||||
|
if (index > 0) { // Keep the first column (index 0)
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Remove corresponding data cells in each row except the first one
|
||||||
|
$('#' + tableId + ' tbody tr').each(function() {
|
||||||
|
$(this).find('td').each(function(index) {
|
||||||
|
if (index > 0) { // Keep the first column (index 0)
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
insurerCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------
|
||||||
function convertToMySQLDate(dateString) {
|
function convertToMySQLDate(dateString) {
|
||||||
|
|
||||||
@ -2316,7 +2363,6 @@ function convertToMySQLDate(dateString) {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function convertMonthYearToMySQLDate(dateString) {
|
function convertMonthYearToMySQLDate(dateString) {
|
||||||
// console.log('convertMonthYearToMySQLDate' + dateString);
|
// console.log('convertMonthYearToMySQLDate' + dateString);
|
||||||
if(dateString !== "" && dateString !== undefined)
|
if(dateString !== "" && dateString !== undefined)
|
||||||
@ -2839,12 +2885,16 @@ $('#Owner_type').on('change', function() {
|
|||||||
|
|
||||||
$('#policy_status').change(function(){
|
$('#policy_status').change(function(){
|
||||||
|
|
||||||
|
var pt_id = $('#policy_tranction_primarykey').val();
|
||||||
var status = $(this).val()
|
var status = $(this).val()
|
||||||
var policy_type_id = $('#policy_type_id').val()
|
var policy_type_id = $('#policy_type_id').val()
|
||||||
var client_id = $('#client_id').val();
|
var client_id = $('#client_id').val();
|
||||||
var client_branch_id = $('#client_branch_id').val();
|
var client_branch_id = $('#client_branch_id').val();
|
||||||
|
|
||||||
if(status == 'completed'){
|
if(status == 'completed'){
|
||||||
|
if(pt_id == ''){
|
||||||
|
removeAllColumnsExceptFirst('insurerTable');
|
||||||
|
}
|
||||||
addInsurerColumn() ;
|
addInsurerColumn() ;
|
||||||
$('#sales_row').show();
|
$('#sales_row').show();
|
||||||
$('#policy_no').prop('required', true);
|
$('#policy_no').prop('required', true);
|
||||||
@ -2963,7 +3013,7 @@ $('#setInsurerCount').on('input', function() {
|
|||||||
function addInsurerColumn() {
|
function addInsurerColumn() {
|
||||||
insurerCount++;
|
insurerCount++;
|
||||||
|
|
||||||
hidePermiumDetailsBasedOnTheTeam()
|
// hidePermiumDetailsBasedOnTheTeam()
|
||||||
|
|
||||||
// Update header
|
// Update header
|
||||||
$('#insurerTable thead tr').append(`
|
$('#insurerTable thead tr').append(`
|
||||||
@ -2977,6 +3027,9 @@ function addInsurerColumn() {
|
|||||||
$('#insurerTable tbody tr').each(function(index) {
|
$('#insurerTable tbody tr').each(function(index) {
|
||||||
let newCell = '';
|
let newCell = '';
|
||||||
|
|
||||||
|
|
||||||
|
if(team_id.includes('4')){
|
||||||
|
|
||||||
switch(index) {
|
switch(index) {
|
||||||
case 0: // Insurer selection
|
case 0: // Insurer selection
|
||||||
newCell = `<td>
|
newCell = `<td>
|
||||||
@ -3103,6 +3156,78 @@ function addInsurerColumn() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else if(team_id.includes('3')){
|
||||||
|
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[]" onchange="getCDAccountNumber(this)">
|
||||||
|
<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[]">
|
||||||
|
<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: // CD Account Number selectionclass="std_tp_td"
|
||||||
|
newCell = `<td>
|
||||||
|
<select class="form-control follow_insurer_cd" data-count="${insurerCount}" id="cd_ac_no_${insurerCount}" name="cd_ac_no_for_child[]" onchange="addCDAccountNumber(this); restrictCDACNO(this)">
|
||||||
|
<option value="" selected>Select CD No</option>
|
||||||
|
<option value="add_cd"> + Add CD No</option>
|
||||||
|
</select>
|
||||||
|
</td>`;
|
||||||
|
break;
|
||||||
|
case 3: // Co-Share %
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" name="co_share_per[]" oninput="validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 4: // Base Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="base_premium_${insurerCount}" name="base_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 5: // TP Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="tp_premium_${insurerCount}" name="tp_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 6: // Ter Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="ter_premium_${insurerCount}" name="ter_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 7: // co Premium
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="co_premium_${insurerCount}" name="co_premium[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 8: // CGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="cgst_${insurerCount}" name="cgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 9: // SGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="sgst_${insurerCount}" name="sgst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 10: // IGST
|
||||||
|
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="igst_${insurerCount}" name="igst[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 11: // GST Amount
|
||||||
|
newCell = `<td><input type="text" class="readonly-color right-align-input" id="gst_amount_${insurerCount}" name="gst_amount[]" oninput="amountCalculation('${insurerCount}')" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 12: // Stamp Duty
|
||||||
|
newCell = `<td><input type="text" class="right-align-input" id="stamp_duty_${insurerCount}" name="stamp_duty[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 13: // Total
|
||||||
|
newCell = `<td><input type="text" class="readonly-color right-align-input" id="total_amt_${insurerCount}" name="total[]" readonly onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
case 14: // ID For Update
|
||||||
|
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$(this).append(newCell);
|
$(this).append(newCell);
|
||||||
|
|
||||||
$('#follow_insurer_id_' + insurerCount).select2()
|
$('#follow_insurer_id_' + insurerCount).select2()
|
||||||
@ -3169,6 +3294,8 @@ function removeInsurerColumn(index) {
|
|||||||
|
|
||||||
function populateTable(dataArray) {
|
function populateTable(dataArray) {
|
||||||
|
|
||||||
|
console.log('populateTable data', dataArray)
|
||||||
|
|
||||||
dataArray.forEach((data, index) => {
|
dataArray.forEach((data, index) => {
|
||||||
// Add a new insurer column for each entry in the data array
|
// Add a new insurer column for each entry in the data array
|
||||||
addInsurerColumn(); // This will add a new column dynamically
|
addInsurerColumn(); // This will add a new column dynamically
|
||||||
@ -3179,6 +3306,7 @@ function populateTable(dataArray) {
|
|||||||
|
|
||||||
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
||||||
|
|
||||||
|
if(team_id.includes('4')){
|
||||||
switch (rowIndex) {
|
switch (rowIndex) {
|
||||||
case 0: // Insurer selection
|
case 0: // Insurer selection
|
||||||
cell.find('select').val(insurer).change();
|
cell.find('select').val(insurer).change();
|
||||||
@ -3283,6 +3411,55 @@ function populateTable(dataArray) {
|
|||||||
cell.find('input[type="hidden"]').val(data.id);
|
cell.find('input[type="hidden"]').val(data.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}else if(team_id.includes('3')){
|
||||||
|
switch (rowIndex) {
|
||||||
|
case 0: // Insurer selection
|
||||||
|
cell.find('select').val(insurer).change();
|
||||||
|
break;
|
||||||
|
case 1: // Is Leader?
|
||||||
|
cell.find('input[type="checkbox"]').prop('checked', data.co_share_type === '1');
|
||||||
|
break;
|
||||||
|
case 2: // CD Account Number selection
|
||||||
|
cell.find('select').val(data.cd_ac_no);
|
||||||
|
break;
|
||||||
|
case 3: // Co-Share %
|
||||||
|
cell.find('input').val(data.co_share_per);
|
||||||
|
break;
|
||||||
|
case 4: // Base Premium
|
||||||
|
cell.find('input').val(data.bp_amt);
|
||||||
|
break;
|
||||||
|
case 5: // TP Premium
|
||||||
|
cell.find('input').val(data.tp_amt);
|
||||||
|
break;
|
||||||
|
case 6: // Ter Premium
|
||||||
|
cell.find('input').val(data.tep_amt);
|
||||||
|
break;
|
||||||
|
case 7: // Co Premium
|
||||||
|
cell.find('input').val(data.cop_amt);
|
||||||
|
break;
|
||||||
|
case 8: // CGST
|
||||||
|
cell.find('input').val(data.bp_cgst);
|
||||||
|
break;
|
||||||
|
case 9: // SGST
|
||||||
|
cell.find('input').val(data.bp_sgst);
|
||||||
|
break;
|
||||||
|
case 10: // IGST
|
||||||
|
cell.find('input').val(data.bp_igst);
|
||||||
|
break;
|
||||||
|
case 11: // GST Amount
|
||||||
|
cell.find('input').val(data.bp_gst_amt);
|
||||||
|
break;
|
||||||
|
case 12: // Stamp Duty
|
||||||
|
cell.find('input').val(data.stamp_duty);
|
||||||
|
break;
|
||||||
|
case 13: // Total
|
||||||
|
cell.find('input').val(data.amount);
|
||||||
|
break;
|
||||||
|
case 14: // Co-share ID (hidden field)
|
||||||
|
cell.find('input[type="hidden"]').val(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user