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
}
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
{
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
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
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());
String sql = "";
......@@ -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() + "]");
//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 j = 0; j < negList.size(); j++)
{
ReceiptBean negBean = negList.get(j);
negBean.setIsSelected("N");
negList.set(j, negBean);
for (int i = 0; i < negList.size(); i++)
{
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".equals(rcpBean.getIsSelected())) {
xmlBuffStr.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
}
}
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()))
}
for (int i = 0; i < posList.size(); i++)
{
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
if( posList.size() > 0 && negList.size() == 0 )
{
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);
posBean.setIsSelected("N");
posList.set(j, posBean);
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
gCnt++;
}
}
ReceiptBean rcpBean = posList.get(i);
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
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);
for (int i = 0; i < posList.size(); i++)
{
if( posList.size() > 0 && negList.size() == 0 )
{
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);
xmlBuff.append(generateXmls(detailDom, gCnt, rcpBean.getIsSelected(), rcpBean));
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
}//end of for (ArrayList templist : custGrpMap.values())
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("xml xmlBuff::::"+xmlBuff);
//System.out.println("xml xmlBuff::::"+xmlBuff);
}//end of suggestion flag
//Pavan R on 24MAY18 End
}//try
catch (SQLException e)
{
System.out.println("SQLException ::GenerateReceiptPrcEJB :" +sql+ e.getMessage() + ":");
System.out.println("SQLException ::GenerateReceiptPrcEJB : getViewData::" +sql+ e.getMessage() + ":");
throw new ITMException(e);
}
catch(Exception ex)
{
System.out.println("Exception []::GenerateReceiptPrcEJB :"+ex.getMessage());
System.out.println("Exception []::GenerateReceiptPrcEJB : getViewData"+ex.getMessage());
ex.printStackTrace();
throw new ITMException(ex);
}
//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();
}else
}
else
{
resultString = retTabSepStrBuff.toString();
}
System.out.println("xml----["+resultString+"]");
System.out.println("getViewData xmlStrng----["+resultString+"]");
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,resultString,true);
if (!errCode.equals(""))
{
......@@ -691,13 +780,13 @@ Put a validation chq amount in filter and total of details matches in case heade
catch (SQLException e)
{
//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);
}
catch(Exception ex)
{
//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();
throw new ITMException(ex);
}
......@@ -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 cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",acctCodeCfAr = "";
String invoiceId = "",lineNo = "",chequeNo = "",schequeDate = "",schqAmount = "",refNo = "",cctrCodeCfAr = "";
String jvAutoConf = "";
String jvAutoConf = "", entryBatchNo = "";
NodeList parentNodeList = null,parentNodeList2 = null;
NodeList childNodeList = null,childNodeList2 = 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
HashMap receiptMap = null;
double adjAmt=0,totalAdjAmt =0.0;// added by nandkumar gadkari on 03/04/18
String groupCode="";
String xmlString = "";
try
{
if(conn==null)
......@@ -809,9 +899,10 @@ conn = getConnection();
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode"); //changes by Nandkumar gadkari on 29/03/18
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.
jvAutoConf = genericUtility.getColumnValue("jv_auto_conf",headerDom);
System.out.println("Pavan----jvAutoConf ["+jvAutoConf+"]");
//Added by Pavan R 10-may-18 end
jvAutoConf = genericUtility.getColumnValue("jv_auto_conf",headerDom);
entryBatchNo = checkNull(genericUtility.getColumnValue("entry_batch_no", headerDom));//added by Pavan R 30aug18[to added in receivables header]
System.out.println("Pavan----jvAutoConf ["+jvAutoConf+"]entryBatchNo["+entryBatchNo+"]");
//Added by Pavan R 10-may-18 end
siteCode = genericUtility.getColumnValue("site_code",headerDom);
//custCode = genericUtility.getColumnValue("cust_code",headerDom);
sdueDate = genericUtility.getColumnValue("due_date",headerDom);
......@@ -1064,9 +1155,16 @@ conn = getConnection();
e.printStackTrace();
throw new ITMException(e);
}*/
parentNodeList = detailDom.getElementsByTagName("Detail2");
//Pavan r 30aug18 to get selected data from getviewData
if("generate_receipt_process".equals(windowName))
{
xmlString = getViewData(headerDom, detailDom, windowName, xtraParams);
detailDom = genericUtility.parseString(xmlString);
parentNodeList = detailDom.getElementsByTagName("Detail2");
}
else {
parentNodeList = detailDom.getElementsByTagName("Detail2");
}
parentNodeListLength = parentNodeList.getLength();
System.out.println("ParentNodeListLength....::- "+parentNodeListLength);
//System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim());
......@@ -1076,9 +1174,10 @@ conn = getConnection();
parentNode = parentNodeList.item(selectedRow);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength--["+childNodeListLength+"]");
for (int childRow = 0; childRow < childNodeListLength; childRow++)
{
System.out.println("childRow["+childRow+"]");
childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName---"+childNodeName);
......@@ -1192,6 +1291,7 @@ conn = getConnection();
chequeDate = java.sql.Timestamp.valueOf(schequeDate+" 00:00:00");
}
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_term",chgTerm);
receiptMap.put("chg_date",chgDate);
......@@ -1768,7 +1868,7 @@ conn = getConnection();
String acctCodeAdv = "",cctrCodeAdv = "",finEntity = "",acctPrd = "",bankName = "",acctCodeBal = "";
String cctrCodeBal = "",acctCodeCf = "",cctrCodeCf = "",chgUser = "",chgTerm = "",custBankRef = "",refNo = "";
//String remarks = "AUTO-RECEIPT GENERATION";
String remarks = "";
String remarks = "", entryBatchNo="";
double advAmt = 0,exchRate = 0,chqAmt = 0;
int count = 0;
double initialValue=0.0;
......@@ -1802,6 +1902,7 @@ conn = getConnection();
custBankRef = (String)insertMap.get("cust_bank_ref");
exchRate = ((Double)insertMap.get("std_exrt")).doubleValue();
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);
chqAmt = chequeAmtToHdr;//((Double)insertMap.get("chq_amt")).doubleValue();
......@@ -1812,8 +1913,8 @@ conn = getConnection();
+ "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,"
+ "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 ) "
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J')";
+" ADVADJ_AMT,NET_AMT,NET_AMT__BC,TRAN_TYPE, ENTRY_BATCH_NO ) "
+ "VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'N',?,?,?,?,? ,'J',?)";
System.out.println("Insert SQL ::- "+sql);
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,"Insert SQL ::- "+sql,true);
......@@ -1850,6 +1951,7 @@ conn = getConnection();
pstmt.setDouble(30,initialValue);
pstmt.setDouble(31,initialValue);
pstmt.setDouble(32,initialValue);
pstmt.setString(33,entryBatchNo);
count = pstmt.executeUpdate();
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