diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index d49e6609..b5d73432 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -226,8 +226,8 @@ class EmployeeServiceController extends AdminController 'col_cell_name' => 'M', 'col_name' => 'Phone', 'is_mandatory' => false, - 'data_type' => 'str', - 'format' => null, + 'data_type' => 'mobile', + 'format' => 'mobile', 'allowed_values' => null, 'custom' => 'check_dup_mobileno', 'params' => ['row', 'existing_mobilenos'] @@ -940,6 +940,7 @@ class EmployeeServiceController extends AdminController { $is_mandatory = $columns_to_check[$keys[$col_key]]['is_mandatory']; $format = $columns_to_check[$keys[$col_key]]['format']; + $data_type = $columns_to_check[$keys[$col_key]]['data_type']; $allowed_values = $columns_to_check[$keys[$col_key]]['allowed_values']; $custom_function = isset($columns_to_check[$keys[$col_key]]['custom']) ? $columns_to_check[$keys[$col_key]]['custom'] : null; $binding_params = isset($columns_to_check[$keys[$col_key]]['params']) ? $columns_to_check[$keys[$col_key]]['params'] : null; @@ -986,15 +987,25 @@ class EmployeeServiceController extends AdminController //format check if(isset($format)) - { - $format_error = check_excel_date_format($col,$format); - if(!$format_error['status']) - { - array_push($result['error_summary'],2); - $result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; //push column name - $result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index; //push column index - $result['error_data'][$row_key][$keys[$col_key]]['error'][] = $format_error['error']; + { + + $validation = validate_excel_value($col, $data_type, $format, $allowed_values); + if (!$validation['status']) { + array_push($result['error_summary'], 2); + + $result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; + $result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index; + $result['error_data'][$row_key][$keys[$col_key]]['error'][] = $validation['error']; } + + // $format_error = check_excel_date_format($col,$format); + // if(!$format_error['status']) + // { + // array_push($result['error_summary'],2); + // $result['error_data'][$row_key][$keys[$col_key]]['col_name'] = $column_dispaly_name; //push column name + // $result['error_data'][$row_key][$keys[$col_key]]['col_idx'] = $column_index; //push column index + // $result['error_data'][$row_key][$keys[$col_key]]['error'][] = $format_error['error']; + // } } // Kint::dump($is_mandatory); //allowed values check diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index a2ff2325..1c4c347b 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -4168,7 +4168,7 @@ class PolicyTransactionController extends BaseController //get no of line items and update in DB $line_items = 0; // get uploaded month transactions data - $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id']); + $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id'], month: $file['month']); // var_dump($source_data);die(); // Kint::dump($source_data);die(); @@ -4291,7 +4291,7 @@ class PolicyTransactionController extends BaseController $line_items = 0; // get uploaded month transactions data - $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id']); + $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id'], month: $file['month']); // dd($source_data); // check policy no,insurer and etc in DB for this month @@ -4439,7 +4439,7 @@ class PolicyTransactionController extends BaseController //get no of line items and update in DB $line_items = count($excel_data); // get uploaded month transactions data - $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id']); + $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id'], month: $file['month']); // Kint::dump($source_data);//die; // Kint::dump($excel_data); // die; diff --git a/app/Controllers/VidalApiController.php b/app/Controllers/VidalApiController.php index e09fc9fb..2e6fa28f 100644 --- a/app/Controllers/VidalApiController.php +++ b/app/Controllers/VidalApiController.php @@ -476,6 +476,7 @@ class VidalApiController extends BaseController $ticket = $this->db->table('ticket_master tm') ->select(" tm.id, + tm.doa, tm.tpa_no as memberId, tm.tpa_claim_push_reference_no as claimRefNo, tm.tpa_claim_id as claimID, @@ -592,6 +593,7 @@ class VidalApiController extends BaseController $TicketData = $this->db->table('ticket_master tm') ->select(" tm.id, + tm.doa, tm.tpa_no as memberId, tm.tpa_claim_push_reference_no as claimRefNo, tm.tpa_claim_id as claimNo, @@ -1650,6 +1652,7 @@ class VidalApiController extends BaseController $ticket = $this->db->table('ticket_master tm') ->select(" tm.id, + tm.doa, tm.tpa_no as memberId, tm.tpa_claim_push_reference_no as claimInwardNO, tm.tpa_claim_id as claimNO, diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index f4540849..788ddc20 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -3014,6 +3014,9 @@ if (!function_exists('validate_excel_value')) { case 'date': return validate_date_value($value, $format); + case 'str': + return check_excel_date_format($value, $format); + case 'mobile': return validate_mobile_value($value); @@ -3064,7 +3067,7 @@ if (!function_exists('validate_mobile_value')) { return [ 'status' => false, - 'error' => "Invalid mobile number. Expected 10 digits." + 'error' => "Invalid mobile number. It must be exactly 10 digits, with no spaces and no +91 prefix." ]; } } diff --git a/app/Models/PTCOShareDetailsModel.php b/app/Models/PTCOShareDetailsModel.php index dc4e9953..59d53c9c 100644 --- a/app/Models/PTCOShareDetailsModel.php +++ b/app/Models/PTCOShareDetailsModel.php @@ -72,11 +72,14 @@ class PTCOShareDetailsModel extends Model 'file_id', ]; - public function getNonReconcileredPolicyTransactions(string $insurer_id,string $insurer_branch_id) + public function getNonReconcileredPolicyTransactions(string $insurer_id,string $insurer_branch_id, string $month) { $currentDate = date('Y-m-d'); $sixMonthsAgo = date('Y-m-01', strtotime('-6 months')); + $startDate = $month; + $endDate = date('Y-m-t', strtotime($startDate)); + return $this->db->table('pt_co_share_details pt_co') ->select(' pt_co.id, @@ -109,8 +112,10 @@ class PTCOShareDetailsModel extends Model ->where('pt_co.insurer_branch_id', $insurer_branch_id) // ->where('pt_co.statement_id is null') ->where('pt.status','completed') - ->where('DATE(pt.created_at) >=', $sixMonthsAgo) - ->where('DATE(pt.created_at) <=', $currentDate) + // ->where('DATE(pt.created_at) >=', $sixMonthsAgo) + // ->where('DATE(pt.created_at) <=', $currentDate) + ->where('pt_co.pt_policy_issue_date >=', $startDate) + ->where('pt_co.pt_policy_issue_date <=', $endDate) // ->where('pt_co.exp_amt', 0.00) // ->orWhere('pt_co.exp_amt is null') ->get() diff --git a/app/Views/client_branch.php b/app/Views/client_branch.php index fd00a267..61f5ec37 100755 --- a/app/Views/client_branch.php +++ b/app/Views/client_branch.php @@ -172,7 +172,7 @@ input:checked + .slider-branch-contact:before {
@@ -180,7 +180,9 @@ input:checked + .slider-branch-contact:before { + data-parsley-pattern-message="Branch Code can contain letters, numbers, underscore (_) and hyphen (-)." + oninput="this.value = this.value.replace(/[^A-Za-z0-9_-]/g, '')" + onblur="this.value = this.value.trim();">
@@ -209,14 +211,14 @@ input:checked + .slider-branch-contact:before {
@@ -771,7 +773,7 @@ function appendContactHtml(contact = false, reset = false) {
@@ -1364,7 +1366,8 @@ function setDefaultUnitValue() { var client_id = $('#client_id_branch').val(); - var branch_code = $('#branch_code').val(); + var branch_code = ($('#branch_code').val() || '').trim(); + $('#branch_code').val(branch_code); var units = $('#selected').val(); console.log('client_id', client_id) diff --git a/app/Views/insurer_branch.php b/app/Views/insurer_branch.php index 6ea9b4ae..92494a03 100755 --- a/app/Views/insurer_branch.php +++ b/app/Views/insurer_branch.php @@ -108,15 +108,17 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Branch Code can contain letters, numbers, spaces, underscore (_) and hyphen (-)." + oninput="this.value = this.value.replace(/[^A-Za-z0-9_\- ]/g, '')" + onblur="this.value = this.value.trim();">
@@ -147,7 +149,7 @@ @@ -158,7 +160,7 @@
@@ -197,8 +199,8 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Contact name can contain letters, numbers, spaces, underscore (_) and hyphen (-).">
@@ -213,7 +215,7 @@
@@ -456,7 +458,7 @@ if (!/^[a-zA-Z0-9\s_-]+$/.test(v)) return 'Branch Name can contain letters, numbers, spaces, underscore (_) and hyphen (-).'; return ''; case 'branch_code': - if (!/^[a-zA-Z0-9_-]+$/.test(v)) return 'Branch Code can contain letters, numbers, underscore (_) and hyphen (-).'; + if (!/^[a-zA-Z0-9\s_-]+$/.test(v)) return 'Branch Code can contain letters, numbers, spaces, underscore (_) and hyphen (-).'; return ''; case 'address1': return ''; @@ -968,8 +970,8 @@
+ data-parsley-pattern="^[a-zA-Z0-9\s_-]+$" + data-parsley-pattern-message="Contact name can contain letters, numbers, spaces, underscore (_) and hyphen (-).">
@@ -984,7 +986,7 @@
diff --git a/app/Views/layout/footer.php b/app/Views/layout/footer.php index 3851bb0e..9463619c 100755 --- a/app/Views/layout/footer.php +++ b/app/Views/layout/footer.php @@ -277,6 +277,7 @@