Skip to content

Commit

Permalink
Merge branch 'development' into #9851_Fix_Report_Format_Excel_Download
Browse files Browse the repository at this point in the history
  • Loading branch information
DamithDeshan authored Dec 26, 2024
2 parents bcebc28 + 2d4f048 commit ecbc69e
Showing 1 changed file with 121 additions and 2 deletions.
123 changes: 121 additions & 2 deletions src/main/java/com/divudi/bean/common/ReportsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ public class ReportsController implements Serializable {
Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap7to1;
Map<Integer, Map<String, Map<Integer, Double>>> weeklyDailyBillItemMap1to7;


private boolean showChart;

public String getDischargedStatus() {
Expand Down Expand Up @@ -3506,7 +3507,7 @@ private void groupBills() {
bundle.setGroupedBillItemsByInstitution(billMap);
}

public Double calculateNetTotalByBills(List<Bill> bills) {
public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
Double netTotal = 0.0;

for (Bill bill : bills) {
Expand All @@ -3516,7 +3517,7 @@ public Double calculateNetTotalByBills(List<Bill> bills) {
return netTotal;
}

public Double calculateDiscountByBills(List<Bill> bills) {
public Double calculateDiscountSubTotalByBills(List<Bill> bills) {
Double discount = 0.0;

for (Bill bill : bills) {
Expand Down Expand Up @@ -3632,6 +3633,111 @@ public Double calculateDueAmountNetTotal() {
return dueAmountNetTotal;
}

public Double calculateNetAmountNetTotal() {
double netAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

netAmountNetTotal += calculateNetAmountSubTotalByBills(bills);
}

return netAmountNetTotal;
}

public Double calculateGrossAmountSubTotalByBills(List<Bill> bills) {
Double billTotal = 0.0;

for (Bill bill : bills) {
billTotal += bill.getBillTotal();
}

return billTotal;
}

public Double calculatePatientShareSubTotalByBills(List<Bill> bills) {
Double settledAmountByPatient = 0.0;

for (Bill bill : bills) {
settledAmountByPatient += bill.getSettledAmountByPatient();
}

return settledAmountByPatient;
}

public Double calculateSponsorShareSubTotalByBills(List<Bill> bills) {
Double settledAmountBySponsor = 0.0;

for (Bill bill : bills) {
settledAmountBySponsor += bill.getSettledAmountBySponsor();
}

return settledAmountBySponsor;
}

public Double calculateDueAmountSubTotalByBills(List<Bill> bills) {
Double balance = 0.0;

for (Bill bill : bills) {
balance += bill.getBalance();
}

return balance;
}

public Double calculateGrossAmountNetTotal() {
double grossAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills);
}

return grossAmountNetTotal;
}

public Double calculateDiscountNetTotal() {
double discountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

discountNetTotal += calculateDiscountSubTotalByBills(bills);
}

return discountNetTotal;
}

public Double calculatePatientShareNetTotal() {
double patientShareNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

patientShareNetTotal += calculatePatientShareSubTotalByBills(bills);
}

return patientShareNetTotal;
}

public Double calculateDueAmountNetTotal() {
double dueAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills);
}

return dueAmountNetTotal;
}

public Double calculateSponsorShareNetTotal() {
double sponsorShareNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
Expand All @@ -3644,6 +3750,19 @@ public Double calculateSponsorShareNetTotal() {

return sponsorShareNetTotal;
}

public Double calculateNetAmountNetTotal() {
double netAmountNetTotal = 0.0;
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();

for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
List<Bill> bills = entry.getValue();

netAmountNetTotal += calculateNetAmountSubTotalByBills(bills);
}

return sponsorShareNetTotal;
}

public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
Double netTotal = 0.0;
Expand Down

0 comments on commit ecbc69e

Please sign in to comment.