FIX_CLIENT_POLICY_NAME_ADD_POLICY_TYPE_NAME : AADHAVAN
This commit is contained in:
parent
a51d6e1bfa
commit
cf3547333d
@ -497,11 +497,13 @@ class EmployeeRestController extends AdminController
|
|||||||
try {
|
try {
|
||||||
$file = $this->request->getFile('file');
|
$file = $this->request->getFile('file');
|
||||||
$client_id = $this->request->getPost('client_id');
|
$client_id = $this->request->getPost('client_id');
|
||||||
// $client_id = $this->request->getJSON('client_id');
|
|
||||||
$policy_id = $this->request->getPost('policy_id');
|
$policy_id = $this->request->getPost('policy_id');
|
||||||
|
|
||||||
$employee_id = $this->request->getPost('employee_id');
|
$token = $this->request->headers()['Auth']->getValue();
|
||||||
// $policy_id = $this->request->getJSON('policy_id');
|
$decodedPayload = json_decode(base64_decode(explode('.', $token)[1]), true);
|
||||||
|
|
||||||
|
// get the employee id from token
|
||||||
|
$employee_id = $decodedPayload['id'];
|
||||||
|
|
||||||
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first();
|
$client_policy = $this->clientPolicyModel->where('id', $policy_id)->where('client_id', $client_id)->first();
|
||||||
|
|
||||||
@ -586,18 +588,18 @@ class EmployeeRestController extends AdminController
|
|||||||
}
|
}
|
||||||
$dataToInsert = [];
|
$dataToInsert = [];
|
||||||
$basic_cover_si= [];
|
$basic_cover_si= [];
|
||||||
if ($extra[9]) {
|
// if ($extra[9]) {
|
||||||
$new_array = [];
|
// $new_array = [];
|
||||||
for ($i=0; $i < count($extra[9]); $i++) {
|
// for ($i=0; $i < count($extra[9]); $i++) {
|
||||||
if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) {
|
// if ($sum_insured_amount_for_check_employee_2 != $extra[9][$i] || $sum_insured_amount_for_check_employee_1 != $extra[9][$i]) {
|
||||||
$new_array[] = $i+1;
|
// $new_array[] = $i+1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if (count($new_array) > 0) {
|
// if (count($new_array) > 0) {
|
||||||
$count =count($new_array);
|
// $count =count($new_array);
|
||||||
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
|
// return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
foreach ($extra['0'] as $index => $id) {
|
foreach ($extra['0'] as $index => $id) {
|
||||||
$relation ='';
|
$relation ='';
|
||||||
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {
|
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {
|
||||||
|
|||||||
@ -62,11 +62,13 @@ class ClientPolicyModel extends Model
|
|||||||
|
|
||||||
public function getClientPolicyByClientId($client_id){
|
public function getClientPolicyByClientId($client_id){
|
||||||
|
|
||||||
|
|
||||||
return $this->db->table('client_policy')
|
return $this->db->table('client_policy')
|
||||||
->select('client_policy.*')
|
->select('client_policy.*')
|
||||||
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
->select('insurers.name as insurer_name, insurers.short_name as insurer_short')
|
||||||
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
|
->select('tpa.name as tpa_name, tpa.short_name as tpa_short')
|
||||||
->select('policies.name as policy_name')
|
->select('policies.name as policy_name, policies.policy_type_id')
|
||||||
|
->select('policy_type.policy_type as policy_type_name')
|
||||||
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
->select('insurer_branch.branch_name as insurer_branch_name, insurer_branch.branch_code as insurer_branch_code')
|
||||||
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
->select('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
|
||||||
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
->join('insurers', 'insurers.id = client_policy.insurer_id')
|
||||||
@ -74,10 +76,13 @@ class ClientPolicyModel extends Model
|
|||||||
->join('tpa', 'tpa.id = client_policy.tpa_id')
|
->join('tpa', 'tpa.id = client_policy.tpa_id')
|
||||||
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id')
|
->join('tpa_branch', 'client_policy.tpa_branch_id = tpa_branch.id')
|
||||||
->join('policies', 'policies.id = client_policy.policy_id')
|
->join('policies', 'policies.id = client_policy.policy_id')
|
||||||
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
->where('client_policy.client_id', $client_id)
|
->where('client_policy.client_id', $client_id)
|
||||||
->get()
|
->get()
|
||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPolicyPremium($policy_id){
|
public function getPolicyPremium($policy_id){
|
||||||
|
|||||||
@ -105,13 +105,11 @@ input:checked + .slider:before {
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="pan">PAN<span class="text-danger">*</span></label>
|
<label for="pan">PAN<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="pan"
|
<input type="text" class="form-control" id="pan" placeholder="Enter PAN Number" data-parsley-error-message="Invalid PAN Number. Example: ABCDE1234F" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
|
||||||
placeholder="Enter PAN Number" value="<?= isset($client['pan']) ? $client['pan'] : '' ?>" name="pan" data-parsley-trigger="change" data-parsley-pattern="^[A-Z]{5}[0-9]{4}[A-Z]$" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="gst">GST<span class="text-danger">*</span></label>
|
<label for="gst">GST<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="gst"
|
<input type="text" class="form-control" id="gst" placeholder="Enter GST Number" data-parsley-error-message="Invalid GST Number. Example: 12ABCDE1234F5Z6" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
||||||
placeholder="Enter GST Number" value="<?= isset($client['gst']) ? $client['gst'] : '' ?>" name="gst" data-parsley-trigger="change" data-parsley-pattern="^\d{2}[A-Z]{5}\d{4}[A-Z]{1}[A-Z\d]{1}[Z]{1}[A-Z\d]{1}$" required>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -194,12 +194,15 @@
|
|||||||
if (policy_PrimaryKey !== '') {
|
if (policy_PrimaryKey !== '') {
|
||||||
var policyTable = '';
|
var policyTable = '';
|
||||||
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
|
||||||
|
|
||||||
data.forEach(function(item) {
|
data.forEach(function(item) {
|
||||||
|
// console.log("----------------------------");
|
||||||
|
|
||||||
|
// console.log(item);
|
||||||
|
|
||||||
policyTable += `
|
policyTable += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
<td>${item.insurer_short} - ${item.insurer_branch_name}</td>
|
||||||
<td>${item.policy_name}</td>
|
<td>${item.policy_name} (${item.policy_type_name})</td>
|
||||||
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
|
||||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
|
|||||||
@ -175,9 +175,6 @@ paths:
|
|||||||
policy_id:
|
policy_id:
|
||||||
type: integer
|
type: integer
|
||||||
description: policy_id
|
description: policy_id
|
||||||
employee_id:
|
|
||||||
type: integer
|
|
||||||
description: employee_id
|
|
||||||
file:
|
file:
|
||||||
type: string
|
type: string
|
||||||
format: binary
|
format: binary
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user