.getPayedAmount(), calculateAmountToPay, event.getDescriptionForEntryType(getEntryType()), calculateAmountToPay));
}
@Override
protected Money doCalculationForAmountToPay(final Event event, final DateTime when, boolean applyDiscount) {
final EquivalencePlanRequestEvent planRequest = (EquivalencePlanRequestEvent) event;
Money amountToPay = getAmountPerUnit();
if (planRequest.getNumberOfEquivalences() != null && planRequest.getNumberOfEquivalences().intValue() != 0) {
amountToPay = amountToPay.multiply(planRequest.getNumberOfEquivalences().intValue());
}
if (getMaximumAmount().greaterThan(Money.ZERO)) {
if (amountToPay.greaterThan(getMaximumAmount())) {
amountToPay = getMaximumAmount();