Commit 4c8e7c43 authored by mnair's avatar mnair

Added changes to the method getPriceListOrderType

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@177757 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9df68b33
......@@ -13289,7 +13289,6 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
return contractNo;
}
// gbf_get_pricelist_for_ordertype
public String getPriceListOrderType(Timestamp orderDate, Document dom, Document dom1, Document dom2,
Connection conn) throws ITMException {
......@@ -13302,21 +13301,36 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
int cnt = 0;
Timestamp orderDate1 = null;
// SimpleDateFormat sdf;
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-yy");
try
{
//SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-yy");
// SimpleDateFormat dateFormat=new
// SimpleDateFormat(genericUtility.getDBDateFormat());
String orderDateInStr = dateFormat.format(orderDate);
System.out.println("orderDateInStr*****" + orderDateInStr);
//String orderDateInStr = dateFormat.format(orderDate);
//System.out.println("orderDateInStr*****" + orderDateInStr);
//Changes by mayur on 08-JAN-18--[START]
String orderDateInStr = "";
if(orderDateInStr.trim().length() > 0)
{
orderDateInStr = genericUtility.getValidDateString(orderDateInStr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat());
orderDate = Timestamp.valueOf(orderDateInStr + " 00:00:00");
}
orderType = checkNull(genericUtility.getColumnValue("order_type", dom));
System.out.println("orderType==" + orderType);
sql = "select count(1) from pricelist where eff_from <= ? and valid_upto >= ? and order_type <> null";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderDateInStr);
pstmt.setString(2, orderDateInStr);
pstmt.setTimestamp(1,orderDate);
pstmt.setTimestamp(2,orderDate);
//pstmt.setString(1, orderDateInStr);
//pstmt.setString(2, orderDateInStr);
//Changes by mayur on 08-JAN-18--[END]
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
cnt = rs.getInt(1);
System.out.println("Count is-----" + cnt);
}
......@@ -13324,27 +13338,34 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
rs = null;
pstmt.close();
pstmt = null;
if (cnt > 0) {
if (cnt > 0)
{
sql = "select distinct price_list , order_type from pricelist where eff_from <=? and valid_upto >= ? and order_type <> null";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderDateInStr);
pstmt.setString(2, orderDateInStr);
//Changes by mayur on 08-JAN-18--[START]
pstmt.setTimestamp(1, orderDate);
pstmt.setTimestamp(2, orderDate);
//Changes by mayur on 08-JAN--[END]
rs = pstmt.executeQuery();
while (rs.next()) {
while (rs.next())
{
priceList1 = checkNull(rs.getString("price_list"));
orderTypeList = rs.getString("order_type");
if (orderTypeList.trim().length() > 0) {
do {
if (orderTypeList.trim().length() > 0)
{
do
{
orderType1 = distCommon.getToken(orderTypeList, ",");
if (orderType1.trim().length() == orderType.trim().length()) {
if (orderType1.trim().length() == orderType.trim().length())
{
priceList = priceList1;
lsExit = "T";
break;
}
} while (orderTypeList.trim().length() > 0);
}
if (lsExit == "T") {
if (lsExit == "T")
{
break;
}
}
......@@ -13353,7 +13374,8 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt.close();
pstmt = null;
}
} catch (Exception e) {
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception ::" + e.getMessage());
throw new ITMException(e);
......@@ -13361,6 +13383,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
return priceList;
}
//Changes done by mayur on 08-JAN-18---[END]
// gbf_exchrate_protect
public String exchangeRateProtect(String currCode, String siteCode, String exchangeRateCol, Connection conn)
......
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