FIX_MUTIEVENT_AND_CHANGE_INSURER_FILTER
This commit is contained in:
parent
37159dc1c5
commit
fa240a71e7
@ -5680,8 +5680,8 @@ class ClientController extends AdminController
|
|||||||
|
|
||||||
$EmployeeMultiEventServiceController = new EmployeeMultiEventServiceController();
|
$EmployeeMultiEventServiceController = new EmployeeMultiEventServiceController();
|
||||||
// $res = $EmployeeMultiEventServiceController->constructMultiEventData(['file_id' => '1069']);
|
// $res = $EmployeeMultiEventServiceController->constructMultiEventData(['file_id' => '1069']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileFormateValidation(['file_id' => '1084']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileFormateValidation(['file_id' => '2373']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileDataValidation(['file_id' => '1069']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileDataValidation(['file_id' => '2373']);
|
||||||
// $res = $EmployeeMultiEventServiceController->excelMultieventFileOnBoard(['file_id' => '1069']);
|
// $res = $EmployeeMultiEventServiceController->excelMultieventFileOnBoard(['file_id' => '1069']);
|
||||||
// dd($res);
|
// dd($res);
|
||||||
|
|
||||||
|
|||||||
@ -1015,6 +1015,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
|
|
||||||
public function excelMultieventFileFormateValidation($params)
|
public function excelMultieventFileFormateValidation($params)
|
||||||
{
|
{
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Formate Validation function START: ' . json_encode(['params' => $params]));
|
||||||
helper('excel_util_helper');
|
helper('excel_util_helper');
|
||||||
$file_id = $params['file_id'];
|
$file_id = $params['file_id'];
|
||||||
$file = $this->fileModel->find($file_id);
|
$file = $this->fileModel->find($file_id);
|
||||||
@ -1092,51 +1093,59 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "inception";
|
$params["action"] = "inception";
|
||||||
$params["file_path"] = $file_paths['inception'];
|
$params["file_path"] = $file_paths['inception'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Inception file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
||||||
$error[] = $this->compareMemberDataAndInceptionData($params);
|
$error[] = $this->compareMemberDataAndInceptionData($params);
|
||||||
|
$this->myLogger->logme('error', 'compare Member Data And Inception Data file validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//addition
|
//addition
|
||||||
if(isset($file_paths['addition']) && $file_paths['addition'] != "" && $file_paths['addition'] != null){
|
if(isset($file_paths['addition']) && $file_paths['addition'] != "" && $file_paths['addition'] != null){
|
||||||
$params["action"] = "addition";
|
$params["action"] = "addition";
|
||||||
$params["file_path"] = $file_paths['addition'];
|
$params["file_path"] = $file_paths['addition'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Addition file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//dependent_addition
|
//dependent_addition
|
||||||
if(isset($file_paths['dependent_addition']) && $file_paths['dependent_addition'] != "" && $file_paths['dependent_addition'] != null){
|
if(isset($file_paths['dependent_addition']) && $file_paths['dependent_addition'] != "" && $file_paths['dependent_addition'] != null){
|
||||||
$params["action"] = "dependent_addition";
|
$params["action"] = "dependent_addition";
|
||||||
$params["file_path"] = $file_paths['dependent_addition'];
|
$params["file_path"] = $file_paths['dependent_addition'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Dependent Addition file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//deletion
|
//deletion
|
||||||
if(isset($file_paths['deletion']) && $file_paths['deletion'] != "" && $file_paths['deletion'] != null){
|
if(isset($file_paths['deletion']) && $file_paths['deletion'] != "" && $file_paths['deletion'] != null){
|
||||||
$params["action"] = "deletion";
|
$params["action"] = "deletion";
|
||||||
$params["file_path"] = $file_paths['deletion'];
|
$params["file_path"] = $file_paths['deletion'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Deletion file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//correction
|
//correction
|
||||||
if(isset($file_paths['correction']) && $file_paths['correction'] != "" && $file_paths['correction'] != null){
|
if(isset($file_paths['correction']) && $file_paths['correction'] != "" && $file_paths['correction'] != null){
|
||||||
$params["action"] = "correction";
|
$params["action"] = "correction";
|
||||||
$params["file_path"] = $file_paths['correction'];
|
$params["file_path"] = $file_paths['correction'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Correction file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//si_enhancement
|
//si_enhancement
|
||||||
if(isset($file_paths['si_enhancement']) && $file_paths['si_enhancement'] != "" && $file_paths['si_enhancement'] != null){
|
if(isset($file_paths['si_enhancement']) && $file_paths['si_enhancement'] != "" && $file_paths['si_enhancement'] != null){
|
||||||
$params["action"] = "si_enhancement";
|
$params["action"] = "si_enhancement";
|
||||||
$params["file_path"] = $file_paths['si_enhancement'];
|
$params["file_path"] = $file_paths['si_enhancement'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'SI Enhancement file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//missed_inception
|
//missed_inception
|
||||||
if(isset($file_paths['missed_inception']) && $file_paths['missed_inception'] != "" && $file_paths['missed_inception'] != null){
|
if(isset($file_paths['missed_inception']) && $file_paths['missed_inception'] != "" && $file_paths['missed_inception'] != null){
|
||||||
$params["action"] = "missed_inception";
|
$params["action"] = "missed_inception";
|
||||||
$params["file_path"] = $file_paths['missed_inception'];
|
$params["file_path"] = $file_paths['missed_inception'];
|
||||||
$error[] = $this->excelFileFormatValidation($params);
|
$error[] = $this->excelFileFormatValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Missed Inception file formate validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$error_type = 1;
|
$error_type = 1;
|
||||||
@ -1145,6 +1154,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
|
|
||||||
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
||||||
$r = Jobs::addJob(['job_name' => 'excelMultieventFileDataValidation', 'payload' => $params]);
|
$r = Jobs::addJob(['job_name' => 'excelMultieventFileDataValidation', 'payload' => $params]);
|
||||||
|
$this->myLogger->logme('error', 'excelMultieventFileDataValidation job pushed');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// $error['error_summary'] = array_count_values($error['error_summary']);
|
// $error['error_summary'] = array_count_values($error['error_summary']);
|
||||||
@ -1160,12 +1170,16 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$this->unlinkFiles($file_paths);
|
$this->unlinkFiles($file_paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Formate Validation function END');
|
||||||
|
|
||||||
return ($error);
|
return ($error);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function excelMultieventFileDataValidation($params)
|
public function excelMultieventFileDataValidation($params)
|
||||||
{
|
{
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Data Validation function START: ' . json_encode(['params' => $params]));
|
||||||
|
|
||||||
helper('excel_util_helper');
|
helper('excel_util_helper');
|
||||||
$file_id = $params['file_id'];
|
$file_id = $params['file_id'];
|
||||||
$file = $this->fileModel->find($file_id);
|
$file = $this->fileModel->find($file_id);
|
||||||
@ -1195,6 +1209,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "inception";
|
$params["action"] = "inception";
|
||||||
$params["file_path"] = $file_paths['inception'];
|
$params["file_path"] = $file_paths['inception'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Inception file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//addition
|
//addition
|
||||||
@ -1202,6 +1217,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "addition";
|
$params["action"] = "addition";
|
||||||
$params["file_path"] = $file_paths['addition'];
|
$params["file_path"] = $file_paths['addition'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Addition file validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//dependent_addition
|
//dependent_addition
|
||||||
@ -1209,6 +1225,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "dependent_addition";
|
$params["action"] = "dependent_addition";
|
||||||
$params["file_path"] = $file_paths['dependent_addition'];
|
$params["file_path"] = $file_paths['dependent_addition'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Dependent Addition file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//deletion
|
//deletion
|
||||||
@ -1216,6 +1233,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "deletion";
|
$params["action"] = "deletion";
|
||||||
$params["file_path"] = $file_paths['deletion'];
|
$params["file_path"] = $file_paths['deletion'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Deletion file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//correction
|
//correction
|
||||||
@ -1223,6 +1241,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "correction";
|
$params["action"] = "correction";
|
||||||
$params["file_path"] = $file_paths['correction'];
|
$params["file_path"] = $file_paths['correction'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Correction file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//si_enhancement
|
//si_enhancement
|
||||||
@ -1230,6 +1249,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "si_enhancement";
|
$params["action"] = "si_enhancement";
|
||||||
$params["file_path"] = $file_paths['si_enhancement'];
|
$params["file_path"] = $file_paths['si_enhancement'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'SI Enhancement file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//missed_inception
|
//missed_inception
|
||||||
@ -1237,6 +1257,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "missed_inception";
|
$params["action"] = "missed_inception";
|
||||||
$params["file_path"] = $file_paths['missed_inception'];
|
$params["file_path"] = $file_paths['missed_inception'];
|
||||||
$error[] = $this->excelFileDataValidation($params);
|
$error[] = $this->excelFileDataValidation($params);
|
||||||
|
$this->myLogger->logme('error', 'Missed Inception file Data validation result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$error_type = 2;
|
$error_type = 2;
|
||||||
@ -1245,6 +1266,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
|
|
||||||
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
if (isset($error['error_data']) && count($error['error_data']) == 0) {
|
||||||
$r = Jobs::addJob(['job_name' => 'excelMultieventFileOnBoard', 'payload' => $params]);
|
$r = Jobs::addJob(['job_name' => 'excelMultieventFileOnBoard', 'payload' => $params]);
|
||||||
|
$this->myLogger->logme('error', 'excelMultieventFileOnBoard job pushed');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// $error['error_summary'] = array_count_values($error['error_summary']);
|
// $error['error_summary'] = array_count_values($error['error_summary']);
|
||||||
@ -1257,11 +1279,15 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$this->setPullNotification($this->getFileMetaDataByFileId($file_id, 'failure'));
|
$this->setPullNotification($this->getFileMetaDataByFileId($file_id, 'failure'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Data Validation function END');
|
||||||
|
|
||||||
return ($error);
|
return ($error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function excelMultieventFileOnBoard($params)
|
public function excelMultieventFileOnBoard($params)
|
||||||
{
|
{
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Onboard function START: ' . json_encode(['params' => $params]));
|
||||||
|
|
||||||
helper('excel_util_helper');
|
helper('excel_util_helper');
|
||||||
|
|
||||||
$file_id = $params['file_id'];
|
$file_id = $params['file_id'];
|
||||||
@ -1291,6 +1317,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "inception";
|
$params["action"] = "inception";
|
||||||
$params["file_path"] = $file_paths['inception'];
|
$params["file_path"] = $file_paths['inception'];
|
||||||
$error['inception'] = $this->employeesOnboardPreprocess($params);
|
$error['inception'] = $this->employeesOnboardPreprocess($params);
|
||||||
|
$this->myLogger->logme('error', 'Inception file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//addition
|
//addition
|
||||||
@ -1298,6 +1325,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "addition";
|
$params["action"] = "addition";
|
||||||
$params["file_path"] = $file_paths['addition'];
|
$params["file_path"] = $file_paths['addition'];
|
||||||
$error['addition'] = $this->employeesOnboardPreprocess($params);
|
$error['addition'] = $this->employeesOnboardPreprocess($params);
|
||||||
|
$this->myLogger->logme('error', 'Addition file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//dependent_addition
|
//dependent_addition
|
||||||
@ -1305,6 +1333,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "dependent_addition";
|
$params["action"] = "dependent_addition";
|
||||||
$params["file_path"] = $file_paths['dependent_addition'];
|
$params["file_path"] = $file_paths['dependent_addition'];
|
||||||
$error['dependent_addition'] = $this->employeesOnboardPreprocess($params);
|
$error['dependent_addition'] = $this->employeesOnboardPreprocess($params);
|
||||||
|
$this->myLogger->logme('error', 'Dependent Addition file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//missed_inception
|
//missed_inception
|
||||||
@ -1312,6 +1341,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "missed_inception";
|
$params["action"] = "missed_inception";
|
||||||
$params["file_path"] = $file_paths['missed_inception'];
|
$params["file_path"] = $file_paths['missed_inception'];
|
||||||
$error['missed_inception'] = $this->employeesOnboardPreprocess($params);
|
$error['missed_inception'] = $this->employeesOnboardPreprocess($params);
|
||||||
|
$this->myLogger->logme('error', 'Missed Inception file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//deletion
|
//deletion
|
||||||
@ -1319,6 +1349,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "deletion";
|
$params["action"] = "deletion";
|
||||||
$params["file_path"] = $file_paths['deletion'];
|
$params["file_path"] = $file_paths['deletion'];
|
||||||
$error['deletion'] = $this->employeeDisembark($params);
|
$error['deletion'] = $this->employeeDisembark($params);
|
||||||
|
$this->myLogger->logme('error', 'Deletion file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//correction
|
//correction
|
||||||
@ -1326,6 +1357,7 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "correction";
|
$params["action"] = "correction";
|
||||||
$params["file_path"] = $file_paths['correction'];
|
$params["file_path"] = $file_paths['correction'];
|
||||||
$error['correction'] = $this->employeesCorrectionProcess($params);
|
$error['correction'] = $this->employeesCorrectionProcess($params);
|
||||||
|
$this->myLogger->logme('error', 'Correction file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//si_enhancement
|
//si_enhancement
|
||||||
@ -1333,11 +1365,13 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
$params["action"] = "si_enhancement";
|
$params["action"] = "si_enhancement";
|
||||||
$params["file_path"] = $file_paths['si_enhancement'];
|
$params["file_path"] = $file_paths['si_enhancement'];
|
||||||
$error['si_enhancement'] = $this->employeesSIEnhanceProcess($params);
|
$error['si_enhancement'] = $this->employeesSIEnhanceProcess($params);
|
||||||
|
$this->myLogger->logme('error', 'SI Enhancement file Onboard Process result: ' . json_encode(['params' => $params]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->fileModel->where('id', $file_id)->set(['status' => 'success', 'reason' => ''])->update();
|
$this->fileModel->where('id', $file_id)->set(['status' => 'success', 'reason' => ''])->update();
|
||||||
$this->myLogger->logme("error", $file['action'].': {file_id} uploaded success', ['file_id' => $file_id]);
|
$this->myLogger->logme("error", $file['action'].': {file_id} uploaded success', ['file_id' => $file_id]);
|
||||||
$this->setPullNotification($this->getFileMetaDataByFileId($file_id, 'success'));
|
$this->setPullNotification($this->getFileMetaDataByFileId($file_id, 'success'));
|
||||||
|
$this->myLogger->logme('error', 'Excel Multievent File Onboard function END');
|
||||||
|
|
||||||
//After insert the success than remove the TEMP JSON files
|
//After insert the success than remove the TEMP JSON files
|
||||||
// $this->unlinkFiles($params['multi_event_file_paths']);
|
// $this->unlinkFiles($params['multi_event_file_paths']);
|
||||||
@ -2912,9 +2946,13 @@ class EmployeeMultiEventServiceController extends BaseController
|
|||||||
// Save JSON file in writable/tmp/
|
// Save JSON file in writable/tmp/
|
||||||
$savedFiles = [];
|
$savedFiles = [];
|
||||||
foreach ($finalData as $key => $data) {
|
foreach ($finalData as $key => $data) {
|
||||||
$filePath = WRITEPATH . 'tmp/' . $key . '_' . time() . '.json';
|
if(!empty($data)){
|
||||||
file_put_contents($filePath, json_encode($data, JSON_PRETTY_PRINT));
|
$filePath = WRITEPATH . 'tmp/' . $key . '_' . time() . '.json';
|
||||||
$savedFiles[$key] = $filePath;
|
file_put_contents($filePath, json_encode($data, JSON_PRETTY_PRINT));
|
||||||
|
$savedFiles[$key] = $filePath;
|
||||||
|
}else{
|
||||||
|
$savedFiles[$key] = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $savedFiles;
|
return $savedFiles;
|
||||||
|
|||||||
@ -345,7 +345,8 @@ input:checked + .slider_blue::before {
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// $('#inception_type').change(function () {
|
// $('#inception_type').change(function () {
|
||||||
// var open_data = $('#open_date').parent();
|
// var open_data = $('#open_date').parent();
|
||||||
// var close_data = $('#close_date').parent();
|
// var close_data = $('#close_date').parent();
|
||||||
@ -367,6 +368,8 @@ input:checked + .slider_blue::before {
|
|||||||
var policy_PrimaryKey = $('#client_id_policy').val();
|
var policy_PrimaryKey = $('#client_id_policy').val();
|
||||||
var policy_client = $('#policy_PrimaryKey').val();
|
var policy_client = $('#policy_PrimaryKey').val();
|
||||||
var submitInterval = null;
|
var submitInterval = null;
|
||||||
|
let insurer_data = <?= json_encode($insurer ?? []) ?>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@ -883,6 +886,14 @@ input:checked + .slider_blue::before {
|
|||||||
$('#tpa').prop('required', true);
|
$('#tpa').prop('required', true);
|
||||||
$('#tpa_danger').show()
|
$('#tpa_danger').show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var select = $('#insurer');
|
||||||
|
let category = insurer_category[policy_type_id] ?? null;
|
||||||
|
console.log('insurer_category', category);
|
||||||
|
|
||||||
|
if(select && category){
|
||||||
|
appendInsurerByCategory(insurer_data, select, category);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1145,6 +1145,61 @@ $(function(){
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
const insurer_category = {
|
||||||
|
1: "general", 2: "general", 3: "general", 4: "general", 5: "general",
|
||||||
|
6: "life", 7: "life", 8: "general", 9: "general", 10: "general",
|
||||||
|
11: "general", 12: "general", 13: "general", 14: "general", 15: "general",
|
||||||
|
16: "general", 17: "general", 18: "general", 19: "general", 20: "general",
|
||||||
|
21: "general", 22: "general", 23: "general", 24: "general", 25: "general",
|
||||||
|
26: "general", 27: "general", 28: "general", 29: "general", 30: "general",
|
||||||
|
31: "general", 32: "life", 33: "general", 34: "life", 35: "general",
|
||||||
|
36: "general", 37: "general", 38: "general", 39: "life", 40: "general",
|
||||||
|
41: "general", 42: "general", 43: "general", 44: "general", 45: "general",
|
||||||
|
46: "general", 47: "general", 48: "general", 49: "general", 50: "general",
|
||||||
|
51: "general", 52: "general", 53: "general", 54: "general", 55: "general",
|
||||||
|
56: "general", 57: "general", 58: "general", 59: "general", 60: "general",
|
||||||
|
61: "general", 62: "general", 63: "general", 64: "general", 65: "general",
|
||||||
|
66: "general", 67: "general", 68: "general", 69: "general", 70: "general",
|
||||||
|
71: "general"
|
||||||
|
};
|
||||||
|
|
||||||
|
function appendInsurerByCategory(data, object, type)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
|
||||||
|
$(object).empty();
|
||||||
|
|
||||||
|
$(object).append($('<option>', {
|
||||||
|
value: '',
|
||||||
|
text: 'Select Insurer'
|
||||||
|
}));
|
||||||
|
|
||||||
|
$.each(data, function(index, item) {
|
||||||
|
|
||||||
|
var displayValue = item.insurer_name + ' - ' + item.branch_code;
|
||||||
|
var dbValue = item.id+'-'+item.insurer_id
|
||||||
|
|
||||||
|
if(item.category == type){
|
||||||
|
|
||||||
|
var option = $('<option>', {
|
||||||
|
value: dbValue,
|
||||||
|
text: displayValue,
|
||||||
|
'data-id': item.insurer_id,
|
||||||
|
'data-bid': item.id,
|
||||||
|
'data-ic': item.category,
|
||||||
|
});
|
||||||
|
|
||||||
|
$(object).append(option);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(object).select2();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@ -1339,6 +1339,7 @@
|
|||||||
let isVehicleFormSubmitting = false;
|
let isVehicleFormSubmitting = false;
|
||||||
var insurer_count_array = [];
|
var insurer_count_array = [];
|
||||||
var redirect_url = '<?= base_url('policy_tranction/inception/list') ?>';
|
var redirect_url = '<?= base_url('policy_tranction/inception/list') ?>';
|
||||||
|
let insurer_data = <?= json_encode($insurer_branch ?? []) ?>;
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
@ -1668,6 +1669,19 @@
|
|||||||
var value = $(this).val();
|
var value = $(this).val();
|
||||||
var selectedOption = $(this).find('option:selected');
|
var selectedOption = $(this).find('option:selected');
|
||||||
|
|
||||||
|
let category = insurer_category[value] ?? null;
|
||||||
|
console.log('insurer_category', category);
|
||||||
|
// console.log('insurer_data', insurer_data);
|
||||||
|
|
||||||
|
// loop through all select fields
|
||||||
|
$('[name="follow_insurer_id[]"]').each(function () {
|
||||||
|
let select = $(this);
|
||||||
|
if(select){
|
||||||
|
appendInsurerByCategory(insurer_data, select, category);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var ebp = selectedOption.data('ebp');
|
var ebp = selectedOption.data('ebp');
|
||||||
var etp = selectedOption.data('etp');
|
var etp = selectedOption.data('etp');
|
||||||
var etep = selectedOption.data('etep');
|
var etep = selectedOption.data('etep');
|
||||||
@ -1924,17 +1938,19 @@
|
|||||||
let insurer = $(this).val();
|
let insurer = $(this).val();
|
||||||
let unique_id = $(this).data('count');
|
let unique_id = $(this).data('count');
|
||||||
let client_id = $('#client_id').val();
|
let client_id = $('#client_id').val();
|
||||||
|
let policy_type_id = $('#policy_type_id').val();
|
||||||
|
|
||||||
console.log('insurer', insurer);
|
console.log('insurer', insurer);
|
||||||
|
console.log('policy_type_id', policy_type_id);
|
||||||
console.log('follow_insurer_id client_id', client_id);
|
console.log('follow_insurer_id client_id', client_id);
|
||||||
console.log('follow_insurer_id unique_id', unique_id);
|
console.log('follow_insurer_id unique_id', unique_id);
|
||||||
|
|
||||||
$('#insurer_id').val(insurer)
|
$('#insurer_id').val(insurer)
|
||||||
|
|
||||||
if(!client_id){
|
if (!policy_type_id || !client_id) {
|
||||||
$(this).val('').select2();
|
$(this).val('').select2();
|
||||||
toastr.warning('Please select the Client', 'WARNING');
|
toastr.warning(!policy_type_id ? 'Please select the Policy Type' : 'Please select the Client', 'WARNING');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4379,7 +4395,7 @@
|
|||||||
<select class="form-control follow_insurer" data-count="${insurerCount}" id="follow_insurer_id_${insurerCount}" name="follow_insurer_id[]" onchange="getCDAccountNumber(this)">
|
<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>
|
<option value="" selected>Select Insurer</option>
|
||||||
<?php foreach ($insurer_branch as $value) { ?>
|
<?php foreach ($insurer_branch as $value) { ?>
|
||||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>">
|
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>" data-ic="<?= $value['category'] ?>">
|
||||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
||||||
</option>
|
</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -4521,7 +4537,7 @@
|
|||||||
<select class="form-control follow_insurer" data-count="${insurerCount}" id="follow_insurer_id_${insurerCount}" name="follow_insurer_id[]" onchange="getCDAccountNumber(this)">
|
<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>
|
<option value="" selected>Select Insurer</option>
|
||||||
<?php foreach ($insurer_branch as $value) { ?>
|
<?php foreach ($insurer_branch as $value) { ?>
|
||||||
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>">
|
<option value="<?= $value['id'] . '-' . $value['insurer_id'] ?>" data-id="<?= $value['insurer_id'] ?>" data-bid="<?= $value['id'] ?>" data-ic="<?= $value['category'] ?>">
|
||||||
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
<?= $value['insurer_name'] . '-' . $value['branch_code'] ?>
|
||||||
</option>
|
</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -4620,7 +4636,16 @@
|
|||||||
|
|
||||||
$(this).append(newCell);
|
$(this).append(newCell);
|
||||||
|
|
||||||
$('#follow_insurer_id_' + insurerCount).select2()
|
let select = $('#follow_insurer_id_' + insurerCount);
|
||||||
|
let add_insurer_policy_type_id = $('#policy_type_id').val();
|
||||||
|
let category = insurer_category[add_insurer_policy_type_id] ?? null;
|
||||||
|
|
||||||
|
if(select && category){
|
||||||
|
appendInsurerByCategory(insurer_data, select, category);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#follow_insurer_id_' + insurerCount).select2();
|
||||||
|
|
||||||
|
|
||||||
var selectedOption = $('#policy_type_id').find('option:selected');
|
var selectedOption = $('#policy_type_id').find('option:selected');
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user