1003599 Payment Allocation: Allow user to enter applied amount that's more than the payment's open amount.

This commit is contained in:
Heng Sin Low 2013-12-05 10:30:46 +08:00
parent 853b3e9da8
commit 1a33572fa9
1 changed files with 4 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.compiere.model.MAllocationLine;
import org.compiere.model.MInvoice; import org.compiere.model.MInvoice;
import org.compiere.model.MPayment; import org.compiere.model.MPayment;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.model.MSysConfig;
import org.compiere.process.DocAction; import org.compiere.process.DocAction;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -422,8 +423,9 @@ public class Allocation
{ {
if ( applied.signum() == -open.signum() ) if ( applied.signum() == -open.signum() )
applied = applied.negate(); applied = applied.negate();
if ( open.abs().compareTo( applied.abs() ) < 0 ) if (! MSysConfig.getBooleanValue("ALLOW_OVER_APPLIED_PAYMENT", false, Env.getAD_Client_ID(Env.getCtx())))
applied = open; if ( open.abs().compareTo( applied.abs() ) < 0 )
applied = open;
} }
payment.setValueAt(applied, row, i_payment); payment.setValueAt(applied, row, i_payment);