Commit cbcfc963 authored by kgaikwad's avatar kgaikwad

bug in Quotation migration

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@216029 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 36889b73
...@@ -93,7 +93,6 @@ public class QuotationIC extends ValidatorEJB { ...@@ -93,7 +93,6 @@ public class QuotationIC extends ValidatorEJB {
Node parentNode1 =null; Node parentNode1 =null;
Node childNode = null; Node childNode = null;
Node childNode1 = null; Node childNode1 = null;
// String errString = "";
int ctr1=0; int ctr1=0;
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
...@@ -111,10 +110,12 @@ public class QuotationIC extends ValidatorEJB { ...@@ -111,10 +110,12 @@ public class QuotationIC extends ValidatorEJB {
loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"); loginSite = getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getDBDateFormat());
today = java.sql.Timestamp.valueOf(sdf.format(new java.util.Date()).toString() + " 00:00:00.0"); today = java.sql.Timestamp.valueOf(sdf.format(new java.util.Date()).toString() + " 00:00:00.0");
if (objContext != null && objContext.trim().length() > 0) { if (objContext != null && objContext.trim().length() > 0)
{
currentFormNo = Integer.parseInt(objContext); currentFormNo = Integer.parseInt(objContext);
} }
switch (currentFormNo) { switch (currentFormNo)
{
case 1: case 1:
parentNodeList = dom.getElementsByTagName("Detail1"); parentNodeList = dom.getElementsByTagName("Detail1");
...@@ -128,14 +129,9 @@ public class QuotationIC extends ValidatorEJB { ...@@ -128,14 +129,9 @@ public class QuotationIC extends ValidatorEJB {
{ {
quotDatestr =checkNullAndTrim (genericUtility.getColumnValue("quot_date", dom)); quotDatestr =checkNullAndTrim (genericUtility.getColumnValue("quot_date", dom));
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
if (quotDatestr == null || quotDatestr.trim().length()== 0)
{
errCode= "NOITEMDET ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if (quotDatestr != null && quotDatestr.trim().length() > 0) {
if (quotDatestr != null && quotDatestr.trim().length() > 0)
{
quotDate = Timestamp.valueOf(genericUtility.getValidDateString(quotDatestr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+" 00:00:00.0"); quotDate = Timestamp.valueOf(genericUtility.getValidDateString(quotDatestr,genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat())+" 00:00:00.0");
errString = finCommon.nfCheckPeriod("QUOT", quotDate,siteCode, conn); errString = finCommon.nfCheckPeriod("QUOT", quotDate,siteCode, conn);
...@@ -143,8 +139,6 @@ public class QuotationIC extends ValidatorEJB { ...@@ -143,8 +139,6 @@ public class QuotationIC extends ValidatorEJB {
{ {
errList.add(errString); errList.add(errString);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
...@@ -153,12 +147,7 @@ public class QuotationIC extends ValidatorEJB { ...@@ -153,12 +147,7 @@ public class QuotationIC extends ValidatorEJB {
{ {
enqNumber = checkNull(genericUtility.getColumnValue("enq_no", dom)); enqNumber = checkNull(genericUtility.getColumnValue("enq_no", dom));
if (enqNumber == null || enqNumber.trim().length()== 0)
{
errCode= "VTINVENQ ";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if (enqNumber != null && enqNumber.trim().length() > 0) if (enqNumber != null && enqNumber.trim().length() > 0)
{ {
...@@ -281,8 +270,10 @@ public class QuotationIC extends ValidatorEJB { ...@@ -281,8 +270,10 @@ public class QuotationIC extends ValidatorEJB {
} }
} }
else else
{ {
sql=" select count(*) from pquot_hdr where enq_no = ? and supp_code = ? "; sql=" select count(*) from pquot_hdr where enq_no = ? and supp_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, enqNumber); pstmt.setString(1, enqNumber);
...@@ -297,7 +288,7 @@ public class QuotationIC extends ValidatorEJB { ...@@ -297,7 +288,7 @@ public class QuotationIC extends ValidatorEJB {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (cnt == 0) if(cnt==0)
{ {
sql1 = " select count(*) from enq_supp where enq_no = ? and supp_code = ? "; sql1 = " select count(*) from enq_supp where enq_no = ? and supp_code = ? ";
...@@ -321,16 +312,18 @@ public class QuotationIC extends ValidatorEJB { ...@@ -321,16 +312,18 @@ public class QuotationIC extends ValidatorEJB {
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} else
else {
{ errCode = "VTALENQSUP";
errCode = "VTALENQSUP"; errList.add(errCode);
errList.add(errCode); errFields.add(childNodeName.toLowerCase());
errFields.add(childNodeName.toLowerCase()); }
} }
} }
} }
} }
else if (childNodeName.equalsIgnoreCase("item_ser")) else if (childNodeName.equalsIgnoreCase("item_ser"))
{ {
itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom)); itemSer = checkNull(genericUtility.getColumnValue("item_ser", dom));
...@@ -387,7 +380,8 @@ public class QuotationIC extends ValidatorEJB { ...@@ -387,7 +380,8 @@ public class QuotationIC extends ValidatorEJB {
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
}} }
}
} }
else if (childNodeName.equalsIgnoreCase("quot_received")) else if (childNodeName.equalsIgnoreCase("quot_received"))
...@@ -464,9 +458,9 @@ public class QuotationIC extends ValidatorEJB { ...@@ -464,9 +458,9 @@ public class QuotationIC extends ValidatorEJB {
{ {
quantity = checkDoubleNull(genericUtility.getColumnValue("quantity", dom)); quantity = checkDoubleNull(genericUtility.getColumnValue("quantity", dom));
intentNum =checkNull(genericUtility.getColumnValue("ind_no", dom)); intentNum =checkNull(genericUtility.getColumnValue("ind_no", dom));
if ((intentNum != null && intentNum.trim().length() > 0) && quantity > 0 ) if ((intentNum != null && intentNum.trim().length() > 0) && quantity > 0 )
{ {
sql = " select (case when (quantity - ord_qty) is null then 0 else (quantity - ord_qty) end ) as quantity2 "+ sql = " select (case when (quantity - ord_qty) is null then 0 else (quantity - ord_qty) end ) as quantity2 "+
" from indent where ind_no= ? "; " from indent where ind_no= ? ";
...@@ -902,11 +896,13 @@ public class QuotationIC extends ValidatorEJB { ...@@ -902,11 +896,13 @@ public class QuotationIC extends ValidatorEJB {
String freight=""; String freight="";
String taxChap="",taxClass="",taxEnv=""; String taxChap="",taxClass="",taxEnv="";
String stationTo="",stationFr="",custCode=""; String stationTo="",stationFr="",custCode="";
Timestamp reqDate=null;; Timestamp reqDate=null;
String quotdate="";
String reStr=""; String reStr="";
String loginSiteCode=""; String loginSiteCode="";
String chguser="",currCode="",exchRate="",currCodeBase=""; String chguser="",currCode="",exchRate="",currCodeBase="";
double quantity = 0,lineNumber=0; int quantity = 0;
double lineNumber=0;
try { try {
System.out.println("**********ITEMCHANGE FOR CASE*********************"); System.out.println("**********ITEMCHANGE FOR CASE*********************");
conn = getConnection(); conn = getConnection();
...@@ -919,7 +915,6 @@ public class QuotationIC extends ValidatorEJB { ...@@ -919,7 +915,6 @@ public class QuotationIC extends ValidatorEJB {
chguser = getValueFromXTRA_PARAMS(xtraParams, "loginCode"); chguser = getValueFromXTRA_PARAMS(xtraParams, "loginCode");
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
Timestamp sysDate = new Timestamp(System.currentTimeMillis()); Timestamp sysDate = new Timestamp(System.currentTimeMillis());
//timestamp = new Timestamp(System.currentTimeMillis());
FinCommon finCommon = new FinCommon(); FinCommon finCommon = new FinCommon();
System.out.println("loginSite[" + loginSiteCode + "][chguserhdr "+ chguser + "]"); System.out.println("loginSite[" + loginSiteCode + "][chguserhdr "+ chguser + "]");
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>"); valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
...@@ -1106,12 +1101,12 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1106,12 +1101,12 @@ public class QuotationIC extends ValidatorEJB {
if (supplName != null && supplName.trim().length() > 0) if (supplName != null && supplName.trim().length() > 0)
{ {
valueXmlString.append("<supp_name protect =\"1\">").append("<![CDATA[" + supplName + "]]>").append("</supp_name>"); valueXmlString.append("<supp_name protect =\"1\">").append("<![CDATA[" + supplName + "]]>").append("</supp_name>");
} }
else else
{ {
valueXmlString.append("<supp_name protect =\"0\">").append("<![CDATA[" + supplName + "]]>").append("</supp_name>"); valueXmlString.append("<supp_name protect =\"0\">").append("<![CDATA[" + supplName + "]]>").append("</supp_name>");
} }
} }
...@@ -1158,10 +1153,11 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1158,10 +1153,11 @@ public class QuotationIC extends ValidatorEJB {
currCode = genericUtility.getColumnValue("curr_code", dom); currCode = genericUtility.getColumnValue("curr_code", dom);
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
quotdate = genericUtility.getColumnValue("quot_date", dom);
if (currCode != null && currCode.trim().length() > 0) if (currCode != null && currCode.trim().length() > 0)
{ {
exchRate = String.valueOf(finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, "", "S", conn)); exchRate = String.valueOf(finCommon.getDailyExchRateSellBuy(currCode, quotdate, siteCode, "", "S", conn));
System.out.println("exchRate>>>>>>>"+exchRate); System.out.println("exchRate>>>>>>>"+exchRate);
...@@ -1238,18 +1234,18 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1238,18 +1234,18 @@ public class QuotationIC extends ValidatorEJB {
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
parentNode = parentNodeList.item(0); parentNode = parentNodeList.item(0);
ctr = 0; ctr = 0;
String lineNo="";
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("[" + currentColumn + "] ==> '" + columnValue + "'");
if (currentColumn.trim().equalsIgnoreCase("itm_default")) if (currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
lineNumber = checkDoubleNull(genericUtility.getColumnValue("line_no", dom)); lineNo = checkNull(genericUtility.getColumnValue("line_no", dom));
if ( lineNumber > 0) if (Integer.parseInt(lineNo) > 0)
{ {
valueXmlString.append("<quot_no>").append("<![CDATA[" + lineNumber + "]]>").append("</quot_no>"); valueXmlString.append("<line_no>").append("<![CDATA[" + lineNo + "]]>").append("</line_no>");
} }
quotNumber = checkNull(genericUtility.getColumnValue("quot_no", dom1)); quotNumber = checkNull(genericUtility.getColumnValue("quot_no", dom1));
enqNumber = checkNull(genericUtility.getColumnValue("enq_no", dom1)); enqNumber = checkNull(genericUtility.getColumnValue("enq_no", dom1));
...@@ -1287,8 +1283,7 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1287,8 +1283,7 @@ public class QuotationIC extends ValidatorEJB {
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(itemCode != null && itemCode.trim().length() > 0)
{
sql = " select descr from item where item_code = ? "; sql = " select descr from item where item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -1304,7 +1299,9 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1304,7 +1299,9 @@ public class QuotationIC extends ValidatorEJB {
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>"); valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
valueXmlString.append("<item_descr>").append("<![CDATA[" + descr + "]]>").append("</item_descr>"); valueXmlString.append("<item_descr>").append("<![CDATA[" + descr + "]]>").append("</item_descr>");
if(itemCode != null && itemCode.trim().length() > 0)
{
sql = " select quantity ,remarks ,ind_no ,unit ,pay_term , brand ,spec_ref , pack_instr from enq_det " + sql = " select quantity ,remarks ,ind_no ,unit ,pay_term , brand ,spec_ref , pack_instr from enq_det " +
" where enq_no = ? and item_code = ? "; " where enq_no = ? and item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1313,7 +1310,7 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1313,7 +1310,7 @@ public class QuotationIC extends ValidatorEJB {
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
quantity = rs.getDouble("quantity"); quantity = rs.getInt("quantity");
remarks = checkNull(rs.getString("remarks")); remarks = checkNull(rs.getString("remarks"));
intentNumber= checkNull(rs.getString("ind_no")); intentNumber= checkNull(rs.getString("ind_no"));
unit=checkNull(rs.getString("unit")); unit=checkNull(rs.getString("unit"));
...@@ -1376,7 +1373,7 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1376,7 +1373,7 @@ public class QuotationIC extends ValidatorEJB {
if (rs.next()) if (rs.next())
{ {
quantity = rs.getDouble(1); quantity = rs.getInt(1);
remarks = rs.getString(2); remarks = rs.getString(2);
intentNum= rs.getString(3); intentNum= rs.getString(3);
unit=rs.getString(4); unit=rs.getString(4);
...@@ -1511,12 +1508,12 @@ public class QuotationIC extends ValidatorEJB { ...@@ -1511,12 +1508,12 @@ public class QuotationIC extends ValidatorEJB {
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, enqNumber); pstmt.setString(1, enqNumber);
pstmt.setDouble(2, lineNumber); pstmt.setString(2, lineNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
itemCode =checkNull(rs.getString("item_code")); itemCode =checkNull(rs.getString("item_code"));
quantity = rs.getDouble("quantity"); quantity = rs.getInt("quantity");
unit=checkNull(rs.getString("unit")); unit=checkNull(rs.getString("unit"));
payTerm = checkNull(rs.getString("pay_term")); payTerm = checkNull(rs.getString("pay_term"));
freight = checkNull(rs.getString("freight")); freight = checkNull(rs.getString("freight"));
......
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