Skip to content

Commit

Permalink
#29 show the applied discount when its value is not zero, instead of …
Browse files Browse the repository at this point in the history
…using the final price as the condition
  • Loading branch information
syjer committed Jan 13, 2015
1 parent 89e1c99 commit 880d84f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/alfio/manager/TicketReservationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ public OrderSummary orderSummaryForReservationId(String reservationId, Event eve

Optional<PromoCodeDiscount> promoCodeDiscount = Optional.ofNullable(reservation.getPromoCodeDiscountId()).map(promoCodeDiscountRepository::findById);

//add the discount summary row
if(!free) {
//add the discount summary row only if it has an effect
if(reservationCost.getDiscount() != 0) {
promoCodeDiscount.ifPresent((promo) -> {
String formattedSingleAmount = "-" + (promo.getDiscountType() == DiscountType.FIXED_AMOUNT ? formatCents(promo.getDiscountAmount()) : (promo.getDiscountAmount()+"%"));
summary.add(new SummaryRow(promo.getPromoCode(),
Expand Down

0 comments on commit 880d84f

Please sign in to comment.