Commit e72192bf authored by mjadhav's avatar mjadhav

add cheque amt and adj amt value


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97558 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b51128f6
......@@ -273,12 +273,13 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
ResultSet rs1 =null;
String tranDate =null;
int lineNo=0;
String siteCode="";
int lineNo=0,lineNoCnt=0;
String siteCode="";
HashMap<String, String> tempMap = new HashMap<String, String>();
Date refDate=null,effDate=null;
double rcpAmt =0.0,chqAmt=0.0;
double rcpAmt =0.0,chqAmt=0.0,totRcpAmt=0.0,adjAmt=0.0,chqAmtNew=0.0;
itmDBAccessEJB = new ITMDBAccessEJB();
SimpleDateFormat sdf = new SimpleDateFormat(e12GenericUtility.getApplDateFormat());
......@@ -334,7 +335,11 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
refSer = refSer == null ? "" : refSer.trim();
refSer = refSer == null ? "" : refSer.trim();*/
if(remarks == "")
{
remarks="auto generated receipt through domestic receipt-"+tranId;
}
/*---------------------------------------------------------------------------------------*/
/*sql = "select acct_code__ar, cctr_code__ar, curr_code, " +
......@@ -432,11 +437,53 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
finEntity = finEntity == null ? "" : finEntity.trim();
/*--------------------------------------------------------------------------------------*/
/*------------------------changes done on 10-MARCH-2015------------------------------------*/
sql=" select ref_ser,ref_no,line_no__ref,line_no,rcp_amt from rcpdet_form where tran_id=? ";
System.out.println("<!@#>Adding detail 2.......... sql "+sql);
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,tranId);
rs1=pstmt1.executeQuery();
while(rs1.next())
{
lineNoCnt++;
System.out.println("lineNo is " + lineNoCnt);
refSer=rs1.getString("ref_ser");
lineNo=rs1.getInt("line_no");
refNo=rs1.getString("ref_no");
lineNoRef=rs1.getString("line_no__ref");
rcpAmt=rs1.getDouble("rcp_amt");
refSer = refSer == null ? "" : refSer.trim();
refNo = refNo == null ? "" : refNo.trim();
lineNoRef = lineNoRef == null ? "" : lineNoRef.trim();
System.out.println("lineNo :"+lineNo);
totRcpAmt = totRcpAmt + rcpAmt;
tempMap.put("line_no" + lineNoCnt, String.valueOf(lineNo));
tempMap.put("line_no_ref" + lineNoCnt, lineNoRef);
tempMap.put("ref_ser" + lineNoCnt, refSer);
tempMap.put("ref_no" + lineNoCnt, refNo);
tempMap.put("rcp_amt" + lineNoCnt, String.valueOf(rcpAmt));
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
System.out.println("totRcpAmt :"+totRcpAmt);
/*--------------------------------------------------------------------------------------------------*/
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
......@@ -476,6 +523,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
else
{
xmlBuff.append("<ref_date><![CDATA[]]></ref_date>");
}
......@@ -493,7 +541,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
xmlBuff.append("<site_code><![CDATA["+siteCode+"]]></site_code>");
xmlBuff.append("<confirmed><![CDATA[]]></confirmed>");
xmlBuff.append("<auto_recd><![CDATA[]]></auto_recd>");
xmlBuff.append("<adv_amt><![CDATA[0]]></adv_amt>");
//xmlBuff.append("<bill_amt><![CDATA[]]></bill_amt>");
// xmlBuff.append("<acct_code__cf><![CDATA["+acctCodeCfHD+"]]></acct_code__cf>");
// xmlBuff.append("<cctr_code__cf><![CDATA["+cctrCodeCfHD+"]]></cctr_code__cf>");
......@@ -513,7 +561,23 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
//xmlBuff.append("<acct_code__adv><![CDATA["+acctCodeAdvHD+"]]></acct_code__adv>");
//xmlBuff.append("<cctr_code__adv><![CDATA["+cctrCodeArHD+"]]></cctr_code__adv>");
xmlBuff.append("<emp_code__aprv><![CDATA[]]></emp_code__aprv>");
xmlBuff.append("<chq_amt><![CDATA["+chqAmt+"]]></chq_amt>");
if(chqAmt > totRcpAmt)
{
adjAmt=chqAmt - totRcpAmt;
xmlBuff.append("<chq_amt><![CDATA["+chqAmt+"]]></chq_amt>");
xmlBuff.append("<adv_amt><![CDATA["+adjAmt+"]]></adv_amt>");
}
else
{
xmlBuff.append("<chq_amt><![CDATA["+chqAmt+"]]></chq_amt>");
xmlBuff.append("<adv_amt><![CDATA[0]]></adv_amt>");
}
//xmlBuff.append("<fin_chg><![CDATA[]]></fin_chg>");
// xmlBuff.append("<EFFECT_PARTY><![CDATA["+tranDate+"]]></tran_date>");
// xmlBuff.append("<TRAN_ID__MRCP><![CDATA["+tranDate+"]]></tran_date>");
......@@ -536,7 +600,7 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
//sql="select ref_ser,ref_no,line_no__ref from rcpdet_form where tran_id=? and ADJ_OPT_FLG <> ? ";
/* //sql="select ref_ser,ref_no,line_no__ref from rcpdet_form where tran_id=? and ADJ_OPT_FLG <> ? ";
sql=" select ref_ser,ref_no,line_no__ref,rcp_amt from rcpdet_form where tran_id=? ";
System.out.println("<!@#>Adding detail 2.......... sql "+sql);
pstmt1=conn.prepareStatement(sql);
......@@ -545,47 +609,44 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
while(rs1.next()){
lineNo++;
System.out.println("lineNo is " + lineNo);
lineNoCnt++;
System.out.println("lineNo is " + lineNoCnt);
refSer=rs1.getString("ref_ser");
lineNo=rs1.getInt("line_no");
refNo=rs1.getString("ref_no");
lineNoRef=rs1.getString("line_no__ref");
rcpAmt=rs1.getDouble("rcp_amt");
refSer = refSer == null ? "" : refSer.trim();
refNo = refNo == null ? "" : refNo.trim();
lineNoRef = lineNoRef == null ? "" : lineNoRef.trim();
System.out.println("lineNo :"+lineNo);
totRcpAmt = totRcpAmt + rcpAmt;
/*---------------------------------------------------------------------------------------*/
/* sql ="select (tot_amt - adj_amt) as amt , tran_ser,tran_date,ref_no,ref_date,curr_code,exch_rate,acct_code, " +
" cctr_code,due_date,tax_amt,tot_amt,cust_code,adj_amt, case when bad_debt_amt is null then 0 else bad_debt_amt end,discount_dt,DISCOUNT from receivables "
+ " where tran_ser = ? and ref_no = ? and line_no__ref = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refSer);
pstmt.setString(2,refNo);
pstmt.setString(3,lineNoRef);
rs = pstmt.executeQuery();
if (rs.next())
{
currCode=rs.getString("curr_code");
acctCode=rs.getString("acct_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
currCode = currCode == null ? "" : currCode.trim();
acctCode = acctCode == null ? "" : acctCode.trim();*/
tempMap.put("line_no" + lineNoCnt, String.valueOf(lineNo));
tempMap.put("line_no_ref" + lineNoCnt, lineNoRef);
tempMap.put("ref_ser" + lineNoCnt, refSer);
tempMap.put("ref_no" + lineNoCnt, refNo);
tempMap.put("rcp_amt" + lineNoCnt, String.valueOf(rcpAmt));
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null; */
System.out.println("rcpAmt :"+rcpAmt);
System.out.println("lineNoCnt :"+lineNoCnt);
for(int i = 1 ; i <= lineNoCnt ; i++ )
{
System.out.println("acctCode !!!"+acctCode);
/*---------------------------------------------------------------------------------------*/
System.out.println("@@@@@@@@@@@@@@@Adding detail 2..........");
//xmlBuff.append("<Detail2 objContext=\"2\" objName=\"receivables_jv\" domID=\"1\" dbID=''>");
......@@ -594,23 +655,19 @@ public class GenReceiptConf extends ActionHandlerEJB implements GenReceiptConfLo
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no><![CDATA["+lineNo+"]]></line_no>");
xmlBuff.append("<line_no__ref><![CDATA["+lineNoRef+"]]></line_no__ref>");
xmlBuff.append("<ref_ser><![CDATA["+refSer+"]]></ref_ser>");
xmlBuff.append("<ref_no><![CDATA["+refNo+"]]></ref_no>");
xmlBuff.append("<rcp_amt><![CDATA["+rcpAmt+"]]></rcp_amt>");
//xmlBuff.append("<curr_code><![CDATA["+currCode+"]]></curr_code>");
//xmlBuff.append("<acct_code__ar><![CDATA["+acctCode+"]]></acct_code__ar>");
xmlBuff.append("<line_no><![CDATA["+tempMap.get("line_no" + i)+"]]></line_no>");
xmlBuff.append("<line_no__ref><![CDATA["+tempMap.get("line_no_ref" + i)+"]]></line_no__ref>");
xmlBuff.append("<ref_ser><![CDATA["+tempMap.get("ref_ser" + i)+"]]></ref_ser>");
xmlBuff.append("<ref_no><![CDATA["+tempMap.get("ref_no" + i)+"]]></ref_no>");
xmlBuff.append("<rcp_amt><![CDATA["+tempMap.get("rcp_amt" + i)+"]]></rcp_amt>");
xmlBuff.append("</Detail2>");
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1=null;
xmlBuff.append(advBuff.toString());
......
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