Commit 522f9396 authored by pshinde's avatar pshinde

process of Customer Item Update


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97688 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6e4b308a
......@@ -71,9 +71,9 @@ public String process(Document headerDom, Document detailDom, String windowName,
String custCodeFrom="",custCodeTo="";
String itemCodeFrom="",itemCodeTo="";
String integralQty="";
double intQty=0,minQty=0,intQtyExst=0;
double intQty=0,minQty=0,intQtyExst=0,temp=0;
String custCode="",itemCode="";
String custCode="",itemCode="",preItemCode="";
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
......@@ -105,7 +105,8 @@ public String process(Document headerDom, Document detailDom, String windowName,
System.out.println("itemCodeTo========="+itemCodeTo);
System.out.println("integralQty========="+integralQty);
System.out.println("intQty========="+intQty);
sql="select (case when integral_qty is null then 0 else integral_qty end) as integral_qty,cust_code,item_code from customeritem where item_code >= ? and item_code <= ? and cust_code >= ? and cust_code <= ? order by item_code";
pstmt=conn.prepareStatement(sql);
......@@ -139,8 +140,21 @@ public String process(Document headerDom, Document detailDom, String windowName,
pstmt1 = null;
rs1 = null;
System.out.println("Getting mininum existing integral quantity======"+minQty);
if(!preItemCode.equalsIgnoreCase(itemCode))
{
System.out.println("In if itemcode does not match. ***********");
temp=minQty;
preItemCode=itemCode;
}
else
{
System.out.println("In else item code match *****************");
minQty=temp;
}
if(intQtyExst <= minQty)
if(intQtyExst <= minQty)
{
System.out.println("intQtyExst before if======"+intQtyExst);
System.out.println("minQty======"+minQty);
......@@ -177,6 +191,21 @@ public String process(Document headerDom, Document detailDom, String windowName,
pstmt1.close();
pstmt1 = null;
sql="select min(case when integral_qty is null then 0 else integral_qty end) as min_qty from customeritem where item_code = ?";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,itemCode);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
minQty=rs1.getDouble("min_qty");
}
pstmt1.close();
rs1.close();
pstmt1 = null;
rs1 = null;
System.out.println("After update======"+minQty);
}
pstmt.close();
rs.close();
......@@ -189,7 +218,7 @@ public String process(Document headerDom, Document detailDom, String windowName,
try {
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
isError = true;
......
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