diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 19219b81..bbd52f5f 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -783,19 +783,11 @@ class ClientController extends AdminController ] ], - // 'cd_ac_no' => [ - // 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/_\\-]+$/]', - // 'errors' => [ - // 'required' => 'Account number is required', - // 'regex_match' => 'Account number can only contain letters, numbers, slashes (/), underscores (_), and hyphens (-)', - // ] - // ], - 'cd_ac_no' => [ - 'rules' => 'required|numeric', + 'rules' => 'required|regex_match[/^[a-zA-Z0-9\/\-_]+$/]', 'errors' => [ - 'required' => 'CD Account number is required.', - 'numeric' => 'CD Account number must contain only numbers.', + 'required' => 'CD Account number is required.', + 'regex_match' => 'CD Account number can only contain letters, numbers, hyphens(-), underscores(_), and slashes(/).', ] ], diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index e4a04375..fae64f2d 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -336,9 +336,9 @@ class EmployeeController extends AdminController //endof validation process if (isset($result['error_summary']) && count($result['error_summary'])) { if(!empty($post_data)){ - return ['status' => false, 'message' => 'file rejected with errors', 'file_id' => $file_id]; + return ['status' => false, 'message' => 'File rejected with errors', 'file_id' => $file_id]; }else{ - return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'file rejected with errors'], 200); + return $this->respond(['dataStatus' => false, 'code' => 404, 'message' => 'File rejected with errors'], 200); } } } else //if file size greater than 1 add the file as job diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index fe7872f7..8c6d875d 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -3,6 +3,7 @@ namespace App\Models; use CodeIgniter\Model; + use Kint; class PolicyTransactionModel extends Model { @@ -3168,9 +3169,10 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(pcsd.pt_policy_issue_date, '%b %Y') AS policy_issue_month, - pt.month as statement_month, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%b %Y') AS statement_year_month, + pcsd.pt_policy_issue_date as statement_month, 'no statement uploaded' AS statement_uploaded, @@ -3331,8 +3333,9 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(IF(insq.month IS NULL, pcsd.pt_policy_issue_date, insq.month),'%b %Y') AS policy_issue_month, + DATE_FORMAT(insq.month, '%b %Y') AS statement_year_month, insq.month as statement_month, 'statement uploaded' AS statement_uploaded, @@ -3392,7 +3395,7 @@ (pcsd.agreed_tp_per + pcsd.agreed_tep_per) AS agreed_tp_or_ter_per, CASE - WHEN insq.month = pt.month THEN pcsd.exp_amt + WHEN DATE_FORMAT(insq.month, '%Y-%m') = DATE_FORMAT(pcsd.pt_policy_issue_date, '%Y-%m') THEN pcsd.exp_amt ELSE 0 END AS total_irda_amt_2, @@ -3521,8 +3524,9 @@ pt.installment, nhance_branch.branch_name as nhance_branch, - DATE_FORMAT(pt.policy_issue_date, '%d %b %Y') AS policy_issue_date, + DATE_FORMAT(pcsd.pt_policy_issue_date, '%d %b %Y') AS policy_issue_date, DATE_FORMAT(IF(insq.month IS NULL, pcsd.pt_policy_issue_date, insq.month),'%b %Y') AS policy_issue_month, + DATE_FORMAT(insq.month, '%b %Y') AS statement_year_month, insq.month as statement_month, 'statement uploaded' AS statement_uploaded, @@ -3704,7 +3708,7 @@ // $countofalldata = count($result); - // dd($result); + // Kint::dump($result); // dd($this->db->getLastQuery()->getQuery()); $keys = []; @@ -3732,7 +3736,7 @@ // ✅ Stable key (NO reward flag) $key = implode('|', [ - $row['statement_month'], + $row['statement_year_month'], $row['insurer_name'], $row['policy_no'], $endorsement_number, @@ -3753,7 +3757,7 @@ // Reindex final output $result = array_values($filtered); - // dd($countofalldata, $result); + // dd($result); // -------------------------------------------------------------------------------------------------------- @@ -3776,7 +3780,7 @@ } } - // dd($totalIrdaMap); + // dd($totalBilled, $totalIrdaMap); $ptSeen = []; $final = []; @@ -3785,8 +3789,10 @@ $ptId = $row['pt_id'].'-'.$row['insurer_id']; if (!isset($ptSeen[$ptId])) { // First entry → set unbilled amount - $row['unbilled_amount'] = (float) (($totalIrdaMap[$ptId] ?? 0) - ($totalBilled[$ptId] ?? 0)) ?? '0.00'; - + $row['unbilled_amount'] = round( + (float) (($totalIrdaMap[$ptId] ?? 0) - ($totalBilled[$ptId] ?? 0)), + 2 + ); $ptSeen[$ptId] = true; } else { // Other entries → zero diff --git a/app/Views/client_basic_info.php b/app/Views/client_basic_info.php index 055a0e33..a8de6ec7 100755 --- a/app/Views/client_basic_info.php +++ b/app/Views/client_basic_info.php @@ -287,6 +287,8 @@ input:checked + .slider:before { var message = (PrimaryKey === '') ? 'Client General Info Created successfully' : 'Client General Info Updated successfully'; toastr.success(message, 'Success'); $submitButton.prop('disabled', false); + let client_name = res.data.client_name ? (' - ' + res.data.client_name) : ''; + $('#client_heading').text(client_name); }, 1000); } diff --git a/app/Views/client_onboarding.php b/app/Views/client_onboarding.php index d8d5eb68..c63e00a6 100755 --- a/app/Views/client_onboarding.php +++ b/app/Views/client_onboarding.php @@ -273,9 +273,9 @@