Commit 3c5e3633 authored by prane's avatar prane

min_rate and max_rate related bug fixed and split batch logic related changes...

min_rate and max_rate related bug fixed and split batch logic related changes as last lot not getting inserted on specific case

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213919 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a31c4680
......@@ -381,7 +381,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
String lotnofrom = "", lotnoto1 = "";
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
double minqtySplit = 0.0, maxqtySplit = 0.0, rate1Split = 0.0;
double minqtySplit = 0.0, maxqtySplit = 0.0, rate1Split = 0.0, minRate1Split=0, MaxRate1Split=0;
String ratetypeSplit = "", PriceListParent1Split = "", refNo1Split = "", refNoold1Split = "";
String updLotFrom = "", LotNoFromUpd="";
Timestamp efffromSplit = null, ValidUpToSplit = null;
......@@ -1154,7 +1154,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, listtype);
pstmtSql.setString(5, LotFrBrow);
//pstmtSql.setString(5, LotFrBrow);
pstmtSql.setString(5, LotNoFrom);
//pstmtSql.setString(6, LotNoToBrow);
pstmtSql.setString(6, updLotFrom);
pstmtSql.setDouble(7, minqty);
......@@ -1179,13 +1180,14 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
LotNoTo = (String) PList.get("LOT_NO__TO");
nextlotnofr = LotNoFrom;
//sql = "select lot_no__from, lot_no__to from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
sql = "select lot_no__from, lot_no__to, eff_from, valid_upto, min_qty, max_qty, rate,rate_type, price_list__parent, ref_no, ref_no_old from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
sql = "select lot_no__from, lot_no__to, eff_from, valid_upto, min_qty, max_qty, rate,rate_type, price_list__parent, ref_no, ref_no_old, min_rate, max_rate from pricelist where price_list = ? and item_code = ? and unit = ? and list_type = ? and lot_no__from <= ? and lot_no__to >= ? and min_qty <= ? and max_qty >= ? order by lot_no__from";
pstmtSql = conn.prepareStatement(sql);
pstmtSql.setString(1, plist);
pstmtSql.setString(2, itemcode);
pstmtSql.setString(3, unit);
pstmtSql.setString(4, listtype);
pstmtSql.setString(5, lotnofrom);
//pstmtSql.setString(5, lotnofrom);
pstmtSql.setString(5, LotNoFrom);
//pstmtSql.setString(6, LotNoToBrow);
pstmtSql.setString(6, updLotFrom);
pstmtSql.setDouble(7, minqty);
......@@ -1206,6 +1208,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
PriceListParent1Split = rs.getString("price_list__parent");
refNo1Split = rs.getString("ref_no");
refNoold1Split = rs.getString("ref_no_old");
minRate1Split = rs.getDouble("min_rate");
MaxRate1Split = rs.getDouble("max_rate");
// }
recordfound = true;
System.out.println("Recode Found@@@@@@@@@@@@@" + recordfound);
......@@ -1492,7 +1496,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
System.out.println("testSub1::-[" + testSub1 + "]");
int testSub = testSub1.length();
System.out.println("testSub" + testSub);
String testSub2 = LotNoFrom.trim().substring(s2.length() - cnt1);
//String testSub2 = LotNoFrom.trim().substring(s2.length() - cnt1);
String testSub2 = LotNoTo.trim().substring(s2.length() - cnt1);
System.out.println("testSub2::-" + testSub2);
sub = Integer.parseInt(testSub2);
int u2 = testSub2.length();
......@@ -1561,7 +1566,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
System.out.println("Insert line no");
LineNo++;
sql = "insert into pricelist (price_list, item_code,unit,list_type,slab_no,eff_from,valid_upto,lot_no__from,lot_no__to,min_qty,max_qty,rate,rate_type,min_rate,chg_date,chg_user,chg_term,max_rate,order_type, price_list__parent, chg_ref_no, ref_no,ref_no_old )"
sql = "insert into pricelist (price_list, item_code,unit,list_type,slab_no,eff_from,valid_upto,lot_no__from,lot_no__to,min_qty,max_qty,rate,rate_type,min_rate,chg_date,chg_user,chg_term,max_rate,order_type, price_list__parent, chg_ref_no, ref_no,ref_no_old )"
+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, plist);
......@@ -1577,12 +1582,12 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtInsert.setDouble(11, maxqtySplit);
pstmtInsert.setDouble(12, rate1Split);
pstmtInsert.setString(13, ratetypeSplit);
pstmtInsert.setDouble(14, rate1Split);
pstmtInsert.setDouble(14, minRate1Split);
chgDate = new java.sql.Timestamp(System.currentTimeMillis());
pstmtInsert.setTimestamp(15, chgDate);
pstmtInsert.setString(16, userId);
pstmtInsert.setString(17, termId);
pstmtInsert.setDouble(18, rate1Split);
pstmtInsert.setDouble(18, MaxRate1Split);
pstmtInsert.setString(19, orderType1);
pstmtInsert.setString(20, PriceListParent1Split);
pstmtInsert.setString(21, chgref1);
......@@ -1657,12 +1662,14 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
pstmtInsert.setDouble(11, maxqty);
pstmtInsert.setDouble(12, rate1);
pstmtInsert.setString(13, ratetype);
pstmtInsert.setDouble(14, rate1);
//pstmtInsert.setDouble(14, rate1);//Pavan R 23dec19 to update min_rate
pstmtInsert.setDouble(14, minrate);
chgDate = new java.sql.Timestamp(System.currentTimeMillis());
pstmtInsert.setTimestamp(15, chgDate);
pstmtInsert.setString(16, userId);
pstmtInsert.setString(17, termId);
pstmtInsert.setDouble(18, rate1);
//pstmtInsert.setDouble(18, rate1);
pstmtInsert.setDouble(18, maxrate1);//Pavan R 23dec19 to update min_rate
pstmtInsert.setString(19, orderType1);
pstmtInsert.setString(20, PriceListParent1);
pstmtInsert.setString(21, chgref1);
......
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