Commit 855f1f9d authored by vkadam's avatar vkadam

Change By CPATIL merged by VKADAM


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98070 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c291731f
......@@ -142,7 +142,7 @@ public class AutoPmtGenPrc extends ProcessEJB implements AutoPmtGenPrcLocal,Auto
String sql= null ;
ResultSet rs = null;
ResultSet rs1 = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt = null,pstmt1=null;
//Statement st = null; // Remarked - Rej - Asnot used - 29/12/2007
//Added by Raj (FI78DIS032)- 29/12/2007
......@@ -310,7 +310,30 @@ public class AutoPmtGenPrc extends ProcessEJB implements AutoPmtGenPrcLocal,Auto
netPayable = rs.getDouble("net_payable");
dueDate = rs.getString("due_date");
/*tempSql= "SELECT sum(case when auto_pay_det.pay_amt is null then 0 else auto_pay_det.pay_amt end) as pay_amt "
tempSql= " select sum(b.net_amt) as unconfirm_amt from misc_payment a,misc_paydet b "+
" where a.tran_id=b.tran_id and "+
" b.vouch_no= ? "+
" and a.confirmed='N' ";
System.out.println("SQL==>"+tempSql);
// stmtTemp = conn.prepareStatement(tempSql);
pstmt1 = conn.prepareStatement(tempSql);
pstmt1.setString(1, refNo);
rsTemp = pstmt1.executeQuery();
if (rsTemp.next())
{
unapprovedPayAmt = rsTemp.getDouble("unconfirm_amt");
}
else
{
unapprovedPayAmt = 0d;
}
pstmt1.close();
pstmt1=null;
rsTemp.close();
rsTemp=null;
/*
tempSql= "SELECT sum(case when auto_pay_det.pay_amt is null then 0 else auto_pay_det.pay_amt end) as pay_amt "
+"FROM auto_pay_hdr, auto_pay_det "
+"WHERE ( auto_pay_det.tran_ser = '" + tranSer + "') AND "
+"( auto_pay_det.ref_no = '" + refNo + "' ) AND "
......@@ -328,7 +351,7 @@ public class AutoPmtGenPrc extends ProcessEJB implements AutoPmtGenPrcLocal,Auto
unapprovedPayAmt = 0d;
}
rsTemp.close();
if (netPayable < 0 && netPayable > unapprovedPayAmt)
{
unapprovedPayAmt = netPayable;
......@@ -583,6 +606,8 @@ public class AutoPmtGenPrc extends ProcessEJB implements AutoPmtGenPrcLocal,Auto
Date maxRefDate=null;
FinCommon fin=new FinCommon();
DistCommon dist=new DistCommon();
double unconfirmAmt=0; // cpatil
try
{ System.out.println("intializingLog$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$........."+ intializingLog("Gen_bank_payment_log"));
retBuf = new StringBuffer();
......@@ -996,11 +1021,20 @@ System.out.println("Getting winName============"+windowName);
}
if (childNodeName.equals("unconfirm_amt")) // cpatil
{
if(childNode.getFirstChild()!=null)
{
unconfirmAmt = Double.valueOf(childNode.getFirstChild().getNodeValue());
}
}
} // For inner loop
//if (Double.parseDouble(netPayable) != 0 ) // Condition added by jaimin 16/08/2007 // Remarked by Raj - 29/12/2007
//changes for grouping on 21/05/15
tempSplitCode = sundryCode+"@"+payMode;
tempSplitCode = sundryCode+"@"+payMode+"@"+dueDate; //added duaDate by cpatil in sun on 06/06/15
System.out.println("Getting combination As====="+tempSplitCode);
if(splitCodeWiseMap.containsKey(tempSplitCode))
{
......@@ -1208,6 +1242,8 @@ System.out.println("Getting winName============"+windowName);
tempMap.put("discount_amt", disAmt);
tempMap.put("discount", discount);
tempMap.put("tot_amt", totAmt);
tempMap.put("unconfirm_amt", unconfirmAmt); // cpatil
System.out.println("Getting value in Map======"+tempMap);
tempList.add(tempMap);
......@@ -1227,7 +1263,7 @@ System.out.println("Sundry Type@@@@"+sundryType);
}
double sumNetAmt=0.0;
double sumNetAmt=0.0,totUnconfAmt=0;
String autoPaymTranId="";
Set setItem = splitCodeWiseMap.entrySet();
System.out.println("getting set item====="+setItem);
......@@ -1248,10 +1284,12 @@ System.out.println("Sundry Type@@@@"+sundryType);
{
sundryCode = checkNull(splitCode.split("@")[0]);
payMode = checkNull(splitCode.split("@")[1]);
dueDate = checkNull(splitCode.split("@")[2]); // added by cpatil @sun on 06/06/15
}
System.out.println("sundryCode after spilt ======="+sundryCode);
System.out.println("payMode after spilt ======="+payMode);
System.out.println("Sundry TYPEEEEEEEE" +sundryType);
System.out.println("dueDate after spilt ======="+dueDate); // added by cpatil @sun on 06/06/15
System.out.println("TempList Inside While======="+tempList);
sundryType=(String)tempMap.get("sundry_type");
......@@ -1397,7 +1435,7 @@ System.out.println("Sundry Type@@@@"+sundryType);
lineNo = 0;
for (int itemCtr = 0; itemCtr < tempList.size(); itemCtr++)
{
lineNo++;
lineNo++; // doubt
System.out.println("Line No after increament=========="+lineNo);
tempMap = (HashMap)tempList.get(itemCtr);
......@@ -1408,13 +1446,20 @@ System.out.println("Sundry Type@@@@"+sundryType);
netPayable=(String)tempMap.get("net_pay_amt") ;
System.out.println("Get netPayable Value from Map==========="+netPayable);
System.out.println("Get SumAmt of PayAmt==========="+sumNetAmt);
totUnconfAmt=Double.valueOf(tempMap.get("unconfirm_amt").toString()) ;
System.out.println("Get totUnconfAmt Value from Map==========="+totUnconfAmt);
//if (Double.parseDouble(payAmt) != 0 ) //
if(sumNetAmt>0)
{
System.out.println("--------------> if payAmt>0 :: "+payAmt);
System.out.println("--------------> if netPayable>0 :: "+netPayable);
if ( (Double.parseDouble(netPayable) > 0 && Double.parseDouble(payAmt) <= Double.parseDouble(netPayable) && Double.parseDouble(payAmt) >=0)
|| (Double.parseDouble(netPayable) < 0 && Double.parseDouble(payAmt) <= 0 && Double.parseDouble(payAmt) >= Double.parseDouble(netPayable)) )
System.out.println("--------------> totUnconfAmt :: "+totUnconfAmt);
if (( (Double.parseDouble(netPayable) > 0 && Double.parseDouble(payAmt) <= Double.parseDouble(netPayable) && Double.parseDouble(payAmt) >=0)
|| (Double.parseDouble(netPayable) < 0 && Double.parseDouble(payAmt) <= 0 && Double.parseDouble(payAmt) >= Double.parseDouble(netPayable)) )
&& ( Double.parseDouble(payAmt) + totUnconfAmt < Double.parseDouble(netPayable) ) ) // added by cpatil @sun on 06/06/15
{ // End by Jaimin 16/08/2007
System.out.println("----------------In condition---1111-----------");
......
......@@ -154,8 +154,8 @@ public class VoucherPostSave extends ValidatorEJB implements VoucherPostSaveLoca
sql="select ? * coalesce(sum(exch_rate),0) from voucher WHERE tran_id = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,netAmtRcp );
pstmt.setString(2,tranId );
pstmt.setDouble(1,netAmtRcp);
pstmt.setString(2,tranId);
rs = pstmt.executeQuery();
if (rs.next())
{
......
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