From 686131b0f79fff1abee87e45a8e050b70d5fe073 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 6 May 2015 16:39:02 -0500 Subject: [PATCH] IDEMPIERE-1770 Allowing manual entry from Attributes tab on shipment/MR line - fix issue not allowing negative shipments --- org.adempiere.base/src/org/compiere/model/MInOut.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 705e327516..453297e100 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1328,9 +1328,9 @@ public class MInOut extends X_M_InOut implements DocAction { BigDecimal movementQty = sLine.getMovementQty(); BigDecimal qtyOnLineMA = MInOutLineMA.getManualQty(sLine.getM_InOutLine_ID(), get_TrxName()); - - if(qtyOnLineMA.compareTo(movementQty)>0) - { + + if ( (movementQty.signum() != 0 && qtyOnLineMA.signum() != 0 && movementQty.signum() != qtyOnLineMA.signum()) // must have same sign + || (qtyOnLineMA.abs().compareTo(movementQty.abs())>0)) { // compare absolute values // More then line qty on attribute tab for line 10 m_processMsg = "@Over_Qty_On_Attribute_Tab@ " + sLine.getLine(); return DOCSTATUS_Invalid;