Commit 6a89a155 authored by msharma's avatar msharma

Partial Adjustment and Group Code wise JV Generation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92193 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d82fd9fd
......@@ -705,6 +705,8 @@ Put a validation chq amount in filter and total of details matches in case heade
boolean flag = false;
String searchKey = null;
HashMap receiptMap = null;
double adjAmt=0;
String groupCode="";
try
{
if(conn==null)
......@@ -973,6 +975,7 @@ Put a validation chq amount in filter and total of details matches in case heade
parentNodeList = detailDom.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
System.out.println("ParentNodeListLength....::- "+parentNodeListLength);
//System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim());
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
......@@ -984,7 +987,8 @@ Put a validation chq amount in filter and total of details matches in case heade
{
childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName---"+childNodeName);
//System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim());
if (childNodeName.equals("invoice_id"))
{
invoiceId = (childNode.getFirstChild().getNodeValue()).trim();
......@@ -1030,8 +1034,28 @@ Put a validation chq amount in filter and total of details matches in case heade
remarks = (childNode.getFirstChild().getNodeValue()).trim();
System.out.println("remarks :::::"+ remarks);
}
if (childNodeName.equals("adj_amt"))//added by kunal on 19/10/12
{
adjAmt = Double.parseDouble((childNode.getFirstChild().getNodeValue()).trim());
System.out.println("adjAmt :::::"+ adjAmt);
}
}//inner for
searchKey = chequeNo + ":" + custCode; //added by rajesh k to concate chequeNo and custCode
sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?";
writeLog(filePtr,sql,true);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode);
rs = pstmt.executeQuery();
if(rs.next())
{
groupCode = rs.getString(1);
}
System.out.println("Group Code ::: "+groupCode);
rs.close();
pstmt.close();
//searchKey = chequeNo + ":" + custCode; //added by rajesh k to concate chequeNo and custCode
searchKey= chequeNo + ":" + groupCode;//Added By Manoj dtd 26/11/2012 for Group Code
writeLog(filePtr,"chequeNo::::: "+chequeNo,true);
writeLog(filePtr,"custCode::::: "+custCode,true);
writeLog(filePtr,"searchKey::::: "+searchKey,true);
......@@ -1059,7 +1083,8 @@ Put a validation chq amount in filter and total of details matches in case heade
receiptMap.put("tran_date",tranDate);
receiptMap.put("search_key",searchKey);//added by rajesh k to put serachkey in map
receiptMap.put("ref_no",chequeNo);
receiptMap.put("cust_code",custCode);// added by rajesh k to put custcode in map
//receiptMap.put("cust_code",custCode);// added by rajesh k to put custcode in map
receiptMap.put("cust_code",groupCode);//Added By Manoj dtd 26/11/2012 for Group Code
receiptMap.put("ref_date",chequeDate);
receiptMap.put("remarks",remarks); //added by Kunal on 19/10/12
receiptMap.put("chq_amt",new Double(chqAmount));
......@@ -1075,7 +1100,8 @@ Put a validation chq amount in filter and total of details matches in case heade
receiptElements = new ReceiptElements();
receiptElements.setSearchKey(searchKey);
receiptElements.setChequeNo(chequeNo);
receiptElements.setCustCode(custCode);
//receiptElements.setCustCode(custCode);
receiptElements.setCustCode(groupCode);//Added By Manoj dtd 26/11/2012 for Group Code
//*********add on 25102006 by taranisen total cheque amt should be equals to invoice amt
receiptElements.setChequeAmt(chqAmount);
......@@ -1092,7 +1118,7 @@ Put a validation chq amount in filter and total of details matches in case heade
}
ReceiptDetail receiptDetail = invoiceDetail(invoiceId,tranSer,conn);
ReceiptDetail receiptDetail = invoiceDetail(invoiceId,tranSer,adjAmt,conn);
receiptElements.setReceiptMap(receiptMap);
receiptElements.setInvoiceList(receiptDetail);
receiptList.set(ele,receiptElements);
......@@ -1158,6 +1184,7 @@ Put a validation chq amount in filter and total of details matches in case heade
double amountcheque = receiptElements.getChequeAmt();
receiptMap = (HashMap) receiptElements.getReceiptMap();
custCode = receiptElements.getCustCode();
System.out.println("1187---custCode----"+custCode);
receiptMap = CustDetail(custCode, receiptMap,siteCode);//added by rajeshk to call method CustDetail
//tranId = generateTranTd("w_receipt_adv",trDate,siteCode);
tranId = generateTranTd("w_receivables_jv",trDate,siteCode);
......@@ -1906,7 +1933,7 @@ Put a validation chq amount in filter and total of details matches in case heade
private ReceiptDetail invoiceDetail(String invoiceId,String tranSer,Connection conn) throws ITMException
private ReceiptDetail invoiceDetail(String invoiceId,String tranSer,double adjustAmt,Connection conn) throws ITMException
{
FinCommon finCommon = new FinCommon();
ReceiptDetail receiptDetail = new ReceiptDetail();
......@@ -2064,7 +2091,13 @@ Put a validation chq amount in filter and total of details matches in case heade
throw new ITMException(e);
}
}//if
rcpAmt = (totAmt - adjAmt);
//Manoj dtd 26/11/2012 to adjust Partial Amount
if(adjustAmt==0)
rcpAmt = (totAmt - adjAmt);
else
rcpAmt=adjustAmt;
System.out.println("adjustAmt----"+adjustAmt);
System.out.println("rcpAmt----"+rcpAmt);
bdFluctuation = finCommon.getFinparams("999999","BD_FLUCTUATION_CF",conn);
writeLog(filePtr,"bdFluctuation:::"+bdFluctuation,true);
......
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