diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index d58d7fceca..d8d30a840f 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -335,6 +335,7 @@ public class ReportsController implements Serializable { Map>> weeklyDailyBillItemMap7to1; Map>> weeklyDailyBillItemMap1to7; + private boolean showChart; public String getDischargedStatus() { @@ -3506,7 +3507,7 @@ private void groupBills() { bundle.setGroupedBillItemsByInstitution(billMap); } - public Double calculateNetTotalByBills(List bills) { + public Double calculateNetAmountSubTotalByBills(List bills) { Double netTotal = 0.0; for (Bill bill : bills) { @@ -3516,7 +3517,7 @@ public Double calculateNetTotalByBills(List bills) { return netTotal; } - public Double calculateDiscountByBills(List bills) { + public Double calculateDiscountSubTotalByBills(List bills) { Double discount = 0.0; for (Bill bill : bills) { @@ -3632,6 +3633,111 @@ public Double calculateDueAmountNetTotal() { return dueAmountNetTotal; } + public Double calculateNetAmountNetTotal() { + double netAmountNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + netAmountNetTotal += calculateNetAmountSubTotalByBills(bills); + } + + return netAmountNetTotal; + } + + public Double calculateGrossAmountSubTotalByBills(List bills) { + Double billTotal = 0.0; + + for (Bill bill : bills) { + billTotal += bill.getBillTotal(); + } + + return billTotal; + } + + public Double calculatePatientShareSubTotalByBills(List bills) { + Double settledAmountByPatient = 0.0; + + for (Bill bill : bills) { + settledAmountByPatient += bill.getSettledAmountByPatient(); + } + + return settledAmountByPatient; + } + + public Double calculateSponsorShareSubTotalByBills(List bills) { + Double settledAmountBySponsor = 0.0; + + for (Bill bill : bills) { + settledAmountBySponsor += bill.getSettledAmountBySponsor(); + } + + return settledAmountBySponsor; + } + + public Double calculateDueAmountSubTotalByBills(List bills) { + Double balance = 0.0; + + for (Bill bill : bills) { + balance += bill.getBalance(); + } + + return balance; + } + + public Double calculateGrossAmountNetTotal() { + double grossAmountNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills); + } + + return grossAmountNetTotal; + } + + public Double calculateDiscountNetTotal() { + double discountNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + discountNetTotal += calculateDiscountSubTotalByBills(bills); + } + + return discountNetTotal; + } + + public Double calculatePatientShareNetTotal() { + double patientShareNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + patientShareNetTotal += calculatePatientShareSubTotalByBills(bills); + } + + return patientShareNetTotal; + } + + public Double calculateDueAmountNetTotal() { + double dueAmountNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills); + } + + return dueAmountNetTotal; + } + public Double calculateSponsorShareNetTotal() { double sponsorShareNetTotal = 0.0; Map> billMap = bundle.getGroupedBillItemsByInstitution(); @@ -3644,6 +3750,19 @@ public Double calculateSponsorShareNetTotal() { return sponsorShareNetTotal; } + + public Double calculateNetAmountNetTotal() { + double netAmountNetTotal = 0.0; + Map> billMap = bundle.getGroupedBillItemsByInstitution(); + + for (Map.Entry> entry : billMap.entrySet()) { + List bills = entry.getValue(); + + netAmountNetTotal += calculateNetAmountSubTotalByBills(bills); + } + + return sponsorShareNetTotal; + } public Double calculateNetAmountSubTotalByBills(List bills) { Double netTotal = 0.0;