if (paymentApplyAvailable.compareTo(ZERO) == 0) {
newPaymentApplyAvailable = paymentApplyAvailable.add(paymentApplication.getBigDecimal("amountApplied")).subtract(amountApplied).setScale(DECIMALS, ROUNDING);
} else {
newPaymentApplyAvailable = paymentApplyAvailable.add(paymentApplyAvailable).subtract(amountApplied).setScale(DECIMALS, ROUNDING);
}
if (newPaymentApplyAvailable.compareTo(ZERO) < 0) {
errorMessageList.add(UtilProperties.getMessage(resource,
"AccountingPaymentNotEnough",
UtilMisc.<String, Object>toMap("paymentId", paymentId,
"paymentApplyAvailable", paymentApplyAvailable.add(paymentApplication.getBigDecimal("amountApplied")),
"amountApplied", amountApplied), locale));