FIX_BDS_HIDE_AND_SHOW_ISSUE_AND_SENMAIL_NOTIFICATION_FUNCTION_TEST_FUNCTION_AND_OTHRS : RV
This commit is contained in:
parent
34402b8568
commit
46278b9f94
@ -12,7 +12,8 @@ $routes->get('/swagger', 'SwaggerController::index', ['filter' => 'authMVC']);
|
||||
// Reminder Mail Notification
|
||||
|
||||
$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_rack_rate_json", "ClientController::updateRackRateJson");
|
||||
$routes->get("updatajson", "EmpDataServiceController::updatajson");
|
||||
|
||||
@ -115,72 +115,121 @@ class ClientController extends AdminController
|
||||
$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 = 205;
|
||||
$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']);
|
||||
if (count($find) > 0) {
|
||||
$array_list[] = $find;
|
||||
}
|
||||
$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();
|
||||
|
||||
// dd($array_list);
|
||||
$client_policy_ids2 = array_column($client_policy_ids, 'client_policy_id');
|
||||
|
||||
$notification = $this->notificationModel->where('client_id', $client_id)->where('template_name', 'member_review_and_summary_mail')->first();
|
||||
$client_policy_id = array_unique($client_policy_ids2);
|
||||
|
||||
// dd($notification);
|
||||
// echo '<pre>';
|
||||
// dd($client_policy_id);
|
||||
// print_r($unique_policy_ids); die;
|
||||
// sort($client_policy_id);
|
||||
|
||||
if (isset($notification) && $notification['enabled'] == 1) {
|
||||
$wholeData = '';
|
||||
$mail_send_return = '';
|
||||
$mail_send_return1 = '';
|
||||
$mail_send_return2 = '';
|
||||
|
||||
$params['array_list'] = $array_list;
|
||||
$params['client_policy_id'] = $client_policy_id;
|
||||
$params['emp_code'] = $emp_code;
|
||||
$params['client_id'] = $client_id;
|
||||
$params['notification'] = $notification;
|
||||
|
||||
// print_r($params);die;
|
||||
|
||||
$wholeData = sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
|
||||
|
||||
// print_r($wholeData); die;
|
||||
|
||||
$mail_send_return = MailHelper::send_email($wholeData[0]);
|
||||
$this->myLogger->logme("info", $mail_send_return);
|
||||
|
||||
if (isset($wholeData[0])) {
|
||||
|
||||
$account_manager_wholeData = sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
|
||||
|
||||
// print_r($account_manager_wholeData); die;
|
||||
|
||||
if ($account_manager_wholeData) {
|
||||
|
||||
foreach ($account_manager_wholeData as $key => $value) {
|
||||
$mail_send_return1 = MailHelper::send_email($value);
|
||||
$this->myLogger->logme("info", $mail_send_return1);
|
||||
$this->myLogger->logme("info", $mail_send_return1);
|
||||
}
|
||||
}
|
||||
|
||||
$client_hr_wholeData = sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
|
||||
|
||||
// print_r($client_hr_wholeData); die;
|
||||
|
||||
if ($client_hr_wholeData) {
|
||||
|
||||
foreach ($client_hr_wholeData as $key => $value) {
|
||||
$mail_send_return2 = MailHelper::send_email($value);
|
||||
$this->myLogger->logme("info", $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){
|
||||
$array_list[] = $find;
|
||||
}
|
||||
}
|
||||
|
||||
// dd($array_list);
|
||||
|
||||
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
|
||||
|
||||
|
||||
if (isset($notification) && $notification['enabled'] == 1) {
|
||||
|
||||
$params ['array_list'] = $array_list;
|
||||
$params ['client_policy_id'] = $client_policy_id;
|
||||
$params ['emp_code'] = $emp_code;
|
||||
$params ['client_id'] = $client_id;
|
||||
$params ['notification'] = $notification;
|
||||
|
||||
// dd($params);
|
||||
|
||||
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
|
||||
// print_r($wholeData); die;
|
||||
|
||||
if($mail_active > 0){
|
||||
$mail_send_return = MailHelper::send_email($wholeData[0]);
|
||||
$this->myLogger->logme("info", $mail_send_return);
|
||||
}
|
||||
|
||||
if (isset($wholeData[0])) {
|
||||
|
||||
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
|
||||
// print_r($account_manager_wholeData); die;
|
||||
|
||||
if($account_manager_wholeData != null && $account_manager_wholeData != '' && count($account_manager_wholeData))
|
||||
{
|
||||
if($mail_active > 0){
|
||||
|
||||
foreach ($account_manager_wholeData as $key => $value) {
|
||||
$mail_send_return1 = MailHelper::send_email($value);
|
||||
$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);
|
||||
// print_r($client_hr_wholeData); die;
|
||||
|
||||
if($client_hr_wholeData != null && $client_hr_wholeData != '' &&count($client_hr_wholeData))
|
||||
{
|
||||
if($mail_active > 0){
|
||||
|
||||
foreach ($client_hr_wholeData as $key => $value) {
|
||||
$mail_send_return2 = MailHelper::send_email($value);
|
||||
$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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
// return $this->respond(['status' => 'success','code' => 200,'data' => [] ], 200);
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
||||
@ -180,14 +180,6 @@ class sendMailNotification
|
||||
$client_data =$clientModel->where('id', $client_id)->first();
|
||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||
|
||||
$client_policy_data = $clientPolicyModel->where('id', $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', $client_policy_id)->first();
|
||||
}else{
|
||||
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $client_policy_id)->first();
|
||||
}
|
||||
|
||||
// dd($notification_data);
|
||||
|
||||
if (isset($notification_data) && $notification_data['enabled'] == 1) {
|
||||
@ -230,10 +222,20 @@ class sendMailNotification
|
||||
|
||||
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'];
|
||||
|
||||
if ($inner_item['relationship'] == 'Self') {
|
||||
$emp_code = ' (' . $inner_item['emp_code'] . ')';
|
||||
$mail = $inner_item['email_corporate'];
|
||||
} else {
|
||||
$emp_code = '';
|
||||
}
|
||||
@ -385,14 +387,6 @@ class sendMailNotification
|
||||
$client_data =$clientModel->where('id', $client_id)->first();
|
||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||
|
||||
$client_policy_data = $clientPolicyModel->where('id', $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', $client_policy_id)->first();
|
||||
}else{
|
||||
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $client_policy_id)->first();
|
||||
}
|
||||
|
||||
if (isset($notification_data) && $notification_data['enabled'] == 1) {
|
||||
|
||||
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
||||
@ -436,6 +430,15 @@ class sendMailNotification
|
||||
|
||||
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'];
|
||||
|
||||
if ($inner_item['relationship'] == 'Self') {
|
||||
@ -588,17 +591,8 @@ class sendMailNotification
|
||||
$notification_data = $notificationModel->where('client_id' ,$client_id)->where('template_name', $action)->first();
|
||||
$clientRMModel =new ClientRMModel();
|
||||
|
||||
|
||||
$client_policy_data = $clientPolicyModel->where('id', $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', $client_policy_id)->first();
|
||||
}else{
|
||||
$policy_premium_data = $PolicyPremium2Model->where('client_policy_id', $client_policy_id)->first();
|
||||
}
|
||||
|
||||
|
||||
if (isset($notification_data['enabled']) && $notification_data['enabled'] == 1) {
|
||||
|
||||
$client_rm_data= $clientRMModel->where('client_id', $client_id)->where('is_active',1)->findAll();
|
||||
$user_list= [];
|
||||
foreach ($client_rm_data as $key => $value) {
|
||||
@ -641,6 +635,16 @@ class sendMailNotification
|
||||
$is_addon = '';
|
||||
|
||||
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'];
|
||||
|
||||
if ($inner_item['relationship'] == 'Self') {
|
||||
@ -779,7 +783,7 @@ class sendMailNotification
|
||||
}
|
||||
|
||||
return $wholeData;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -361,66 +361,74 @@
|
||||
<tr id="table_tr_13">
|
||||
<td>Total</td>
|
||||
</tr>
|
||||
<tr id="table_tr_14">
|
||||
<td>Agreed BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_15">
|
||||
<td id="agree_tp_td">Agreed TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_16" style="display: none;">
|
||||
<td id="agree_tp_td">Agreed TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_17">
|
||||
<td>Agreed Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_18">
|
||||
<td>Standard BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_19">
|
||||
<td>Standard TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_20" style="display: none;">
|
||||
<td>Standard TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_21">
|
||||
<td>Actual BP Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_22">
|
||||
<td>Actual TP Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_23" style="display: none;">
|
||||
<td>Actual TEP Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_24">
|
||||
<td>Actual BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_25">
|
||||
<td>Actual TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_26" style="display: none;">
|
||||
<td>Actual TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_27">
|
||||
<td>Actual BP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_28">
|
||||
<td>Actual TP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_29" style="display: none;">
|
||||
<td>Actual TEP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_30">
|
||||
<td>Expected Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_31">
|
||||
<td>Variance</td>
|
||||
</tr>
|
||||
<tr id="table_tr_32">
|
||||
<td>Reward</td>
|
||||
</tr>
|
||||
|
||||
<?php if (in_array(FINANCE_TEAM_ID, user_team())) { ?>
|
||||
|
||||
<tr id="table_tr_14">
|
||||
<td>Agreed BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_15">
|
||||
<td id="agree_tp_td">Agreed TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_16" style="display: none;">
|
||||
<td id="agree_tp_td">Agreed TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_17">
|
||||
<td>Agreed Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_18">
|
||||
<td>Standard BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_19">
|
||||
<td>Standard TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_20" style="display: none;">
|
||||
<td>Standard TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_21">
|
||||
<td>Actual BP Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_22">
|
||||
<td>Actual TP Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_23" style="display: none;">
|
||||
<td>Actual TEP Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_24">
|
||||
<td>Actual BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_25">
|
||||
<td>Actual TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_26" style="display: none;">
|
||||
<td>Actual TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_27">
|
||||
<td>Actual BP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_28">
|
||||
<td>Actual TP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_29" style="display: none;">
|
||||
<td>Actual TEP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_30">
|
||||
<td>Expected Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_31">
|
||||
<td>Variance</td>
|
||||
</tr>
|
||||
<tr id="table_tr_32">
|
||||
<td>Reward</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<tr id="table_tr_33" style="display: none;">
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -451,9 +459,21 @@
|
||||
|
||||
<script>
|
||||
|
||||
var team_id = [];
|
||||
|
||||
$(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()
|
||||
hidePermiumDetailsBasedOnTheTeam()
|
||||
// hidePermiumDetailsBasedOnTheTeam()
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
@ -1335,7 +1355,7 @@ $('#setInsurerCount').on('input', function() {
|
||||
function addInsurerColumn() {
|
||||
insurerCount++;
|
||||
|
||||
hidePermiumDetailsBasedOnTheTeam();
|
||||
// hidePermiumDetailsBasedOnTheTeam();
|
||||
|
||||
// Update header
|
||||
$('#insurerTable thead tr').append(`
|
||||
@ -1349,123 +1369,187 @@ function addInsurerColumn() {
|
||||
$('#insurerTable tbody tr').each(function(index) {
|
||||
let newCell = '';
|
||||
|
||||
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: // Agreed TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 15: // Agreed Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tep_${insurerCount}" name="agreed_ter[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="agreed_amount_${insurerCount}" name="agreed_amount[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 17: // Standard BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 18: // Standard TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly ></td>`;
|
||||
break;
|
||||
case 19: // Standard Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 22: // Actual TEP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 25: // Actual TEP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tep_per_${insurerCount}" name="actual_tep_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_broker_amt' )" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 28: // Actual TEP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="exp_amt_${insurerCount}" name="exp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 30: // Variance
|
||||
newCell = `<td><input type="text" class="readonly-color right-align-input" id="variance_${insurerCount}" name="variance[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 31: // Reward
|
||||
newCell = `<td><input type="text" class="right-align-input" id="reward_${insurerCount}" name="reward[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 32: // ID For Update
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
if(team_id.includes('4')){
|
||||
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: // Agreed TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 15: // Agreed Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tep_${insurerCount}" name="agreed_ter[]" oninput="amountCalculation('${insurerCount}'); validateRange(this)" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="agreed_amount_${insurerCount}" name="agreed_amount[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 17: // Standard BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 18: // Standard TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly ></td>`;
|
||||
break;
|
||||
case 19: // Standard Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 22: // Actual TEP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 25: // Actual TEP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tep_per_${insurerCount}" name="actual_tep_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_broker_amt' )" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 28: // Actual TEP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="exp_amt_${insurerCount}" name="exp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 30: // Variance
|
||||
newCell = `<td><input type="text" class="readonly-color right-align-input" id="variance_${insurerCount}" name="variance[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 31: // Reward
|
||||
newCell = `<td><input type="text" class="right-align-input" id="reward_${insurerCount}" name="reward[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 32: // ID For Update
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
}
|
||||
}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);
|
||||
|
||||
$(this).append(newCell);
|
||||
@ -1578,106 +1662,156 @@ function populateTable(dataArray, status = false) {
|
||||
|
||||
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
||||
|
||||
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: // Agreed TP %
|
||||
cell.find('input').val(data.agreed_tp_per);
|
||||
break;
|
||||
case 15: // Agreed Ter %
|
||||
cell.find('input').val(data.agreed_tep_per);
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
cell.find('input').val(data.agreed_amt);
|
||||
break;
|
||||
case 17: // Standard BP %
|
||||
cell.find('input').val(data.standerd_bp_per);
|
||||
break;
|
||||
case 18: // Standard TP %
|
||||
cell.find('input').val(data.standerd_tp_per);
|
||||
break;
|
||||
case 19: // Standard Ter %
|
||||
cell.find('input').val(data.standerd_tep_per);
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
cell.find('input').val(status ? data.actual_bp_amt : '');
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
cell.find('input').val(status ? data.actual_tp_amt : '');
|
||||
break;
|
||||
case 22: // Actual Ter Amount
|
||||
cell.find('input').val(status ? data.actual_tep_amt : '');
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
cell.find('input').val(status ? data.actual_bp_per : '');
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
cell.find('input').val(status ? data.actual_tp_per : '');
|
||||
break;
|
||||
case 25: // Actual Ter %
|
||||
cell.find('input').val(status ? data.actual_tep_per : '');
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_bp_brokerage_amt : '');
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_tp_brokerage_amt : '');
|
||||
break;
|
||||
case 28: // Actual Ter Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_tep_brokerage_amt : '');
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
cell.find('input').val(status ? data.exp_amt : '');
|
||||
break;
|
||||
case 30: // Variance
|
||||
cell.find('input').val(status ? data.variance : '');
|
||||
break;
|
||||
case 31: // Reward
|
||||
cell.find('input').val(status ? data.reward : '');
|
||||
break;
|
||||
case 32: // Co-share ID (hidden field)
|
||||
cell.find('input[type="hidden"]').val(status ? data.id : '');
|
||||
break;
|
||||
if(team_id.includes('4')){
|
||||
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: // Agreed TP %
|
||||
cell.find('input').val(data.agreed_tp_per);
|
||||
break;
|
||||
case 15: // Agreed Ter %
|
||||
cell.find('input').val(data.agreed_tep_per);
|
||||
break;
|
||||
case 16: // Agreed Amount
|
||||
cell.find('input').val(data.agreed_amt);
|
||||
break;
|
||||
case 17: // Standard BP %
|
||||
cell.find('input').val(data.standerd_bp_per);
|
||||
break;
|
||||
case 18: // Standard TP %
|
||||
cell.find('input').val(data.standerd_tp_per);
|
||||
break;
|
||||
case 19: // Standard Ter %
|
||||
cell.find('input').val(data.standerd_tep_per);
|
||||
break;
|
||||
case 20: // Actual BP Amount
|
||||
cell.find('input').val(status ? data.actual_bp_amt : '');
|
||||
break;
|
||||
case 21: // Actual TP Amount
|
||||
cell.find('input').val(status ? data.actual_tp_amt : '');
|
||||
break;
|
||||
case 22: // Actual Ter Amount
|
||||
cell.find('input').val(status ? data.actual_tep_amt : '');
|
||||
break;
|
||||
case 23: // Actual BP %
|
||||
cell.find('input').val(status ? data.actual_bp_per : '');
|
||||
break;
|
||||
case 24: // Actual TP %
|
||||
cell.find('input').val(status ? data.actual_tp_per : '');
|
||||
break;
|
||||
case 25: // Actual Ter %
|
||||
cell.find('input').val(status ? data.actual_tep_per : '');
|
||||
break;
|
||||
case 26: // Actual BP Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_bp_brokerage_amt : '');
|
||||
break;
|
||||
case 27: // Actual TP Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_tp_brokerage_amt : '');
|
||||
break;
|
||||
case 28: // Actual Ter Brokerage Amount
|
||||
cell.find('input').val(status ? data.actual_tep_brokerage_amt : '');
|
||||
break;
|
||||
case 29: // Expected Amount
|
||||
cell.find('input').val(status ? data.exp_amt : '');
|
||||
break;
|
||||
case 30: // Variance
|
||||
cell.find('input').val(status ? data.variance : '');
|
||||
break;
|
||||
case 31: // Reward
|
||||
cell.find('input').val(status ? data.reward : '');
|
||||
break;
|
||||
case 32: // Co-share ID (hidden field)
|
||||
cell.find('input[type="hidden"]').val(status ? data.id : '');
|
||||
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,63 +633,69 @@
|
||||
<tr id="table_tr_13">
|
||||
<td>Total</td>
|
||||
</tr>
|
||||
<tr id="table_tr_14">
|
||||
<td>Agreed BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_15">
|
||||
<td id="agree_tp_td">Agreed TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_16" style="display: none;">
|
||||
<td id="agree_tp_td">Agreed TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_17">
|
||||
<td>Agreed Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_18">
|
||||
<td>Standard BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_19">
|
||||
<td>Standard TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_20" style="display: none;">
|
||||
<td>Standard TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_21">
|
||||
<td>Actual BP Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_22">
|
||||
<td>Actual TP Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_23" style="display: none;">
|
||||
<td>Actual TEP Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_24">
|
||||
<td>Actual BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_25">
|
||||
<td>Actual TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_26" style="display: none;">
|
||||
<td>Actual TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_27">
|
||||
<td>Actual BP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_28">
|
||||
<td>Actual TP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_29" style="display: none;">
|
||||
<td>Actual TEP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_30">
|
||||
<td>Expected Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_31">
|
||||
<td>Variance</td>
|
||||
</tr>
|
||||
<tr id="table_tr_32">
|
||||
<td>Reward</td>
|
||||
</tr>
|
||||
|
||||
<?php if (in_array(FINANCE_TEAM_ID, user_team())) { ?>
|
||||
|
||||
<tr id="table_tr_14">
|
||||
<td>Agreed BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_15">
|
||||
<td id="agree_tp_td">Agreed TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_16" style="display: none;">
|
||||
<td id="agree_tp_td">Agreed TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_17">
|
||||
<td>Agreed Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_18">
|
||||
<td>Standard BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_19">
|
||||
<td>Standard TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_20" style="display: none;">
|
||||
<td>Standard TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_21">
|
||||
<td>Actual BP Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_22">
|
||||
<td>Actual TP Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_23" style="display: none;">
|
||||
<td>Actual TEP Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_24">
|
||||
<td>Actual BP %</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_25">
|
||||
<td>Actual TP %</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_26" style="display: none;">
|
||||
<td>Actual TEP %</td>
|
||||
</tr>
|
||||
<tr id="table_tr_27">
|
||||
<td>Actual BP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hidetp" id="table_tr_28">
|
||||
<td>Actual TP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr class="hideter" id="table_tr_29" style="display: none;">
|
||||
<td>Actual TEP <br> Remuneration Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_30">
|
||||
<td>Expected Amount</td>
|
||||
</tr>
|
||||
<tr id="table_tr_31">
|
||||
<td>Variance</td>
|
||||
</tr>
|
||||
<tr id="table_tr_32">
|
||||
<td>Reward</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<tr id="table_tr_33" style="display: none;">
|
||||
<td></td>
|
||||
</tr>
|
||||
@ -971,9 +977,20 @@
|
||||
|
||||
<script>
|
||||
|
||||
var team_id = [];
|
||||
|
||||
$(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({
|
||||
placeholder: "Select Insurers", // Placeholder for a better UX
|
||||
@ -1080,7 +1097,7 @@ $(document).ready(function(){
|
||||
|
||||
$('#policy_type_id').change(function() {
|
||||
|
||||
hidePermiumDetailsBasedOnTheTeam();
|
||||
// hidePermiumDetailsBasedOnTheTeam();
|
||||
|
||||
$('#client_type').val('');
|
||||
$('#client_id').val('').select2();
|
||||
@ -1148,7 +1165,7 @@ $(document).ready(function(){
|
||||
$('#client_branch_id').removeClass('readonly-select ').select2();
|
||||
}
|
||||
|
||||
hidePermiumDetailsBasedOnTheTeam();
|
||||
// hidePermiumDetailsBasedOnTheTeam();
|
||||
});
|
||||
|
||||
})
|
||||
@ -1439,7 +1456,7 @@ function getPolicyTransactionDataForEdit(input) {
|
||||
|
||||
setTimeout(function() {
|
||||
$('#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();
|
||||
$('#base_policy').val(res.data.base_policy).select2();
|
||||
//console.log('---------------------------------------------------------------')
|
||||
@ -1720,7 +1737,7 @@ function actualAmountCalculation(input, field = null){
|
||||
console.log('actualAmountCalculation function input', input)
|
||||
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');
|
||||
|
||||
console.log('actualAmountCalculation function bap', bap)
|
||||
@ -2141,11 +2158,16 @@ function getCDAccountNumber(input)
|
||||
$('#cd_ac_no').val(res.data[0].cd_ac_no)
|
||||
}
|
||||
}else{
|
||||
toastr.warning('The insurer does not has a CD account number');
|
||||
var pt_id = $('#policy_tranction_primarykey').val();
|
||||
if(pt_id == ''){
|
||||
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).append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select Policy',
|
||||
text: 'Select CD No',
|
||||
}));
|
||||
$('#cd_ac_no_'+unique_id).append($('<option>', {
|
||||
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) {
|
||||
|
||||
@ -2316,7 +2363,6 @@ function convertToMySQLDate(dateString) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
function convertMonthYearToMySQLDate(dateString) {
|
||||
// console.log('convertMonthYearToMySQLDate' + dateString);
|
||||
if(dateString !== "" && dateString !== undefined)
|
||||
@ -2839,12 +2885,16 @@ $('#Owner_type').on('change', function() {
|
||||
|
||||
$('#policy_status').change(function(){
|
||||
|
||||
var pt_id = $('#policy_tranction_primarykey').val();
|
||||
var status = $(this).val()
|
||||
var policy_type_id = $('#policy_type_id').val()
|
||||
var client_id = $('#client_id').val();
|
||||
var client_branch_id = $('#client_branch_id').val();
|
||||
|
||||
if(status == 'completed'){
|
||||
if(pt_id == ''){
|
||||
removeAllColumnsExceptFirst('insurerTable');
|
||||
}
|
||||
addInsurerColumn() ;
|
||||
$('#sales_row').show();
|
||||
$('#policy_no').prop('required', true);
|
||||
@ -2963,7 +3013,7 @@ $('#setInsurerCount').on('input', function() {
|
||||
function addInsurerColumn() {
|
||||
insurerCount++;
|
||||
|
||||
hidePermiumDetailsBasedOnTheTeam()
|
||||
// hidePermiumDetailsBasedOnTheTeam()
|
||||
|
||||
// Update header
|
||||
$('#insurerTable thead tr').append(`
|
||||
@ -2976,133 +3026,208 @@ function addInsurerColumn() {
|
||||
// Add a new column for each data row
|
||||
$('#insurerTable tbody tr').each(function(index) {
|
||||
let newCell = '';
|
||||
|
||||
|
||||
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: // Agreed BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_bp_${insurerCount}" name="agreed_bp[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 15: // Agreed TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 16: // Agreed Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_ter_${insurerCount}" name="agreed_ter[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 17: // Agreed Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="agreed_amount_${insurerCount}" name="agreed_amount[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 18: // Standard BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 19: // Standard TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_tp_${insurerCount}" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly ></td>`;
|
||||
break;
|
||||
case 20: // Standard Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_tep_${insurerCount}" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 21: // Actual BP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 22: // Actual TP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 23: // Actual TEP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 24: // Actual BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 25: // Actual TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 26: // Actual TEP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tep_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 27: // Actual BP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 28: // Actual TP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 29: // Actual TEP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 30: // Expected Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="exp_amt_${insurerCount}" name="exp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 31: // Variance
|
||||
newCell = `<td><input type="text" class="readonly-color right-align-input" id="variance_${insurerCount}" name="variance[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 32: // Reward
|
||||
newCell = `<td><input type="text" class="right-align-input" id="reward_${insurerCount}" name="reward[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 33: // ID For Update
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
if(team_id.includes('4')){
|
||||
|
||||
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: // Agreed BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_bp_${insurerCount}" name="agreed_bp[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 15: // Agreed TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_tp_${insurerCount}" name="agreed_tp[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 16: // Agreed Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="agreed_ter_${insurerCount}" name="agreed_ter[]" oninput="validateRange(this); amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" ></td>`;
|
||||
break;
|
||||
case 17: // Agreed Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="agreed_amount_${insurerCount}" name="agreed_amount[]" oninput="amountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 18: // Standard BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_bp_${insurerCount}" name="standard_bp[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 19: // Standard TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_tp_${insurerCount}" name="standard_tp[]" onkeypress="return onlyNumbers(event)" readonly ></td>`;
|
||||
break;
|
||||
case 20: // Standard Ter %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="readonly-color right-align-input" id="standard_tep_${insurerCount}" name="standard_ter[]" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 21: // Actual BP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_amt_${insurerCount}" name="actual_bp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 22: // Actual TP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_amt_${insurerCount}" name="actual_tp_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 23: // Actual TEP Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_amt_${insurerCount}" name="actual_tep_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_amt_for_calc')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 24: // Actual BP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_bp_per_${insurerCount}" name="actual_bp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 25: // Actual TP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tp_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 26: // Actual TEP %
|
||||
newCell = `<td class="input-with-percentage"><input type="text" class="right-align-input" id="actual_tep_per_${insurerCount}" name="actual_tp_per[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_per')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 27: // Actual BP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_bp_brokerage_amt_${insurerCount}" name="actual_bp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'bp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 28: // Actual TP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tp_brokerage_amt_${insurerCount}" name="actual_tp_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tp_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 29: // Actual TEP Brokerage Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="actual_tep_brokerage_amt_${insurerCount}" name="actual_tep_brokerage_amt[]" onchange="actualAmountCalculation('${insurerCount}', 'tep_broker_amt')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 30: // Expected Amount
|
||||
newCell = `<td><input type="text" class="right-align-input" id="exp_amt_${insurerCount}" name="exp_amt[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 31: // Variance
|
||||
newCell = `<td><input type="text" class="readonly-color right-align-input" id="variance_${insurerCount}" name="variance[]" onchange="actualAmountCalculation('${insurerCount}')" onkeypress="return onlyNumbers(event)" readonly></td>`;
|
||||
break;
|
||||
case 32: // Reward
|
||||
newCell = `<td><input type="text" class="right-align-input" id="reward_${insurerCount}" name="reward[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
case 33: // ID For Update
|
||||
newCell = `<td><input type="hidden" name="co_share_id[]" id="co_share_id[]" onkeypress="return onlyNumbers(event)"></td>`;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}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);
|
||||
|
||||
$('#follow_insurer_id_' + insurerCount).select2()
|
||||
@ -3169,6 +3294,8 @@ function removeInsurerColumn(index) {
|
||||
|
||||
function populateTable(dataArray) {
|
||||
|
||||
console.log('populateTable data', dataArray)
|
||||
|
||||
dataArray.forEach((data, index) => {
|
||||
// Add a new insurer column for each entry in the data array
|
||||
addInsurerColumn(); // This will add a new column dynamically
|
||||
@ -3179,109 +3306,159 @@ function populateTable(dataArray) {
|
||||
|
||||
let insurer = data.insurer_branch_id + '-' + data.insurer_id;
|
||||
|
||||
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: // Agreed BP %
|
||||
cell.find('input').val(data.agreed_bp_per);
|
||||
break;
|
||||
case 15: // Agreed TP %
|
||||
cell.find('input').val(data.agreed_tp_per);
|
||||
break;
|
||||
case 16: // Agreed Ter %
|
||||
cell.find('input').val(data.agreed_tep_per);
|
||||
break;
|
||||
case 17: // Agreed Amount
|
||||
cell.find('input').val(data.agreed_amt);
|
||||
break;
|
||||
case 18: // Standard BP %
|
||||
cell.find('input').val(data.standerd_bp_per);
|
||||
break;
|
||||
case 19: // Standard TP %
|
||||
cell.find('input').val(data.standerd_tp_per);
|
||||
break;
|
||||
case 20: // Standard Ter %
|
||||
cell.find('input').val(data.standerd_tep_per);
|
||||
break;
|
||||
case 21: // Actual BP Amount
|
||||
cell.find('input').val(data.actual_bp_amt);
|
||||
break;
|
||||
case 22: // Actual TP Amount
|
||||
cell.find('input').val(data.actual_tp_amt);
|
||||
break;
|
||||
case 23: // Actual Ter Amount
|
||||
cell.find('input').val(data.actual_tep_amt);
|
||||
break;
|
||||
case 24: // Actual BP %
|
||||
cell.find('input').val(data.actual_bp_per);
|
||||
break;
|
||||
case 25: // Actual TP %
|
||||
cell.find('input').val(data.actual_tp_per);
|
||||
break;
|
||||
case 26: // Actual Ter %
|
||||
cell.find('input').val(data.actual_tep_per);
|
||||
break;
|
||||
case 27: // Actual BP Brokerage Amount
|
||||
cell.find('input').val(data.actual_bp_brokerage_amt);
|
||||
break;
|
||||
case 28: // Actual TP Brokerage Amount
|
||||
cell.find('input').val(data.actual_tp_brokerage_amt);
|
||||
break;
|
||||
case 29: // Actual Ter Brokerage Amount
|
||||
cell.find('input').val(data.actual_tep_brokerage_amt);
|
||||
break;
|
||||
case 30: // Expected Amount
|
||||
cell.find('input').val(data.exp_amt);
|
||||
break;
|
||||
case 31: // Variance
|
||||
cell.find('input').val(data.variance);
|
||||
break;
|
||||
case 32: // Reward
|
||||
cell.find('input').val(data.reward);
|
||||
break;
|
||||
case 33: // Co-share ID (hidden field)
|
||||
cell.find('input[type="hidden"]').val(data.id);
|
||||
break;
|
||||
if(team_id.includes('4')){
|
||||
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: // Agreed BP %
|
||||
cell.find('input').val(data.agreed_bp_per);
|
||||
break;
|
||||
case 15: // Agreed TP %
|
||||
cell.find('input').val(data.agreed_tp_per);
|
||||
break;
|
||||
case 16: // Agreed Ter %
|
||||
cell.find('input').val(data.agreed_tep_per);
|
||||
break;
|
||||
case 17: // Agreed Amount
|
||||
cell.find('input').val(data.agreed_amt);
|
||||
break;
|
||||
case 18: // Standard BP %
|
||||
cell.find('input').val(data.standerd_bp_per);
|
||||
break;
|
||||
case 19: // Standard TP %
|
||||
cell.find('input').val(data.standerd_tp_per);
|
||||
break;
|
||||
case 20: // Standard Ter %
|
||||
cell.find('input').val(data.standerd_tep_per);
|
||||
break;
|
||||
case 21: // Actual BP Amount
|
||||
cell.find('input').val(data.actual_bp_amt);
|
||||
break;
|
||||
case 22: // Actual TP Amount
|
||||
cell.find('input').val(data.actual_tp_amt);
|
||||
break;
|
||||
case 23: // Actual Ter Amount
|
||||
cell.find('input').val(data.actual_tep_amt);
|
||||
break;
|
||||
case 24: // Actual BP %
|
||||
cell.find('input').val(data.actual_bp_per);
|
||||
break;
|
||||
case 25: // Actual TP %
|
||||
cell.find('input').val(data.actual_tp_per);
|
||||
break;
|
||||
case 26: // Actual Ter %
|
||||
cell.find('input').val(data.actual_tep_per);
|
||||
break;
|
||||
case 27: // Actual BP Brokerage Amount
|
||||
cell.find('input').val(data.actual_bp_brokerage_amt);
|
||||
break;
|
||||
case 28: // Actual TP Brokerage Amount
|
||||
cell.find('input').val(data.actual_tp_brokerage_amt);
|
||||
break;
|
||||
case 29: // Actual Ter Brokerage Amount
|
||||
cell.find('input').val(data.actual_tep_brokerage_amt);
|
||||
break;
|
||||
case 30: // Expected Amount
|
||||
cell.find('input').val(data.exp_amt);
|
||||
break;
|
||||
case 31: // Variance
|
||||
cell.find('input').val(data.variance);
|
||||
break;
|
||||
case 32: // Reward
|
||||
cell.find('input').val(data.reward);
|
||||
break;
|
||||
case 33: // Co-share ID (hidden field)
|
||||
cell.find('input[type="hidden"]').val(data.id);
|
||||
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