Commit 6f654be3 authored by pdas's avatar pdas

Changes are made to set order value


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98058 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7464d22e
......@@ -2258,6 +2258,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
String quantityStr = "";
int pos = 0;
String totQtyStr = "0";
String disparmVal = null;
String salesPers = "";
try
{
......@@ -2417,7 +2419,9 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
rs = null;
valueXmlString.append("<cust_code isSrvCallOnChg='1' protect =\"1\">").append(custCode).append("</cust_code>");
}else
}
else
{
valueXmlString.append("<cust_code isSrvCallOnChg='0' protect =\"0\">").append( "" ).append("</cust_code>");
siteCode = loginSiteCode;
......@@ -2519,14 +2523,20 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
valueXmlString.append("<order_type protect =\"1\">").append("F").append("</order_type>");
valueXmlString.append("<trans_mode protect =\"1\">").append("</trans_mode>");
valueXmlString.append("<max_ord_value protect =\"1\">").append("</max_ord_value>");
}else
}
else
{
valueXmlString.append("<item_ser protect =\"0\">").append("</item_ser>");
valueXmlString.append("<order_type protect =\"0\">").append("F").append("</order_type>");
valueXmlString.append("<trans_mode protect =\"0\">").append("</trans_mode>");
valueXmlString.append("<max_ord_value protect =\"0\">").append("</max_ord_value>");
}
}
else if (currentColumn.trim().equals("itm_defaultedit") )
{
......@@ -2761,6 +2771,42 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
valueXmlString.append("<state_descr>").append("<![CDATA["+stateDescr.trim()+"]]>").append("</state_descr>");
valueXmlString.append("<country_descr>").append("<![CDATA["+countryDescr.trim()+"]]>").append("</country_descr>");
valueXmlString.append("<order_type>").append("<![CDATA["+orderType.trim()+"]]>").append("</order_type>");
disparmVal = distCommon.getDisparams("999999","SALES_BANGLA",conn);
System.out.println("getDisparams()....disparmVal..."+disparmVal);
disparmVal = disparmVal == null ?" " : disparmVal.trim();
if(disparmVal != null && disparmVal.trim().length() > 0)
{
if(disparmVal=="NULLFOUND")
{
disparmVal = "N";
}
if(disparmVal.trim().equalsIgnoreCase("Y"))
{
custCode= genericUtility.getColumnValue( "cust_code", dom );
sql="select sales_pers from customer_series where cust_code = ?";
pstmt= conn.prepareStatement(sql);
pstmt.setString(1,custCode);
rs = pstmt.executeQuery();
if(rs.next())
{
salesPers = rs.getString(1) == null ? "" : rs.getString(1);
}
rs.close();
pstmt.close();
pstmt = null;
rs = null;
valueXmlString.append("<sales_pers>").append(salesPers).append("</sales_pers>");
}
}
}
else if(currentColumn.trim().equalsIgnoreCase("site_code"))
{
......@@ -3288,7 +3334,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
System.out.println("priceList .." + priceList);
rs.close();
pstmt.close();
pstmt = null;
......@@ -3304,7 +3350,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
priceList = rs.getString(1) == null ? "" : rs.getString(1);
}
//System.out.println("priceList .." + priceList);
System.out.println("priceList>>>>>>>>" + priceList);
rs.close();
pstmt.close();
pstmt = null;
......@@ -3312,6 +3358,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
unit = genericUtility.getColumnValue("unit",dom);
listType = getPriceListType(priceList,conn);
sql = " select count(1) from pricelist"
+ " where price_list = ?"
+ " and item_code = ?"
......@@ -3337,11 +3384,12 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
//System.out.println("priceList .." + priceList);
System.out.println("priceList COUNT .." + cnt);
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
{
sql = "select lot_no__from, lot_no__to from pricelist"
......@@ -3401,7 +3449,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
//System.out.println("orderDate in appl date format " + orderDateStr);
rate = distCommon.pickRate(priceList,orderDateStr,itemCode,maxRefNoStr,"L",totQty,conn);
//System.out.println("rate from distcommon>>>>>>>>> " + rate);
System.out.println("rate from distcommon>>>>>>>>> " + rate);
}//end cnt >= 1
if(rate <= 0)
{
......@@ -3424,17 +3472,18 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
break;
}
//System.out.println("priceListParent .." + priceListParent);
System.out.println("priceListParent .." + priceListParent);
rs.close();
pstmt.close();
pstmt = null;
rs = null;
//System.out.println("priceListParent null codition:-" + priceListParent);
System.out.println("priceListParent null codition:-" + priceListParent);
if(priceListParent == null || priceListParent.trim().length() == 0 || "null".equalsIgnoreCase( priceListParent ) )
{
break;
}
listType = distCommon.getPriceListType(priceListParent,conn);
sql = " select count(1) from pricelist"
+ " where price_list = ? "
+ " and item_code = ? "
......@@ -3461,11 +3510,12 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
{
cnt = rs.getInt(1) ;
}
//System.out.println("cnt .." + cnt);
System.out.println("cnt .." + cnt);
rs.close();
pstmt.close();
pstmt = null;
rs = null;
if( cnt >= 1)
{
//sql = " select max(ref_no) from pricelist"
......@@ -3538,7 +3588,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
//System.out.println("orderDateStr for rate:- " + orderDateStr);
//System.out.println(" priceListParent:- " + priceListParent + " priceListParent:- " + priceListParent + " itemCode:- " + itemCode + " maxRefNoStr:- " + maxRefNoStr + " totQty:- " + totQty);
rate = distCommon.pickRate(priceListParent,orderDateStr,itemCode,maxRefNoStr,"L",totQty,conn);
//System.out.println("rate :- " + rate);
System.out.println("rate :- " + rate);
if(rate >0)
{
priceList = priceListParent;
......@@ -3549,11 +3599,11 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
while(true);
}
System.out.println("rate :- " + rate);
OrdValue = qtyTotal * rate ;
//System.out.println("rate :- " + rate);
//System.out.println("qtyTotal :- " + qtyTotal);
//System.out.println("setting OrdValue from :["+OrdValue+"]");
System.out.println("rate :- " + rate);
System.out.println("qtyTotal :- " + qtyTotal);
System.out.println("setting OrdValue from :["+OrdValue+"]");
......@@ -4212,6 +4262,43 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
unit = genericUtility.getColumnValue("unit",dom);
listType = getPriceListType(priceList,conn);
if(listType.equalsIgnoreCase("L"))
{
String sql1 = " select count(1) from pricelist"
+ " where price_list = ? "
+ " and item_code = ? "
+ " and unit = ? "
+ " and list_type = ? "
+ " and eff_from <= ? "
+ " and valid_upto >= ? "
+ " and min_qty <= ? "
+ " and max_qty >= ? ";
pstmt= conn.prepareStatement(sql1);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
pstmt.setString(3,unit);
pstmt.setString(4,listType);
pstmt.setTimestamp(5,OrderDate);
pstmt.setTimestamp(6,OrderDate);
pstmt.setDouble(7,totQty);
pstmt.setDouble(8,totQty);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1) ;
}
//System.out.println("cnt .." + cnt);
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
else
{
sql = " select count(1) from pricelist"
+ " where price_list = ?"
+ " and item_code = ?"
......@@ -4242,6 +4329,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
pstmt.close();
pstmt = null;
rs = null;
}
System.out.println("Cnt first>>>>>>>" + cnt);
if( cnt >= 1)
{
sql = "select lot_no__from, lot_no__to from pricelist"
......@@ -4303,6 +4392,7 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
rate = distCommon.pickRate(priceList,orderDateStr,itemCode,maxRefNoStr,"L",totQty,conn);
//System.out.println("rate from distcommon>>>>>>>>> " + rate);
}//end cnt >= 1
System.out.println("Rate>>>>>>>>" +rate);
if(rate <= 0)
{
do
......@@ -4331,6 +4421,43 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
break;
}
listType = distCommon.getPriceListType(priceListParent,conn);
if(listType.equalsIgnoreCase("L"))
{
String sql1 = " select count(1) from pricelist"
+ " where price_list = ? "
+ " and item_code = ? "
+ " and unit = ? "
+ " and list_type = ? "
+ " and eff_from <= ? "
+ " and valid_upto >= ? "
+ " and min_qty <= ? "
+ " and max_qty >= ? ";
pstmt= conn.prepareStatement(sql1);
pstmt.setString(1,priceList);
pstmt.setString(2,itemCode);
pstmt.setString(3,unit);
pstmt.setString(4,listType);
pstmt.setTimestamp(5,OrderDate);
pstmt.setTimestamp(6,OrderDate);
pstmt.setDouble(7,totQty);
pstmt.setDouble(8,totQty);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1) ;
}
//System.out.println("cnt .." + cnt);
rs.close();
pstmt.close();
pstmt = null;
rs = null;
}
else
{
sql = " select count(1) from pricelist"
+ " where price_list = ? "
+ " and item_code = ? "
......@@ -4362,6 +4489,8 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
pstmt.close();
pstmt = null;
rs = null;
}
System.out.println("Count " + cnt);
if( cnt >= 1)
{
//sql = " select max(ref_no) from pricelist"
......@@ -4444,11 +4573,11 @@ public class SOrderForm extends ValidatorEJB implements SOrderFormLocal, SOrderF
}
while(true);
}
//System.out.println("totQty>>>>>>>>>>>>>>>> " + totQty);
//System.out.println("rate>>>>>>>>>>>>>>>> " + rate);
System.out.println("totQty>>>>>>>>>>>>>>>> " + totQty);
System.out.println("rate>>>>>>>>>>>>>>>> " + rate);
ordValue = totQty * rate ;
//System.out.println("setting calculated ordValue>>>>>>>>>>>>>>>> " +ordValue);
System.out.println("setting calculated ordValue>>>>>>>>>>>>>>>> " +ordValue);
valueXmlString.append("<ord_value>").append("<![CDATA["+ deciFormater.format( ordValue )+"]]>").append("</ord_value>");
siteCodeShip = genericUtility.getColumnValue("site_code",dom);
......
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