BUG [ 1878795 ] Invoice-Receipt over matched
This commit is contained in:
parent
860b4ede1e
commit
b1241e7a95
|
@ -1401,6 +1401,9 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
MInvoiceLine iLine = MInvoiceLine.getOfInOutLine (sLine);
|
MInvoiceLine iLine = MInvoiceLine.getOfInOutLine (sLine);
|
||||||
if (iLine != null && iLine.getM_Product_ID() != 0)
|
if (iLine != null && iLine.getM_Product_ID() != 0)
|
||||||
{
|
{
|
||||||
|
if (matchQty.compareTo(iLine.getQtyInvoiced())>0)
|
||||||
|
matchQty = iLine.getQtyInvoiced();
|
||||||
|
|
||||||
MMatchInv[] matches = MMatchInv.get(getCtx(),
|
MMatchInv[] matches = MMatchInv.get(getCtx(),
|
||||||
sLine.getM_InOutLine_ID(), iLine.getC_InvoiceLine_ID(), get_TrxName());
|
sLine.getM_InOutLine_ID(), iLine.getC_InvoiceLine_ID(), get_TrxName());
|
||||||
if (matches == null || matches.length == 0)
|
if (matches == null || matches.length == 0)
|
||||||
|
|
|
@ -1736,7 +1736,12 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
&& line.getM_Product_ID() != 0
|
&& line.getM_Product_ID() != 0
|
||||||
&& !isReversal())
|
&& !isReversal())
|
||||||
{
|
{
|
||||||
|
MInOutLine receiptLine = new MInOutLine (getCtx(),line.getM_InOutLine_ID(), get_TrxName());
|
||||||
BigDecimal matchQty = line.getQtyInvoiced();
|
BigDecimal matchQty = line.getQtyInvoiced();
|
||||||
|
|
||||||
|
if (receiptLine.getMovementQty().compareTo(matchQty) < 0)
|
||||||
|
matchQty = receiptLine.getMovementQty();
|
||||||
|
|
||||||
MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty);
|
MMatchInv inv = new MMatchInv(line, getDateInvoiced(), matchQty);
|
||||||
if (!inv.save(get_TrxName()))
|
if (!inv.save(get_TrxName()))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue