return Collections.singleton(makeAccountingTransaction(user, event, fromAccount, toAccount, getEntryType(), entryDTOs
.iterator().next().getAmountToPay(), transactionDetail));
}
private void checkIfCanAddAmount(final Money amountToPay, final Event event, final DateTime whenRegistered) {
final Money totalFinalAmount = event.getPayedAmount().add(amountToPay);
if (totalFinalAmount.lessThan(calculateTotalAmountToPay(event, whenRegistered))) {
throw new DomainExceptionWithLabelFormatter(
"error.accounting.postingRules.gratuity.EquivalencePlanRequestPR.amount.being.payed.must.be.equal.to.amount.in.debt",
event.getDescriptionForEntryType(getEntryType()));
}
}