Commit d45c56b1 authored by agaikwad's avatar agaikwad

Request_id-DI2ASUN029


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98084 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 65f7ea3e
...@@ -405,7 +405,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -405,7 +405,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
String PriceListParent1="",orderType1=""; String PriceListParent1="",orderType1="";
int Ctr=0,countup=0,Len=0,Len1=0; int Ctr=0,countup=0,Len=0,Len1=0;
java.sql.Timestamp ChgDate=null,efffromdt=null,validupto=null; java.sql.Timestamp ChgDate=null,efffromdt=null,validupto=null;
java.sql.Timestamp chgDate = null,validupto1=null; java.sql.Timestamp chgDate = null,efffrom=null,today=null;
String lotnofr="",lotnoto="",currentlotnofr="",currentlotnoto="",nextlotnofr="",LotNoTo="",currentlotnofrtemp="",currentlotnototemp=""; String lotnofr="",lotnoto="",currentlotnofr="",currentlotnoto="",nextlotnofr="",LotNoTo="",currentlotnofrtemp="",currentlotnototemp="";
//String LotNoFrom="",LotNoTo=""; //String LotNoFrom="",LotNoTo="";
boolean recordfound; boolean recordfound;
...@@ -448,21 +448,27 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -448,21 +448,27 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
//ratetype=(String)PList.get("rate_type"); //ratetype=(String)PList.get("rate_type");
//minrate=(Double)PList.get("min_rate"); //minrate=(Double)PList.get("min_rate");
//maxrate1=(Double)PList.get("max_rate"); //maxrate1=(Double)PList.get("max_rate");
//refNo1=(String)PList.get("ref_No");
//refNoold1=(String)PList.get("ref_No_old");
//PriceListParent1=(String)PList.get("Price_List__Parent");
//orderType1=(String)PList.get("order_Type");
//chgref1=(String)PList.get("chg_ref_no");
PricelistGen.add(PList); PricelistGen.add(PList);
System.out.println("List size is"+PricelistGen);
lotnofrom=(String)PList.get("lot_no__from"); lotnofrom=(String)PList.get("lot_no__from");
System.out.println("lot no from "+lotnofrom); System.out.println("lot no from "+lotnofrom);
lotnoto1=(String)PList.get("lot_no__to"); lotnoto1=(String)PList.get("lot_no__to");
System.out.println("lot no to "+lotnoto1); System.out.println("lot no to "+lotnoto1);
validupto1=(java.sql.Timestamp)PList.get("valid_upto"); efffrom=(java.sql.Timestamp)PList.get("eff_from");
System.out.println("List Sizeeeeeee"+PricelistGen.size()); System.out.println("List Sizeeeeeee"+PricelistGen.size());
minqty=(Double)PList.get("min_qty"); minqty=(Double)PList.get("min_qty");
System.out.println("min qty in list"+minqty); System.out.println("min qty in list"+minqty);
maxqty=(Double)PList.get("max_qty"); maxqty=(Double)PList.get("max_qty");
rate1=(Double)PList.get("rate");
ratetype=(String)PList.get("rate_type");
minrate=(Double)PList.get("min_rate");
maxrate1=(Double)PList.get("max_rate");
refNo1=(String)PList.get("ref_No");
refNoold1=(String)PList.get("ref_No_old");
PriceListParent1=(String)PList.get("Price_List__Parent");
orderType1=(String)PList.get("order_Type");
chgref1=(String)PList.get("chg_ref_no");
...@@ -486,26 +492,29 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -486,26 +492,29 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
SlabNo=rs.getDouble("slab_no"); SlabNo=rs.getDouble("slab_no");
System.out.println("slabbbb_no1111111111111111111111"+SlabNo); System.out.println("slabbbb_no1111111111111111111111"+SlabNo);
LotFrBrow=rs.getString("lot_no__from"); LotFrBrow=rs.getString("lot_no__from");
System.out.println("Lots Number from brow window"+LotFrBrow);
LotNoToBrow=rs.getString("lot_no__to"); LotNoToBrow=rs.getString("lot_no__to");
System.out.println("Lots Number from brow window"+LotNoToBrow);
MinQtyBrow=rs.getDouble("min_qty"); MinQtyBrow=rs.getDouble("min_qty");
MaxQtyBrow=rs.getDouble("max_qty"); MaxQtyBrow=rs.getDouble("max_qty");
System.out.println("Minimum value is@@@@@@@@@"+MinQtyBrow); System.out.println("Minimum value is@@@@@@@@@"+MinQtyBrow);
} }
System.out.println("check if conditionn"); System.out.println("check if conditionn");
DayDiff=(int)utilMethods.DaysAfter(ValidUpTo,validupto1); DayDiff=(int)utilMethods.DaysAfter(ValidUpTo,efffrom);
System.out.println("check"+DayDiff); System.out.println("check"+DayDiff);
if(DayDiff<=0 && LotFrBrow.trim()== lotnofrom && LotNoToBrow.trim()==lotnoto1) if(DayDiff<=0 )
{ {
System.out.println("In if condition@@@@@");
if(LotFrBrow == lotnofrom && LotNoToBrow ==lotnoto1)
{
System.out.println("In if condition ######");
ValidUpTo=utilMethods.RelativeDate((java.sql.Timestamp)PList.get("eff_from"), -1 ); ValidUpTo=utilMethods.RelativeDate((java.sql.Timestamp)PList.get("eff_from"), -1 );
if( dbName.equalsIgnoreCase("db2")) if( dbName.equalsIgnoreCase("db2"))
{ {
validupto=(ValidUpTo);
//validupto=new java.sql.Timestamp(System.currentTimeMillis()); System.out.println("Valid upto date is:"+ValidUpTo);
//sdf = new java.text.SimpleDateFormat(genericUtility System.out.println("Converted Valid Upto Date is:"+validupto);
// .getApplDateFormat());
//=sdf.format(ValidUpTo);
//validupto=datetime(ValidUpTo);
sql="update pricelist set valid_upto = ? where price_list =? and item_code = ? and unit = ? and list_type = ? and slab_no = ?"; sql="update pricelist set valid_upto = ? where price_list =? and item_code = ? and unit = ? and list_type = ? and slab_no = ?";
pstmtSql=conn.prepareStatement(sql); pstmtSql=conn.prepareStatement(sql);
pstmtSql.setTimestamp(1, validupto); pstmtSql.setTimestamp(1, validupto);
...@@ -542,6 +551,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -542,6 +551,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
} }
}
}// for end }// for end
...@@ -631,7 +641,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -631,7 +641,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{ {
OrigStr = Character.toString(left); OrigStr = Character.toString(left);
Set = Set + OrigStr; Set = Set + OrigStr;
LotNoFrom = (mid + 1); LotNoFrom = ( mid+1);
} }
Ctr++; Ctr++;
...@@ -654,7 +664,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -654,7 +664,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.setString(4, unit); pstmtSql.setString(4, unit);
pstmtSql.setString(5,listtype); pstmtSql.setString(5,listtype);
pstmtSql.setString(6, lotnofrom); pstmtSql.setString(6, lotnofrom);
pstmtSql.setString(7, lotnoto1); pstmtSql.setString(7, lotnofrom);
pstmtSql.setDouble(8, minqty); pstmtSql.setDouble(8, minqty);
pstmtSql.setDouble(9, maxqty); pstmtSql.setDouble(9, maxqty);
int upcnt1=pstmtSql.executeUpdate(); int upcnt1=pstmtSql.executeUpdate();
...@@ -671,6 +681,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -671,6 +681,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
//change the valid upto date of price before the eff from date and batch no less then the //change the valid upto date of price before the eff from date and batch no less then the
//plist1 = (String)PList.get("price_list"); //plist1 = (String)PList.get("price_list");
refNoold=(String)PList.get("ref_no_old"); refNoold=(String)PList.get("ref_no_old");
System.out.println("Reference Number old is:"+refNoold);
if(listtype.equalsIgnoreCase("B")) if(listtype.equalsIgnoreCase("B"))
{ {
LotNoFrom=(String)PList.get("lot_no__from"); LotNoFrom=(String)PList.get("lot_no__from");
...@@ -776,7 +787,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -776,7 +787,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
ValidUpTo=utilMethods.RelativeDate((java.sql.Timestamp)PList.get("eff_from"), -1 ); ValidUpTo=utilMethods.RelativeDate((efffromdt), -1 );
Len=LotNoFrom.trim().length(); Len=LotNoFrom.trim().length();
String s=LotNoFrom.trim(); String s=LotNoFrom.trim();
System.out.println("String s"+s); System.out.println("String s"+s);
...@@ -840,7 +851,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -840,7 +851,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
if( dbName.equalsIgnoreCase("db2")) if( dbName.equalsIgnoreCase("db2"))
{ {
//validupto=datetime(ValidUpTo); validupto=(ValidUpTo);
if(refNoold !=null && refNoold.trim().length() > 0) if(refNoold !=null && refNoold.trim().length() > 0)
{ {
sql="update pricelist set valid_upto = ? lot_no__to = ? where price_list = ? and item_code = ? and unit =? and list_type = ? and min_qty >= ? and max_qty <= ? and slab_no = ? and ref_no =?"; sql="update pricelist set valid_upto = ? lot_no__to = ? where price_list = ? and item_code = ? and unit =? and list_type = ? and min_qty >= ? and max_qty <= ? and slab_no = ? and ref_no =?";
...@@ -867,7 +878,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -867,7 +878,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{ {
sql="update pricelist set valid_upto = ? lot_no__to = ? where price_list = ? and item_code = ? and unit =? and list_type = ? and min_qty >= ? and max_qty <= ? and slab_no = ? and ref_no is null "; sql="update pricelist set valid_upto = ? lot_no__to = ? where price_list = ? and item_code = ? and unit =? and list_type = ? and min_qty >= ? and max_qty <= ? and slab_no = ? and ref_no is null ";
pstmtSql=conn.prepareStatement(sql); pstmtSql=conn.prepareStatement(sql);
pstmtSql.setTimestamp(1, validupto); pstmtSql.setTimestamp(1, ValidUpTo);
pstmtSql.setString(2, LotNoFrom); pstmtSql.setString(2, LotNoFrom);
pstmtSql.setString(3, plist); pstmtSql.setString(3, plist);
pstmtSql.setString(4, itemcode); pstmtSql.setString(4, itemcode);
...@@ -937,6 +948,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -937,6 +948,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
} }
//split the batch if the entered batch no is already existing in the master pricelist
recordfound = false; recordfound = false;
if(listtype.equalsIgnoreCase("B")) if(listtype.equalsIgnoreCase("B"))
{ {
...@@ -991,6 +1003,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -991,6 +1003,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
currentlotnoto=rs.getString(2); currentlotnoto=rs.getString(2);
} }
recordfound = true; recordfound = true;
System.out.println("Recode Found@@@@@@@@@@@@@"+recordfound);
currentlotnofrtemp = currentlotnofr; currentlotnofrtemp = currentlotnofr;
currentlotnototemp= currentlotnoto; currentlotnototemp= currentlotnoto;
...@@ -1164,10 +1177,10 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1164,10 +1177,10 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtInsert.setString(3, unit); pstmtInsert.setString(3, unit);
pstmtInsert.setString(4, listtype); pstmtInsert.setString(4, listtype);
pstmtInsert.setDouble(5, LineNo); pstmtInsert.setDouble(5, LineNo);
pstmtInsert.setTimestamp(6, validupto1); pstmtInsert.setTimestamp(6, efffrom);
pstmtInsert.setTimestamp(7, ValidUpTo); pstmtInsert.setTimestamp(7, ValidUpTo);
pstmtInsert.setString(8,lotnofr); pstmtInsert.setString(8,lotnofrom);
pstmtInsert.setString(9, lotnoto); pstmtInsert.setString(9, lotnoto1);
pstmtInsert.setDouble(10, minqty); pstmtInsert.setDouble(10, minqty);
pstmtInsert.setDouble(11, maxqty); pstmtInsert.setDouble(11, maxqty);
pstmtInsert.setDouble(12, rate1); pstmtInsert.setDouble(12, rate1);
...@@ -1211,6 +1224,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1211,6 +1224,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
System.out System.out
.println("Record found@@@@@@@@@@@@@"+recordfound); .println("Record found@@@@@@@@@@@@@"+recordfound);
today=new Timestamp(System.currentTimeMillis());
ChgDate = today;
if(recordfound == false) if(recordfound == false)
{ {
LineNo++; LineNo++;
...@@ -1224,8 +1239,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1224,8 +1239,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtInsert.setDouble(5, slabno); pstmtInsert.setDouble(5, slabno);
pstmtInsert.setTimestamp(6, EffDate); pstmtInsert.setTimestamp(6, EffDate);
pstmtInsert.setTimestamp(7, ValidUpTo); pstmtInsert.setTimestamp(7, ValidUpTo);
pstmtInsert.setString(8,lotnofr); pstmtInsert.setString(8,lotnofrom);//lotnofr)
pstmtInsert.setString(9, lotnoto); pstmtInsert.setString(9, lotnoto1);//lotnoto)
pstmtInsert.setDouble(10, minqty); pstmtInsert.setDouble(10, minqty);
pstmtInsert.setDouble(11, maxqty); pstmtInsert.setDouble(11, maxqty);
pstmtInsert.setDouble(12, rate1); pstmtInsert.setDouble(12, rate1);
......
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