IDEMPIERE-2035 Generate Shipments is not adjusting QtyEntered. Accept patch from Alan Rodrigo Lescano.

This commit is contained in:
Heng Sin Low 2014-07-04 18:38:42 +08:00
parent 15596ee282
commit 2bcf6c577e
1 changed files with 4 additions and 0 deletions

View File

@ -525,6 +525,10 @@ public class InOutGenerate extends SvrProcess
MInOutLine line = new MInOutLine (m_shipment);
line.setOrderLine(orderLine, 0, order.isSOTrx() ? toDeliver : Env.ZERO);
line.setQty(toDeliver);
if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0)
line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered())
.divide(orderLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP));
line.setLine(m_line + orderLine.getLine());
if (!line.save())
throw new IllegalStateException("Could not create Shipment Line");