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