From 8378bce809b58fd2ddfd1ffb60c6859d8a2dad4f Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 31 Oct 2025 15:41:34 +0530 Subject: [PATCH] CHANGE_bds_issue-final-fix-4 - VADIVEL J 2025-10-31 15:41 --- app/Models/PolicyTransactionModel.php | 2 +- app/Views/report_bds.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Models/PolicyTransactionModel.php b/app/Models/PolicyTransactionModel.php index e988f0c3..4882bd8a 100644 --- a/app/Models/PolicyTransactionModel.php +++ b/app/Models/PolicyTransactionModel.php @@ -1851,7 +1851,7 @@ policy_transaction.ref AS ref, DATE_FORMAT(policy_transaction.policy_issue_date, '%d %b %Y') AS policy_issue_date, - DATE_FORMAT( policy_transaction.policy_issue_date,, '%b %Y') AS policy_issue_month, + DATE_FORMAT( policy_transaction.policy_issue_date, '%b %Y') AS policy_issue_month, CASE WHEN 1 = 1 THEN 'no statement uploaded' diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index a393e404..e856f82e 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -168,10 +168,14 @@ }else{ if(isset($uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]) ){ + + $pastMonth = explode("-",$uniqueRecord )[1] ; + $currentMonth = $policy_updated_month ; + $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer] -= $row['billed_amt']; - $row['total_irda_amt'] = 0; + $row['total_irda_amt'] = $pastMonth == $currentMonth ? $row['total_irda_amt'] : 0 ; $row['outstanding_amt'] = $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]; - $row['multiple_months'] = true; + $row['multiple_months'] = $pastMonth == $currentMonth ? false : true ; } else{ $row['outstanding_amt'] = $row['total_irda_amt'] - $row['billed_amt'];