Commit 5af0df58 authored by kdabholkar's avatar kdabholkar

commited new changes of Rate Logic and bug fixixng for the same.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174563 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4a66c4de
...@@ -6,15 +6,6 @@ ...@@ -6,15 +6,6 @@
package ibase.webitm.ejb.wms; package ibase.webitm.ejb.wms;
import ibase.utility.CommonConstants;
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;
import java.awt.Color; import java.awt.Color;
import java.awt.Font; import java.awt.Font;
import java.awt.FontMetrics; import java.awt.FontMetrics;
...@@ -36,8 +27,8 @@ import java.util.ArrayList; ...@@ -36,8 +27,8 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
...@@ -50,6 +41,15 @@ import org.w3c.dom.Document; ...@@ -50,6 +41,15 @@ import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import ibase.utility.CommonConstants;
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;
@Stateless @Stateless
public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLocal, SorderWizardEJBRemote public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLocal, SorderWizardEJBRemote
{ {
...@@ -2143,16 +2143,10 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2143,16 +2143,10 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
} }
} }
if(qty.equals("0"))
{
//temStrBuffer.append("<![CDATA[").append(dataMap.get(key)).append("]]>\r\n");
temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty+"~"+discount+"~"+rate).append("]]>\r\n");
}
else
{
//temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty).append("]]>\r\n");
temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty+"~"+discount+"~"+rate).append("]]>\r\n");
}
//Changed by wasim //Changed by wasim
//key = key + ":"+ getItemRate(dataMap.get(key).toString(), otherDetails, conn); //key = key + ":"+ getItemRate(dataMap.get(key).toString(), otherDetails, conn);
...@@ -2174,13 +2168,28 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2174,13 +2168,28 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
System.out.println("orderDateString"+orderDateString); System.out.println("orderDateString"+orderDateString);
ContractNo=salesOrderIC.getContract(siteCode, custCode, orderDateString, itemCode, "", "", conn);
System.out.println("ContractNo From method"+ContractNo);
System.out.println(ContractNo.length());
if("@".equalsIgnoreCase(ContractNo))
{
System.out.println("inside");
ContractNo="";
}
SalesPriceList = distCommon.getSalesPriceList(custCode,custcodedlv,siteCode,ContractNo,itemCode,orderDate,conn);
lsListType = distCommon.getPriceListType(SalesPriceList, conn);
if("0.0".equalsIgnoreCase(rate) || "0".equalsIgnoreCase(rate) || rate == null || rate == "" || rate.trim().length() == 0) if("0.0".equalsIgnoreCase(rate) || "0".equalsIgnoreCase(rate) || rate == null || rate == "" || rate.trim().length() == 0)
{ {
ContractNo=salesOrderIC.getContract(siteCode, custCode, orderDateString, itemCode, "", "", conn); /*ContractNo=salesOrderIC.getContract(siteCode, custCode, orderDateString, itemCode, "", "", conn);
SalesPriceList = distCommon.getSalesPriceList(custCode,custcodedlv,siteCode,ContractNo,itemCode,orderDate,conn); SalesPriceList = distCommon.getSalesPriceList(custCode,custcodedlv,siteCode,ContractNo,itemCode,orderDate,conn);
lsListType = distCommon.getPriceListType(SalesPriceList, conn); lsListType = distCommon.getPriceListType(SalesPriceList, conn);*/
System.out.println("lsListType"+lsListType); System.out.println("lsListType"+lsListType);
...@@ -2201,12 +2210,39 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2201,12 +2210,39 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
} }
System.out.println("ContractNo"+ContractNo); System.out.println("ContractNo"+ContractNo);
// System.out.println("lsListType::"+lsListType); System.out.println("lsListType::"+lsListType);
System.out.println("SalesPriceList::"+SalesPriceList); System.out.println("SalesPriceList::"+SalesPriceList);
System.out.println("newRate::"+newRate); System.out.println("newRate::"+newRate);
if( !"B".equalsIgnoreCase(lsListType))
{
//itemParentRate = getItemRate(itemParent, otherDetails, conn);
// newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,"","","","","",0.0,conn);
newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,orderDate,"C",ContractNo,ContractNo,itmCode,0.0,conn);
valueXmlString.append("<trueFlag><![CDATA[").append("true").append("]]></trueFlag>\r\n");
}
else
{
// temStrBuffer.append("<![CDATA[").append(itmCode+"~"+qty+"~"+discount+"~"+newRate).append("]]>\r\n");
valueXmlString.append("<trueFlag><![CDATA[").append("false").append("]]></trueFlag>\r\n");
}
if(qty.equals("0"))
{
//temStrBuffer.append("<![CDATA[").append(dataMap.get(key)).append("]]>\r\n");
System.out.println("inside qty");
temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty+"~"+discount+"~"+newRate).append("]]>\r\n");
}
else
{
//temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty).append("]]>\r\n");
//temStrBuffer.append("<![CDATA[").append(dataMap.get(key)+"~"+qty+"~"+discount+"~"+rate).append("]]>\r\n");
temStrBuffer.append("<![CDATA[").append(itmCode+"~"+qty+"~"+discount+"~"+newRate).append("]]>\r\n");
}
// key = key + ":"+ rate; // key = key + ":"+ rate;
key = key + ":"+ rate; System.out.println("newRateCalulated"+newRate);
key = key + ":"+ newRate;
//Commented and Changed by Santosh on 04-11-2017 to get physical attributes values from item_type [Start] //Commented and Changed by Santosh on 04-11-2017 to get physical attributes values from item_type [Start]
/*String toolTipData = key + ":"+ "Item Code- "+itmCode+""+ /*String toolTipData = key + ":"+ "Item Code- "+itmCode+""+
"&#010;Color- "+colorList.get(j)+ "&#010;Color- "+colorList.get(j)+
...@@ -2218,16 +2254,18 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2218,16 +2254,18 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
"&#010;"+colName2+" - "+dimensionList.get(i)+ "&#010;"+colName2+" - "+dimensionList.get(i)+
"&#010;Size - "+sizeList.get(k)+""+ "&#010;Size - "+sizeList.get(k)+""+
"&#010;Rate - "+newRate+""; "&#010;Rate - "+newRate+"";
//Commented and Changed by Santosh on 04-11-2017 to get physical attributes values from item_type [End] //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); System.out.println("Your Key is="+key);
System.out.println("itmCode"+itmCode);
/*temRateString.append("<"+sizeList.get(k)+"><![CDATA[").append(rate).append("]]></"+sizeList.get(k)+">\r\n");*/ /*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");*/
/* temRateString.append("<"+descrList.get(k)+"><![CDATA[").append(newRate).append("]]></"+descrList.get(k)+">\r\n");*/
//tooltip.add(key); //tooltip.add(key);
tooltip.add(toolTipData); tooltip.add(toolTipData);
} }
else else
{ {
...@@ -2247,8 +2285,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2247,8 +2285,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
valueXmlString.append(temStrBuffer.toString()); valueXmlString.append(temStrBuffer.toString());
} }
temRateString.append("</RATES>"); temRateString.append("</RATES>");
} }
} }
valueXmlString.append(temRateString.toString()); valueXmlString.append(temRateString.toString());
...@@ -2299,7 +2337,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2299,7 +2337,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
System.out.println("lsListTypeparent::"+lsListType); System.out.println("lsListTypeparent::"+lsListType);
// if("B".equalsIgnoreCase(lsListType)) // if("B".equalsIgnoreCase(lsListType))
if( !"B".equalsIgnoreCase(lsListType)) /*if( !"B".equalsIgnoreCase(lsListType))
{ {
//itemParentRate = getItemRate(itemParent, otherDetails, conn); //itemParentRate = getItemRate(itemParent, otherDetails, conn);
// newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,"","","","","",0.0,conn); // newRate = distCommon.getSalesRate(SalesPriceList,siteCode,custCode,orderDate,"","","","","",0.0,conn);
...@@ -2309,7 +2347,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2309,7 +2347,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
else else
{ {
valueXmlString.append("<trueFlag><![CDATA[").append("false").append("]]></trueFlag>\r\n"); valueXmlString.append("<trueFlag><![CDATA[").append("false").append("]]></trueFlag>\r\n");
} }*/
System.out.println("newRate1::"+newRate); System.out.println("newRate1::"+newRate);
System.out.println("itemParentRate1"+itemParentRate); System.out.println("itemParentRate1"+itemParentRate);
...@@ -2421,6 +2459,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2421,6 +2459,8 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
lsPriceList = "",orderDate = "",dueDate = "",custCode = "",custItemRef = "",saleOrder = ""; lsPriceList = "",orderDate = "",dueDate = "",custCode = "",custItemRef = "",saleOrder = "";
try try
{ {
System.out.println("dom1["+genericUtility.serializeDom(dom1)+"]dom2[\n"+genericUtility.serializeDom(dom2)+"]itemparant["+itemParent+"]");
System.out.println("Inside getSorderDetails-->ItemParent["+itemParent+"] DetailString["+aString+"] DOMId["+domID+"]"); System.out.println("Inside getSorderDetails-->ItemParent["+itemParent+"] DetailString["+aString+"] DOMId["+domID+"]");
String itemCode = "",quantity = "",ordDate = "",tabNo = "",discount = "",itemRate = ""; String itemCode = "",quantity = "",ordDate = "",tabNo = "",discount = "",itemRate = "";
String[] arr = aString.split("~"); String[] arr = aString.split("~");
...@@ -2440,6 +2480,15 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2440,6 +2480,15 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
custCodeBil = checkNullAndTrim(genericUtility.getColumnValue("cust_code__bil", dom1)); custCodeBil = checkNullAndTrim(genericUtility.getColumnValue("cust_code__bil", dom1));
orderType = checkNullAndTrim(genericUtility.getColumnValue("order_type", dom1)); orderType = checkNullAndTrim(genericUtility.getColumnValue("order_type", dom1));
custCode = checkNullAndTrim(genericUtility.getColumnValue("cust_code", dom1)); custCode = checkNullAndTrim(genericUtility.getColumnValue("cust_code", dom1));
System.out.println("saleOrder"+saleOrder);
System.out.println("siteCode"+siteCode);
System.out.println("orderDate"+orderDate);
System.out.println("custCodeDlv"+custCodeDlv);
System.out.println("custCodeBil"+custCodeBil);
System.out.println("orderType"+orderType);
System.out.println("custCode"+custCode);
//Commented temporary //Commented temporary
//custCodeDlv = custCode;//for temporary need to check //custCodeDlv = custCode;//for temporary need to check
...@@ -2460,6 +2509,9 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2460,6 +2509,9 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
itmStru = checkNullAndTrim(rs.getString("ITEM_STRU")); itmStru = checkNullAndTrim(rs.getString("ITEM_STRU"));
packInstr = checkNullAndTrim(rs.getString("PACK_INSTR")); packInstr = checkNullAndTrim(rs.getString("PACK_INSTR"));
custItemRef = checkNullAndTrim(rs.getString("PHY_ATTRIB_4")); custItemRef = checkNullAndTrim(rs.getString("PHY_ATTRIB_4"));
System.out.println("itemDescr"+itemDescr);
System.out.println("unitRate"+unitRate);
} }
if(rs != null) if(rs != null)
{ {
...@@ -2567,6 +2619,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2567,6 +2619,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
valueXmlString.append("<dsp_date><![CDATA[").append(ordDate).append("]]></dsp_date>\r\n"); valueXmlString.append("<dsp_date><![CDATA[").append(ordDate).append("]]></dsp_date>\r\n");
valueXmlString.append("<quantity><![CDATA[").append(quantity).append("]]></quantity>\r\n"); valueXmlString.append("<quantity><![CDATA[").append(quantity).append("]]></quantity>\r\n");
System.out.println("itemRate in getSorderDetails "+itemRate);
if(itemRate != null && itemRate.trim().length() > 0) if(itemRate != null && itemRate.trim().length() > 0)
{ {
...@@ -2581,7 +2634,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2581,7 +2634,7 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
} }
} }
System.out.println("Item Rate="+lcStdrate); System.out.println("Item Rate inside getSorderDetails="+lcStdrate);
int cntRate = 0; int cntRate = 0;
if(lcStdrate <= 0) if(lcStdrate <= 0)
...@@ -2607,9 +2660,13 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2607,9 +2660,13 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
} }
} }
System.out.println("RATE from SORDDET"+lcStdrate);
System.out.println("cntRate"+cntRate);
//else //else
if(cntRate == 0) if(cntRate == 0)
{ {
System.out.println("Inside cntRate= 0 ");
/*lsPriceList = checkNullAndTrim(distCommon.getDisparams("999999", "STD_SO_PL", conn)); /*lsPriceList = checkNullAndTrim(distCommon.getDisparams("999999", "STD_SO_PL", conn));
if (lsPriceList.length() > 0) if (lsPriceList.length() > 0)
{ {
...@@ -2627,8 +2684,13 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca ...@@ -2627,8 +2684,13 @@ public class SorderWizardEJB extends ValidatorEJB implements SorderWizardEJBLoca
rateClg = distCommon.pickRate( priceListClg, orderDate, itemCode, "", "L", conn ); rateClg = distCommon.pickRate( priceListClg, orderDate, itemCode, "", "L", conn );
} }
System.out.println("lcStdrate"+lcStdrate);
System.out.println("Rate Clg New="+rateClg);
//lcStdrate=10;
System.out.println("Rate Clg="+rateClg);
if ( rateClg == 0 ) if ( rateClg == 0 )
{ {
rateClg = lcStdrate; rateClg = lcStdrate;
......
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