* [ 1643987 ] Generation of shipment should be done in atomic transaction

This commit is contained in:
Heng Sin Low 2007-03-01 14:55:30 +00:00
parent d87604830e
commit 24d25a2bc5
1 changed files with 8 additions and 2 deletions

View File

@ -128,8 +128,10 @@ public class InOutGenerate extends SvrProcess
if (p_Selection) // VInOutGen if (p_Selection) // VInOutGen
{ {
m_sql = "SELECT * FROM C_Order " m_sql = "SELECT C_Order.* FROM C_Order, T_Selection "
+ "WHERE IsSelected='Y' AND DocStatus='CO' AND IsSOTrx='Y' AND AD_Client_ID=?"; + "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 else
{ {
@ -160,7 +162,10 @@ public class InOutGenerate extends SvrProcess
pstmt = DB.prepareStatement (m_sql, get_TrxName()); pstmt = DB.prepareStatement (m_sql, get_TrxName());
int index = 1; int index = 1;
if (p_Selection) if (p_Selection)
{
pstmt.setInt(index++, Env.getAD_Client_ID(getCtx())); pstmt.setInt(index++, Env.getAD_Client_ID(getCtx()));
pstmt.setInt(index++, getAD_PInstance_ID());
}
else else
{ {
pstmt.setInt(index++, p_M_Warehouse_ID); pstmt.setInt(index++, p_M_Warehouse_ID);
@ -191,6 +196,7 @@ public class InOutGenerate extends SvrProcess
while (rs.next ()) // Order while (rs.next ()) // Order
{ {
MOrder order = new MOrder (getCtx(), rs, get_TrxName()); MOrder order = new MOrder (getCtx(), rs, get_TrxName());
System.out.println("Shipment for: " + order.getDocumentNo());
// New Header different Shipper, Shipment Location // New Header different Shipper, Shipment Location
if (!p_ConsolidateDocument if (!p_ConsolidateDocument
|| (m_shipment != null || (m_shipment != null