fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From my...@apache.org
Subject [fineract-cn-cheques] 02/18: ignore proportional charges while issuing cheques
Date Mon, 22 Jan 2018 15:27:44 GMT
This is an automated email from the ASF dual-hosted git repository.

myrle pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract-cn-cheques.git

commit d574660536e02aba76dced6399109d6eda7fb104
Author: mgeiss <mgeiss@mifos.org>
AuthorDate: Mon Aug 21 16:39:03 2017 +0200

    ignore proportional charges while issuing cheques
---
 .../service/internal/service/helper/AccountingService.java       | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
index 238e3c4..95ef589 100644
--- a/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
+++ b/service/src/main/java/io/mifos/cheque/service/internal/service/helper/AccountingService.java
@@ -54,7 +54,14 @@ public class AccountingService {
 
   public void bookCharges(final String sourceAccount, final List<Charge> charges) {
 
-    final Double totalCharges = charges.stream().mapToDouble(Charge::getAmount).sum();
+    final Double totalCharges = charges.stream().mapToDouble(charge -> {
+      if (charge.getProportional()) {
+        this.logger.info("Charges for issuing cheques must be fixed.");
+        return 0.00D;
+      } else {
+        return charge.getAmount();
+      }
+    }).sum();
     if (totalCharges == 0.00D) {
       return;
     }

-- 
To stop receiving notification emails like this one, please contact
myrle@apache.org.

Mime
View raw message