Commit c21e52e9 authored by smane's avatar smane

update ejb file for flat booking cancellation(DI3HDOS006) to change in amount calculation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97319 ce508802-f39f-4f6c-b175-0d175dae99d5
parent aa4a91eb
......@@ -618,7 +618,8 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
if(rs.next())
//if(rs.next())
while(rs.next()) //condition changed by sagar on 13/02/15
{
adjLineNo = rs.getString("line_no");
adjRefSer = rs.getString("ref_ser");
......@@ -626,7 +627,8 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
adjAmt = rs.getDouble("adj_amt");
refBalAmt = rs.getDouble("ref_bal_amt");
mrpValueAdj = rs.getDouble("mrp_value__adj");
System.out.println(">>>>>>>>>>>>>>>>>in while misc_drcr_rcpinv adjLineNo:"+adjLineNo);
System.out.println(">>>>>>>>>>>>>>>>>in while misc_drcr_rcpinv adjAmt:"+adjAmt);
miscRcpInvMap = new HashMap();
miscRcpInvMap.put("line_no",adjLineNo);
miscRcpInvMap.put("ref_ser",adjRefSer);
......@@ -2044,6 +2046,7 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
String refSerHdr="",cust="",refSer="",refNo="";
double totAdjAmt=0,amount=0,mrpValueAdj=0,adjAmt=0,totAmt=0;
double totAdjAmtDet=0.0;
try
{
System.out.println("<!@#> In gbfPostMiscDrcrAdjdet :::::::::::::::::::::::::::::::");
......@@ -2062,7 +2065,8 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
mrpValueAdj = (Double)advListMap.get("mrp_value__adj");
totAdjAmt = amount;
totAdjAmtDet= totAdjAmtDet + amount; //added by sagar on 13/02/15
System.out.println(">>>>>>In gbfPostMiscDrcrAdjdet amount:"+amount);
sql =" update receivables "
+" set adj_amt = case when adj_amt is null then 0 else adj_amt end + ? , "
+" mrp_value = case when mrp_value is null then 0 else mrp_value end - ? "
......@@ -2072,7 +2076,7 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
pstmt.setDouble(1,amount);
pstmt.setDouble(2,mrpValueAdj);
pstmt.setString(3,refSer);
pstmt.setString(3,refNo);
pstmt.setString(4,refNo); // code changed by sagar on 13/02/15
upd = pstmt.executeUpdate();
if(upd <1)
{
......@@ -2115,12 +2119,15 @@ public class MiscDrCrRcpConf extends ActionHandlerEJB implements MiscDrCrRcpConf
pstmt = null;
}
}//end of for
System.out.println(">>>>>In MiscDrCrRcpConf fianl totAdjAmtDet:"+totAdjAmtDet);
sql =" update receivables set adj_amt = case when adj_amt is null then 0 else adj_amt end + -1 * ? "
+" where tran_ser = ? and ref_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1,totAdjAmt);
//pstmt.setDouble(1,totAdjAmt); //comment added by sagar on 13/02/15
pstmt.setDouble(1,totAdjAmtDet);
pstmt.setString(2,refSerHdr);
pstmt.setString(3,tranId);
upd = pstmt.executeUpdate();
......
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