Commit e6657a88 authored by prane's avatar prane

bug fix


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182985 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 979d3d48
......@@ -127,6 +127,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
String analCode2 = "";
String deptCode = "";
String projCodes = "";
String payableReceivable = "";
double amount = 0.0;
Timestamp contractDate = null;
FinCommon finCommon = null;
......@@ -158,6 +159,8 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
payableReceivable = checkNull(genericUtility.getColumnValue("payable_receivable", dom));
System.out.println(">>>>>>payableReceivable in Val::["+payableReceivable+"]");
if (childNodeName.equalsIgnoreCase("site_code"))
{
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
......@@ -252,11 +255,15 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
{
sundryCode = checkNull(genericUtility.getColumnValue("sundry_code", dom));
if ( sundryCode == null || sundryCode.trim().length() == 0)
{
if(!("J".equalsIgnoreCase(payableReceivable)))
{
errList.add("VTACCTCD1");
errFields.add(childNodeName.toLowerCase());
//goto hdr_error
}
}else
{
sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom));
if("C".equalsIgnoreCase(sundryType))
{
......@@ -341,6 +348,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
}
}
}
}//else end
}
else if (childNodeName.equalsIgnoreCase("eff_date"))
{
......@@ -510,6 +518,8 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
}
}
else if (childNodeName.equalsIgnoreCase("cr_term"))
{
if(!("J".equalsIgnoreCase(payableReceivable)))
{
crTerm = checkNull(genericUtility.getColumnValue("cr_term", dom));
sql = " select count(*) as cnt from crterm where cr_term = ?";
......@@ -531,6 +541,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
errFields.add(childNodeName.toLowerCase());
}
}
}
else if (childNodeName.equalsIgnoreCase("bank_code"))
{
bankCode = checkNull(genericUtility.getColumnValue("bank_code", dom));
......@@ -760,7 +771,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
{
Connection conn = null;
String sql = "", descr = "", sundryCode="", sundryType="", payableReceivable="", description="",description1="",description2="",description3="",
dateNow="", rndStr="", rndOff="", tranSer="", siteCode="",SiteDescr="",bankCode="",bankName="";
dateNow="", rndStr="", rndOff="", tranSer="", siteCode="",SiteDescr="",bankCode="",bankName="", projCode="";
String crTerm="", creditPrd="" ,payMode="", empFName="", empLName="", sundryName="",
accountsDescr="", currencyDescr="", currCode="",acctCode="",cctrCode="",acctCodeArAp="",lineNo="",
contractId="",taxClass="",taxChap="",taxEnv="",empCode="",deptCode="", fName="", lName="", mName="";
......@@ -937,6 +948,14 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
valueXmlString.append("<bank_bank_name>").append("<![CDATA[" + bankName + "]]>").append("</bank_bank_name>");
}
projCode = checkNull(genericUtility.getColumnValue("proj_code", dom));
if(projCode != null && projCode.trim().length() > 0)
{
valueXmlString.append("<proj_code>").append("<![CDATA[" + " " + "]]>").append("</proj_code>");
}else
{
valueXmlString.append("<proj_code>").append("<![CDATA[" + projCode + "]]>").append("</proj_code>");
}
}else if(currentColumn.trim().equalsIgnoreCase("sundry_code"))
{
sundryCode = checkNullAndTrim(genericUtility.getColumnValue("sundry_code", dom));
......@@ -1233,9 +1252,12 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
}
else if(sundryType != null && "O".equalsIgnoreCase(sundryType))
{
valueXmlString.append("<sundry_code>").append("<![CDATA[" + " " + "]]>").append("</sundry_code>");
valueXmlString.append("<payable_receivable>").append("<![CDATA[" + "J" + "]]>").append("</payable_receivable>");
valueXmlString.append("<cr_term>").append("<![CDATA[" + "0" + "]]>").append("</cr_term>");
}else
{
valueXmlString.append("<sundry_code>").append("<![CDATA[" + sundryCode + "]]>").append("</sundry_code>");
valueXmlString.append("<payable_receivable>").append("<![CDATA[" + "R" + "]]>").append("</payable_receivable>");
}
......@@ -1327,6 +1349,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
pstmt = null;
valueXmlString.append("<bank_bank_name>").append("<![CDATA[" + bankName + "]]>").append("</bank_bank_name>");
}
valueXmlString.append("</Detail1>");
break;
case 2:
......
......@@ -391,8 +391,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
" AND ( contract_id <= ? ) " +
" AND ( site_code >= ? ) " +
" AND ( site_code <= ? ) " +
" AND ( sundry_code >= ? ) " +
" AND ( sundry_code <= ? ) " +
// " AND ( sundry_code >= ? ) " +
// " AND ( sundry_code <= ? ) " +
" AND ( payable_receivable between ? AND ? ) " +
" AND ( contract_type >= ? ) " +
" AND ( contract_type <= ? ) " +
......@@ -405,15 +405,15 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.setString(2, contIdTo);
pstmt.setString(3, siteFr);
pstmt.setString(4, siteTo);
pstmt.setString(5, sundCodeFr);
pstmt.setString(6, sundCodeTo);
pstmt.setString(7, "J");
pstmt.setString(8, "J");
pstmt.setString(9, contractTypeFr);
pstmt.setString(10, contractTypeTo);
pstmt.setString(11, "A");
pstmt.setTimestamp(12, fromDate);
pstmt.setTimestamp(13, toDate);
//pstmt.setString(5, sundCodeFr);
//pstmt.setString(6, sundCodeTo);
pstmt.setString(5, "J");
pstmt.setString(6, "J");
pstmt.setString(7, contractTypeFr);
pstmt.setString(8, contractTypeTo);
pstmt.setString(9, "A");
pstmt.setTimestamp(10, fromDate);
pstmt.setTimestamp(11, toDate);
rs=pstmt.executeQuery();
}else
......@@ -424,8 +424,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
" and site_code >= ? " +
" and site_code <= ? " +
" and sundry_type like ? " +
" and sundry_code >= ? " +
" and sundry_code <= ? " +
// " and sundry_code >= ? " +
// " and sundry_code <= ? " +
" and (payable_receivable between ? and ? ) " +
" and contract_type >= ? " +
" and contract_type <= ? " +
......@@ -439,15 +439,15 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.setString(3, siteFr);
pstmt.setString(4, siteTo);
pstmt.setString(5, sundryType1);
pstmt.setString(6, sundCodeFr);
pstmt.setString(7, sundCodeTo);
pstmt.setString(8, payRec);
pstmt.setString(9, payRec);
pstmt.setString(10, contractTypeFr);
pstmt.setString(11, contractTypeTo);
pstmt.setString(12, "A");
pstmt.setTimestamp(13, fromDate);
pstmt.setTimestamp(14, toDate);
//pstmt.setString(6, sundCodeFr);
//pstmt.setString(7, sundCodeTo);
pstmt.setString(6, payRec);
pstmt.setString(7, payRec);
pstmt.setString(8, contractTypeFr);
pstmt.setString(9, contractTypeTo);
pstmt.setString(10, "A");
pstmt.setTimestamp(11, fromDate);
pstmt.setTimestamp(12, toDate);
rs=pstmt.executeQuery();
}
}
......@@ -516,14 +516,14 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
}
if(taxClass == null || taxClass.trim().length() == 0 || "null".equals(taxClass))
{
taxClass = "";
taxClass = " ";
}
if(taxChap == null || taxChap.trim().length() == 0 || "null".equals(taxChap))
{
taxChap = "";
taxChap = " ";
}if(taxEnv == null || taxEnv.trim().length() == 0 || "null".equals(taxEnv))
{
taxEnv = "";
taxEnv = " ";
}
if(String.valueOf(amount) == null)
{
......@@ -954,7 +954,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
else
{
errCode = "VTABTRANS ";
errString = getMsg("Error in Journal V",errCode, conn);
errString = getMsg("Misc. Debit Note record can't be saved as the are incomplete.",errCode, conn);
}
}
else
......@@ -1021,7 +1021,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
}else{
errCode = "VTABTRANS ";
errString = getMsg("Error in Journal V",errCode, conn);
errString = getMsg("Journal record can't be saved as the are incomplete.",errCode, conn);
}
}//end jv call
}
......@@ -1311,6 +1311,23 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
{
ldtoDate = effDate1;
}
if(taxClass == null || taxClass.trim().length() == 0 || "null".equals(taxClass))
{
taxClass = " ";
}
if(taxChap == null || taxChap.trim().length() == 0 || "null".equals(taxChap))
{
taxChap = " ";
}
if(taxEnv == null || taxEnv.trim().length() == 0 || "null".equals(taxEnv))
{
taxEnv = " ";
}
if(projCode == null || projCode.trim().length() == 0 || "null".equals(projCode))
{
projCode = " ";
}
vouchType = "E";
//Inserting data into the 'misc_voucher'
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?><DocumentRoot>");
......@@ -1452,9 +1469,20 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
}else
{
taxDet = 0 ;
taxClassDet = "";
taxChapDet = "";
taxEnvDet = "";
taxClassDet = " ";
taxChapDet = " ";
taxEnvDet = " ";
}
if(taxClassDet == null || taxClassDet.trim().length() == 0 || "null".equals(taxClassDet))
{
taxClassDet = " ";
}
if(taxChapDet == null || taxChapDet.trim().length() == 0 || "null".equals(taxChapDet))
{
taxChapDet = " ";
}if(taxEnvDet == null || taxEnvDet.trim().length() == 0 || "null".equals(taxEnvDet))
{
taxEnvDet = " ";
}
lineNoCount++;
xmlBuff.append("<Detail3 dbID=\"\" domID=\""+lineNoCount+"\" objContext=\"3\" objName=\"misc_voucher\">");
......@@ -1469,9 +1497,9 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<anal_code>").append("<![CDATA[" + rs.getString("anal_code") + "]]>").append("</anal_code>");
xmlBuff.append("<apply_tax>").append("<![CDATA[" + apply + "]]>").append("</apply_tax>");
xmlBuff.append("<tax_amt>").append("<![CDATA[" + taxDet + "]]>").append("</tax_amt>");
xmlBuff.append("<tax_class>").append("<![CDATA[" + rs.getString("tax_class") + "]]>").append("</tax_class>");
xmlBuff.append("<tax_chap>").append("<![CDATA[" + rs.getString("tax_chap") + "]]>").append("</tax_chap>");
xmlBuff.append("<tax_env>").append("<![CDATA[" + rs.getString("tax_env") + "]]>").append("</tax_env>");
xmlBuff.append("<tax_class>").append("<![CDATA[" + taxClassDet + "]]>").append("</tax_class>");
xmlBuff.append("<tax_chap>").append("<![CDATA[" + taxChapDet + "]]>").append("</tax_chap>");
xmlBuff.append("<tax_env>").append("<![CDATA[" + taxEnvDet + "]]>").append("</tax_env>");
xmlBuff.append("<anal_code__1>").append("<![CDATA[" + rs.getString("anal_code__1") + "]]>").append("</anal_code__1>");
xmlBuff.append("<anal_code__2>").append("<![CDATA[" + rs.getString("anal_code__2") + "]]>").append("</anal_code__2>");
xmlBuff.append("<dept_code>").append("<![CDATA[" + rs.getString("dept_code") + "]]>").append("</dept_code>");
......@@ -1599,7 +1627,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
cctrCodedet = "", analCode = "", empCode = "", type = "", tranType = "",loginSite="",today="",
taxClass = "", taxChap = "", taxEnv = "", apply = "", anKeyCol = "",
oEditTax = "", arg1 = "", arg2 = "", rndOff = "", analCode1 = "", analCode2 = "", deptCode = "",
remarksDet = "", taxClassDet = "", taxChapdet = "", taxEnvdet = "", bankCode = "", projCode = "", billNo = "", temp = "", billDateStr = "", lineNo = "";
remarksDet = "", taxClassDet = "", taxChapDet = "", taxEnvDet = "", bankCode = "", projCode = "", billNo = "", temp = "", billDateStr = "", lineNo = "";
String xmlString = "", tranIDSer = "", errString = "", stringxmlInvString="";
Timestamp tranDate = null, effDate = null, chgDate = null, dueDate = null , currDate= null, releaseFrDt = null, releaseToDt = null, taxDate = null, relDate = null, effDate1 = null, billDate = null;
Double amount = 0.0, amt = 0.0, amountDet = 0.0, taxDet = 0.0, netAmtBc = 0.0,
......@@ -1831,8 +1859,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
if(apply != null && "Y".equalsIgnoreCase(apply))
{
taxClassDet = rs.getString("tax_class");
taxChapdet = rs.getString("tax_chap");
taxEnvdet = rs.getString("tax_env");
taxChapDet = rs.getString("tax_chap");
taxEnvDet = rs.getString("tax_env");
anKeyCol = rs.getString("contract_id");
arg1 = "amount";
......@@ -1844,6 +1872,22 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
{
taxDet = 0.0;
}
if(taxClassDet == null || taxClassDet.trim().length() == 0 || "null".equals(taxClassDet))
{
taxClassDet = " ";
}
if(taxChapDet == null || taxChapDet.trim().length() == 0 || "null".equals(taxChapDet))
{
taxChapDet = " ";
}
if(taxEnvDet == null || taxEnvDet.trim().length() == 0 || "null".equals(taxEnvDet))
{
taxEnvDet = " ";
}
if(projCode == null || projCode.trim().length() == 0 || "null".equals(projCode))
{
projCode = " ";
}
System.out.println("amountDet:"+amountDet);
netAmt = amountDet + taxDet;
lineNoCount++;
......@@ -1862,8 +1906,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<net_amt>").append("<![CDATA[" + netAmt + "]]>").append("</net_amt>");
xmlBuff.append("<tax_class>").append("<![CDATA[" + taxClassDet + "]]>").append("</tax_class>");
xmlBuff.append("<tax_chap>").append("<![CDATA[" + taxChapdet + "]]>").append("</tax_chap>");
xmlBuff.append("<tax_env>").append("<![CDATA[" + taxEnvdet + "]]>").append("</tax_env>");
xmlBuff.append("<tax_chap>").append("<![CDATA[" + taxChapDet + "]]>").append("</tax_chap>");
xmlBuff.append("<tax_env>").append("<![CDATA[" + taxEnvDet + "]]>").append("</tax_env>");
xmlBuff.append("<anal_code__1>").append("<![CDATA[" + analCode1 + "]]>").append("</anal_code__1>");
xmlBuff.append("<anal_code__2>").append("<![CDATA[" + analCode2 + "]]>").append("</anal_code__2>");
xmlBuff.append("<dept_code>").append("<![CDATA[" + deptCode + "]]>").append("</dept_code>");
......@@ -2027,7 +2071,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
if(finEntity == null || finEntity.trim().length() == 0)
{
errCode = "VMSITE ";
errString = getMsg("Entered site code not defined",errCode, conn);
errString = getMsg("site code is not defined",errCode, conn);
return errString;
}
......
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