Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
ignore proportional charges while issuing cheques
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeiss committed Aug 21, 2017
1 parent 6828d67 commit d574660
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -54,7 +54,14 @@ public AccountingService(@Qualifier(ServiceConstants.LOGGER_NAME) final Logger l

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;
}
Expand Down

0 comments on commit d574660

Please sign in to comment.