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
}
else
{
//Added by Pavan R on 14/NOV/17 Start for club order issue
sql = " select count(1) from sorditem b " ;
sql = sql + " where b.site_code = ? " ;
if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))
if(clubOrder != null && clubOrder.equalsIgnoreCase("Y"))
{
sql = sql + " and cust_code__dlv = '"+fromCustCode+"' ";
}
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 " ;
sql = " select count(1) from sorder a, sorditem b " ;
sql = sql + " where a.sale_order = b.sale_order and b.site_code = ? " ;
if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))//custCode
{
sql = sql + " and b.cust_code__dlv = '"+fromCustCode+"' ";
}
else
{
sql = sql + " and b.cust_code__dlv >= '"+fromCustCode+"' and b.cust_code__dlv <= '"+toCustCode+"' " ;
}
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.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);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, siteCodeShip);
pstmt.setTimestamp(3, fromDate);
pstmt.setTimestamp(4, 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;
}
else
{
pstmt.setString(4, SaleOrder);
pstmt.setString(5, SaleOrder);
}
rs = pstmt.executeQuery();
if(rs.next())
{
sordItemAllocCnt = rs.getInt(1);
sql = " select count(1) from sorditem b " ;
sql = sql + " where b.site_code = ? " ;
if(fromCustCode.trim().equalsIgnoreCase(toCustCode.trim()))
{
sql = sql + " and cust_code__dlv = '"+fromCustCode+"' ";
}
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();
rs = null;
pstmt.close();
pstmt = null;
//Added End by Pavan R on 14/NOV/17 for club order issue
/*System.out.println("sordItemAllocCnt :"+sordItemAllocCnt);
System.out.println("clubOrder :"+clubOrder);*/
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