FIX_Small Fixes

This commit is contained in:
venba-Inspriron-3558 2025-08-29 16:38:12 +05:30
parent bb212d64f0
commit a3f84efe3b
6 changed files with 55 additions and 4 deletions

View File

@ -1862,6 +1862,7 @@ class EmpDataServiceController extends BaseController
$status = $file['status'];
$batch_code = $file['batch_code'];
$user_id = $file['created_by'];
$policy_issue_date = $file['policy_issue_date'];
$insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first();
@ -2086,6 +2087,7 @@ class EmpDataServiceController extends BaseController
'no_of_dependent' => count($no_of_dependent ?? []) ?? null,
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
'gst' => $base_bremium_and_gst['gst'] ?? null,
'policy_issue_date' => $policy_issue_date ?? null,
]]);
// $this->cashDepositCalculationForInception($depositeData);
@ -2417,6 +2419,7 @@ class EmpDataServiceController extends BaseController
$batch_code = $file['batch_code'];
$user_id = $file['created_by'];
$event_type = $file['event_type'];
$policy_issue_date = $file['policy_issue_date'];
$status_val = 'success';
@ -2519,6 +2522,7 @@ class EmpDataServiceController extends BaseController
'endorsement_no' => $endorsement_id[0] ?? null,
'emp_count' => $emp_count ?? null,
'action_type' => $file['event_type'] ?? null,
'policy_issue_date' => $policy_issue_date ?? null,
]]);
@ -2999,6 +3003,7 @@ class EmpDataServiceController extends BaseController
$status = $file['status'];
$batch_code = $file['batch_code'];
$user_id = $file['created_by'];
$policy_issue_date = $file['policy_issue_date'];
$insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first();
@ -3179,6 +3184,7 @@ class EmpDataServiceController extends BaseController
'no_of_dependent' => count($no_of_dependent ?? []) ?? null,
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
'gst' => $base_bremium_and_gst['gst'] ?? null,
'policy_issue_date' => $policy_issue_date ?? null,
]]);
}
@ -3537,6 +3543,7 @@ class EmpDataServiceController extends BaseController
$status = $file['status'];
$batch_code = $file['batch_code'];
$user_id = $file['created_by'];
$policy_issue_date = $file['policy_issue_date'];
$insurer_id = $this->clientPolicyModel->where('id', $client_policy_id)->first();
@ -3687,6 +3694,7 @@ class EmpDataServiceController extends BaseController
'no_of_dependent' => count($no_of_dependent ?? []) ?? null,
'base_premium' => $base_bremium_and_gst['base_premium'] ?? null,
'gst' => $base_bremium_and_gst['gst'] ?? null,
'policy_issue_date' => $policy_issue_date ?? null,
]]);
}
@ -4981,7 +4989,7 @@ class EmpDataServiceController extends BaseController
'policy_no' => $policy_data['policy_no'] ?? null,
'cd_ac_no' => $policy_data['cd_ac_no'] ?? null,
'cd_ac_pk' => $policy_data['cd_ac_pk'] ?? null,
'policy_issue_date' => $policy_data['policy_start_date'] ?? null,
'policy_issue_date' => $policy_data['policy_issue_date'] ?? null,
'policy_start_date' => $policy_data['policy_start_date'] ?? null,
'policy_end_date' => $policy_data['policy_end_date'] ?? null,
'data_received_date' => $policy_data['data_received_date'] ?? null,
@ -4992,7 +5000,7 @@ class EmpDataServiceController extends BaseController
'co_share' => $policy_data['co_share'] ?? 0,
'pre_payable_by' => $policy_data['pre_payable_by'] ?? 1,
'renewal_date' => $policy_data['policy_end_date'] ?? null,
'month' => date('Y-m-01', strtotime($policy_data['policy_start_date'])) ?? null,
'month' => date('Y-m-01', strtotime($policy_data['policy_issue_date'] ?? "")) ?? null,
'ct_type' => 1,
'is_cd_reduce_from_bds' => 0,
'client_type_id' => 0,

View File

@ -515,6 +515,7 @@ class EmployeeController extends AdminController
$client_branch_id = $this->request->getPost('client_branch_id');
$insurer_or_tpa = $this->request->getPost('insurer_or_tpa');
$actions = $this->request->getPost('action_type');
$policy_issue_date = $this->request->getPost('policy_issue_date');
$client_data = $this->clientPolicyModel->getCliendDataForExcelFileName($client_policy_id);
$file_name = generate_filename($client_data['short_name'], $event_type, $actions, $insurer_or_tpa, $client_data['policy_type'], $client_data['branch_code']);
@ -530,6 +531,13 @@ class EmployeeController extends AdminController
'actions' => $actions,
'file_name' => $file_name,
];
$batch_data['policy_issue_date'] = (!empty($policy_issue_date) && strtotime($policy_issue_date) !== false)
? change_date_format($policy_issue_date)
: null;
if ($actions == 'export') {
if ($event_type == 'inception' || $event_type == 'addition' || $event_type == 'dependent_addition' || $event_type == 'missed_inception' || ($event_type == 'MultipleEvents' && $insurer_or_tpa == 'tpa')) {

View File

@ -3676,6 +3676,7 @@ class LeadsController extends BaseController
$result = $this->gmailSentHistoryModel
->where('pk', $id)
->where('module',"leads")
->orderBy('created_at', 'desc')
->findAll();
if(!empty($result)){
$result = !empty($result) ? $result : [];

View File

@ -299,7 +299,9 @@ class ThzController extends BaseController
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)->get()->getResultArray();
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)
->orderBy('thz_history.created_at', 'desc')
->get()->getResultArray();

View File

@ -25,6 +25,7 @@ class BatchFileModel extends Model
"status",
"error_data",
"client_branch_id",
"policy_issue_date",
];
// Callbacks

View File

@ -90,9 +90,15 @@
</select>
</div>
</div>
<div class="form-row policy_issue_date_row" style="display:none;">
<div class="form-group col-md-4">
<label id="policy_issue_date_label">Policy Issue Date</label> <br />
<input type="text" class="form-control" id="policy_issue_date" name="policy_issue_date"
placeholder="Enter Policy Issue Date">
</div>
</div>
<br>
<div class="form-row" id="import_excel_btn">
<div class="form-group col-md-3">
<label>Upload file</label>&nbsp;[ <a id="import_excel_download" data-toggle="tooltip" data-placement="top" title="Download Import Sample Excel" style="display: none;">Sample Excel</a> ]
@ -144,6 +150,16 @@
});
$(document).ready(function() {
var policy_issue_datePicker = flatpickr("#policy_issue_date", {
dateFormat: "d/m/Y",
allowInput: false,
});
$('#insurer_or_tpa, #action_type').on('change', togglePolicyIssueDate);
});
$(document).ready(function() {
<?php if (session()->has('error')) : ?>
@ -730,4 +746,19 @@
//------------------------------------------------------------------------------------------------------
</script>
<script>
function togglePolicyIssueDate() {
let insurer = $('#insurer_or_tpa').val();
let action = $('#action_type').val();
if (insurer === 'insurer' && action === 'import') {
$('.policy_issue_date_row').show();
$('#policy_issue_date').attr('required', true);
$('#policy_issue_date_label').html('Policy Issue Date <span class="text-danger">*</span>');
} else {
$('.policy_issue_date_row').hide();
$('#policy_issue_date').removeAttr('required').val('');
$('#policy_issue_date_label').text('Policy Issue Date');
}
}
</script>