1003475 IDEMPIERE-1530 Allow Material Receipt Line with Quantity Receipt more then Purchase Order Line's Quantity Ordered. Fixed NPE when create MR line without order line.

This commit is contained in:
Heng Sin Low 2013-11-18 10:35:51 +08:00
parent d365cb1fb8
commit 6937c2dbdb
1 changed files with 9 additions and 6 deletions

View File

@ -1339,6 +1339,8 @@ public class MInOut extends X_M_InOut implements DocAction
if (!isSOTrx()) if (!isSOTrx())
{ {
if (!isReversal()) if (!isReversal())
{
if (oLine != null)
{ {
BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered()); BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered());
if (sLine.getMovementQty().compareTo(toDelivered) > 0) if (sLine.getMovementQty().compareTo(toDelivered) > 0)
@ -1349,6 +1351,7 @@ public class MInOut extends X_M_InOut implements DocAction
sLine.saveEx(); sLine.saveEx();
} }
} }
}
else else
{ {
overReceipt = sLine.getQtyOverReceipt(); overReceipt = sLine.getQtyOverReceipt();