IDEMPIERE-2997 - AR Credit Memo updates Sales Order Line QtyInvoiced in the wrong direction.

This commit is contained in:
dantam 2016-01-07 18:53:15 +01:00
parent 077a2c07a4
commit ddc6b7ccc3
1 changed files with 3 additions and 2 deletions

View File

@ -1854,8 +1854,9 @@ public class MInvoice extends X_C_Invoice implements DocAction
|| line.getM_Product_ID() == 0) || line.getM_Product_ID() == 0)
{ {
ol = new MOrderLine (getCtx(), line.getC_OrderLine_ID(), get_TrxName()); ol = new MOrderLine (getCtx(), line.getC_OrderLine_ID(), get_TrxName());
if (line.getQtyInvoiced() != null) if (line.getQtyInvoiced() != null) {
ol.setQtyInvoiced(ol.getQtyInvoiced().add(line.getQtyInvoiced())); ol.setQtyInvoiced(ol.getQtyInvoiced().add(isCreditMemo() ? line.getQtyInvoiced().negate() : line.getQtyInvoiced()));
}
if (!ol.save(get_TrxName())) if (!ol.save(get_TrxName()))
{ {
m_processMsg = "Could not update Order Line"; m_processMsg = "Could not update Order Line";