Commit 38b2a120 authored by kdabholkar's avatar kdabholkar

commited new changes related rate

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@173844 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 45f825c3
......@@ -11,6 +11,7 @@ import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.SalesOrderIC;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.TransIDGenerator;
......@@ -54,6 +55,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
{
E12GenericUtility genericUtility = new E12GenericUtility();
DistCommon distCommon = new DistCommon();
SalesOrderIC salesOrderIC = new SalesOrderIC();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
/**
* Default constructor.
......@@ -1794,6 +1796,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
HashMap dataMap = new HashMap();
ArrayList sizeList = new ArrayList();
ArrayList descrList = new ArrayList();
ArrayList colorList = new ArrayList();
ArrayList dimensionList = new ArrayList();
......@@ -1825,6 +1828,20 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
String itemParent = itemData[0];
String tabNum = itemData[1];
System.out.println("GetRateList Details"+otherDetails);
String rateListDetails[] = otherDetails.split(":");
String custCode = rateListDetails[0];
String orderType = rateListDetails[1];
String orderDate = rateListDetails[2];
String duedate = rateListDetails[3];
String custcodedlv = rateListDetails[4];
String siteCode = rateListDetails[5];
Timestamp orderDateString = null;
System.out.println("custCode::"+custCode+"orderType::"+orderType+"orderDate::"+orderDate+"duedate::"+duedate+"custcodedlv::"+custcodedlv+"siteCode::"+siteCode);
conn = getConnection();
//Added by Santosh on 04-11-2017 to get physical attributes values from item_type [Start]
......@@ -1919,6 +1936,9 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
//if(tranType.equals("T"))
//{
/********* need to add here **************/
valueXmlString.append("<TH_SET selected = 'N'>\r\n");
sql = " SELECT DISTINCT TRIM(V.ATTRIB_ID),SORT_ORDER AS PSIZE,V.DESCR FROM ITEM I, ITM_ATTRIB_VAL V WHERE V.ATTRIB_ID = I.PHY_ATTRIB_1 AND "
+" I.PRODUCT_CODE = ? AND I.ITEM_CODE != ? AND V.ATTRIB_CODE = I.PHY_ATTRIB_22 "
......@@ -1944,7 +1964,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
dSize = checkNullAndTrim(rs.getString(1));
dSizeDescr = checkNullAndTrim(rs.getString(3));
sizeList.add(dSize);
descrList.add(dSizeDescr);
//valueXmlString.append("<SET><![CDATA[").append(dSizeDescr+" @"+"1.0").append("]]></SET>\r\n");
valueXmlString.append("<SET><![CDATA[").append(dSizeDescr).append("]]></SET>\r\n");
cntSizes++;
......@@ -1961,6 +1982,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
valueXmlString.append("</TH_SET>\r\n");
sql = " SELECT DISTINCT I.PHY_ATTRIB_2,V.DESCR FROM ITEM I,ITM_ATTRIB_VAL V WHERE I.PRODUCT_CODE = ? AND I.ITEM_CODE != ?"
+" AND I.PHY_ATTRIB_2 = V.ATTRIB_ID "
//Changed by Santosh on 04-11-2017
......@@ -2053,14 +2076,17 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
valueXmlString.append("<RECORDS>\r\n");
String qty ="0",discount = "0.0",rate = "0.0";
String itmCode = "";
String qty = "0", discount = "0.0",rate = "0.0",itemParentRate= "";
double newRate=0.0;
String itmCode = "",SalesPriceList = "",lsListType= "",ContractNo = "";
int dimlistlen = dimensionList.size();
int colorlen = colorList.size();
int sizelen = sizeList.size();
String key = "";
StringBuffer temStrBuffer = null;
boolean isItemExist = false;
StringBuffer temRateString = new StringBuffer();
for(int i=0;i<dimlistlen;i++)
{
for(int j=0;j<colorlen;j++)
......@@ -2072,11 +2098,16 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
temStrBuffer.append("<td><![CDATA[").append(dimensionData.get(dimensionList.get(i))).append("]]></td>\r\n");
temStrBuffer.append("<td><![CDATA[").append(0).append("]]></td>\r\n");
/*temStrBuffer.append("<td><![CDATA[").append(0).append("]]></td>\r\n");*/
temRateString.append("<RATES>\r\n");
for(int k=0;k<sizelen;k++)
{
key = colorList.get(j) + ":"+ dimensionList.get(i) + ":"+ sizeList.get(k);
//System.out.println("Current Key["+key+"]");
System.out.println("Current Key["+key+"]");
temStrBuffer.append("<td>\r\n");
if(dataMap.containsKey(key))
......@@ -2117,11 +2148,43 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
rate = getItemRate(dataMap.get(key).toString(), otherDetails, conn);
key = key + ":"+ rate;*/
System.out.println("itemCode is::"+itemCode);
itmCode = dataMap.get(key).toString();
System.out.println("itmCode::1"+itmCode);
if(orderDate !=null && orderDate.length()>0)
{
orderDateString = Timestamp.valueOf(genericUtility.getValidDateString(orderDate,
genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
System.out.println("orderDateString"+orderDateString);
if("0.0".equalsIgnoreCase(rate) || "0".equalsIgnoreCase(rate) || rate == null || rate == "" || rate.trim().length() == 0)
{
rate = getItemRate(itmCode, otherDetails, conn);
ContractNo=salesOrderIC.getContract(siteCode, custCode, orderDateString, itemCode, "", "", conn);
SalesPriceList = distCommon.getSalesPriceList(custCode,custcodedlv,siteCode,ContractNo,itemCode,orderDate,conn);
lsListType = distCommon.getPriceListType(SalesPriceList, conn);
if("B".equalsIgnoreCase(lsListType))
//if(lsListType != "B")
{
//rate = getItemRate(itmCode, otherDetails, conn);
System.out.println("Inside lsListType");
newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,orderDate,"C",ContractNo,ContractNo,itemCode,0.0,conn);
}
}
System.out.println("ContractNo"+ContractNo);
System.out.println("lsListType::"+lsListType);
System.out.println("SalesPriceList::"+SalesPriceList);
System.out.println("newRate::"+newRate);
// key = key + ":"+ rate;
key = key + ":"+ rate;
//Commented and Changed by Santosh on 04-11-2017 to get physical attributes values from item_type [Start]
/*String toolTipData = key + ":"+ "Item Code- "+itmCode+""+
......@@ -2137,6 +2200,11 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
//Commented and Changed by Santosh on 04-11-2017 to get physical attributes values from item_type [End]
System.out.println("Your Key is="+key);
/*temRateString.append("<"+sizeList.get(k)+"><![CDATA[").append(rate).append("]]></"+sizeList.get(k)+">\r\n");*/
temRateString.append("<"+descrList.get(k)+"><![CDATA[").append(newRate).append("]]></"+descrList.get(k)+">\r\n");
//tooltip.add(key);
tooltip.add(toolTipData);
}
......@@ -2149,16 +2217,21 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
temStrBuffer.append("</td>\r\n");
}
temStrBuffer.append("</tr>\r\n");
if(isItemExist)
{
valueXmlString.append(temStrBuffer.toString());
}
temRateString.append("</RATES>");
}
}
valueXmlString.append(temRateString.toString());
for (int i = 0; i < tooltip.size(); i++)
{
//System.out.println("Adding="+tooltip.get(i));
......@@ -2201,11 +2274,25 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
valueXmlString.append("<DLVDate><![CDATA[").append(dspDate).append("]]></DLVDate>\r\n");
}
String itemParentRate = getItemRate(itemParent, otherDetails, conn);
valueXmlString.append("<item_parent_rate><![CDATA[").append(itemParentRate).append("]]></item_parent_rate>\r\n");
//if("B".equalsIgnoreCase(lsListType))
if( !"B".equalsIgnoreCase(lsListType))
{
itemParentRate = getItemRate(itemParent, otherDetails, conn);
newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,"","","","","",0.0,conn);
valueXmlString.append("<trueFlag><![CDATA[").append("true").append("]]></trueFlag>\r\n");
}
else
{
valueXmlString.append("<trueFlag><![CDATA[").append("false").append("]]></trueFlag>\r\n");
}
// System.out.println("newRate1::"+newRate);
System.out.println("itemParentRate1"+itemParentRate);
valueXmlString.append("<item_parent_rate><![CDATA[").append(newRate).append("]]></item_parent_rate>\r\n");
valueXmlString.append("<tab_no><![CDATA[").append(tabNum).append("]]></tab_no>\r\n");
valueXmlString.append("<tot_qty><![CDATA[").append(totalQty).append("]]></tot_qty>\r\n");
/* valueXmlString.append("<rate><![CDATA[").append(rate).append("]]></rate>\r\n");*/
valueXmlString.append("</RECORDS>\r\n");
valueXmlString.append("</PRODUCT_SET>\r\n");
valueXmlString.append("</Root>");
......@@ -2268,7 +2355,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
try
{
if (rs != null)
{
{
rs.close();
rs = null;
}
......@@ -3015,7 +3102,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
//Connection conn = null;
boolean isError = false;
String priceList = "",priceListClg = "",lsPriceList = "";
String priceList = "",priceListClg = "",lsPriceList = "",lsListType="";
double rateClg = 0,lcStdrate = 0;
int count = 0;
......@@ -3047,6 +3134,14 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
pstmt.close();pstmt = null;
}
lsListType = distCommon.getPriceListType(priceList, conn);
System.out.println("lsListType::"+lsListType);
lsPriceList = checkNullAndTrim(distCommon.getDisparams("999999", "STD_SO_PL", conn));
if (lsPriceList.length() > 0)
......
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