Commit 13dda27e authored by prane's avatar prane

To release the hold receivables

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183434 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ea4e929e
......@@ -122,7 +122,7 @@ public class DisputedReceivablesConf extends ActionHandlerEJB implements Dispute
String cctrCode = "";
String acctCode = "";
String refType = "";
String refType__o = "";
String refTypeO = "";
String reasCode = "";
String loginEmpCode="";
double disputeAmt = 0.0;
......@@ -186,7 +186,7 @@ public class DisputedReceivablesConf extends ActionHandlerEJB implements Dispute
pstmt.close();
pstmt = null;
System.out.println("recType:["+recType+"]");
if( recType != null || recType.trim().length() > 0)
if( recType != null && recType.trim().length() > 0)
{
if(recType != null && "R".equalsIgnoreCase(recType))
{
......@@ -262,7 +262,7 @@ public class DisputedReceivablesConf extends ActionHandlerEJB implements Dispute
cctrCode = rs.getString(10);
acctCode = rs.getString(11);
refType = rs.getString(12);
refType = rs.getString(13);
refTypeO = rs.getString(13);
expRcpDate = rs.getTimestamp(14);
reasCode = rs.getString(15);
......@@ -287,12 +287,10 @@ public class DisputedReceivablesConf extends ActionHandlerEJB implements Dispute
//if lc_totamt < (lc_adjamt + lc_dispamt + lc_dispute_amt ) or ( lc_dispamt + lc_dispute_amt ) < 0 then
if (totAmt < (adjAmt + dispAmt + disputeAmtDet) || dispAmt + disputeAmtDet < 0)
{
System.out.println("ledg_post_conf is alredy Y....");
System.out.println("ledg_post_conf is already Y....");
errString = itmDBAccessEJB.getErrorString("","VTAMT1 ","","",conn);
return errString;
}
return errString;
}
/**
* If rec_type in disputed_recv is 'R' then updates disputeAmt = disputeAmt +
* and refType, tranSer and refNo from disputed_recv_det in receivables.
......@@ -310,8 +308,52 @@ public class DisputedReceivablesConf extends ActionHandlerEJB implements Dispute
pstmt1 = null;
System.out.println("update receivables dispute_amt & ref_type cnt["+cnt+"]");
}
else
{ //recType = "R" end if
//Pavan R on 09APR2018 Start[To release the hold receivables]
else if(recType != null && "O".equalsIgnoreCase(recType))
{
sql1 = "select tot_amt, adj_amt, dispute_amt from receivables " +
" where tran_ser = ? and ref_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, refSer);
pstmt1.setString(2, refId);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
totAmt = rs1.getDouble(1);
adjAmt = rs1.getDouble(2);
dispAmt = rs1.getDouble(3);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if (totAmt < (adjAmt + dispAmt + disputeAmtDet) || dispAmt + disputeAmtDet < 0)
{
System.out.println("ledg_post_conf is alredy Y....");
errString = itmDBAccessEJB.getErrorString("","VTAMT1 ","","",conn);
return errString;
}
disputeAmtDet = 0 ;
/**
* If rec_type in disputed_recv is 'O' then updates disputeAmt = 0
* and refType, tranSer and refNo from disputed_recv_det in receivables.
* Otherwise updates the exp_rcp_date with reason code and refType in receivables *
*/
sql1 = "update receivables set dispute_amt = ?, ref_type = ? " +
" where tran_ser = ? and ref_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setDouble(1, disputeAmtDet);
pstmt1.setString(2, "F");//refType
pstmt1.setString(3, refSer);
pstmt1.setString(4, refId);
int cnt = pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
System.out.println("update receivables dispute_amt & ref_type cnt["+cnt+"]");
//Pavan R on 09APR2018 End
}else
{
sql1 = "update receivables set exp_rcp_date = ?, reas_code = ?, ref_type = ? " +
" where tran_ser = ? and ref_no = ?";
pstmt1 = conn.prepareStatement(sql1);
......
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