Commit 13aa34ca authored by cpatil's avatar cpatil

*** empty log message ***


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92306 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fdc0176b
...@@ -534,11 +534,11 @@ public class StockUpdate ...@@ -534,11 +534,11 @@ public class StockUpdate
mamount = this.quantity * this.rate; mamount = this.quantity * this.rate;
count=0; count=0;
// *********xxxxxxxxxxxxxxxx******************** // *********xxxxxxxxxxxxxxxx********************
sql = "select count(*) from stock where item_code ='"+this.itemCode+"'" sql = "select count(*) from stock where item_code ='"+this.itemCode.trim()+"'"
+" and site_code ='"+this.siteCode+"'" +" and site_code ='"+this.siteCode.trim()+"'"
+" and loc_code = '"+this.locationCode+"'" +" and loc_code = '"+this.locationCode.trim()+"'"
+" and lot_no = '"+this.lotNo+"'" +" and lot_no = '"+this.lotNo.trim()+"'"
+" and lot_sl = '"+this.lotSl+"'"; +" and lot_sl = '"+this.lotSl.trim()+"'";
System.out.println("Query :::- ["+sql+"]"); System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -546,6 +546,7 @@ public class StockUpdate ...@@ -546,6 +546,7 @@ public class StockUpdate
{ {
count=rs.getInt(1); count=rs.getInt(1);
} }
System.out.println("@@@@test :count::::["+count+"]");
pstmt.close(); pstmt.close();
rs.close(); rs.close();
if(count != 0) if(count != 0)
...@@ -930,6 +931,10 @@ public class StockUpdate ...@@ -930,6 +931,10 @@ public class StockUpdate
{ {
errString = updateLotInfo( updateStockMap , conn); // added by cpatil calling function errString = updateLotInfo( updateStockMap , conn); // added by cpatil calling function
if( errString != null && errString.trim().length() > 0)
{
return errString;
}
if (count > 0) if (count > 0)
{ {
sql ="select (case when acct_code__inv is null then ' ' else acct_code__inv end), (case when cctr_code__inv is null then ' ' else cctr_code__inv end), qty_per_art" sql ="select (case when acct_code__inv is null then ' ' else acct_code__inv end), (case when cctr_code__inv is null then ' ' else cctr_code__inv end), qty_per_art"
...@@ -1142,6 +1147,25 @@ public class StockUpdate ...@@ -1142,6 +1147,25 @@ public class StockUpdate
} }
} }
//
sql="select count(1) from stock where item_code= ? ,site_code = ? ,loc_code= ? ,lot_no = ? ,lot_sl = ? ";
System.out.println("Query :::- ["+sql+"]");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,this.itemCode);
pstmt.setString(2,this.siteCode);
pstmt.setString(3,this.locationCode);
pstmt.setString(4,this.lotNo);
pstmt.setString(5,this.lotSl);
rs = pstmt.executeQuery();
if(rs.next())
{
int cnt5 = rs.getInt(1);
System.out.println("tets ::cnt 5 ::::"+cnt5);
}
pstmt.close();
rs.close();
//
sql="insert into stock " sql="insert into stock "
+" (item_code , site_code, loc_code," +" (item_code , site_code, loc_code,"
+" lot_no, lot_sl, unit," +" lot_no, lot_sl, unit,"
...@@ -1239,7 +1263,8 @@ public class StockUpdate ...@@ -1239,7 +1263,8 @@ public class StockUpdate
System.out.println("UNIT :"+mbaseUnit); System.out.println("UNIT :"+mbaseUnit);
System.out.println("CREA_DATE :"+creaDt); System.out.println("CREA_DATE :"+creaDt);
pstmt.executeUpdate(); pstmt.executeUpdate();
System.out.println("@@@@@@@ executed sucessfully............");
} }
} }
if(this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID")) if(this.tranType.equalsIgnoreCase("I") || this.tranType.equalsIgnoreCase("ID"))
...@@ -2426,7 +2451,7 @@ public class StockUpdate ...@@ -2426,7 +2451,7 @@ public class StockUpdate
Calendar currentDate = Calendar.getInstance(); Calendar currentDate = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
Timestamp today = Timestamp.valueOf(simpleDateFormat.format(simpleDateFormat.parse(simpleDateFormat.format(currentDate.getTime()))).toString() + " 00:00:00.0"); Timestamp today = Timestamp.valueOf(simpleDateFormat.format(simpleDateFormat.parse(simpleDateFormat.format(currentDate.getTime()))).toString() + " 00:00:00.0");
System.out.println("Now the date is :=> " + today); System.out.println("Now the date is :=> " + today);
// today = new java.sql.Date(System.currentTimeMillis()); // today = new java.sql.Date(System.currentTimeMillis());
System.out.println("today:::["+today+"]"); System.out.println("today:::["+today+"]");
...@@ -2916,6 +2941,7 @@ public class StockUpdate ...@@ -2916,6 +2941,7 @@ public class StockUpdate
cnt1 = pstmt.executeUpdate(); cnt1 = pstmt.executeUpdate();
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("@@@@ cnt1:::"+cnt1);
if ( cnt1 == 0) if ( cnt1 == 0)
{ {
errCode = "VTUPDDET"; errCode = "VTUPDDET";
......
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