From 49c5881ebab3f461a68ea87316f5fb32a326f755 Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Fri, 29 May 2026 14:01:29 +0530 Subject: [PATCH 1/4] CHANGE_DATE_FORMATE_ALL_PLACE --- app/Controllers/ClientController.php | 2 +- app/Views/batch_list.php | 4 +- app/Views/bds_dump_file_list.php | 2 +- app/Views/cd_master_add_modal.php | 45 ++++++++++- app/Views/cd_master_list.php | 8 +- app/Views/claim_dump_file_list.php | 4 +- app/Views/client_policy.php | 111 +++++++++++++++++++------- app/Views/commission_file_upload.php | 2 +- app/Views/expense_list.php | 2 +- app/Views/file_list.php | 4 +- app/Views/hr_file_upload.php | 2 +- app/Views/non_eb_claim_list.php | 2 +- app/Views/report_bds.php | 26 +++--- app/Views/retail_endorsement_list.php | 2 +- app/Views/test_members_list.php | 2 +- app/Views/thz_list.php | 4 +- app/Views/ticket_reports.php | 2 +- 17 files changed, 160 insertions(+), 64 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 56087644..7a3a89a1 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -6652,7 +6652,7 @@ class ClientController extends AdminController // Check in Enrollment (client_policy) $client_policy_data = $this->clientPolicyModel ->where('is_active', 1) - ->where('policy_status', 1) + // ->where('policy_status', 1) ->where('TRIM(policy_no)', $policy_no) ->first(); diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 5ebdebc5..61d395e7 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -34,7 +34,7 @@ if (!empty($batch_list) && is_array($batch_list)) { $countStr = ($file['count'] ?? null) === null ? '-' : (string) $file['count']; $batch_col_max_len[9] = max($batch_col_max_len[9], mb_strlen($countStr)); $batch_col_max_len[10] = max($batch_col_max_len[10], mb_strlen((string) format_indian_number($file['amount']))); - $userTime = change_date_format($file['created_at'] ?? '', 'Y-m-d H:i:s', 'd M Y h:i a') + $userTime = change_date_format($file['created_at'] ?? '', 'Y-m-d H:i:s', 'd/m/Y h:i a') . ' by ' . get_username($file['created_by'] ?? ''); $batch_col_max_len[11] = max($batch_col_max_len[11], mb_strlen($userTime)); @@ -350,7 +350,7 @@ for ($i = 0; $i < $batch_col_count; $i++) { - by + by diff --git a/app/Views/bds_dump_file_list.php b/app/Views/bds_dump_file_list.php index b56448fa..2ea6207a 100644 --- a/app/Views/bds_dump_file_list.php +++ b/app/Views/bds_dump_file_list.php @@ -49,7 +49,7 @@ - ' . $file['user_name'] . '' ?> + ' . $file['user_name'] . '' ?> diff --git a/app/Views/cd_master_add_modal.php b/app/Views/cd_master_add_modal.php index e73b807f..29597a75 100644 --- a/app/Views/cd_master_add_modal.php +++ b/app/Views/cd_master_add_modal.php @@ -107,13 +107,50 @@ var isCdMasterPage = ; console.log("isCdMasterPage", isCdMasterPage); + function formatCdOpeningDateForInput(inputDate) { + if (!inputDate || String(inputDate).trim() === '') { + return ''; + } + var str = String(inputDate).trim(); + var iso = str.match(/^(\d{4})-(\d{2})-(\d{2})/); + if (iso) { + return iso[3] + '/' + iso[2] + '/' + iso[1]; + } + var dmy = str.match(/^(\d{1,2})[-\/](\d{1,2})[-\/](\d{4})$/); + if (dmy) { + var day = ('0' + dmy[1]).slice(-2); + var month = ('0' + dmy[2]).slice(-2); + return day + '/' + month + '/' + dmy[3]; + } + return str; + } + + function cdOpeningDateForSubmit(inputDate) { + var formatted = formatCdOpeningDateForInput(inputDate); + if (!formatted) { + return inputDate || ''; + } + var parts = formatted.split('/'); + return parts[0] + '-' + parts[1] + '-' + parts[2]; + } + + var openingDatePicker; + $(document).ready(function(){ - var openingDatePicker = flatpickr("#opening_date", { - dateFormat: "d-m-Y", + openingDatePicker = flatpickr("#opening_date", { + dateFormat: "d/m/Y", allowInput: false }); + $('#con-close-modal').on('shown.bs.modal', function() { + var val = $('#opening_date').val(); + if (val) { + var formatted = formatCdOpeningDateForInput(val); + openingDatePicker.setDate(formatted, false); + } + }); + if(isCdMasterPage == true){ $('#cd_client_id').select2(); $('#insurer_id_for_cd').select2(); @@ -172,6 +209,10 @@ } let formData = new FormData($('#CDMasterForm')[0]); + var openingDate = formData.get('opening_date'); + if (openingDate) { + formData.set('opening_date', cdOpeningDateForSubmit(openingDate)); + } console.log("formData", formData); let url = ''; diff --git a/app/Views/cd_master_list.php b/app/Views/cd_master_list.php index 1314066a..1bd8dc4e 100755 --- a/app/Views/cd_master_list.php +++ b/app/Views/cd_master_list.php @@ -15,12 +15,12 @@ foreach ($CD_Master_Data as $index => $row) { $cdm_col_max_len[1] = max($cdm_col_max_len[1], mb_strlen($clientCell)); $cdm_col_max_len[2] = max($cdm_col_max_len[2], mb_strlen((string) ($row['insurer_name'] ?? ''))); $cdm_col_max_len[3] = max($cdm_col_max_len[3], mb_strlen((string) ($row['insurer_branch_name'] ?? ''))); - $od = ! empty($row['opening_date']) ? date('d-m-Y', strtotime((string) $row['opening_date'])) : ''; + $od = ! empty($row['opening_date']) ? date('d/m/Y', strtotime((string) $row['opening_date'])) : ''; $cdm_col_max_len[4] = max($cdm_col_max_len[4], mb_strlen($od)); $cdm_col_max_len[5] = max($cdm_col_max_len[5], mb_strlen((string) ($row['cd_ac_no'] ?? ''))); $cdm_col_max_len[6] = max($cdm_col_max_len[6], mb_strlen((string) ($row['opening_bal'] ?? ''))); $du = ! empty($row['created_at']) - ? (date('d-M-Y h:i A', strtotime((string) $row['created_at'])) . ' by ' . ($row['user_name'] ?? '')) + ? (date('d/m/Y h:i A', strtotime((string) $row['created_at'])) . ' by ' . ($row['user_name'] ?? '')) : ''; $cdm_col_max_len[7] = max($cdm_col_max_len[7], mb_strlen($du)); $cdm_col_max_len[8] = max($cdm_col_max_len[8], 4); @@ -118,10 +118,10 @@ $cdm_col_width_px = nhance_dt_column_widths_px($cdm_header_labels, $cdm_col_max_ ( ) - + -
by +
by