From 3c456c93ff050bace0d493e50d14d727e1619b7d Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Sat, 23 Jan 2010 21:00:48 +0000 Subject: [PATCH] merge from 11305 revision FR 1948157 - Is necessary the reference for document reverse - fix the reversal_ID before preparing as it's needed to know the reversal_ID in model validators - change isReversal to public in MInOut Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=1948157 --- base/src/org/compiere/model/MInOut.java | 12 ++++++------ base/src/org/compiere/model/MInvoice.java | 7 ++++--- base/src/org/compiere/model/MJournalBatch.java | 2 +- base/src/org/compiere/model/MPayment.java | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/base/src/org/compiere/model/MInOut.java b/base/src/org/compiere/model/MInOut.java index 388553d43d..63a298b694 100644 --- a/base/src/org/compiere/model/MInOut.java +++ b/base/src/org/compiere/model/MInOut.java @@ -54,8 +54,7 @@ public class MInOut extends X_M_InOut implements DocAction /** * */ - private static final long serialVersionUID = 1925611141368881643L; - + private static final long serialVersionUID = 727186799622809208L; /** * Create Shipment From Order @@ -760,7 +759,7 @@ public class MInOut extends X_M_InOut implements DocAction * Is Reversal * @return reversal */ - private boolean isReversal() + public boolean isReversal() { return m_reversal; } // isReversal @@ -2025,6 +2024,9 @@ public class MInOut extends X_M_InOut implements DocAction // Set M_RMA_ID reversal.setM_RMA_ID(getM_RMA_ID()); reversal.addDescription("{->" + getDocumentNo() + ")"); + //FR1948157 + reversal.setReversal_ID(getM_InOut_ID()); + reversal.saveEx(get_TrxName()); // if (!reversal.processIt(DocAction.ACTION_Complete) || !reversal.getDocStatus().equals(DocAction.STATUS_Completed)) @@ -2033,12 +2035,10 @@ public class MInOut extends X_M_InOut implements DocAction return false; } reversal.closeIt(); - //FR1948157 - reversal.setReversal_ID(getM_InOut_ID()); reversal.setProcessing (false); reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); - reversal.save(get_TrxName()); + reversal.saveEx(get_TrxName()); // addDescription("(" + reversal.getDocumentNo() + "<-)"); diff --git a/base/src/org/compiere/model/MInvoice.java b/base/src/org/compiere/model/MInvoice.java index 277cba352a..29b1393375 100644 --- a/base/src/org/compiere/model/MInvoice.java +++ b/base/src/org/compiere/model/MInvoice.java @@ -2114,6 +2114,9 @@ public class MInvoice extends X_C_Invoice implements DocAction } reversal.setC_Order_ID(getC_Order_ID()); reversal.addDescription("{->" + getDocumentNo() + ")"); + //FR1948157 + reversal.setReversal_ID(getC_Invoice_ID()); + reversal.saveEx(get_TrxName()); // if (!reversal.processIt(DocAction.ACTION_Complete)) { @@ -2121,14 +2124,12 @@ public class MInvoice extends X_C_Invoice implements DocAction return false; } reversal.setC_Payment_ID(0); - //FR1948157 - reversal.setReversal_ID(getC_Invoice_ID()); reversal.setIsPaid(true); reversal.closeIt(); reversal.setProcessing (false); reversal.setDocStatus(DOCSTATUS_Reversed); reversal.setDocAction(DOCACTION_None); - reversal.save(get_TrxName()); + reversal.saveEx(get_TrxName()); m_processMsg = reversal.getDocumentNo(); // addDescription("(" + reversal.getDocumentNo() + "<-)"); diff --git a/base/src/org/compiere/model/MJournalBatch.java b/base/src/org/compiere/model/MJournalBatch.java index 697bd36919..e4cbc56ce3 100644 --- a/base/src/org/compiere/model/MJournalBatch.java +++ b/base/src/org/compiere/model/MJournalBatch.java @@ -641,7 +641,7 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction reverse.setDescription(description); //[ 1948157 ] reverse.setReversal_ID(getGL_JournalBatch_ID()); - reverse.save(); + reverse.saveEx(); // // Reverse Journals diff --git a/base/src/org/compiere/model/MPayment.java b/base/src/org/compiere/model/MPayment.java index 3a22bb224c..9745df4f2a 100644 --- a/base/src/org/compiere/model/MPayment.java +++ b/base/src/org/compiere/model/MPayment.java @@ -2372,7 +2372,7 @@ public final class MPayment extends X_C_Payment reversal.addDescription("{->" + getDocumentNo() + ")"); //FR [ 1948157 ] reversal.setReversal_ID(getC_Payment_ID()); - reversal.save(get_TrxName()); + reversal.saveEx(get_TrxName()); // Post Reversal if (!reversal.processIt(DocAction.ACTION_Complete)) {