Fixed: [ 1691676 ] Duplicate Allocation when you reverse invoice with PR cash
https://sourceforge.net/tracker/index.php?func=detail&aid=1691676&group_id=176962&atid=879332
This commit is contained in:
parent
a8f220dd40
commit
56575e6679
|
@ -2011,6 +2011,9 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
m_processMsg = "@PeriodClosed@";
|
m_processMsg = "@PeriodClosed@";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash))
|
||||||
|
{
|
||||||
//
|
//
|
||||||
MAllocationHdr[] allocations = MAllocationHdr.getOfInvoice(getCtx(),
|
MAllocationHdr[] allocations = MAllocationHdr.getOfInvoice(getCtx(),
|
||||||
getC_Invoice_ID(), get_TrxName());
|
getC_Invoice_ID(), get_TrxName());
|
||||||
|
@ -2020,6 +2023,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
allocations[i].reverseCorrectIt();
|
allocations[i].reverseCorrectIt();
|
||||||
allocations[i].save(get_TrxName());
|
allocations[i].save(get_TrxName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Reverse/Delete Matching
|
// Reverse/Delete Matching
|
||||||
if (!isSOTrx())
|
if (!isSOTrx())
|
||||||
{
|
{
|
||||||
|
@ -2051,6 +2055,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
}
|
}
|
||||||
reversal.setReversal(true);
|
reversal.setReversal(true);
|
||||||
|
|
||||||
|
|
||||||
// Reverse Line Qty
|
// Reverse Line Qty
|
||||||
MInvoiceLine[] rLines = reversal.getLines(false);
|
MInvoiceLine[] rLines = reversal.getLines(false);
|
||||||
for (int i = 0; i < rLines.length; i++)
|
for (int i = 0; i < rLines.length; i++)
|
||||||
|
@ -2109,6 +2114,8 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
setC_Payment_ID(0);
|
setC_Payment_ID(0);
|
||||||
setIsPaid(true);
|
setIsPaid(true);
|
||||||
|
|
||||||
|
if(!getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash))
|
||||||
|
{
|
||||||
// Create Allocation
|
// Create Allocation
|
||||||
MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(),
|
MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(),
|
||||||
getC_Currency_ID(),
|
getC_Currency_ID(),
|
||||||
|
@ -2135,6 +2142,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
if (alloc.processIt(DocAction.ACTION_Complete))
|
if (alloc.processIt(DocAction.ACTION_Complete))
|
||||||
alloc.save();
|
alloc.save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// After reverseCorrect
|
// After reverseCorrect
|
||||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
if (m_processMsg != null)
|
if (m_processMsg != null)
|
||||||
|
|
Loading…
Reference in New Issue