@Override
 public String getAmountToPay() {
   return installment
       .calculateAmount(
           event,
           installment.getStartDate().toLocalDate().toDateTimeAtStartOfDay(),
           BigDecimal.ZERO,
           event.getGratuityPaymentPlan().isToApplyPenalty(event, this.installment))
       .toPlainString();
 }
  @Override
  public String getRemainingAmount() {
    Map<Installment, Money> calculateInstallmentRemainingAmounts =
        event
            .getGratuityPaymentPlan()
            .calculateInstallmentRemainingAmounts(
                event, new DateTime(), event.getPostingRule().getDiscountPercentage(event));

    for (Map.Entry<Installment, Money> entry : calculateInstallmentRemainingAmounts.entrySet()) {
      if (entry.getKey() == this.installment) {
        return entry.getValue().toPlainString();
      }
    }

    return Money.ZERO.toPlainString();
  }