Commit 53198b47 authored by prane's avatar prane

changes done for new menu of Auto Ar Settlement Process

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190177 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a0f3fe26
...@@ -143,8 +143,35 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -143,8 +143,35 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
} }
return rtrStr; return rtrStr;
} }
//Pavan R on 30aug18 below method added and exsiting method is declared as privete and called to pass selected data on process() method.
public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException public String getData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{
String errString = "";
String preview = "";
try
{
errString = getViewData(headerDom, detailDom, windowName, xtraParams);
}
catch (Exception e)
{
System.out.println("Exception :GenerateReceiptPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
throw new ITMException(e);
}finally
{
try
{
errString= null;
}
catch(Exception e)
{
e.printStackTrace();
}
}
return errString;
}
private String getViewData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
{ {
/* /*
...@@ -178,7 +205,17 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -178,7 +205,17 @@ Put a validation chq amount in filter and total of details matches in case heade
xmlBuff.append("<group0>"); xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>"); xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>"); xmlBuff.append("<Header0>");
StringBuffer xmlBuffStr = new StringBuffer("<?xml version = \"1.0\"?>");
System.out.println("In GetViewData::["+windowName+"]");
if("generate_receipt_process".equals(windowName))
{
xmlBuffStr.append("<DocumentRoot>");
xmlBuffStr.append("<description>").append("Datawindow Root").append("</description>");
xmlBuffStr.append("<group0>");
xmlBuffStr.append("<description>").append("Group0 description").append("</description>");
xmlBuffStr.append("<Header0>");
}
java.sql.Date currDate = new java.sql.Date(System.currentTimeMillis()); java.sql.Date currDate = new java.sql.Date(System.currentTimeMillis());
String sql = ""; String sql = "";
...@@ -607,80 +644,132 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -607,80 +644,132 @@ Put a validation chq amount in filter and total of details matches in case heade
} }
System.out.println("@@@@@ POSListSize[" + posList.size()+ "]****NEGListSize[" + negList.size() + "]"); System.out.println("@@@@@ POSListSize[" + posList.size()+ "]****NEGListSize[" + negList.size() + "]");
//int cnt = 1; //int cnt = 1;
for (int i = 0; i < negList.size(); i++) //Pavan R on 30aug2018 to get only selected data for process method on preview flag
System.out.println("windowName["+windowName+"]");
if("generate_receipt_process".equals(windowName))
{ {
if( negList.size() > 0 && posList.size() == 0 ) for (int i = 0; i < negList.size(); i++)
{ {
for (int j = 0; j < negList.size(); j++) if( negList.size() > 0 && posList.size() == 0 )
{ {
ReceiptBean negBean = negList.get(j); for (int j = 0; j < negList.size(); j++)
negBean.setIsSelected("N"); {
negList.set(j, negBean); ReceiptBean negBean = negList.get(j);
negBean.setIsSelected("N");
negList.set(j, negBean);
}
}
ReceiptBean rcpBean = negList.get(i);
//below if condition added to append unselected negative records after matched selected
if ("Y".equals(rcpBean.getIsSelected())) {
xmlBuffStr.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
} }
} }
ReceiptBean rcpBean = negList.get(i); for (int i = 0; i < posList.size(); i++)
//below if condition added to append unselected negative records after matched selected
if("Y".equalsIgnoreCase(rcpBean.getIsSelected())||"N".equalsIgnoreCase(rcpBean.getIsSelected()))
{ {
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean)); if( posList.size() > 0 && negList.size() == 0 )
gCnt++; {
for (int j = 0; j < posList.size(); j++)
{
ReceiptBean posBean = posList.get(j);
posBean.setIsSelected("N");
posList.set(j, posBean);
}
}
ReceiptBean rcpBean = posList.get(i);
if ("Y".equals(rcpBean.getIsSelected())) {
xmlBuffStr.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
}
} }
}
for (int i = 0; i < posList.size(); i++) }//Pavan R on 30aug2018 to get only selected data for process method on preview flag END
else
{ {
if( posList.size() > 0 && negList.size() == 0 ) for (int i = 0; i < negList.size(); i++)
{ {
for (int j = 0; j < posList.size(); j++) if( negList.size() > 0 && posList.size() == 0 )
{
for (int j = 0; j < negList.size(); j++)
{
ReceiptBean negBean = negList.get(j);
negBean.setIsSelected("N");
negList.set(j, negBean);
}
}
ReceiptBean rcpBean = negList.get(i);
//below if condition added to append unselected negative records after matched selected
if("Y".equalsIgnoreCase(rcpBean.getIsSelected())||"N".equalsIgnoreCase(rcpBean.getIsSelected()))
{ {
ReceiptBean posBean = posList.get(j); xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
posBean.setIsSelected("N"); gCnt++;
posList.set(j, posBean);
} }
} }
ReceiptBean rcpBean = posList.get(i); for (int i = 0; i < posList.size(); i++)
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean)); {
gCnt++; if( posList.size() > 0 && negList.size() == 0 )
} {
//below loop added to append unselected negative records after matched selected for (int j = 0; j < posList.size(); j++)
for (int i = 0; i < negList.size(); i++) {
{ ReceiptBean posBean = posList.get(j);
ReceiptBean rcpBean = negList.get(i); posBean.setIsSelected("N");
if("".equalsIgnoreCase(rcpBean.getIsSelected())) posList.set(j, posBean);
{//ReceiptBean rcpBean = negList.get(i); }
}
ReceiptBean rcpBean = posList.get(i);
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean)); xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++; gCnt++;
} }
//below loop added to append unselected negative records after matched selected
for (int i = 0; i < negList.size(); i++)
{
ReceiptBean rcpBean = negList.get(i);
if("".equalsIgnoreCase(rcpBean.getIsSelected()))
{//ReceiptBean rcpBean = negList.get(i);
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
}
}
} }
//Changes done on 26JUN2018 End //Changes done on 26JUN2018 End
}//end of for (ArrayList templist : custGrpMap.values()) }//end of for (ArrayList templist : custGrpMap.values())
xmlBuff.append("</Header0>"); xmlBuff.append("</Header0>");
xmlBuff.append("</group0>"); xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>"); xmlBuff.append("</DocumentRoot>");
System.out.println("xml xmlBuff::::"+xmlBuff); //System.out.println("xml xmlBuff::::"+xmlBuff);
}//end of suggestion flag }//end of suggestion flag
//Pavan R on 24MAY18 End //Pavan R on 24MAY18 End
}//try }//try
catch (SQLException e) catch (SQLException e)
{ {
System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":"); System.out.println("SQLException ::GenerateReceiptPrcEJB : getViewData::" +sql+ e.getMessage() + ":");
throw new ITMException(e); throw new ITMException(e);
} }
catch(Exception ex) catch(Exception ex)
{ {
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage()); System.out.println("Exception []::GenerateReceiptPrcEJB : getViewData"+ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
//if suggested adj is Y then display selected/unselected data else exsting will work //if suggested adj is Y then display selected/unselected data else exsting will work
if("Y".equalsIgnoreCase(suggestAdj)) if("generate_receipt_process".equals(windowName) && "Y".equalsIgnoreCase(suggestAdj))
{
xmlBuffStr.append("</Header0>");
xmlBuffStr.append("</group0>");
xmlBuffStr.append("</DocumentRoot>");
resultString = xmlBuffStr.toString();
}
else if("Y".equalsIgnoreCase(suggestAdj))
{ {
resultString = xmlBuff.toString(); resultString = xmlBuff.toString();
}else }
else
{ {
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString();
} }
System.out.println("xml----["+resultString+"]"); System.out.println("getViewData xmlStrng----["+resultString+"]");
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,resultString,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,resultString,true);
if (!errCode.equals("")) if (!errCode.equals(""))
{ {
...@@ -691,13 +780,13 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -691,13 +780,13 @@ Put a validation chq amount in filter and total of details matches in case heade
catch (SQLException e) catch (SQLException e)
{ {
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":"); System.out.println("SQLException :GenerateReceiptPrcEJB :getViewData ::" +sql+ e.getMessage() + ":");
throw new ITMException(e); throw new ITMException(e);
} }
catch(Exception ex) catch(Exception ex)
{ {
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,ex,true);
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage()); System.out.println("Exception :GenerateReceiptPrcEJB :getViewData :: "+ex.getMessage());
ex.printStackTrace(); ex.printStackTrace();
throw new ITMException(ex); throw new ITMException(ex);
} }
...@@ -781,7 +870,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -781,7 +870,7 @@ Put a validation chq amount in filter and total of details matches in case heade
String acctCodeAdv = "",cctrCodeAdv = "",finEntity = "",acctPrd = "",bankName = "",acctCodeBal = ""; String acctCodeAdv = "",cctrCodeAdv = "",finEntity = "",acctPrd = "",bankName = "",acctCodeBal = "";
String cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",acctCodeCfAr = ""; String cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",acctCodeCfAr = "";
String invoiceId = "",lineNo = "",chequeNo = "",schequeDate = "",schqAmount = "",refNo = "",cctrCodeCfAr = ""; String invoiceId = "",lineNo = "",chequeNo = "",schequeDate = "",schqAmount = "",refNo = "",cctrCodeCfAr = "";
String jvAutoConf = ""; String jvAutoConf = "", entryBatchNo = "";
NodeList parentNodeList = null,parentNodeList2 = null; NodeList parentNodeList = null,parentNodeList2 = null;
NodeList childNodeList = null,childNodeList2 = null; NodeList childNodeList = null,childNodeList2 = null;
Node parentNode = null,parentNode2 = null; Node parentNode = null,parentNode2 = null;
...@@ -795,6 +884,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -795,6 +884,7 @@ Put a validation chq amount in filter and total of details matches in case heade
HashMap receiptMap = null; HashMap receiptMap = null;
double adjAmt=0,totalAdjAmt =0.0;// added by nandkumar gadkari on 03/04/18 double adjAmt=0,totalAdjAmt =0.0;// added by nandkumar gadkari on 03/04/18
String groupCode=""; String groupCode="";
String xmlString = "";
try try
{ {
if(conn==null) if(conn==null)
...@@ -809,9 +899,10 @@ conn = getConnection(); ...@@ -809,9 +899,10 @@ conn = getConnection();
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); //changes by Nandkumar gadkari on 29/03/18 chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); //changes by Nandkumar gadkari on 29/03/18
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId"); chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
//Added by Pavan R 10-may-18 to flag in filter on receivable JV creation, to create a confirmed or unconfirmed JV. //Added by Pavan R 10-may-18 to flag in filter on receivable JV creation, to create a confirmed or unconfirmed JV.
jvAutoConf = genericUtility.getColumnValue("jv_auto_conf",headerDom); jvAutoConf = genericUtility.getColumnValue("jv_auto_conf",headerDom);
System.out.println("Pavan----jvAutoConf ["+jvAutoConf+"]"); entryBatchNo = checkNull(genericUtility.getColumnValue("entry_batch_no", headerDom));//added by Pavan R 30aug18[to added in receivables header]
//Added by Pavan R 10-may-18 end System.out.println("Pavan----jvAutoConf ["+jvAutoConf+"]entryBatchNo["+entryBatchNo+"]");
//Added by Pavan R 10-may-18 end
siteCode = genericUtility.getColumnValue("site_code",headerDom); siteCode = genericUtility.getColumnValue("site_code",headerDom);
//custCode = genericUtility.getColumnValue("cust_code",headerDom); //custCode = genericUtility.getColumnValue("cust_code",headerDom);
sdueDate = genericUtility.getColumnValue("due_date",headerDom); sdueDate = genericUtility.getColumnValue("due_date",headerDom);
...@@ -1064,9 +1155,16 @@ conn = getConnection(); ...@@ -1064,9 +1155,16 @@ conn = getConnection();
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
}*/ }*/
//Pavan r 30aug18 to get selected data from getviewData
if("generate_receipt_process".equals(windowName))
parentNodeList = detailDom.getElementsByTagName("Detail2"); {
xmlString = getViewData(headerDom, detailDom, windowName, xtraParams);
detailDom = genericUtility.parseString(xmlString);
parentNodeList = detailDom.getElementsByTagName("Detail2");
}
else {
parentNodeList = detailDom.getElementsByTagName("Detail2");
}
parentNodeListLength = parentNodeList.getLength(); parentNodeListLength = parentNodeList.getLength();
System.out.println("ParentNodeListLength....::- "+parentNodeListLength); System.out.println("ParentNodeListLength....::- "+parentNodeListLength);
//System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim()); //System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim());
...@@ -1076,9 +1174,10 @@ conn = getConnection(); ...@@ -1076,9 +1174,10 @@ conn = getConnection();
parentNode = parentNodeList.item(selectedRow); parentNode = parentNodeList.item(selectedRow);
childNodeList = parentNode.getChildNodes(); childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength(); childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength--["+childNodeListLength+"]");
for (int childRow = 0; childRow < childNodeListLength; childRow++) for (int childRow = 0; childRow < childNodeListLength; childRow++)
{ {
System.out.println("childRow["+childRow+"]");
childNode = childNodeList.item(childRow); childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
System.out.println("childNodeName---"+childNodeName); System.out.println("childNodeName---"+childNodeName);
...@@ -1192,6 +1291,7 @@ conn = getConnection(); ...@@ -1192,6 +1291,7 @@ conn = getConnection();
chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00"); chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00");
} }
receiptMap = new HashMap(); receiptMap = new HashMap();
receiptMap.put("entry_batch_no",entryBatchNo); //added by Pavan R 30aug18[to added in receivablesJV header]
receiptMap.put("chg_user",chgUser); receiptMap.put("chg_user",chgUser);
receiptMap.put("chg_term",chgTerm); receiptMap.put("chg_term",chgTerm);
receiptMap.put("chg_date",chgDate); receiptMap.put("chg_date",chgDate);
...@@ -1768,7 +1868,7 @@ conn = getConnection(); ...@@ -1768,7 +1868,7 @@ conn = getConnection();
String acctCodeAdv = "",cctrCodeAdv = "",finEntity = "",acctPrd = "",bankName = "",acctCodeBal = ""; String acctCodeAdv = "",cctrCodeAdv = "",finEntity = "",acctPrd = "",bankName = "",acctCodeBal = "";
String cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",refNo = ""; String cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",refNo = "";
//String remarks = "AUTO-RECEIPT GENERATION"; //String remarks = "AUTO-RECEIPT GENERATION";
String remarks = ""; String remarks = "", entryBatchNo="";
double advAmt = 0,exchRate = 0,chqAmt = 0; double advAmt = 0,exchRate = 0,chqAmt = 0;
int count = 0; int count = 0;
double initialValue=0.0; double initialValue=0.0;
...@@ -1802,6 +1902,7 @@ conn = getConnection(); ...@@ -1802,6 +1902,7 @@ conn = getConnection();
custBankRef = (String)insertMap.get("cust_bank_ref"); custBankRef = (String)insertMap.get("cust_bank_ref");
exchRate = ((Double)insertMap.get("std_exrt")).doubleValue(); exchRate = ((Double)insertMap.get("std_exrt")).doubleValue();
remarks = (String)insertMap.get("remarks");//added by Kunal remarks = (String)insertMap.get("remarks");//added by Kunal
entryBatchNo = checkNull((String)insertMap.get("entry_batch_no")); //added by Pavan R 30aug18[to added in receivablesJV header]
System.out.println("remarks:::"+remarks); System.out.println("remarks:::"+remarks);
chqAmt = chequeAmtToHdr;//((Double)insertMap.get("chq_amt")).doubleValue(); chqAmt = chequeAmtToHdr;//((Double)insertMap.get("chq_amt")).doubleValue();
...@@ -1812,8 +1913,8 @@ conn = getConnection(); ...@@ -1812,8 +1913,8 @@ conn = getConnection();
+ "EFF_DATE,SITE_CODE,CHG_DATE,CHG_USER,CHG_TERM,ACCT_CODE__AR,CCTR_CODE__AR," + "EFF_DATE,SITE_CODE,CHG_DATE,CHG_USER,CHG_TERM,ACCT_CODE__AR,CCTR_CODE__AR,"
+ "CURR_CODE,ACCT_CODE__ADV,CCTR_CODE__ADV,CUST_BANK_REF,EXCH_RATE,EXCH_RATE_SPOT," + "CURR_CODE,ACCT_CODE__ADV,CCTR_CODE__ADV,CUST_BANK_REF,EXCH_RATE,EXCH_RATE_SPOT,"
+ "FIN_ENTITY,ACCT_CODE__BAL,CCTR_CODE__BAL,ACCT_CODE__CF,CCTR_CODE__CF,REMARKS,CHQ_AMT, CONFIRMED, OTH_AMT,ADV_AMT," + "FIN_ENTITY,ACCT_CODE__BAL,CCTR_CODE__BAL,ACCT_CODE__CF,CCTR_CODE__CF,REMARKS,CHQ_AMT, CONFIRMED, OTH_AMT,ADV_AMT,"
+" ADVADJ_AMT,NET_AMT,NET_AMT__BC,TRAN_TYPE ) " +" ADVADJ_AMT,NET_AMT,NET_AMT__BC,TRAN_TYPE, ENTRY_BATCH_NO ) "
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J')"; + "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J',?)";
System.out.println("Insert SQL ::- "+sql); System.out.println("Insert SQL ::- "+sql);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Insert SQL ::- "+sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Insert SQL ::- "+sql,true);
...@@ -1850,6 +1951,7 @@ conn = getConnection(); ...@@ -1850,6 +1951,7 @@ conn = getConnection();
pstmt.setDouble(30,initialValue); pstmt.setDouble(30,initialValue);
pstmt.setDouble(31,initialValue); pstmt.setDouble(31,initialValue);
pstmt.setDouble(32,initialValue); pstmt.setDouble(32,initialValue);
pstmt.setString(33,entryBatchNo);
count = pstmt.executeUpdate(); count = pstmt.executeUpdate();
System.out.println("No of records inserted successfully in RECEIPT are : "+count); System.out.println("No of records inserted successfully in RECEIPT are : "+count);
......
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