diff --git a/app/Views/report_bds.php b/app/Views/report_bds.php index 2d6eba73..5a1786f4 100644 --- a/app/Views/report_bds.php +++ b/app/Views/report_bds.php @@ -1,660 +1,554 @@ - - -
- -
-
-
-
-

BDS Report

-
+ +
+
+
+
+
+

BDS Report

+ +
+
+
+ +
+ Total Premium: 0.00 +
+ +
+ Total Rewards: 0.00 +
+ +
+ Total IRDA Revenue INR: 0.00 +
+ +
+ Total Billed Amount: 0.00 +
+ +
+ Total Unbilled Amount: 0.00 +
+ +
+ Total Policy Count: +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $row){ ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S. NoUserMonthClient TypeInsured NamePolicy/
Endorsement
Policy TypeBAP GroupVehicle NumberPolicy NoEndorsement NoInsurer BranchEndorsement
Effective Date
Policy
Effective Date
Policy
Expiry Date
ReferenceRemarksBP PremiumTP/Ter PremiumPremium
(without GST)
Total PremiumBP %TP/Ter %RewardsAgreed AmountInvoiced AmountOutstanding Amount
  " class="mdi mdi-pencil" >  % %
+ +
+
+
+
+
+
+ + + -
-
-
-
-
-
+ - - + \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/report_bds_new.php b/app/Views/report_bds_new.php new file mode 100644 index 00000000..2d6eba73 --- /dev/null +++ b/app/Views/report_bds_new.php @@ -0,0 +1,660 @@ + + +
+ +
+
+
+
+

BDS Report

+
+ +
+
+
+ +
+ Total Premium: 0.00 +
+ +
+ Total Rewards: 0.00 +
+ +
+ Total IRDA Revenue INR: 0.00 +
+ +
+ Total Billed Amount: 0.00 +
+ +
+ Total Unbilled Amount: 0.00 +
+ +
+ Total Policy Count: +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $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-$statement_status" ; + + // irrespective of months or multiple months + $uniqueAgreedAmountPerInsurer = "$policy_no-$policy_type-$client_name-$insurer_branch_name" ; + + + $pastMonth = explode("-",$uniqueRecord )[1] ; + $currentMonth = $policy_updated_month ; + + $pastStatementStatus = explode("-",$uniqueRecord )[5] ; + $currentStatementStatus = $statement_status; + + if( + isset($uniquePoliciesReport[$uniqueRecord]) + && $pastStatementStatus == $currentStatementStatus + ){ + continue ; + } + else if( + isset($uniquePoliciesReport[$uniqueRecord]) + && $pastStatementStatus == $currentStatementStatus + ){ + continue; + }else{ + + if(isset($uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]) ){ + + + $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer] -= $row['billed_amt']; + $row['total_irda_amt'] = $pastMonth == $currentMonth ? $row['total_irda_amt'] : 0 ; + $row['outstanding_amt'] = $uniqueAgreedAmountList[$uniqueAgreedAmountPerInsurer]; + $row['multiple_months'] = $pastMonth == $currentMonth ? false : 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){ + + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S. NoUserMonthstatement uploadClient TypeInsured NamePolicy/
Endorsement
Policy TypeBAP GroupVehicle NumberPolicy NoEndorsement NoInsurer BranchEndorsement
Effective Date
Policy
Effective Date
Policy
Expiry Date
ReferenceRemarksBP PremiumTP/Ter PremiumPremium
(without GST)
Total PremiumBP %TP/Ter %RewardsAgreed AmountInvoiced AmountOutstanding Amount
  " class="mdi mdi-pencil" >  % %
+ +
+
+
+
+
+
+ + + + + + + \ No newline at end of file