Commit d283d9f7 authored by kmandhre's avatar kmandhre

allow space in Cost center code


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92963 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dac3a675
...@@ -531,18 +531,20 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -531,18 +531,20 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
String pordType = ""; String pordType = "";
//String cctrCode = ""; //String cctrCode = "";
//String acctCode = ""; //String acctCode = "";
String itemCodeRef = " "; String itemCodeRef = "";
//String indentNo = ""; //String indentNo = "";
//String suppCodeMnfr = " "; //String suppCodeMnfr = " ";
//String qcReqd = "" ; //String qcReqd = "" ;
//String costctr = ""; //String costctr = "";
//String CctrLoccode = ""; //String CctrLoccode = "";
String acctCr = "" ; //String acctCr = "" ;
String cctrCr = "" ; //String cctrCr = "" ;
String acctCr = " " ;
String cctrCr = " " ;
String invacct = ""; String invacct = "";
String invacctQc = ""; String invacctQc = "";
String acctDr = "" ; String acctDr = " " ;
String cctrDr = "" ; String cctrDr = " " ;
String Cr[] = null; String Cr[] = null;
String Dr[] = null; String Dr[] = null;
//String unitStd = ""; //String unitStd = "";
...@@ -706,11 +708,13 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -706,11 +708,13 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
pordType = genericUtility.getColumnValue("pord_type", dom1); pordType = genericUtility.getColumnValue("pord_type", dom1);
System.out.println("pordType::"+pordType); System.out.println("pordType::"+pordType);
if(boqAcctCode != null && boqAcctCode.trim().length() > 0) if(boqAcctCode != null && boqAcctCode.trim().length() > 0)
//if(boqAcctCode != null )
{ {
acctDr = boqAcctCode; acctDr = boqAcctCode;
cctrDr = boqCctrCode; cctrDr = boqCctrCode;
} }
if(acctDr == null || acctDr.trim().length() == 0) if(acctDr == null || acctDr.trim().length() == 0)
//if(acctDr == null )
{ {
acctDet = finCommon.getAcctDetrTtype(ditemCode, itemSer, "IN", pordType, conn); acctDet = finCommon.getAcctDetrTtype(ditemCode, itemSer, "IN", pordType, conn);
System.out.println("cctrCode::"+acctDet); System.out.println("cctrCode::"+acctDet);
...@@ -726,6 +730,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -726,6 +730,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
{ {
cctrDr = Dr[1]; cctrDr = Dr[1];
} }
else
{
cctrDr = " ";
}
System.out.println("acctCode::"+acctDr); System.out.println("acctCode::"+acctDr);
} }
} }
...@@ -854,6 +862,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -854,6 +862,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
}*/ }*/
if(acctDr == null || acctDr.trim().length() == 0) if(acctDr == null || acctDr.trim().length() == 0)
//if(acctDr == null || acctDr.length() > 10)
{ {
if(contractNo != null && contractNo.trim().length() > 0) if(contractNo != null && contractNo.trim().length() > 0)
{ {
...@@ -866,10 +875,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -866,10 +875,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
acctDr = checkNull(rs.getString(1)); acctDr = rs.getString(1) == null ? " ":rs.getString(1);
cctrDr = checkNull(rs.getString(2)); cctrDr = rs.getString(2) == null ? " ":rs.getString(2);
acctCr = checkNull(rs.getString(3)); acctCr = rs.getString(3) == null ? " ":rs.getString(3);
cctrCr = checkNull(rs.getString(4)); cctrCr = rs.getString(4) == null ? " ":rs.getString(4);
} }
rs.close(); rs.close();
...@@ -887,8 +896,8 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -887,8 +896,8 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
acctDr = checkNull(rs.getString(1)); acctDr = rs.getString(1) == null ?" ":rs.getString(1);
cctrDr = checkNull(rs.getString(2)); cctrDr = rs.getString(2) == null ?" ":rs.getString(2);
} }
rs.close(); rs.close();
...@@ -898,7 +907,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -898,7 +907,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
} }
} }
if(acctDr == null || acctDr.trim().length() ==0 ) if(acctDr == null || acctDr.trim().length() == 0)
{ {
acctDet = finCommon.getAcctDetrTtype(ditemCode, itemSer, "IN", pordType, conn); acctDet = finCommon.getAcctDetrTtype(ditemCode, itemSer, "IN", pordType, conn);
...@@ -913,6 +922,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -913,6 +922,10 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
{ {
cctrDr = Dr[1]; cctrDr = Dr[1];
} }
else
{
cctrDr = " ";
}
} }
} }
...@@ -944,10 +957,18 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -944,10 +957,18 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
{ {
acctCr = Cr[0]; acctCr = Cr[0];
} }
else
{
acctCr = " ";
}
if(Cr.length > 1) if(Cr.length > 1)
{ {
cctrCr = Cr[1]; cctrCr = Cr[1];
} }
else
{
cctrCr = " ";
}
} }
else else
...@@ -959,10 +980,18 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -959,10 +980,18 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
{ {
acctCr = Cr[0]; acctCr = Cr[0];
} }
else
{
acctCr = " ";
}
if(Cr.length > 1) if(Cr.length > 1)
{ {
cctrCr = Cr[1]; cctrCr = Cr[1];
} }
else
{
cctrCr = " ";
}
if(acctCr == null || acctCr.trim().length() == 0) if(acctCr == null || acctCr.trim().length() == 0)
{ {
sql= " select acct_code__ap , cctr_code__ap from supplier where supp_code = ? " ; sql= " select acct_code__ap , cctr_code__ap from supplier where supp_code = ? " ;
...@@ -971,14 +1000,14 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -971,14 +1000,14 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
acctCr = checkNull(rs.getString(1)); acctCr = rs.getString(1) == null ?" ":rs.getString(1);
cctrCr = checkNull(rs.getString(2)); cctrCr = rs.getString(2) == null ?" ":rs.getString(2);
} }
} }
} }
} }
if (acctDr == null || acctDr.trim().length() == 0 ) /*if (acctDr == null || acctDr.trim().length() == 0 )
{ {
acctDr = " "; acctDr = " ";
} }
...@@ -993,7 +1022,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -993,7 +1022,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
if (cctrCr == null || cctrCr.trim().length() == 0 ) if (cctrCr == null || cctrCr.trim().length() == 0 )
{ {
cctrCr = " "; cctrCr = " ";
} }*/
XmlString.append("<acct_code__dr>").append("<![CDATA[").append(acctDr).append("]]>").append("</acct_code__dr>\r\n"); XmlString.append("<acct_code__dr>").append("<![CDATA[").append(acctDr).append("]]>").append("</acct_code__dr>\r\n");
XmlString.append("<cctr_code__dr>").append("<![CDATA[").append(cctrDr).append("]]>").append("</cctr_code__dr>\r\n"); XmlString.append("<cctr_code__dr>").append("<![CDATA[").append(cctrDr).append("]]>").append("</cctr_code__dr>\r\n");
...@@ -1239,6 +1268,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -1239,6 +1268,7 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
String objName = ""; String objName = "";
String discountType = "",bomCode = ""; String discountType = "",bomCode = "";
String acctCodeCr = null,acctCodeDr = null,cctrCodeCr = null,cctrCodeDr = null;
try try
{ {
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -1304,10 +1334,50 @@ implements BillofQuantityActLocal, BillofQuantityActRemote ...@@ -1304,10 +1334,50 @@ implements BillofQuantityActLocal, BillofQuantityActRemote
valueXmlString.append("<discount>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("discount", currDetail1)).append("]]>").append("</discount>\r\n"); valueXmlString.append("<discount>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("discount", currDetail1)).append("]]>").append("</discount>\r\n");
valueXmlString.append("<bom_code>").append("<![CDATA[").append(bomCode).append("]]>").append("</bom_code>\r\n"); valueXmlString.append("<bom_code>").append("<![CDATA[").append(bomCode).append("]]>").append("</bom_code>\r\n");
valueXmlString.append("<contract_detail>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("contract_detail", currDetail1)).append("]]>").append("</contract_detail>\r\n"); valueXmlString.append("<contract_detail>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("contract_detail", currDetail1)).append("]]>").append("</contract_detail>\r\n");
valueXmlString.append("<cctr_code__cr>").append("<![CDATA[").append( checkNull( genericUtility.getColumnValueFromNode("cctr_code__cr", currDetail1)).trim()).append("]]>").append("</cctr_code__cr>\r\n"); acctCodeDr = genericUtility.getColumnValueFromNode("acct_code__dr", currDetail1);
valueXmlString.append("<acct_code__cr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("acct_code__cr", currDetail1)).trim()).append("]]>").append("</acct_code__cr>\r\n"); System.out.println("acctCodeDr="+acctCodeDr);
valueXmlString.append("<cctr_code__dr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("cctr_code__dr", currDetail1)).trim()).append("]]>").append("</cctr_code__dr>\r\n"); if(acctCodeDr != null && acctCodeDr.length() > 10)
valueXmlString.append("<acct_code__dr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("acct_code__dr", currDetail1)).trim()).append("]]>").append("</acct_code__dr>\r\n"); {
valueXmlString.append("<acct_code__dr>").append("<![CDATA[").append(checkNull(acctCodeDr).trim()).append("]]>").append("</acct_code__dr>\r\n");
}
else
{
valueXmlString.append("<acct_code__dr>").append("<![CDATA[").append(acctCodeDr).append("]]>").append("</acct_code__dr>\r\n");
}
cctrCodeDr = genericUtility.getColumnValueFromNode("cctr_code__dr", currDetail1);
System.out.println("cctrCodeDr="+cctrCodeDr);
if (cctrCodeDr != null && cctrCodeDr.length() > 4)
{
valueXmlString.append("<cctr_code__dr>").append("<![CDATA[").append(cctrCodeDr.trim()).append("]]>").append("</cctr_code__dr>\r\n");
}
else
{
valueXmlString.append("<cctr_code__dr>").append("<![CDATA[").append(cctrCodeDr).append("]]>").append("</cctr_code__dr>\r\n");
}
acctCodeCr = genericUtility.getColumnValueFromNode("acct_code__cr", currDetail1);
if(acctCodeCr != null && acctCodeCr.length() > 10)
{
valueXmlString.append("<acct_code__cr>").append("<![CDATA[").append(acctCodeCr.trim()).append("]]>").append("</acct_code__cr>\r\n");
}
else
{
valueXmlString.append("<acct_code__cr>").append("<![CDATA[").append(acctCodeCr).append("]]>").append("</acct_code__cr>\r\n");
}
cctrCodeCr = genericUtility.getColumnValueFromNode("cctr_code__cr", currDetail1);
if (cctrCodeCr != null && cctrCodeCr.length() > 4)
{
valueXmlString.append("<cctr_code__cr>").append("<![CDATA[").append( cctrCodeCr.trim()).append("]]>").append("</cctr_code__cr>\r\n");
}
else
{
valueXmlString.append("<cctr_code__cr>").append("<![CDATA[").append( cctrCodeCr).append("]]>").append("</cctr_code__cr>\r\n");
}
//valueXmlString.append("<cctr_code__cr>").append("<![CDATA[").append( checkNull( genericUtility.getColumnValueFromNode("cctr_code__cr", currDetail1)).trim()).append("]]>").append("</cctr_code__cr>\r\n");
//valueXmlString.append("<acct_code__cr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("acct_code__cr", currDetail1)).trim()).append("]]>").append("</acct_code__cr>\r\n");
//valueXmlString.append("<cctr_code__dr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("cctr_code__dr", currDetail1)).trim()).append("]]>").append("</cctr_code__dr>\r\n");
//valueXmlString.append("<acct_code__dr>").append("<![CDATA[").append(checkNull( genericUtility.getColumnValueFromNode("acct_code__dr", currDetail1)).trim()).append("]]>").append("</acct_code__dr>\r\n");
valueXmlString.append("<loc_code>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("loc_code", currDetail1)).append("]]>").append("</loc_code>\r\n"); valueXmlString.append("<loc_code>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("loc_code", currDetail1)).append("]]>").append("</loc_code>\r\n");
valueXmlString.append("<rate__clg>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("rate__clg", currDetail1)).append("]]>").append("</rate__clg>\r\n"); valueXmlString.append("<rate__clg>").append("<![CDATA[").append(genericUtility.getColumnValueFromNode("rate__clg", currDetail1)).append("]]>").append("</rate__clg>\r\n");
valueXmlString.append("<supp_item__ref>").append("<![CDATA[").append( checkNull(genericUtility.getColumnValueFromNode("supp_item__ref", currDetail1)).trim() ).append("]]>").append("</supp_item__ref>\r\n"); valueXmlString.append("<supp_item__ref>").append("<![CDATA[").append( checkNull(genericUtility.getColumnValueFromNode("supp_item__ref", currDetail1)).trim() ).append("]]>").append("</supp_item__ref>\r\n");
......
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