From 24d25a2bc5989d3842370366a18d0f1dadccbea1 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 1 Mar 2007 14:55:30 +0000 Subject: [PATCH] * [ 1643987 ] Generation of shipment should be done in atomic transaction --- base/src/org/compiere/process/InOutGenerate.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/base/src/org/compiere/process/InOutGenerate.java b/base/src/org/compiere/process/InOutGenerate.java index 0c59673796..ef53d37964 100644 --- a/base/src/org/compiere/process/InOutGenerate.java +++ b/base/src/org/compiere/process/InOutGenerate.java @@ -128,8 +128,10 @@ public class InOutGenerate extends SvrProcess if (p_Selection) // VInOutGen { - m_sql = "SELECT * FROM C_Order " - + "WHERE IsSelected='Y' AND DocStatus='CO' AND IsSOTrx='Y' AND AD_Client_ID=?"; + m_sql = "SELECT C_Order.* FROM C_Order, T_Selection " + + "WHERE C_Order.DocStatus='CO' AND C_Order.IsSOTrx='Y' AND C_Order.AD_Client_ID=? " + + "AND C_Order.C_Order_ID = T_Selection.T_Selection_ID " + + "AND T_Selection.AD_PInstance_ID=? "; } else { @@ -160,7 +162,10 @@ public class InOutGenerate extends SvrProcess pstmt = DB.prepareStatement (m_sql, get_TrxName()); int index = 1; if (p_Selection) + { pstmt.setInt(index++, Env.getAD_Client_ID(getCtx())); + pstmt.setInt(index++, getAD_PInstance_ID()); + } else { pstmt.setInt(index++, p_M_Warehouse_ID); @@ -191,6 +196,7 @@ public class InOutGenerate extends SvrProcess while (rs.next ()) // Order { MOrder order = new MOrder (getCtx(), rs, get_TrxName()); + System.out.println("Shipment for: " + order.getDocumentNo()); // New Header different Shipper, Shipment Location if (!p_ConsolidateDocument || (m_shipment != null