From 52428e8db1a3206c73f8ffc7266c5b1f8a979e0e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 28 Apr 2007 07:01:33 +0000 Subject: [PATCH] Revert revision 2156 Not Fixed Yet: [ 1691676 ] Duplicate Allocation when you reverse invoice with PR cash Explanations on tracker http://sourceforge.net/tracker/index.php?func=detail&aid=1691676&group_id=176962&atid=879332 --- base/src/org/compiere/model/MInvoice.java | 24 ++++++++--------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/base/src/org/compiere/model/MInvoice.java b/base/src/org/compiere/model/MInvoice.java index 6033e6685f..7cbcef6b48 100644 --- a/base/src/org/compiere/model/MInvoice.java +++ b/base/src/org/compiere/model/MInvoice.java @@ -2011,18 +2011,14 @@ public class MInvoice extends X_C_Invoice implements DocAction m_processMsg = "@PeriodClosed@"; return false; } - - if(!getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) - { - // - MAllocationHdr[] allocations = MAllocationHdr.getOfInvoice(getCtx(), - getC_Invoice_ID(), get_TrxName()); - for (int i = 0; i < allocations.length; i++) - { - allocations[i].setDocAction(DocAction.ACTION_Reverse_Correct); - allocations[i].reverseCorrectIt(); - allocations[i].save(get_TrxName()); - } + // + MAllocationHdr[] allocations = MAllocationHdr.getOfInvoice(getCtx(), + getC_Invoice_ID(), get_TrxName()); + for (int i = 0; i < allocations.length; i++) + { + allocations[i].setDocAction(DocAction.ACTION_Reverse_Correct); + allocations[i].reverseCorrectIt(); + allocations[i].save(get_TrxName()); } // Reverse/Delete Matching if (!isSOTrx()) @@ -2054,7 +2050,6 @@ public class MInvoice extends X_C_Invoice implements DocAction return false; } reversal.setReversal(true); - // Reverse Line Qty MInvoiceLine[] rLines = reversal.getLines(false); @@ -2114,8 +2109,6 @@ public class MInvoice extends X_C_Invoice implements DocAction setC_Payment_ID(0); setIsPaid(true); - if(!getPaymentRule().equals(MInvoice.PAYMENTRULE_Cash)) - { // Create Allocation MAllocationHdr alloc = new MAllocationHdr(getCtx(), false, getDateAcct(), getC_Currency_ID(), @@ -2142,7 +2135,6 @@ public class MInvoice extends X_C_Invoice implements DocAction if (alloc.processIt(DocAction.ACTION_Complete)) alloc.save(); } - } // After reverseCorrect m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); if (m_processMsg != null)