Commit 8cfdb2a5 authored by mkhan's avatar mkhan

generate xml in specified path given in IBASEHOME


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91159 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e6e7e037
......@@ -63,6 +63,7 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
int upd = 0;
String returnString = "";
int count=0;
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
......@@ -147,9 +148,9 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
double taxAmt =0.00,taxAbleAmt=0.00;
String custSiteCodeTo= "",custSiteCodeFr="";
String returnErrorString="",currDate="";
StringTokenizer stringTokenizer = null;
int count=0;
String modifiedInvSiteCode="" ,invSiteCode;
StringTokenizer stringTokenizer = null;
String modifiedInvSiteCode="" ,invSiteCode="",fileName="";
try
{
......@@ -210,11 +211,48 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
xmlBuff.append(getTaxCrtXmlValue(custSiteCodeFr,modifiedInvSiteCode,effFromTs,validUpToTs,connITM2INI ));
}
xmlBuff.append("\n</PurchaseDetails>");
String fileName = "C:"+File.separator+"CNF"+File.separator+"401"+File.separator+"INPUT_TAX_XML_FILES"+File.separator+"invxml_"+custSiteCodeFr+"_"+currDate+".xml ";
count=0;
//start comment on 30/09/09
/*String fileName = "C:"+File.separator+"CNF"+File.separator+"401"+File.separator+"INPUT_TAX_XML_FILES"+File.separator+"invxml_"+custSiteCodeFr+"_"+currDate+".xml ";
File file = new File(fileName);
FileOutputStream fileOutput = new FileOutputStream(file);
PrintWriter printWriter = new PrintWriter(fileOutput,true);
printWriter.println(xmlBuff.toString());
*/
//end comment on 30/09/09
// changes on 30/09/09
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse( "/IBASEHOME/ibase.xml" );
String taxInputCerdStr = dom.getElementsByTagName( "tax_input_credit" ).item(0).getFirstChild().getNodeValue();
fileName = taxInputCerdStr + File.separator+"invxml_"+custSiteCodeFr+"_"+currDate+".xml";
dom = null;
db = null;
dbf = null;
File taxDir = new File( fileName );
File subDirFile = null;
if( !taxDir.exists() )
{
String subDirs[] = taxInputCerdStr.split( "\\\\" );
String subDirName = subDirs[0];
int subDirLen = subDirs.length;
for( int idx = 1; idx < subDirLen; idx++ )
{
subDirName = subDirName + File.separator + subDirs[ idx ];
subDirFile = new File( subDirName );
if( !subDirFile.exists() )
subDirFile.mkdir();
}
subDirFile = null;
}
FileOutputStream fileOutput = new FileOutputStream(taxDir);
PrintWriter printWriter = new PrintWriter(fileOutput,true);
printWriter.println(xmlBuff.toString());
taxDir = null;
// end of changes on 30/09/09
conn.close();
conn=null;
connITM2INI.close();
......@@ -252,7 +290,7 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
}
//System.out.println("returning from TaxInputCrtXmlPrc "+xmlBuff.toString());
returnErrorString = "<?xml version=\"1.0\"?><Root><Errors><error id=\"VTPROCESS1\" type=\"P\" column_name=\"\"><message>Xml Generate Successfully</message><description>Xml File Name \n invxml_"+custSiteCodeFr+"_"+currDate+".xml \t \n </description><type>P</type><option>Y</option><time>null</time><alarm>null</alarm><source>null</source><trace>C:\\CNF\\401\\INPUT_TAX_XML_FILES\\..</trace><redirect>1</redirect></error></Errors></Root>";
returnErrorString = "<?xml version=\"1.0\"?><Root><Errors><error id=\"VTPROCESS1\" type=\"P\" column_name=\"\"><message>Xml Generate Successfully</message><description>Xml File Name \n invxml_"+custSiteCodeFr+"_"+currDate+".xml \t \n </description><type>P</type><option>Y</option><time>null</time><alarm>null</alarm><source>null</source><trace>"+fileName+"..</trace><redirect>1</redirect></error></Errors></Root>";
return returnErrorString ;
//return itmDBAccessEJB.getErrorString("","VTSALORSUC",userId);
} //end process
......@@ -266,7 +304,6 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
StringBuffer xmlBuff = new StringBuffer();
String sql="",siteCodeInv="",CustSiteCode="",invoiceId="",suppName="",tranDateStr="",SqlSiteReg="",siteRegno="",custSiteRegno="",tranDateprd="";
double taxAmt =0.00,taxAbleAmt=0.00;
int count=0;
String tranDateInv = "";
try{
......
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