Commit d1bc403b authored by prane's avatar prane

postorderprocess updated for club order issue

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@173504 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f2c8bcd4
...@@ -738,47 +738,98 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -738,47 +738,98 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
//Added by Pavan R on 14/NOV/17 Start for club order issue
sql = " select count(1) from sorditem b " ; if(clubOrder != null && clubOrder.equalsIgnoreCase("Y"))
sql = sql + " where b.site_code = ? " ;
if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))
{ {
sql = sql + " and cust_code__dlv = '"+fromCustCode+"' "; sql = " select count(1) from sorder a, sorditem b " ;
} sql = sql + " where a.sale_order = b.sale_order and b.site_code = ? " ;
else if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))//custCode
{ {
sql = sql + " and cust_code__dlv >= '"+fromCustCode+"' and cust_code__dlv <= '"+toCustCode+"' " ; sql = sql + " and b.cust_code__dlv = '"+fromCustCode+"' ";
} }
sql = sql +" and b.due_date >= ? " ; else
sql = sql +" and b.due_date <= ? " ; {
sql = sql +" and b.sale_order >= ? " ; sql = sql + " and b.cust_code__dlv >= '"+fromCustCode+"' and b.cust_code__dlv <= '"+toCustCode+"' " ;
sql = sql +" and b.sale_order <= ? " ; }
sql = sql +" and (case when b.qty_alloc is null then 0 else b.qty_alloc end) > 0 " ; sql = sql +" and a.cust_code__bil = ? " ;
sql = sql +" and b.due_date >= ? " ;
sql = sql +" and b.due_date <= ? " ;
sql = sql +" and b.sale_order >= ? " ;
sql = sql +" and b.sale_order <= ? " ;
sql = sql +" and (case when b.qty_alloc is null then 0 else b.qty_alloc end) > 0 " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeShip);
pstmt.setTimestamp(2, fromDate); pstmt.setString(1, custCode);
pstmt.setTimestamp(3, toDate); pstmt.setString(2, siteCodeShip);
if(clubOrder != null && clubOrder.equalsIgnoreCase("Y") ) pstmt.setTimestamp(3, fromDate);
{ pstmt.setTimestamp(4, toDate);
pstmt.setString(4, fromSaleOrder); if(clubOrder != null && clubOrder.equalsIgnoreCase("Y") )
pstmt.setString(5, toSaleOrder); {
pstmt.setString(4, fromSaleOrder);
pstmt.setString(5, toSaleOrder);
}
else
{
pstmt.setString(4, SaleOrder);
pstmt.setString(5, SaleOrder);
}
rs = pstmt.executeQuery();
if(rs.next())
{
sordItemAllocCnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
else else
{ {
pstmt.setString(4, SaleOrder); sql = " select count(1) from sorditem b " ;
pstmt.setString(5, SaleOrder); sql = sql + " where b.site_code = ? " ;
} if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))
rs = pstmt.executeQuery(); {
if(rs.next()) sql = sql + " and cust_code__dlv = '"+fromCustCode+"' ";
{ }
sordItemAllocCnt = rs.getInt(1); else
{
sql = sql + " and cust_code__dlv >= '"+fromCustCode+"' and cust_code__dlv <= '"+toCustCode+"' " ;
}
sql = sql +" and b.due_date >= ? " ;
sql = sql +" and b.due_date <= ? " ;
sql = sql +" and b.sale_order >= ? " ;
sql = sql +" and b.sale_order <= ? " ;
sql = sql +" and (case when b.qty_alloc is null then 0 else b.qty_alloc end) > 0 " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCodeShip);
pstmt.setTimestamp(2, fromDate);
pstmt.setTimestamp(3, toDate);
if(clubOrder != null && clubOrder.equalsIgnoreCase("Y") )
{
pstmt.setString(4, fromSaleOrder);
pstmt.setString(5, toSaleOrder);
}
else
{
pstmt.setString(4, SaleOrder);
pstmt.setString(5, SaleOrder);
}
rs = pstmt.executeQuery();
if(rs.next())
{
sordItemAllocCnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
rs.close(); //Added End by Pavan R on 14/NOV/17 for club order issue
rs = null;
pstmt.close();
pstmt = null;
/*System.out.println("sordItemAllocCnt :"+sordItemAllocCnt); /*System.out.println("sordItemAllocCnt :"+sordItemAllocCnt);
System.out.println("clubOrder :"+clubOrder);*/ System.out.println("clubOrder :"+clubOrder);*/
if( sordItemAllocCnt == 0 ) if( sordItemAllocCnt == 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment