From 4590bc45b869d09a07162b7b954fa1379a942d54 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 25 Oct 2025 17:15:15 +0530 Subject: [PATCH] New Report BDS CHanges-2 - VADIVEL J 2025-10-25 --- app/Views/report_bds.php | 109 ++++++++++++++++++++++++++++++++++----- 1 file changed, 95 insertions(+), 14 deletions(-) diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index 446f2ada..ff3eba14 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -113,8 +113,91 @@ table.dataTable tbody td { - - $row){ ?> + + + + + $row){ + + $policy_no = $row['policy_no']; + + $policy_updated_month = $row['policy_issue_month']; + + $policy_type = $row['policy_type']; + + $statement_status = $row['statement_uploaded']; + + $client_name = $row['client_name']; + + $insurer_branch_name = $row['insurer_branch_name']; + + + + $uniqueRecord = "$policy_no-$policy_updated_month-$policy_type-$client_name-$insurer_branch_name" ; + + // irrespective of months or multiple months + $uniqueAgreedAmountPerInsurer = "$policy_no-$policy_type-$client_name-$insurer_branch_name" ; + + + + if(isset($uniquePoliciesReport[$uniqueRecord]) && $statement_status == "no statement uploaded" ){ + continue ; + } + else if(isset($uniquePoliciesReport[$uniqueRecord]) && $statement_status == "statement uploaded" ){ + unset($uniquePoliciesReport[$uniqueRecord]); + }else{ + + if(isset($uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]) ){ + $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer] -= $row['billed_amt']; + $row['total_irda_amt'] = 0; + $row['outstanding_amt'] = $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]; + $row['multiple_months'] = true; + } + else{ + $row['outstanding_amt'] = $row['total_irda_amt'] - $row['billed_amt']; + $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer] = $row['total_irda_amt'] ; + $row['multiple_months'] = false; + } + + + + $uniquePoliciesReport[$uniqueRecord] = $row; + } + + + + + + + } + + + + + + + $report_list = array_values($uniquePoliciesReport); + + ?> + + + + $row){ + + ?>   " class="mdi mdi-pencil" > - + + @@ -149,17 +233,13 @@ table.dataTable tbody td {  %  % - - - - + + + + - - - + + @@ -394,7 +474,8 @@ $(document).ready(function() { $(sheet).find('sheetData').append(totalRow); }, exportOptions: { - orthogonal: 'sort' + orthogonal: 'sort' , + columns: ':not(:eq(3))' // skip the same 4th column }, customizeData: function (data) { for (var i = 0; i < data.body.length; i++) {