BUG [ 1878795 ] Invoice-Receipt over matched

This commit is contained in:
armenrz 2008-01-29 10:44:44 +00:00
parent 860b4ede1e
commit b1241e7a95
2 changed files with 8 additions and 0 deletions

View File

@ -1401,6 +1401,9 @@ public class MInOut extends X_M_InOut implements DocAction
MInvoiceLine iLine = MInvoiceLine.getOfInOutLine (sLine);
if (iLine != null && iLine.getM_Product_ID() != 0)
{
if (matchQty.compareTo(iLine.getQtyInvoiced())>0)
matchQty = iLine.getQtyInvoiced();
MMatchInv[] matches = MMatchInv.get(getCtx(),
sLine.getM_InOutLine_ID(), iLine.getC_InvoiceLine_ID(), get_TrxName());
if (matches == null || matches.length == 0)

View File

@ -1736,7 +1736,12 @@ public class MInvoice extends X_C_Invoice implements DocAction
&& line.getM_Product_ID() != 0
&& !isReversal())
{
MInOutLine receiptLine = new MInOutLine (getCtx(),line.getM_InOutLine_ID(), get_TrxName());
BigDecimal matchQty = line.getQtyInvoiced();
if (receiptLine.getMovementQty().compareTo(matchQty) < 0)
matchQty = receiptLine.getMovementQty();
MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty);
if (!inv.save(get_TrxName()))
{