From 355ea6055c757d47d8c02063b3184721d1cecdd3 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 31 Dec 2013 12:46:26 +0800 Subject: [PATCH] IDEMPIERE-1607 1003649 Payment menu - unable to over-allocate payment amounts to invoices. --- org.adempiere.base/src/org/compiere/model/MPayment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 96447ccfb5..6e3b6e03f0 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -1623,8 +1623,14 @@ public final class MPayment extends X_C_Payment if (pAllocs.length > 0) { for (MPaymentAllocate pAlloc : pAllocs) sumPaymentAllocates = sumPaymentAllocates.add(pAlloc.getAmount()); - if (getPayAmt().compareTo(sumPaymentAllocates) != 0) + if (getPayAmt().compareTo(sumPaymentAllocates) != 0) { + if (isReceipt() && getPayAmt().compareTo(sumPaymentAllocates) < 0) { + if (MSysConfig.getBooleanValue("ALLOW_OVER_APPLIED_PAYMENT", false, Env.getAD_Client_ID(Env.getCtx()))) { + return true; + } + } return false; + } } return true; }