Commit 2cfaad5e authored by dpawar's avatar dpawar

changes in getPriceListRate method data param


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94284 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6e609a2e
...@@ -184,8 +184,9 @@ public String process(Document dom, Document dom2, String windowName, String xtr ...@@ -184,8 +184,9 @@ public String process(Document dom, Document dom2, String windowName, String xtr
if(custCodeFrm.length() > 0 && custCodeTo.length() > 0 && siteCode.length() > 0){ if(custCodeFrm.length() > 0 && custCodeTo.length() > 0 && siteCode.length() > 0){
siteCodeG=siteCode; siteCodeG=siteCode;
invTypeG=invType; invTypeG=invType;
inv45dayList.add("618ID00008");
sql="select invoice_id from invoice where cust_code__bil between ? and ? and site_code = ? " sql="select invoice_id from invoice where cust_code__bil between ? and ? and site_code = ? "
+ "and sysdate - conf_date > 570"; + "and sysdate - conf_date > 600";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1, custCodeFrm); pstmt.setString(1, custCodeFrm);
pstmt.setString(2, custCodeTo); pstmt.setString(2, custCodeTo);
...@@ -368,7 +369,7 @@ private String generateDebitNote(Connection conn,ArrayList<String> podProcessInv ...@@ -368,7 +369,7 @@ private String generateDebitNote(Connection conn,ArrayList<String> podProcessInv
lotSl=lotSl==null ? "" :lotSl.trim(); lotSl=lotSl==null ? "" :lotSl.trim();
itemCode=itemCode==null ? "" :itemCode.trim(); itemCode=itemCode==null ? "" :itemCode.trim();
itemCodeOrd=itemCodeOrd==null ? "" :itemCodeOrd.trim(); itemCodeOrd=itemCodeOrd==null ? "" :itemCodeOrd.trim();
QtyInvTrace=Double.toHexString(invQty);
//Discount need discussion -----------------@@@@@-------- //Discount need discussion -----------------@@@@@--------
if(discount > 0) if(discount > 0)
...@@ -840,6 +841,7 @@ private Map<String,Double> schemeApply(Connection conn,String invoiceID,String i ...@@ -840,6 +841,7 @@ private Map<String,Double> schemeApply(Connection conn,String invoiceID,String i
}else{ }else{
System.out.println("----data not found in bomdet---------"); System.out.println("----data not found in bomdet---------");
schemeQtyMap.put("success", new Double(0)); schemeQtyMap.put("success", new Double(0));
return schemeQtyMap;
} }
schemeQtyMap.put("success", new Double(1)); schemeQtyMap.put("success", new Double(1));
...@@ -1019,6 +1021,7 @@ private String newErrorMessage(String errString,String invid) ...@@ -1019,6 +1021,7 @@ private String newErrorMessage(String errString,String invid)
NodeList parentNodeList = doc.getElementsByTagName("error"); NodeList parentNodeList = doc.getElementsByTagName("error");
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
String demo =GenericUtility.getInstance().serializeDom(doc);
System.out.println("childNodeList length----------------"+parentNodeList.getLength()); System.out.println("childNodeList length----------------"+parentNodeList.getLength());
for (int i = 0; i < childNodeList.getLength(); i++) { for (int i = 0; i < childNodeList.getLength(); i++) {
childNode = childNodeList.item(i); childNode = childNodeList.item(i);
...@@ -1047,15 +1050,17 @@ private String newErrorMessage(String errString,String invid) ...@@ -1047,15 +1050,17 @@ private String newErrorMessage(String errString,String invid)
} }
trace=trace+ " Invoice Id : "+invid; trace=trace+ " Invoice Id : "+invid;
newStr.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" newStr.append(errString.substring(0,errString.indexOf("message")-1));
+ "<Errors><error column_name=\"acct_code\" id=\"VMACCT1\" type=\"E\">" newStr.append("<message><![CDATA["+message+"]]></message>"
+ "<message><![CDATA["+message+"]]></message>" + "<description><![CDATA["+desc+"]]></description>");
+ "<description><![CDATA["+desc+"]]></description>"); newStr.append("<trace><![CDATA["+trace +"]]></trace>");
newStr.append("<trace><![CDATA["+trace +"]]></trace>"); newStr.append("<redirect><![CDATA["+redirect+"]]></redirect>");
newStr.append("<redirect><![CDATA["+redirect+"]]></redirect>"); newStr.append("<detailDomId><![CDATA["+domID+"]]></detailDomId>");
newStr.append("<detailDomId><![CDATA["+domID+"]]></detailDomId>");
newStr.append("</error></Errors>");
newStr.append("</error></Errors>"); if(errString.contains("Root")){
newStr.append("</Root>");
}
System.out.println("Final xml in newErrorMessage--->>[["+newStr.toString()+"]]"); System.out.println("Final xml in newErrorMessage--->>[["+newStr.toString()+"]]");
...@@ -1080,28 +1085,32 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String ...@@ -1080,28 +1085,32 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String
//boolean connectionState = false; //boolean connectionState = false;
try try
{ {
System.out.println("in getPriceListRate method-------------------");
stmt = connectionObject.createStatement(); stmt = connectionObject.createStatement();
sql = "SELECT LIST_TYPE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"'"; sql = "SELECT LIST_TYPE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"'";
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if (!rs.next()) if (!rs.next())
{ {
return -1; return -1;
} }
else else
{ {
type = rs.getString(1); type = rs.getString(1);
} }
if (type.equalsIgnoreCase("L")) // List Price if (type.equalsIgnoreCase("L")) // List Price
{ {
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'L' AND EFF_FROM <= '"+tranDate+"' AND VALID_UPTO >= '"+tranDate+"'";
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'L' AND EFF_FROM <= sysdate AND VALID_UPTO >= sysdate";
System.out.println("sql in list type L--->>[["+sql+"]]");
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if (!rs.next()) if (!rs.next())
{ {
return -1; // Denotes Error return -1; // Denotes Error
} }
else else
{ {
rate = rs.getDouble(1); rate = rs.getDouble(1);
} }
} }
...@@ -1110,12 +1119,12 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String ...@@ -1110,12 +1119,12 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String
{ {
try try
{ {
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'L' AND EFF_FROM <= '"+tranDate+"' AND VALID_UPTO >= '"+tranDate+"'"; sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'L' AND EFF_FROM <= sysdate AND VALID_UPTO >= sysdate";
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if (!rs.next()) if (!rs.next())
{ {
rate = 0; rate = 0;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'B' AND LOT_NO__FROM <= '"+lotNo+"' AND LOT_NO__TO >= '"+lotNo+"' AND EFF_FROM <= '"+tranDate+"' AND VALID_UPTO >= '"+tranDate+"'"; sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = 'B' AND LOT_NO__FROM <= '"+lotNo+"' AND LOT_NO__TO >= '"+lotNo+"' AND EFF_FROM <= sysdate AND VALID_UPTO >= sysdate";
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if (!rs.next()) if (!rs.next())
{ {
...@@ -1156,7 +1165,7 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String ...@@ -1156,7 +1165,7 @@ public double getPriceListRate(String priceList, java.util.Date tranDate, String
} }
else if (type.equalsIgnoreCase("M") || type.equalsIgnoreCase("N")) // Discount Price else if (type.equalsIgnoreCase("M") || type.equalsIgnoreCase("N")) // Discount Price
{ {
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = '"+type+"' AND EFF_FROM <= '"+tranDate+"' AND VALID_UPTO >= '"+tranDate+"'"; sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"' AND ITEM_CODE = '"+itemCode+"' AND LIST_TYPE = '"+type+"' AND EFF_FROM <= sysdate AND VALID_UPTO >= sysdate";
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
if (!rs.next()) if (!rs.next())
{ {
......
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