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

@ -1340,13 +1340,16 @@ public class MInOut extends X_M_InOut implements DocAction
{ {
if (!isReversal()) if (!isReversal())
{ {
BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered()); if (oLine != null)
if (sLine.getMovementQty().compareTo(toDelivered) > 0)
overReceipt = sLine.getMovementQty().subtract(toDelivered);
if (overReceipt.signum() != 0)
{ {
sLine.setQtyOverReceipt(overReceipt); BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered());
sLine.saveEx(); if (sLine.getMovementQty().compareTo(toDelivered) > 0)
overReceipt = sLine.getMovementQty().subtract(toDelivered);
if (overReceipt.signum() != 0)
{
sLine.setQtyOverReceipt(overReceipt);
sLine.saveEx();
}
} }
} }
else else