FIX_CLIENT_POLICY_NAME_ADD_POLICY_TYPE_NAME : AADHAVAN

This commit is contained in:
aadhavan valli 2024-03-30 18:18:39 +05:30
parent a51d6e1bfa
commit cf3547333d
5 changed files with 30 additions and 25 deletions

View File

@ -497,11 +497,13 @@ class EmployeeRestController extends AdminController
try {
$file = $this->request->getFile('file');
$client_id = $this->request->getPost('client_id');
// $client_id = $this->request->getJSON('client_id');
$policy_id = $this->request->getPost('policy_id');
$employee_id = $this->request->getPost('employee_id');
// $policy_id = $this->request->getJSON('policy_id');
$token = $this->request->headers()['Auth']->getValue();
$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();
@ -586,18 +588,18 @@ class EmployeeRestController extends AdminController
}
$dataToInsert = [];
$basic_cover_si= [];
if ($extra[9]) {
$new_array = [];
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]) {
$new_array[] = $i+1;
}
}
if (count($new_array) > 0) {
$count =count($new_array);
return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "$count Employee Sum Insured is Not Match.. " , 'data' => $new_array], 200);
}
}
// if ($extra[9]) {
// $new_array = [];
// 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]) {
// $new_array[] = $i+1;
// }
// }
// if (count($new_array) > 0) {
// $count =count($new_array);
// 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) {
$relation ='';
if ($extra['5'][$index] === 'Mother' || $extra['5'][$index] === 'Father') {

View File

@ -61,12 +61,14 @@ class ClientPolicyModel extends Model
}
public function getClientPolicyByClientId($client_id){
return $this->db->table('client_policy')
->select('client_policy.*')
->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('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('tpa_branch.branch_name as tpa_branch_name, tpa_branch.branch_code as tpa_branch_code')
->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_branch', 'client_policy.tpa_branch_id = tpa_branch.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)
->get()
->getResult();
}
public function getPolicyPremium($policy_id){

View File

@ -105,13 +105,11 @@ input:checked + .slider:before {
<div class="form-row">
<div class="form-group col-md-4">
<label for="pan">PAN<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="pan"
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>
<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>
</div>
<div class="form-group col-md-4">
<label for="gst">GST<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="gst"
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>
<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>
</div>
</div>

View File

@ -194,12 +194,15 @@
if (policy_PrimaryKey !== '') {
var policyTable = '';
var data = <?= isset($client_policy) ? json_encode($client_policy) : '[]' ?>;
data.forEach(function(item) {
// console.log("----------------------------");
// console.log(item);
policyTable += `
<tr>
<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>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
<td>${checkDateStatus(item.policy_end_date, 1)}</td>

View File

@ -175,9 +175,6 @@ paths:
policy_id:
type: integer
description: policy_id
employee_id:
type: integer
description: employee_id
file:
type: string
format: binary