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 ...@@ -705,6 +705,8 @@ Put a validation chq amount in filter and total of details matches in case heade
boolean flag = false; boolean flag = false;
String searchKey = null; String searchKey = null;
HashMap receiptMap = null; HashMap receiptMap = null;
double adjAmt=0;
String groupCode="";
try try
{ {
if(conn==null) if(conn==null)
...@@ -973,6 +975,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -973,6 +975,7 @@ Put a validation chq amount in filter and total of details matches in case heade
parentNodeList = detailDom.getElementsByTagName("Detail2"); 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());
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++) 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 ...@@ -984,7 +987,8 @@ Put a validation chq amount in filter and total of details matches in case heade
{ {
childNode = childNodeList.item(childRow); childNode = childNodeList.item(childRow);
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
System.out.println("childNodeName---"+childNodeName);
//System.out.println("(childNode.getFirstChild().getNodeValue()).trim()----"+(childNode.getFirstChild().getNodeValue()).trim());
if (childNodeName.equals("invoice_id")) if (childNodeName.equals("invoice_id"))
{ {
invoiceId = (childNode.getFirstChild().getNodeValue()).trim(); invoiceId = (childNode.getFirstChild().getNodeValue()).trim();
...@@ -1030,8 +1034,28 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1030,8 +1034,28 @@ Put a validation chq amount in filter and total of details matches in case heade
remarks = (childNode.getFirstChild().getNodeValue()).trim(); remarks = (childNode.getFirstChild().getNodeValue()).trim();
System.out.println("remarks :::::"+ remarks); 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 }//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,"chequeNo::::: "+chequeNo,true);
writeLog(filePtr,"custCode::::: "+custCode,true); writeLog(filePtr,"custCode::::: "+custCode,true);
writeLog(filePtr,"searchKey::::: "+searchKey,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 ...@@ -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("tran_date",tranDate);
receiptMap.put("search_key",searchKey);//added by rajesh k to put serachkey in map receiptMap.put("search_key",searchKey);//added by rajesh k to put serachkey in map
receiptMap.put("ref_no",chequeNo); 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("ref_date",chequeDate);
receiptMap.put("remarks",remarks); //added by Kunal on 19/10/12 receiptMap.put("remarks",remarks); //added by Kunal on 19/10/12
receiptMap.put("chq_amt",new Double(chqAmount)); 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 ...@@ -1075,7 +1100,8 @@ Put a validation chq amount in filter and total of details matches in case heade
receiptElements = new ReceiptElements(); receiptElements = new ReceiptElements();
receiptElements.setSearchKey(searchKey); receiptElements.setSearchKey(searchKey);
receiptElements.setChequeNo(chequeNo); 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 //*********add on 25102006 by taranisen total cheque amt should be equals to invoice amt
receiptElements.setChequeAmt(chqAmount); receiptElements.setChequeAmt(chqAmount);
...@@ -1092,7 +1118,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -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.setReceiptMap(receiptMap);
receiptElements.setInvoiceList(receiptDetail); receiptElements.setInvoiceList(receiptDetail);
receiptList.set(ele,receiptElements); receiptList.set(ele,receiptElements);
...@@ -1158,6 +1184,7 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -1158,6 +1184,7 @@ Put a validation chq amount in filter and total of details matches in case heade
double amountcheque = receiptElements.getChequeAmt(); double amountcheque = receiptElements.getChequeAmt();
receiptMap = (HashMap) receiptElements.getReceiptMap(); receiptMap = (HashMap) receiptElements.getReceiptMap();
custCode = receiptElements.getCustCode(); custCode = receiptElements.getCustCode();
System.out.println("1187---custCode----"+custCode);
receiptMap = CustDetail(custCode, receiptMap,siteCode);//added by rajeshk to call method CustDetail receiptMap = CustDetail(custCode, receiptMap,siteCode);//added by rajeshk to call method CustDetail
//tranId = generateTranTd("w_receipt_adv",trDate,siteCode); //tranId = generateTranTd("w_receipt_adv",trDate,siteCode);
tranId = generateTranTd("w_receivables_jv",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 ...@@ -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(); FinCommon finCommon = new FinCommon();
ReceiptDetail receiptDetail = new ReceiptDetail(); ReceiptDetail receiptDetail = new ReceiptDetail();
...@@ -2064,7 +2091,13 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -2064,7 +2091,13 @@ Put a validation chq amount in filter and total of details matches in case heade
throw new ITMException(e); throw new ITMException(e);
} }
}//if }//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); bdFluctuation = finCommon.getFinparams("999999","BD_FLUCTUATION_CF",conn);
writeLog(filePtr,"bdFluctuation:::"+bdFluctuation,true); 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