Commit 702da0d6 authored by prane's avatar prane

fixing the functionalities in retainer contract

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183418 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4056aa0e
......@@ -129,7 +129,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
String projCodes = "";
String payableReceivable = "";
double amount = 0.0;
Timestamp contractDate = null;
Timestamp contractDate = null, effDate = null, validUpto = null;
FinCommon finCommon = null;
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
try
......@@ -353,11 +353,12 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
else if (childNodeName.equalsIgnoreCase("eff_date"))
{
effDateStr = checkNull(genericUtility.getColumnValue("eff_date", dom));
//effDate = Timestamp.valueOf(genericUtility.getValidDateString(effDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
effDate = Timestamp.valueOf(genericUtility.getValidDateString(effDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
validUptoStr = checkNull(genericUtility.getColumnValue("valid_upto", dom));
//validUpto = Timestamp.valueOf(genericUtility.getValidDateString(validUptoStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
validUpto = Timestamp.valueOf(genericUtility.getValidDateString(validUptoStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//if(validUpto.compareTo(effDate) < 0)
if(validUptoStr.compareTo(effDateStr) < 0)
//if(validUptoStr.compareTo(effDateStr) < 0)
if(validUpto.before(effDate))
{
//effective date is less than valid date
errList.add("VTDATE6");
......@@ -786,6 +787,7 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
String childNodeName = null;
Timestamp currentDate= null;
FinCommon finCommon = null;
DistCommon distCommon = null;
try {
System.out.println("----------------Inside itemChanged-------------------");
finCommon = new FinCommon();
......@@ -1243,7 +1245,16 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
pstmt = null;
valueXmlString.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
valueXmlString.append("<currency_descr>").append("<![CDATA[" + currencyDescr + "]]>").append("</currency_descr>");
//valueXmlString.append("<>").append("<![CDATA[" + + "]]>").append("</>");
//Pavan R on 10APR18 [to set tax class and tax chapter from sundry Masters.]
taxClass = distCommon.getTaxClass(sundryCode, sundryCode, "", siteCode, conn);
taxChap = distCommon.getTaxChap("", "", sundryCode, sundryCode, siteCode, conn);
System.out.println("taxClass:["+taxClass+"]taxChap:["+taxChap+"]");
valueXmlString.append("<tax_class>").append("<![CDATA[" + taxClass + "]]>").append("</tax_class>");
valueXmlString.append("<tax_chap>").append("<![CDATA[" + taxChap + "]]>").append("</tax_chap>");
//valueXmlString.append("<tax_env>").append("<![CDATA[" + taxEnv + "]]>").append("</tax_env>");
//Pavan R on 10APR18 END
}else if(currentColumn.trim().equalsIgnoreCase("sundry_type"))
{
......
......@@ -899,18 +899,12 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
if (errString.indexOf("Success") > -1)
{
releasedContList.add(contractId);
}
else
{
return errString;
}
}
else
{
sql ="select to_date from retainer_contract where contract_id = ?";
sql = "select to_date from retainer_contract " +
" where contract_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contractId);
rs= pstmt.executeQuery();
rs = pstmt.executeQuery();
if(rs.next())
{
processUptillDate = rs.getTimestamp(1);
......@@ -920,7 +914,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.close();
pstmt = null;
sql ="update retainer_contract set to_date = ? where contract_id = ? ";
sql = "update retainer_contract set to_date = ? where contract_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, toDate);
pstmt.setString(2, contractId);
......@@ -928,16 +922,19 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.close();
pstmt = null;
sql ="update retainer_contract set date__last_proc = ? where contract_id = ?";
sql = "update retainer_contract set date__last_proc = ? where contract_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, lastDate1);
pstmt.setString(2, contractId);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
//rel++;
}//else end
}
else
{
return errString;
}
}
}else if( prType != null && "R".equalsIgnoreCase(prType))
{
errString = miscVoucherAR("w_misc_drcr_rcp", contractId,sundryCode, headerDom, hdrMap, "MDRCRD", lastDate1, fromDate, toDate, xtraParams, conn);
......@@ -948,21 +945,10 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
System.out.println("errString from misc_drcr_rcp ["+errString+"]");
if (errString.indexOf("Success") > -1)
{
String[] arrayForTranIdIssue = errString.split("<TranID>");
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
releasedContList.add(contractId);
}
else
{
errCode = "VTABTRANS ";
errString = getMsg("Misc. Debit Note record can't be saved as the are incomplete.",errCode, conn);
}
}
else
{
sql ="select to_date from retainer_contract where contract_id = ? ";
sql = "select to_date from retainer_contract " +
" where contract_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contractId);
rs= pstmt.executeQuery();
......@@ -975,7 +961,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.close();
pstmt = null;
sql ="update retainer_contract set to_date = ? where contract_id = ? ";
sql = "update retainer_contract set to_date = ? where contract_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, toDate);
pstmt.setString(2, contractId);
......@@ -983,7 +969,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.close();
pstmt = null;
sql ="update retainer_contract set date__last_proc = ? where contract_id = ?";
sql = "update retainer_contract set date__last_proc = ? where contract_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, lastDate1);
pstmt.setString(2, contractId);
......@@ -991,7 +977,12 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
pstmt.close();
pstmt = null;
//rel++;
}
else
{
errCode = "VTABTRANS ";
errString = getMsg("Misc. Debit Note record can't be saved as the are incomplete.",errCode, conn);
}
}
}else if( prType != null && "J".equalsIgnoreCase(prType))
{
......@@ -1003,10 +994,38 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
{
if (errString.indexOf("Success") > -1)
{
String[] arrayForTranIdIssue = errString.split("<TranID>");
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
releasedContList.add(contractId);
sql = "select to_date from retainer_contract " +
" where contract_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, contractId);
rs= pstmt.executeQuery();
if(rs.next())
{
processUptillDate = rs.getTimestamp(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update retainer_contract set to_date = ? where contract_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, toDate);
pstmt.setString(2, contractId);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
sql = "update retainer_contract set date__last_proc = ? where contract_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, lastDate1);
pstmt.setString(2, contractId);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
//errCode = "VTCOMMIT";
//errString = getMsg("Record saved successsfully",errCode, conn);
/*String begPart = errString.substring( 0, errString.indexOf("<trace>") + 7 );
......@@ -1042,9 +1061,10 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
}//end if( lastDate1 <= validDate )
if(errString !=null && errString.trim().length() == 0)
if(errString != null && errString.trim().length() > 0)
{
conn.commit();
System.out.println("Commited!!");
}
else
{
......@@ -1406,7 +1426,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<emp_code>").append("<![CDATA[" + empCodedet + "]]>").append("</emp_code>");
xmlBuff.append("<net_amt__bc>").append("<![CDATA[" + netAmtBc + "]]>").append("</net_amt__bc>");
xmlBuff.append("<pay_mode>").append("<![CDATA[" + payMode + "]]>").append("</pay_mode>");
xmlBuff.append("<remarks>").append("<![CDATA[" + remarks + "]]>").append("</remarks>");
xmlBuff.append("<remarks>").append("<![CDATA[" + "#" +contractId + ", Autogenerated" + "]]>").append("</remarks>");
xmlBuff.append("<acct_code__cf>").append("<![CDATA[" + acctCodeCf + "]]>").append("</acct_code__cf>");
xmlBuff.append("<cctr_code__cf>").append("<![CDATA[" + cctrCodeCf + "]]>").append("</cctr_code__cf>");
xmlBuff.append("<acct_code__pay>").append("<![CDATA[" + acctCode + "]]>").append("</acct_code__pay>");
......@@ -1821,7 +1841,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<amount>").append("<![CDATA[" + amount + "]]>").append("</amount>");
xmlBuff.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
xmlBuff.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>");
xmlBuff.append("<remarks>").append("<![CDATA[" + remarks + "]]>").append("</remarks>");
xmlBuff.append("<remarks>").append("<![CDATA[" + "#" +contractId + ", Autogenerated" + "]]>").append("</remarks>");
xmlBuff.append("<drcr_flag>").append("<![CDATA[" + drCrFlag + "]]>").append("</drcr_flag>");
xmlBuff.append("<tran_id__rcv>").append("<![CDATA[" + tranIdRcv + "]]>").append("</tran_id__rcv>");
xmlBuff.append("<confirmed>").append("<![CDATA[" + confirmed + "]]>").append("</confirmed>");
......
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