Skip to content

Commit 15edab7

Browse files
authored
Merge pull request #9828 from hmislk/Issue#9820_Cash_is_not_working_for_cc_deposit
Issue#9820 cash is not working for cc deposit Closes #9820
2 parents 4f3bff6 + 882ea82 commit 15edab7

File tree

2 files changed

+9
-113
lines changed

2 files changed

+9
-113
lines changed

src/main/java/com/divudi/bean/common/ReportsController.java

Lines changed: 7 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ public void setSelectedDateType(String selectedDateType) {
391391
this.selectedDateType = selectedDateType;
392392
}
393393

394+
394395
public Investigation getInvestigation() {
395396
return investigation;
396397
}
@@ -3494,7 +3495,7 @@ private void groupBills() {
34943495
bundle.setGroupedBillItemsByInstitution(billMap);
34953496
}
34963497

3497-
public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
3498+
public Double calculateNetTotalByBills(List<Bill> bills) {
34983499
Double netTotal = 0.0;
34993500

35003501
for (Bill bill : bills) {
@@ -3504,7 +3505,7 @@ public Double calculateNetAmountSubTotalByBills(List<Bill> bills) {
35043505
return netTotal;
35053506
}
35063507

3507-
public Double calculateDiscountSubTotalByBills(List<Bill> bills) {
3508+
public Double calculateDiscountByBills(List<Bill> bills) {
35083509
Double discount = 0.0;
35093510

35103511
for (Bill bill : bills) {
@@ -3515,122 +3516,17 @@ public Double calculateDiscountSubTotalByBills(List<Bill> bills) {
35153516
}
35163517

35173518

3518-
public Double calculateNetAmountNetTotal() {
3519-
double netAmountNetTotal = 0.0;
3520-
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
3521-
3522-
for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
3523-
List<Bill> bills = entry.getValue();
3524-
3525-
netAmountNetTotal += calculateNetAmountSubTotalByBills(bills);
3526-
}
3527-
3528-
return netAmountNetTotal;
3529-
}
3530-
3531-
public Double calculateGrossAmountSubTotalByBills(List<Bill> bills) {
3532-
Double billTotal = 0.0;
3533-
3534-
for (Bill bill : bills) {
3535-
billTotal += bill.getBillTotal();
3536-
}
3537-
3538-
return billTotal;
3539-
}
3540-
3541-
public Double calculatePatientShareSubTotalByBills(List<Bill> bills) {
3542-
Double settledAmountByPatient = 0.0;
3543-
3544-
for (Bill bill : bills) {
3545-
settledAmountByPatient += bill.getSettledAmountByPatient();
3546-
}
3547-
3548-
return settledAmountByPatient;
3549-
}
3550-
3551-
public Double calculateSponsorShareSubTotalByBills(List<Bill> bills) {
3552-
Double settledAmountBySponsor = 0.0;
3553-
3554-
for (Bill bill : bills) {
3555-
settledAmountBySponsor += bill.getSettledAmountBySponsor();
3556-
}
3557-
3558-
return settledAmountBySponsor;
3559-
}
3560-
3561-
public Double calculateDueAmountSubTotalByBills(List<Bill> bills) {
3562-
Double balance = 0.0;
3563-
3564-
for (Bill bill : bills) {
3565-
balance += bill.getBalance();
3566-
}
3567-
3568-
return balance;
3569-
}
3570-
3571-
public Double calculateGrossAmountNetTotal() {
3572-
double grossAmountNetTotal = 0.0;
3573-
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
3574-
3575-
for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
3576-
List<Bill> bills = entry.getValue();
3577-
3578-
grossAmountNetTotal += calculateGrossAmountSubTotalByBills(bills);
3579-
}
3580-
3581-
return grossAmountNetTotal;
3582-
}
3583-
3584-
public Double calculateDiscountNetTotal() {
3585-
double discountNetTotal = 0.0;
3586-
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
3587-
3588-
for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
3589-
List<Bill> bills = entry.getValue();
3590-
3591-
discountNetTotal += calculateDiscountSubTotalByBills(bills);
3592-
}
3593-
3594-
return discountNetTotal;
3595-
}
3596-
3597-
public Double calculatePatientShareNetTotal() {
3598-
double patientShareNetTotal = 0.0;
3599-
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
3600-
3601-
for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
3602-
List<Bill> bills = entry.getValue();
3603-
3604-
patientShareNetTotal += calculatePatientShareSubTotalByBills(bills);
3605-
}
3606-
3607-
return patientShareNetTotal;
3608-
}
3609-
3610-
public Double calculateDueAmountNetTotal() {
3611-
double dueAmountNetTotal = 0.0;
3612-
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
3613-
3614-
for (Map.Entry<Institution, List<Bill>> entry : billMap.entrySet()) {
3615-
List<Bill> bills = entry.getValue();
3616-
3617-
dueAmountNetTotal += calculateDueAmountSubTotalByBills(bills);
3618-
}
3619-
3620-
return dueAmountNetTotal;
3621-
}
3622-
3623-
public Double calculateSponsorShareNetTotal() {
3624-
double sponsorShareNetTotal = 0.0;
3519+
public Double calculateSubTotal() {
3520+
double subTotal = 0.0;
36253521
Map<Institution, List<Bill>> billMap = bundle.getGroupedBillItemsByInstitution();
36263522

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

3630-
sponsorShareNetTotal += calculateSponsorShareSubTotalByBills(bills);
3526+
subTotal += calculateNetTotalByBills(bills);
36313527
}
36323528

3633-
return sponsorShareNetTotal;
3529+
return subTotal;
36343530
}
36353531

36363532
public void generateDiscountReport() {

src/main/java/com/divudi/service/PaymentService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ private void populatePaymentDetails(Payment payment, PaymentMethod paymentMethod
203203
break;
204204
case Cash:
205205
// payment.getBill().getNetTotal();
206-
payment.setPaidValue(paymentMethodData.getCash().getTotalValue());
207-
payment.setComments(paymentMethodData.getCash().getComment());
206+
payment.setPaidValue(payment.getBill().getNetTotal());
207+
payment.setComments(payment.getBill().getComments());
208208
break;
209209
case ewallet:
210210
payment.setPaidValue(paymentMethodData.getEwallet().getTotalValue());

0 commit comments

Comments
 (0)