Commit 4c7feb4b authored by agaikwad's avatar agaikwad

Added SOP(Print generate xml of Invoice).


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43869 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e1c46b00
...@@ -498,7 +498,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -498,7 +498,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if(salesInvPstHdr.equalsIgnoreCase("NULLFOUND") || salesInvPstHdr.equalsIgnoreCase("H")) if(salesInvPstHdr.equalsIgnoreCase("NULLFOUND") || salesInvPstHdr.equalsIgnoreCase("H"))
{ {
//System.out.println("SorderSalMap size :- ["+sorderSalMap.size()+"]"); System.out.println("SorderSalMap size :- ["+sorderSalMap.size()+"]");
xmlBuff.append("<acct_code__sal><![CDATA[" +sorderSalMap.get("lsacct_sal")+ "]]></acct_code__sal>"); xmlBuff.append("<acct_code__sal><![CDATA[" +sorderSalMap.get("lsacct_sal")+ "]]></acct_code__sal>");
xmlBuff.append("<cctr_code__sal><![CDATA[" +sorderSalMap.get("lscctr_sal")+ "]]></cctr_code__sal>"); xmlBuff.append("<cctr_code__sal><![CDATA[" +sorderSalMap.get("lscctr_sal")+ "]]></cctr_code__sal>");
xmlBuff.append("<posttype><![CDATA[" +"H"+ "]]></posttype>"); xmlBuff.append("<posttype><![CDATA[" +"H"+ "]]></posttype>");
...@@ -528,7 +528,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -528,7 +528,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
xmlBuff.append("<cctr_code__dis><![CDATA["+cctrCodeDis+"]]></cctr_code__dis>"); xmlBuff.append("<cctr_code__dis><![CDATA["+cctrCodeDis+"]]></cctr_code__dis>");
} }
xmlBuff.append("<bank_code><![CDATA["+invDespMap.get("bank_code")+"]]></bank_code>"); xmlBuff.append("<bank_code><![CDATA["+invDespMap.get("bank_code")+"]]></bank_code>");
//System.out.println("sorderSalMap["+sorderSalMap+"]"); System.out.println("sorderSalMap["+sorderSalMap+"]");
arCustomerMap=new HashMap<String, String>(); arCustomerMap=new HashMap<String, String>();
arCustomerMap=getarCustomer(invDespMap.get("cust_code__bil"),conn); arCustomerMap=getarCustomer(invDespMap.get("cust_code__bil"),conn);
...@@ -659,10 +659,10 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -659,10 +659,10 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
mainInvDespDetMap=(HashMap<String, HashMap>) dataList.get(0); mainInvDespDetMap=(HashMap<String, HashMap>) dataList.get(0);
//System.out.println("@@@@@@@@@525:::mainInvDespDetMap["+mainInvDespDetMap+"]"); System.out.println("@@@@@@@@@525:::mainInvDespDetMap["+mainInvDespDetMap+"]");
for(String keyStr:mainInvDespDetMap.keySet()) for(String keyStr:mainInvDespDetMap.keySet())
{ {
//System.out.println("Detail 2:::"); System.out.println("Detail 2:::");
// if(!keyStr.contains("@")) // if(!keyStr.contains("@"))
// { // {
/** /**
...@@ -675,7 +675,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -675,7 +675,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
despLineNo=keyStr; despLineNo=keyStr;
invTraceDetMap=mainInvDespDetMap.get(keyStr); invTraceDetMap=mainInvDespDetMap.get(keyStr);
//System.out.println("Inner InvDespDetMap size:-["+invTraceDetMap.size()+"]"); System.out.println("Inner InvDespDetMap size:-["+invTraceDetMap.size()+"]");
lineNo++; lineNo++;
xmlBuff.append("<Detail2 dbID=\"\" domID=\""+lineNo+"\" objContext=\"2\" objName=\"invoice_po\">"); xmlBuff.append("<Detail2 dbID=\"\" domID=\""+lineNo+"\" objContext=\"2\" objName=\"invoice_po\">");
...@@ -846,10 +846,10 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -846,10 +846,10 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
* */ * */
// invDetBeanMap=mainInvDespDetMap.get(keyStr); // invDetBeanMap=mainInvDespDetMap.get(keyStr);
invDetBeanMap=(HashMap<String, Object>) dataList.get(1); invDetBeanMap=(HashMap<String, Object>) dataList.get(1);
//System.out.println("@@@@@@@@@@@ invDetBeanMap["+invDetBeanMap.toString()+"]"); System.out.println("@@@@@@@@@@@ invDetBeanMap["+invDetBeanMap.toString()+"]");
for(String keyStr:invDetBeanMap.keySet()) for(String keyStr:invDetBeanMap.keySet())
{ {
//System.out.println("Detail 3:::::::::::"); System.out.println("Detail 3:::::::::::");
lineNoDet++; lineNoDet++;
invoiceDetBean=(InvoiceDetBean) invDetBeanMap.get(keyStr); invoiceDetBean=(InvoiceDetBean) invDetBeanMap.get(keyStr);
...@@ -943,14 +943,14 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -943,14 +943,14 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
xmlBuff.append("</group0>"); xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>"); xmlBuff.append("</DocumentRoot>");
xmlInvString=xmlBuff.toString(); xmlInvString=xmlBuff.toString();
// System.out.println("XML generated :- ["+xmlInvString+"]"); System.out.println("XML generated :- ["+xmlInvString+"]");
/** /**
* Master statefull * Master statefull
* Save data * Save data
* */ * */
retString = saveData(loginSite, xmlInvString, xtraParams, conn); retString = saveData(loginSite, xmlInvString, xtraParams, conn);
// System.out.println("Return string after save data :- ["+retString+"]"); System.out.println("Return string after save data :- ["+retString+"]");
//fos1.write(("Return String after save data is :- [" + retString +"]\r\n").getBytes()); //fos1.write(("Return String after save data is :- [" + retString +"]\r\n").getBytes());
...@@ -965,7 +965,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -965,7 +965,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
String[] arrayForTranIdIssue = retString.split("<TranID>"); String[] arrayForTranIdIssue = retString.split("<TranID>");
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>"); int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue); tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
// System.out.println("@V@ Tran id :- [" + tranId + "]"); System.out.println("@V@ Tran id :- [" + tranId + "]");
sql="update invdet set net_amt=(quantity__stduom*rate__stduom)- ( case when disc_amt is null then 0 else disc_amt end ) +tax_amt where invoice_id=?"; sql="update invdet set net_amt=(quantity__stduom*rate__stduom)- ( case when disc_amt is null then 0 else disc_amt end ) +tax_amt where invoice_id=?";
...@@ -1372,7 +1372,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1372,7 +1372,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
{ {
dueDate=utlMethods.RelativeDate(ldTranDate,(int)liDaysNo); dueDate=utlMethods.RelativeDate(ldTranDate,(int)liDaysNo);
} }
// System.out.println("Due Date is :- ["+dueDate+"]"); System.out.println("Due Date is :- ["+dueDate+"]");
} catch (SQLException e) } catch (SQLException e)
{ {
...@@ -1380,13 +1380,13 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1380,13 +1380,13 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
System.out.println("Exception ::"+ e.getMessage()); System.out.println("Exception ::"+ e.getMessage());
throw new ITMException(e); throw new ITMException(e);
} }
//System.out.println("@@@@@@@@@@@901::::::::dueDate["+dueDate+"]"); System.out.println("@@@@@@@@@@@901::::::::dueDate["+dueDate+"]");
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String dueDate1 = sdf.format(dueDate); String dueDate1 = sdf.format(dueDate);
//System.out.println("System date :- [" + dueDate + "]"); System.out.println("System date :- [" + dueDate + "]");
//System.out.println("@@@@@@@@@@@901::::::::dueDate1["+dueDate1+"]"); System.out.println("@@@@@@@@@@@901::::::::dueDate1["+dueDate1+"]");
return dueDate1; return dueDate1;
} }
...@@ -1493,7 +1493,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1493,7 +1493,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if((rs.getString("sord_date"))!= null) if((rs.getString("sord_date"))!= null)
{ {
//System.out.println("inside if of sord_date"); System.out.println("inside if of sord_date");
sordDtStr=genericUtility.getValidDateString(checknull(rs.getString("sord_date")), genericUtility.getDBDateFormat(), sordDtStr=genericUtility.getValidDateString(checknull(rs.getString("sord_date")), genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat()); genericUtility.getApplDateFormat());
} }
...@@ -1506,7 +1506,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1506,7 +1506,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if((rs.getString("lr_date")) != null) if((rs.getString("lr_date")) != null)
{ {
//System.out.println("inside if of lr_date"); System.out.println("inside if of lr_date");
lrDtStr=genericUtility.getValidDateString(checknull(rs.getString("lr_date")), genericUtility.getDBDateFormat(), lrDtStr=genericUtility.getValidDateString(checknull(rs.getString("lr_date")), genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat()); genericUtility.getApplDateFormat());
} }
...@@ -1517,7 +1517,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1517,7 +1517,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if((rs.getString("gp_date"))!=null) if((rs.getString("gp_date"))!=null)
{ {
//System.out.println("inside if of gp_date"); System.out.println("inside if of gp_date");
gpDtStr=genericUtility.getValidDateString(checknull(rs.getString("gp_date")), genericUtility.getDBDateFormat(), gpDtStr=genericUtility.getValidDateString(checknull(rs.getString("gp_date")), genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat()); genericUtility.getApplDateFormat());
} }
...@@ -1535,7 +1535,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1535,7 +1535,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if((rs.getString("tax_date")) != null) if((rs.getString("tax_date")) != null)
{ {
//System.out.println("inside if of tax_date"); System.out.println("inside if of tax_date");
taxDtStr=genericUtility.getValidDateString(checknull(rs.getString("tax_date")), genericUtility.getDBDateFormat(), taxDtStr=genericUtility.getValidDateString(checknull(rs.getString("tax_date")), genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat()); genericUtility.getApplDateFormat());
} }
...@@ -1562,7 +1562,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1562,7 +1562,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
if((rs.getString("eff_date"))!= null) if((rs.getString("eff_date"))!= null)
{ {
//System.out.println("inside if of eff_date"); System.out.println("inside if of eff_date");
effDtStr=genericUtility.getValidDateString(checknull(rs.getString("eff_date")), genericUtility.getDBDateFormat(), effDtStr=genericUtility.getValidDateString(checknull(rs.getString("eff_date")), genericUtility.getDBDateFormat(),
genericUtility.getApplDateFormat()); genericUtility.getApplDateFormat());
} }
...@@ -1592,7 +1592,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1592,7 +1592,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
invDespMap.put("freight_amt_add", checknull(rs.getString("freight_amt_add"))); invDespMap.put("freight_amt_add", checknull(rs.getString("freight_amt_add")));
//System.out.println("MAP VALUES:::::::::::::::"+invDespMap); System.out.println("MAP VALUES:::::::::::::::"+invDespMap);
// mainInvDespMap.put(rs.getString("desp_id"), invDespMap); // mainInvDespMap.put(rs.getString("desp_id"), invDespMap);
// invDespMap=null; // invDespMap=null;
...@@ -1915,16 +1915,15 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1915,16 +1915,15 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
invTraceMap.put("netComm", commissionMap.get("netComm").toString()); invTraceMap.put("netComm", commissionMap.get("netComm").toString());
//End Added by chandrashekar on 01-09-2016 //End Added by chandrashekar on 01-09-2016
// System.out.println("@@@@@@@@@@@@@@@@@ invTraceMap["+invTraceMap+"]"); System.out.println("@@@@@@@@@@@@@@@@@ invTraceMap["+invTraceMap+"]");
mainInvDespDetMap.put(rs.getString("line_no"), invTraceMap); mainInvDespDetMap.put(rs.getString("line_no"), invTraceMap);
System.out.println("@@@@@@@@@@@@@@@@@ mainInvDespDetMap["+mainInvDespDetMap+"]");
// System.out.println("@@@@@@@@@@@@@@@@@ mainInvDespDetMap["+mainInvDespDetMap+"]");
//beanMapKey=rs.getString("sord_no").trim()+"@".trim()+rs.getString("line_no__sord").trim(); //beanMapKey=rs.getString("sord_no").trim()+"@".trim()+rs.getString("line_no__sord").trim();
beanMapKey=rs.getString("sord_no").trim()+"@".trim()+rs.getString("line_no").trim(); beanMapKey=rs.getString("sord_no").trim()+"@".trim()+rs.getString("line_no").trim();
// System.out.println("beanMapKey>>>>["+beanMapKey+"]"); System.out.println("beanMapKey>>>>["+beanMapKey+"]");
/** /**
* Check generated key is exist in * Check generated key is exist in
* Bean map * Bean map
...@@ -1984,7 +1983,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -1984,7 +1983,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
invoiceDetBean.setNetComm(commissionMap.get("netComm").toString());//Start Added by chandrashekar on 01-09-2016 invoiceDetBean.setNetComm(commissionMap.get("netComm").toString());//Start Added by chandrashekar on 01-09-2016
invoiceDetBean.setItemDescr(invTraceMap.get("item_descr")); invoiceDetBean.setItemDescr(invTraceMap.get("item_descr"));
invDetBeanMap.put(beanMapKey, invoiceDetBean); invDetBeanMap.put(beanMapKey, invoiceDetBean);
//System.out.println("@@@@@1634 invoiceDetBean added into invDetBeanMap........"); System.out.println("@@@@@1634 invoiceDetBean added into invDetBeanMap........");
} }
else else
{ {
...@@ -2002,11 +2001,11 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB ...@@ -2002,11 +2001,11 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
* Set invDetBeanMap * Set invDetBeanMap
* in mainInvDespDetMap * in mainInvDespDetMap
* */ * */
//System.out.println("@@@@@@@@@@@1384:::before:mainArrayList.size()["+mainArrayList.size()+"]:::mainInvDespDetMap[["+mainInvDespDetMap+"]]::::::::invDetBeanMap[["+invDetBeanMap+"]]"); System.out.println("@@@@@@@@@@@1384:::before:mainArrayList.size()["+mainArrayList.size()+"]:::mainInvDespDetMap[["+mainInvDespDetMap+"]]::::::::invDetBeanMap[["+invDetBeanMap+"]]");
mainArrayList.add(mainInvDespDetMap); mainArrayList.add(mainInvDespDetMap);
mainArrayList.add(invDetBeanMap); mainArrayList.add(invDetBeanMap);
//System.out.println("@@@@@@@@@@@1388:::after:mainArrayList.size()["+mainArrayList.size()+"]"); System.out.println("@@@@@@@@@@@1388:::after:mainArrayList.size()["+mainArrayList.size()+"]");
......
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