Commit 05734f43 authored by msalla's avatar msalla

unpost salesreturn and sales despatch and porcp

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215713 ce508802-f39f-4f6c-b175-0d175dae99d5
parent db54cb99
...@@ -20,7 +20,11 @@ import java.sql.Timestamp; ...@@ -20,7 +20,11 @@ import java.sql.Timestamp;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import com.itextpdf.text.log.SysoCounter;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.InvAllocTraceBean;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.mfg.MfgCommon; import ibase.webitm.ejb.mfg.MfgCommon;
import java.util.*; import java.util.*;
...@@ -28,7 +32,7 @@ import java.sql.*; ...@@ -28,7 +32,7 @@ import java.sql.*;
public class UnpostFin extends ProcessEJB public class UnpostFin extends ProcessEJB
{ {
FinCommon finCommon = new FinCommon(); FinCommon finCommon = new FinCommon();
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
...@@ -88,7 +92,7 @@ public class UnpostFin extends ProcessEJB ...@@ -88,7 +92,7 @@ public class UnpostFin extends ProcessEJB
refIdFr = genericUtility.getColumnValue("ref_id__fr",headerDom); refIdFr = genericUtility.getColumnValue("ref_id__fr",headerDom);
refIdTo = genericUtility.getColumnValue("ref_id__to",headerDom); refIdTo = genericUtility.getColumnValue("ref_id__to",headerDom);
errString = unPost(refSer, refIdFr, refIdTo , conn); errString = unPost(refSer, refIdFr, refIdTo , conn);
if (errString.indexOf("PRCSUCES") == -1 ) if (errString.indexOf("PRCSUCES") == -1 )
{ {
isError = true; isError = true;
...@@ -135,15 +139,15 @@ public class UnpostFin extends ProcessEJB ...@@ -135,15 +139,15 @@ public class UnpostFin extends ProcessEJB
public String unPost(String refSer, String refIdFr, String refIdTo , Connection conn) throws ITMException, Exception public String unPost(String refSer, String refIdFr, String refIdTo , Connection conn) throws ITMException, Exception
{ {
String errCode = "", errString = "", paySer = "", paymentNo = "", refSerAdv = "", refNoAdv = "", vouchType = "", siteCode = "", tranSer = ""; String errCode = "", errString = "", paySer = "", paymentNo = "", refSerAdv = "", refNoAdv = "", vouchType = "", siteCode = "", tranSer = "";
String tableName = "", pkColName = "", sql = "", errMsg = "", refId = ""; String tableName = "", pkColName = "", sql = "", errMsg = "", refId = "";
String tempStr1 = "", tempStr2 = "", tempStr = ""; String tempStr1 = "", tempStr2 = "", tempStr = "";
double payAmount = 0, adjAmtAdv = 0, tempAmount1 = 0, chqAmount = 0; double payAmount = 0, adjAmtAdv = 0, tempAmount1 = 0, chqAmount = 0;
int count = 0; int count = 0;
boolean isError = false; boolean isError = false;
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null; PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
ArrayList<String> tranList = new ArrayList<String>(); ArrayList<String> tranList = new ArrayList<String>();
...@@ -236,14 +240,19 @@ public class UnpostFin extends ProcessEJB ...@@ -236,14 +240,19 @@ public class UnpostFin extends ProcessEJB
tableName = "porcp"; tableName = "porcp";
pkColName = "tran_id"; pkColName = "tran_id";
} }
else if("S-DSP".equals(refSer)) // 17-jan-2020 purchase receipt added by manoharan else if("S-DSP".equals(refSer)) // 17-jan-2020 sale order despatch added by manoharan
{ {
tableName = "despatch"; tableName = "despatch";
pkColName = "desp_id"; pkColName = "desp_id";
} }
System.out.println("Before loop refSer["+ refSer + "]"); else if("S-RET".equals(refSer)) // 20-jan-2020 salesreturn added by monika salla
{
tableName = "sreturn";
pkColName = "tran_id";
}
System.out.println("Before loop refSer["+ refSer + "] REF_ID ["+pkColName+" ] TABLE NAME[ "+tableName);
sql = "select " + pkColName + " as tran_id from " + tableName + " where " + pkColName + " >= ? and " + pkColName + " <= ? and confirmed = 'Y' order by 1 " ; sql = "select " + pkColName + " as tran_id from " + tableName + " where " + pkColName + " >= ? and " + pkColName + " <= ? and confirmed = 'Y' order by 1 " ;
if("F-XFR".equals(refSer)) // fundtransfer if("F-XFR".equals(refSer)) // fundtransfer
{ {
sql = "select " + pkColName + " as tran_id from " + tableName + " where " + pkColName + " >= ? and " + pkColName + " <= ? and status = 'C' order by 1 " ; sql = "select " + pkColName + " as tran_id from " + tableName + " where " + pkColName + " >= ? and " + pkColName + " <= ? and status = 'C' order by 1 " ;
...@@ -256,6 +265,8 @@ public class UnpostFin extends ProcessEJB ...@@ -256,6 +265,8 @@ public class UnpostFin extends ProcessEJB
{ {
tranList.add(rs.getString("tran_id")); tranList.add(rs.getString("tran_id"));
} }
System.out.println("sql--->>[ "+sql);
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
...@@ -265,7 +276,7 @@ public class UnpostFin extends ProcessEJB ...@@ -265,7 +276,7 @@ public class UnpostFin extends ProcessEJB
errCode = "VTNOREC"; errCode = "VTNOREC";
errString = getMsg("No transaction in the range selected for unposting",errCode, conn); errString = getMsg("No transaction in the range selected for unposting",errCode, conn);
return errString; return errString;
} }
for(int tranCtr = 0; tranCtr<tranList.size(); tranCtr++) for(int tranCtr = 0; tranCtr<tranList.size(); tranCtr++)
{ {
...@@ -283,7 +294,7 @@ public class UnpostFin extends ProcessEJB ...@@ -283,7 +294,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
errString = unPostStock(refSer, refId, conn); errString = unPostStock(refSer, refId, conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
{ {
...@@ -294,14 +305,43 @@ public class UnpostFin extends ProcessEJB ...@@ -294,14 +305,43 @@ public class UnpostFin extends ProcessEJB
{ {
// Assumed that in case voucher/payment doen which are undone through finance unpost option // Assumed that in case voucher/payment doen which are undone through finance unpost option
// 3. update transaction as unconfirmed // 3. update transaction as unconfirmed
sql = "update porcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update porcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1)
{
isError = true;
errCode = "DS000NR";
errString = getMsg("Update drcr_rcp failed ",errCode, conn);
break;
}
}
//added by monika salla 0n 20 jan 2020 -in case of despatch which are undone through finance unpost option
else if("S-DSP".equals(refSer)) // Purchase receipt
{
//ADD
System.out.println("inside salesdespatch");
errString = unPost(refSer, refId, conn);
if(errString != null && errString.trim().length() > 0 )
{
isError = true;
break;
}
//END
sql = "update despatch set confirmed = 'N' where DESP_ID = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate();
pstmtUpd.close();
pstmtUpd = null;
System.out.println("count in despatch "+count);
if(count != 1) if(count != 1)
{ {
isError = true; isError = true;
...@@ -310,7 +350,38 @@ public class UnpostFin extends ProcessEJB ...@@ -310,7 +350,38 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
} }
//added by monika salla 0n 20 jan 2020 -in case of sales return which are undone through finance unpost option
else if("S-RET".equals(refSer)) // Purchase receipt
{
System.out.println("inside salesreturn");
//ADD
errString = unPost(refSer, refId, conn);
if(errString != null && errString.trim().length() > 0 )
{
isError = true;
break;
}//END
sql = "update sreturn set confirmed = 'N',tran_id__crn=null where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate();
pstmtUpd.close();
pstmtUpd = null;
System.out.println("count in salesreturn "+count);
if(count != 1)
{
isError = true;
errCode = "DS000NR";
errString = getMsg("Update drcr_rcp failed ",errCode, conn);
break;
}
}
//end
else if("CRNRCP".equals(refSer) || "DRNRCP".equals(refSer)) // credit note (invoice) else if("CRNRCP".equals(refSer) || "DRNRCP".equals(refSer)) // credit note (invoice)
{ {
errString = unPost(refSer, refId, conn); errString = unPost(refSer, refId, conn);
...@@ -320,13 +391,13 @@ public class UnpostFin extends ProcessEJB ...@@ -320,13 +391,13 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "update drcr_rcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y' "; sql = "update drcr_rcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y' ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1) if(count != 1)
{ {
isError = true; isError = true;
...@@ -334,16 +405,16 @@ public class UnpostFin extends ProcessEJB ...@@ -334,16 +405,16 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update drcr_rcp failed ",errCode, conn); errString = getMsg("Update drcr_rcp failed ",errCode, conn);
break; break;
} }
sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0 "; sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0 ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1) if(count != 1)
{ {
isError = true; isError = true;
...@@ -352,13 +423,13 @@ public class UnpostFin extends ProcessEJB ...@@ -352,13 +423,13 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "delete from drcr_racct where tran_id = ? "; sql = "delete from drcr_racct where tran_id = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count <= 1) if(count <= 1)
{ {
isError = true; isError = true;
...@@ -386,9 +457,9 @@ public class UnpostFin extends ProcessEJB ...@@ -386,9 +457,9 @@ public class UnpostFin extends ProcessEJB
// errCode = 'Unpost option only for Receipt type' // errCode = 'Unpost option only for Receipt type'
// exit // exit
//end if //end if
errString = unPost(refSer, refId, conn); errString = unPost(refSer, refId, conn);
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
{ {
isError = true; isError = true;
...@@ -433,7 +504,7 @@ public class UnpostFin extends ProcessEJB ...@@ -433,7 +504,7 @@ public class UnpostFin extends ProcessEJB
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "update pay_ibca set confirmed = 'N' where tran_id = ?"; sql = "update pay_ibca set confirmed = 'N' where tran_id = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -449,7 +520,7 @@ public class UnpostFin extends ProcessEJB ...@@ -449,7 +520,7 @@ public class UnpostFin extends ProcessEJB
} }
else if("R-IBCA".equals(refSer)) else if("R-IBCA".equals(refSer))
{ {
sql = "select tran_ser from rcp_ibca where tran_id = ? " ; sql = "select tran_ser from rcp_ibca where tran_id = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId); pstmt.setString(1, refId);
...@@ -477,7 +548,7 @@ public class UnpostFin extends ProcessEJB ...@@ -477,7 +548,7 @@ public class UnpostFin extends ProcessEJB
tempStr1 = rs.getString("ref_ser"); tempStr1 = rs.getString("ref_ser");
tempStr2 = rs.getString("ref_no"); tempStr2 = rs.getString("ref_no");
tempAmount1 = rs.getDouble("tot_amt"); tempAmount1 = rs.getDouble("tot_amt");
if("R".equals(tempStr)) if("R".equals(tempStr))
{ {
sql = "delete from receivables where tran_ser = ? and ref_no = ?"; sql = "delete from receivables where tran_ser = ? and ref_no = ?";
...@@ -508,9 +579,9 @@ public class UnpostFin extends ProcessEJB ...@@ -508,9 +579,9 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "update rcp_ibca set confirmed = 'N' where tran_id = ?"; sql = "update rcp_ibca set confirmed = 'N' where tran_id = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -533,7 +604,7 @@ public class UnpostFin extends ProcessEJB ...@@ -533,7 +604,7 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "update journal set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update journal set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -582,7 +653,7 @@ public class UnpostFin extends ProcessEJB ...@@ -582,7 +653,7 @@ public class UnpostFin extends ProcessEJB
refNoAdv = rs.getString("ref_no"); refNoAdv = rs.getString("ref_no");
adjAmtAdv = rs.getDouble("adj_amt"); adjAmtAdv = rs.getDouble("adj_amt");
sql = "update misc_payables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? "; sql = "update misc_payables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, adjAmtAdv); pstmtUpd.setDouble(1, adjAmtAdv);
pstmtUpd.setString(2, refSerAdv); pstmtUpd.setString(2, refSerAdv);
...@@ -608,12 +679,12 @@ public class UnpostFin extends ProcessEJB ...@@ -608,12 +679,12 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
} }
sql = "update voucher set confirmed = 'N', " sql = "update voucher set confirmed = 'N', "
+ " net_amt = net_amt - (case when rnd_amt is null then 0 else rnd_amt end), " + " net_amt = net_amt - (case when rnd_amt is null then 0 else rnd_amt end), "
+ " net_amt__bc = (net_amt - (case when rnd_amt is null then 0 else rnd_amt end))*exch_rate, " + " net_amt__bc = (net_amt - (case when rnd_amt is null then 0 else rnd_amt end))*exch_rate, "
+ " rnd_amt = 0 where tran_id = ? and confirmed = 'Y' "; + " rnd_amt = 0 where tran_id = ? and confirmed = 'Y' ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -628,7 +699,7 @@ public class UnpostFin extends ProcessEJB ...@@ -628,7 +699,7 @@ public class UnpostFin extends ProcessEJB
} }
sql = "delete from misc_payables where tran_ser = ? and ref_no = ? and adj_amt = 0 "; sql = "delete from misc_payables where tran_ser = ? and ref_no = ? and adj_amt = 0 ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
...@@ -657,7 +728,7 @@ public class UnpostFin extends ProcessEJB ...@@ -657,7 +728,7 @@ public class UnpostFin extends ProcessEJB
if (!"A".equals(vouchType )) if (!"A".equals(vouchType ))
{ {
sql = "delete from vouchdet where tran_id = ( select tran_id from voucher where tran_id = ? and vouch_type <> 'A') "; sql = "delete from vouchdet where tran_id = ( select tran_id from voucher where tran_id = ? and vouch_type <> 'A') ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -703,9 +774,9 @@ public class UnpostFin extends ProcessEJB ...@@ -703,9 +774,9 @@ public class UnpostFin extends ProcessEJB
refSerAdv = rs.getString("ref_ser"); refSerAdv = rs.getString("ref_ser");
refNoAdv = rs.getString("ref_no"); refNoAdv = rs.getString("ref_no");
adjAmtAdv = rs.getDouble("adj_amt"); adjAmtAdv = rs.getDouble("adj_amt");
sql = "update misc_payables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? "; sql = "update misc_payables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, adjAmtAdv); pstmtUpd.setDouble(1, adjAmtAdv);
pstmtUpd.setString(2, refSerAdv); pstmtUpd.setString(2, refSerAdv);
...@@ -743,11 +814,11 @@ public class UnpostFin extends ProcessEJB ...@@ -743,11 +814,11 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "update misc_voucher set confirmed = 'N', net_amt = net_amt - rnd_amt, " sql = "update misc_voucher set confirmed = 'N', net_amt = net_amt - rnd_amt, "
+ " net_amt__bc = (net_amt - rnd_amt)*exch_rate, rnd_amt = 0 " + " net_amt__bc = (net_amt - rnd_amt)*exch_rate, rnd_amt = 0 "
+ " where tran_id = ? and confirmed = 'Y' "; + " where tran_id = ? and confirmed = 'Y' ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -799,7 +870,7 @@ public class UnpostFin extends ProcessEJB ...@@ -799,7 +870,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update misc_voucher failed ",errCode, conn); errString = getMsg("Update misc_voucher failed ",errCode, conn);
break; break;
} }
sql = "delete from misc_vouchacct where tran_id = ?"; sql = "delete from misc_vouchacct where tran_id = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -813,7 +884,7 @@ public class UnpostFin extends ProcessEJB ...@@ -813,7 +884,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update misc_voucher failed ",errCode, conn); errString = getMsg("Update misc_voucher failed ",errCode, conn);
break; break;
} }
} }
else if ( "P-VOUC".equals(refSer)) // payroll voucher else if ( "P-VOUC".equals(refSer)) // payroll voucher
{ {
...@@ -823,7 +894,7 @@ public class UnpostFin extends ProcessEJB ...@@ -823,7 +894,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update payr_voucher set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update payr_voucher set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -863,7 +934,7 @@ public class UnpostFin extends ProcessEJB ...@@ -863,7 +934,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update payr_voucher failed ",errCode, conn); errString = getMsg("Update payr_voucher failed ",errCode, conn);
break; break;
} }
} }
else if("MDRCRC".equals(refSer) || "MDRCRD".equals(refSer)) // misc credit / debit note else if("MDRCRC".equals(refSer) || "MDRCRD".equals(refSer)) // misc credit / debit note
{ {
...@@ -873,7 +944,7 @@ public class UnpostFin extends ProcessEJB ...@@ -873,7 +944,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update misc_drcr_rcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update misc_drcr_rcp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -887,7 +958,7 @@ public class UnpostFin extends ProcessEJB ...@@ -887,7 +958,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update misc_drcr_rcp failed ",errCode, conn); errString = getMsg("Update misc_drcr_rcp failed ",errCode, conn);
break; break;
} }
sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0 "; sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0 ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
...@@ -911,7 +982,7 @@ public class UnpostFin extends ProcessEJB ...@@ -911,7 +982,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update payment_exp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update payment_exp set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -948,7 +1019,7 @@ public class UnpostFin extends ProcessEJB ...@@ -948,7 +1019,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update misc_payment set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update misc_payment set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -993,13 +1064,13 @@ public class UnpostFin extends ProcessEJB ...@@ -993,13 +1064,13 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(errString != null && errString.trim().length() > 0 ) if(errString != null && errString.trim().length() > 0 )
{ {
isError = true; isError = true;
break; break;
} }
sql = "delete from banktran_log where tran_ser = ? and tran_no = ? "; sql = "delete from banktran_log where tran_ser = ? and tran_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
...@@ -1047,9 +1118,9 @@ public class UnpostFin extends ProcessEJB ...@@ -1047,9 +1118,9 @@ public class UnpostFin extends ProcessEJB
paySer = rs.getString("tran_ser"); paySer = rs.getString("tran_ser");
paymentNo = rs.getString("vouch_no"); paymentNo = rs.getString("vouch_no");
payAmount = rs.getDouble("pay_amt"); payAmount = rs.getDouble("pay_amt");
sql = "update misc_payables set adj_amt = adj_amt + ? where tran_ser = ? and ref_no = ? " ; sql = "update misc_payables set adj_amt = adj_amt + ? where tran_ser = ? and ref_no = ? " ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, payAmount); pstmtUpd.setDouble(1, payAmount);
pstmtUpd.setString(2, paySer); pstmtUpd.setString(2, paySer);
...@@ -1075,7 +1146,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1075,7 +1146,7 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "delete from banktran_log where tran_ser = ? and tran_no = ? "; sql = "delete from banktran_log where tran_ser = ? and tran_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
...@@ -1099,7 +1170,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1099,7 +1170,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update misc_receipt set confirmed = 'N' where tran_id = ? and confirmed = 'Y' "; sql = "update misc_receipt set confirmed = 'N' where tran_id = ? and confirmed = 'Y' ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -1136,7 +1207,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1136,7 +1207,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "update rcpdishnr set confirmed = 'N' where tran_id = ? and confirmed = 'Y' "; sql = "update rcpdishnr set confirmed = 'N' where tran_id = ? and confirmed = 'Y' ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
...@@ -1160,9 +1231,9 @@ public class UnpostFin extends ProcessEJB ...@@ -1160,9 +1231,9 @@ public class UnpostFin extends ProcessEJB
paySer = rs.getString("ref_ser"); paySer = rs.getString("ref_ser");
paymentNo = rs.getString("ref_no"); paymentNo = rs.getString("ref_no");
payAmount = rs.getDouble("rcp_amt"); payAmount = rs.getDouble("rcp_amt");
sql = "update receivables set adj_amt = adj_amt + ? where tran_ser = ? and ref_no = ? "; sql = "update receivables set adj_amt = adj_amt + ? where tran_ser = ? and ref_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, payAmount); pstmtUpd.setDouble(1, payAmount);
pstmtUpd.setString(2, paySer); pstmtUpd.setString(2, paySer);
...@@ -1187,9 +1258,9 @@ public class UnpostFin extends ProcessEJB ...@@ -1187,9 +1258,9 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
sql = "delete from banktran_log where tran_ser = ? and tran_no = ?" ; sql = "delete from banktran_log where tran_ser = ? and tran_no = ?" ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
...@@ -1226,7 +1297,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1226,7 +1297,7 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "delete from banktran_log where tran_ser = ? and tran_no = ?" ; sql = "delete from banktran_log where tran_ser = ? and tran_no = ?" ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
...@@ -1272,7 +1343,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1272,7 +1343,7 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "delete from invacct where invoice_id = ?" ; sql = "delete from invacct where invoice_id = ?" ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -1286,7 +1357,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1286,7 +1357,7 @@ public class UnpostFin extends ProcessEJB
break; break;
} }
sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0" ; sql = "delete from receivables where tran_ser = ? and ref_no = ? and adj_amt = 0" ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
...@@ -1310,7 +1381,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1310,7 +1381,7 @@ public class UnpostFin extends ProcessEJB
isError = true; isError = true;
break; break;
} }
// added by shiri 20/02/06 - to unpost receivables JV // added by shiri 20/02/06 - to unpost receivables JV
sql = "select chq_amt from receipt where tran_id = ?"; sql = "select chq_amt from receipt where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1324,9 +1395,9 @@ public class UnpostFin extends ProcessEJB ...@@ -1324,9 +1395,9 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "update receipt set confirmed = 'N' where tran_id = ? and confirmed = 'Y'"; sql = "update receipt set confirmed = 'N' where tran_id = ? and confirmed = 'Y'";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -1339,28 +1410,28 @@ public class UnpostFin extends ProcessEJB ...@@ -1339,28 +1410,28 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update of receipt failed ",errCode, conn); errString = getMsg("Update of receipt failed ",errCode, conn);
break; break;
} }
sql = "delete from receivables where tran_ser = 'R-ADV' and ref_no = ?"; sql = "delete from receivables where tran_ser = 'R-ADV' and ref_no = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
sql = "delete from banktran_log where tran_ser = ? and tran_no = ?"; sql = "delete from banktran_log where tran_ser = ? and tran_no = ?";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
// amish 27-03-06 delete from rcpacct // amish 27-03-06 delete from rcpacct
sql = "delete from rcpacct where tran_id = ? " sql = "delete from rcpacct where tran_id = ? "
+ " and ( acct_code in (select acct_code__adv from receipt where tran_id = rcpacct.tran_id ) or " + " and ( acct_code in (select acct_code__adv from receipt where tran_id = rcpacct.tran_id ) or "
+ " acct_code in (select acct_code__ar from rcpdet where tran_id = rcpacct.tran_id ) ) "; + " acct_code in (select acct_code__ar from rcpdet where tran_id = rcpacct.tran_id ) ) ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
...@@ -1377,7 +1448,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1377,7 +1448,7 @@ public class UnpostFin extends ProcessEJB
paymentNo = rs.getString("ref_no"); paymentNo = rs.getString("ref_no");
payAmount = rs.getDouble("rcp_amt"); payAmount = rs.getDouble("rcp_amt");
sql = "update receivables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? "; sql = "update receivables set adj_amt = adj_amt - ? where tran_ser = ? and ref_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, payAmount); pstmtUpd.setDouble(1, payAmount);
pstmtUpd.setString(2, paySer); pstmtUpd.setString(2, paySer);
...@@ -1420,11 +1491,11 @@ public class UnpostFin extends ProcessEJB ...@@ -1420,11 +1491,11 @@ public class UnpostFin extends ProcessEJB
System.out.println("Error string after loop ["+errString + "]"); System.out.println("Error string after loop ["+errString + "]");
if (errString == null || errString.trim().length() == 0) if (errString == null || errString.trim().length() == 0)
{ {
errCode = "PRCSUCES"; errCode = "PRCSUCES";
errString = getMsg("Unposting completed",errCode, conn); errString = getMsg("Unposting completed",errCode, conn);
} }
} }
catch(Exception exception) catch(Exception exception)
{ {
...@@ -1476,14 +1547,14 @@ public class UnpostFin extends ProcessEJB ...@@ -1476,14 +1547,14 @@ public class UnpostFin extends ProcessEJB
{ {
genericUtility = null; genericUtility = null;
} }
} }
System.out.println("Return string from UnPost(1) ["+errString + "]"); System.out.println("Return string from UnPost(1) ["+errString + "]");
return errString ; return errString ;
} }
private String unPost(String refSer, String refId, Connection conn) throws ITMException private String unPost(String refSer, String refId, Connection conn) throws ITMException
{ {
String errCode = "", errString = "", acctPrd = "", prdCode = "", siteCode = "", acctCode = "", sundryType = "", sundryCode= ""; String errCode = "", errString = "", acctPrd = "", prdCode = "", siteCode = "", acctCode = "", sundryType = "", sundryCode= "";
String cctrCode = "", entryBatchNo = "", postType = "", tranIdTrace = "",acctCodeCoinDiff = "", sql = ""; String cctrCode = "", entryBatchNo = "", postType = "", tranIdTrace = "",acctCodeCoinDiff = "", sql = "";
String cctrCodeCoinDiff = "", ledgPostCoinDiff = "", postStat = "", cctrCodeUpd = "", cctrCodesundryBal = ""; String cctrCodeCoinDiff = "", ledgPostCoinDiff = "", postStat = "", cctrCodeUpd = "", cctrCodesundryBal = "";
...@@ -1492,7 +1563,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1492,7 +1563,7 @@ public class UnpostFin extends ProcessEJB
double tempAmount1 = 0, tempAmount2 = 0; double tempAmount1 = 0, tempAmount2 = 0;
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null; PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
try try
{ {
...@@ -1551,20 +1622,20 @@ public class UnpostFin extends ProcessEJB ...@@ -1551,20 +1622,20 @@ public class UnpostFin extends ProcessEJB
} }
// END OF SHEETAL - 4/3/02 // END OF SHEETAL - 4/3/02
// end 04-11-04 manoharan moved from inside loop // end 04-11-04 manoharan moved from inside loop
refSer = refSer.trim(); refSer = refSer.trim();
glTraceCnt = 0; glTraceCnt = 0;
totalDrAmount = 0; totalDrAmount = 0;
totalCrAmount = 0; totalCrAmount = 0;
sql = "select gltrace.tran_id as tran_id, gltrace.acct_prd as acct_prd, gltrace.prd_code as prd_code, gltrace.site_code as site_code, gltrace.acct_code as acct_code, " sql = "select gltrace.tran_id as tran_id, gltrace.acct_prd as acct_prd, gltrace.prd_code as prd_code, gltrace.site_code as site_code, gltrace.acct_code as acct_code, "
+ " gltrace.cctr_code as cctr_code, gltrace.sundry_type as sundry_type, gltrace.sundry_code as sundry_code, gltrace.dr_amt as dr_amt, " + " gltrace.cctr_code as cctr_code, gltrace.sundry_type as sundry_type, gltrace.sundry_code as sundry_code, gltrace.dr_amt as dr_amt, "
+ " gltrace.cr_amt as cr_amt, gltrace.exch_rate as exch_rate, gltrace.entry_batch_no as entry_batch_no, " + " gltrace.cr_amt as cr_amt, gltrace.exch_rate as exch_rate, gltrace.entry_batch_no as entry_batch_no, "
+ " (case when accounts.ledg_post is null then 'D' else accounts.ledg_post end) as ledg_post, " + " (case when accounts.ledg_post is null then 'D' else accounts.ledg_post end) as ledg_post, "
+ " (case when gltrace.post_stat is null then 'N' else gltrace.post_stat end) as post_stat " + " (case when gltrace.post_stat is null then 'N' else gltrace.post_stat end) as post_stat "
+ " from gltrace, accounts " + " from gltrace, accounts "
+ " where gltrace.acct_code = accounts.acct_code " + " where gltrace.acct_code = accounts.acct_code "
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and ref_id = ? " ; + " and ref_id = ? " ;
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refSer); pstmt1.setString(1, refSer);
...@@ -1586,28 +1657,28 @@ public class UnpostFin extends ProcessEJB ...@@ -1586,28 +1657,28 @@ public class UnpostFin extends ProcessEJB
entryBatchNo = rs1.getString("entry_batch_no"); entryBatchNo = rs1.getString("entry_batch_no");
postType = rs1.getString("ledg_post"); postType = rs1.getString("ledg_post");
postStat = rs1.getString("post_stat"); postStat = rs1.getString("post_stat");
totalDrAmount = totalDrAmount + (drAmount * exchRate) ; totalDrAmount = totalDrAmount + (drAmount * exchRate) ;
totalCrAmount = totalCrAmount + (crAmount * exchRate) ; totalCrAmount = totalCrAmount + (crAmount * exchRate) ;
totalDrAmount = getReqDecimal(totalDrAmount, 3) ; totalDrAmount = getReqDecimal(totalDrAmount, 3) ;
totalCrAmount = getReqDecimal(totalCrAmount, 3) ; totalCrAmount = getReqDecimal(totalCrAmount, 3) ;
glTraceCnt++; glTraceCnt++;
if (drAmount != 0 || crAmount != 0) if (drAmount != 0 || crAmount != 0)
{ {
if(entryBatchNo == null || "null".equals(entryBatchNo)) if(entryBatchNo == null || "null".equals(entryBatchNo))
{ {
entryBatchNo = ""; entryBatchNo = "";
} }
drAmountBase = drAmount * exchRate ; drAmountBase = drAmount * exchRate ;
crAmountBase = crAmount * exchRate ; crAmountBase = crAmount * exchRate ;
if (!"O".equals(sundryType)) if (!"O".equals(sundryType))
{ {
if (!"Y".equals(cctrCodeUpd)) if (!"Y".equals(cctrCodeUpd))
{ {
cctrCodesundryBal = " "; cctrCodesundryBal = " ";
...@@ -1616,21 +1687,21 @@ public class UnpostFin extends ProcessEJB ...@@ -1616,21 +1687,21 @@ public class UnpostFin extends ProcessEJB
{ {
cctrCodesundryBal = cctrCode; cctrCodesundryBal = cctrCode;
} }
// undo sundrybal // undo sundrybal
sql = "update sundrybal " sql = "update sundrybal "
+ " set dr_amt = dr_amt - ?, " + " set dr_amt = dr_amt - ?, "
+" cr_amt = cr_amt - ?, " +" cr_amt = cr_amt - ?, "
+ " dr_amt__base = dr_amt__base - ?, " + " dr_amt__base = dr_amt__base - ?, "
+ " cr_amt__base = cr_amt__base - ? " + " cr_amt__base = cr_amt__base - ? "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code in (?, 'zzzzzz') " + " and prd_code in (?, 'zzzzzz') "
+ " and site_code = ? " + " and site_code = ? "
+ " and sundry_type = ? " + " and sundry_type = ? "
+ " and sundry_code = ? " + " and sundry_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? " ; + " and cctr_code = ? " ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, drAmount); pstmtUpd.setDouble(1, drAmount);
pstmtUpd.setDouble(2, crAmount); pstmtUpd.setDouble(2, crAmount);
...@@ -1648,11 +1719,11 @@ public class UnpostFin extends ProcessEJB ...@@ -1648,11 +1719,11 @@ public class UnpostFin extends ProcessEJB
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 2) if(count != 2)
{ {
errCode = "DS000NR1"; errCode = "DS000NR1";
errString = getMsg("Insert Into SUNDRYBAL Failed For Period :[" +prdCode +"]",errCode, conn); errString = getMsg("Insert Into SUNDRYBAL Failed For Period :[" +prdCode +"]",errCode, conn);
break; break;
} }
} }
if ("Y".equals(postStat )) if ("Y".equals(postStat ))
{ {
...@@ -1761,35 +1832,35 @@ public class UnpostFin extends ProcessEJB ...@@ -1761,35 +1832,35 @@ public class UnpostFin extends ProcessEJB
// consider entry_batch_no for summary type posting // consider entry_batch_no for summary type posting
// //
if("S-INV".equals(refSer) || "D-ISS".equals(refSer) if("S-INV".equals(refSer) || "D-ISS".equals(refSer)
|| "D-RCP".equals(refSer) || "S-DSP".equals(refSer) || "D-RCP".equals(refSer) || "S-DSP".equals(refSer)
|| "P-RCP".equals(refSer) || "C-ISS".equals(refSer) || "P-RCP".equals(refSer) || "C-ISS".equals(refSer)
|| "W-ISS".equals(refSer) || "W-RCP".equals(refSer) || "W-ISS".equals(refSer) || "W-RCP".equals(refSer)
|| "ADJISS".equals(refSer) || "ADJRCP".equals(refSer) || "ADJISS".equals(refSer) || "ADJRCP".equals(refSer)
|| "VOUCH".equals(refSer) || "CRNRCP".equals(refSer) || "VOUCH".equals(refSer) || "CRNRCP".equals(refSer)
|| "DRNRCP".equals(refSer) || "MDRCRC".equals(refSer) || "DRNRCP".equals(refSer) || "MDRCRC".equals(refSer)
|| "MDRCRD".equals(refSer) || "P-VOUC".equals(refSer) || "MDRCRD".equals(refSer) || "P-VOUC".equals(refSer)
|| "RCP".equals(refSer) || "R-DIS".equals(refSer) || "RCP".equals(refSer) || "R-DIS".equals(refSer)
|| "M-RCP".equals(refSer) || "M-PAY".equals(refSer) || "M-RCP".equals(refSer) || "M-PAY".equals(refSer)
|| "MPCANC".equals(refSer) || "E-PAY".equals(refSer) || "MPCANC".equals(refSer) || "E-PAY".equals(refSer)
|| "S-RET".equals(refSer) || "P-RET".equals(refSer) || "S-RET".equals(refSer) || "P-RET".equals(refSer)
|| "M-VOUC".equals(refSer) || "P-IBCA".equals(refSer) || "M-VOUC".equals(refSer) || "P-IBCA".equals(refSer)
|| "R-IBCA".equals(refSer) ) || "R-IBCA".equals(refSer) )
{ {
entryBatchNo = refSer.trim() + prdCode.trim(); entryBatchNo = refSer.trim() + prdCode.trim();
} }
else else
{ {
entryBatchNo = " " ; entryBatchNo = " " ;
} }
sql = "select count(1) as count from gltran " sql = "select count(1) as count from gltran "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
+ " and site_code = ? " + " and site_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? " + " and cctr_code = ? "
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and tran_id__trace = ? "; + " and tran_id__trace = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctPrd); pstmt.setString(1, acctPrd);
pstmt.setString(2, prdCode); pstmt.setString(2, prdCode);
...@@ -1817,14 +1888,14 @@ public class UnpostFin extends ProcessEJB ...@@ -1817,14 +1888,14 @@ public class UnpostFin extends ProcessEJB
else if (count == 1) else if (count == 1)
{ {
sql = "update gltran set dr_amt = dr_amt - ?, " sql = "update gltran set dr_amt = dr_amt - ?, "
+ " cr_amt = cr_amt - ? " + " cr_amt = cr_amt - ? "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
+ " and site_code = ? " + " and site_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? " + " and cctr_code = ? "
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and tran_id__trace = ? " ; + " and tran_id__trace = ? " ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, drAmountBase); pstmtUpd.setDouble(1, drAmountBase);
...@@ -1848,14 +1919,14 @@ public class UnpostFin extends ProcessEJB ...@@ -1848,14 +1919,14 @@ public class UnpostFin extends ProcessEJB
} }
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
sql = "select dr_amt, cr_amt from gltran " sql = "select dr_amt, cr_amt from gltran "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
+ " and site_code = ? " + " and site_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? " + " and cctr_code = ? "
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and tran_id__trace = ? " ; + " and tran_id__trace = ? " ;
//where tran_id = :ls_var1 ; //where tran_id = :ls_var1 ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctPrd); pstmt.setString(1, acctPrd);
pstmt.setString(2, prdCode); pstmt.setString(2, prdCode);
...@@ -1874,7 +1945,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1874,7 +1945,7 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (tempAmount1 < 0 || tempAmount2 < 0 ) if (tempAmount1 < 0 || tempAmount2 < 0 )
{ {
errCode = "wrong amount"; errCode = "wrong amount";
...@@ -1891,14 +1962,14 @@ public class UnpostFin extends ProcessEJB ...@@ -1891,14 +1962,14 @@ public class UnpostFin extends ProcessEJB
} }
// undo acctbal // undo acctbal
sql = "update acctbal set dr_amt = dr_amt - ?, " sql = "update acctbal set dr_amt = dr_amt - ?, "
+ " cr_amt = cr_amt - ?, " + " cr_amt = cr_amt - ?, "
+ " dr_amt__base = dr_amt__base - ?, " + " dr_amt__base = dr_amt__base - ?, "
+ " cr_amt__base = cr_amt__base - ? " + " cr_amt__base = cr_amt__base - ? "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code in (?, 'zzzzzz') " + " and prd_code in (?, 'zzzzzz') "
+ " and site_code = ? " + " and site_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? "; + " and cctr_code = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, drAmount); pstmtUpd.setDouble(1, drAmount);
...@@ -1913,7 +1984,7 @@ public class UnpostFin extends ProcessEJB ...@@ -1913,7 +1984,7 @@ public class UnpostFin extends ProcessEJB
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if ( count != 2) if ( count != 2)
{ {
errCode = "DS000NR1B"; errCode = "DS000NR1B";
...@@ -1928,14 +1999,14 @@ public class UnpostFin extends ProcessEJB ...@@ -1928,14 +1999,14 @@ public class UnpostFin extends ProcessEJB
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if (errString != null && errString.trim().length() > 0 ) if (errString != null && errString.trim().length() > 0 )
{ {
return errString; return errString;
} }
totalDrAmount = getReqDecimal(totalDrAmount, 2) ; totalDrAmount = getReqDecimal(totalDrAmount, 2) ;
totalCrAmount = getReqDecimal(totalCrAmount, 2) ; totalCrAmount = getReqDecimal(totalCrAmount, 2) ;
if (totalDrAmount != totalCrAmount) if (totalDrAmount != totalCrAmount)
{ {
String coinDiffLimit = finCommon.getFinparams("999999", "COIN_DIFF_LIMIT", conn); String coinDiffLimit = finCommon.getFinparams("999999", "COIN_DIFF_LIMIT", conn);
...@@ -1965,38 +2036,38 @@ public class UnpostFin extends ProcessEJB ...@@ -1965,38 +2036,38 @@ public class UnpostFin extends ProcessEJB
drAmountBase = diffAmount; drAmountBase = diffAmount;
crAmountBase = 0; crAmountBase = 0;
} }
sql = "update acctbal set dr_amt = dr_amt - ?," sql = "update acctbal set dr_amt = dr_amt - ?,"
+ " cr_amt = cr_amt - ?, " + " cr_amt = cr_amt - ?, "
+ " dr_amt__base = dr_amt__base - ?, " + " dr_amt__base = dr_amt__base - ?, "
+ " cr_amt__base = cr_amt__base - ? " + " cr_amt__base = cr_amt__base - ? "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code in (?, 'zzzzzz') " + " and prd_code in (?, 'zzzzzz') "
+ " and site_code = ? " + " and site_code = ? "
+ " and acct_code = ? " + " and acct_code = ? "
+ " and cctr_code = ? "; + " and cctr_code = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, drAmount); pstmtUpd.setDouble(1, drAmount);
pstmtUpd.setDouble(2, crAmount); pstmtUpd.setDouble(2, crAmount);
pstmtUpd.setDouble(3, drAmountBase); pstmtUpd.setDouble(3, drAmountBase);
pstmtUpd.setDouble(4, crAmountBase); pstmtUpd.setDouble(4, crAmountBase);
pstmtUpd.setString(5, acctPrd); pstmtUpd.setString(5, acctPrd);
pstmtUpd.setString(6, prdCode); pstmtUpd.setString(6, prdCode);
pstmtUpd.setString(7, siteCode); pstmtUpd.setString(7, siteCode);
pstmtUpd.setString(8, acctCodeCoinDiff); pstmtUpd.setString(8, acctCodeCoinDiff);
pstmtUpd.setString(9, cctrCodeCoinDiff); pstmtUpd.setString(9, cctrCodeCoinDiff);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if ( count != 2) if ( count != 2)
{ {
errCode = "DS000NR1C"; errCode = "DS000NR1C";
errString = getMsg("Invalid count for update of acctbal [" +acctCodeCoinDiff +"]",errCode, conn); errString = getMsg("Invalid count for update of acctbal [" +acctCodeCoinDiff +"]",errCode, conn);
return errString; return errString;
} }
if("S-INV".equals(refSer) || "D-ISS".equals(refSer) if("S-INV".equals(refSer) || "D-ISS".equals(refSer)
|| "D-RCP".equals(refSer) || "S-DSP".equals(refSer) || "D-RCP".equals(refSer) || "S-DSP".equals(refSer)
|| "P-RCP".equals(refSer) || "C-ISS".equals(refSer) || "P-RCP".equals(refSer) || "C-ISS".equals(refSer)
|| "W-ISS".equals(refSer) || "W-RCP".equals(refSer) || "W-ISS".equals(refSer) || "W-RCP".equals(refSer)
...@@ -2010,16 +2081,16 @@ public class UnpostFin extends ProcessEJB ...@@ -2010,16 +2081,16 @@ public class UnpostFin extends ProcessEJB
|| "S-RET".equals(refSer) || "P-RET".equals(refSer) || "S-RET".equals(refSer) || "P-RET".equals(refSer)
|| "M-VOUC".equals(refSer) || "P-IBCA".equals(refSer) || "M-VOUC".equals(refSer) || "P-IBCA".equals(refSer)
|| "R-IBCA".equals(refSer) ) || "R-IBCA".equals(refSer) )
{ {
entryBatchNo = refSer.trim() + prdCode.trim(); entryBatchNo = refSer.trim() + prdCode.trim();
} }
else else
{ {
entryBatchNo = " " ; entryBatchNo = " " ;
} }
if("S".equals(ledgPostCoinDiff)) if("S".equals(ledgPostCoinDiff))
{ {
sql = "update gltran set dr_amt = dr_amt - ?, " sql = "update gltran set dr_amt = dr_amt - ?, "
+ " cr_amt = cr_amt - ? " + " cr_amt = cr_amt - ? "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
...@@ -2029,51 +2100,51 @@ public class UnpostFin extends ProcessEJB ...@@ -2029,51 +2100,51 @@ public class UnpostFin extends ProcessEJB
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and tran_id__trace = ? " ; + " and tran_id__trace = ? " ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, drAmount); pstmtUpd.setDouble(1, drAmount);
pstmtUpd.setDouble(2, crAmount); pstmtUpd.setDouble(2, crAmount);
pstmtUpd.setString(3, acctPrd); pstmtUpd.setString(3, acctPrd);
pstmtUpd.setString(4, prdCode); pstmtUpd.setString(4, prdCode);
pstmtUpd.setString(5, siteCode); pstmtUpd.setString(5, siteCode);
pstmtUpd.setString(6, acctCodeCoinDiff); pstmtUpd.setString(6, acctCodeCoinDiff);
pstmtUpd.setString(7, cctrCodeCoinDiff); pstmtUpd.setString(7, cctrCodeCoinDiff);
pstmtUpd.setString(8, refSer); pstmtUpd.setString(8, refSer);
pstmtUpd.setString(9, entryBatchNo); pstmtUpd.setString(9, entryBatchNo);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1) if(count != 1)
{
errCode = "DS000NR1D";
errString = getMsg("Error updating gltran [" +refSer +"]",errCode, conn);
return errString;
}
}
else
{ {
// in case there is a difference in total debit/credit in gltrace errCode = "DS000NR1D";
// as there is no corresponding row in gltrace table during posting errString = getMsg("Error updating gltran [" +refSer +"]",errCode, conn);
// the following logic is used, the same is repeated here return errString;
// get the entry_batch_no using a cursor as done during posting }
sql = "select gltrace.entry_batch_no as entry_batch_no from gltrace, finent " }
else
{
// in case there is a difference in total debit/credit in gltrace
// as there is no corresponding row in gltrace table during posting
// the following logic is used, the same is repeated here
// get the entry_batch_no using a cursor as done during posting
sql = "select gltrace.entry_batch_no as entry_batch_no from gltrace, finent "
+ " where gltrace.fin_entity = finent.fin_entity " + " where gltrace.fin_entity = finent.fin_entity "
+ " and gltrace.ref_ser = ? " + " and gltrace.ref_ser = ? "
+ " and gltrace.ref_id = ? "; + " and gltrace.ref_id = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer); pstmt.setString(1, refSer);
pstmt.setString(2, refId); pstmt.setString(2, refId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
entryBatchNo = rs.getString("entry_batch_no"); entryBatchNo = rs.getString("entry_batch_no");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sql = "select count(1) as count from gltran " sql = "select count(1) as count from gltran "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
+ " and site_code = ? " + " and site_code = ? "
...@@ -2082,35 +2153,35 @@ public class UnpostFin extends ProcessEJB ...@@ -2082,35 +2153,35 @@ public class UnpostFin extends ProcessEJB
+ " and ref_ser = ? " + " and ref_ser = ? "
+ " and ref_id = ? " + " and ref_id = ? "
+ " and tran_id__trace = ? "; + " and tran_id__trace = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctPrd); pstmt.setString(1, acctPrd);
pstmt.setString(2, prdCode); pstmt.setString(2, prdCode);
pstmt.setString(3, siteCode); pstmt.setString(3, siteCode);
pstmt.setString(4, acctCodeCoinDiff); pstmt.setString(4, acctCodeCoinDiff);
pstmt.setString(5, cctrCodeCoinDiff); pstmt.setString(5, cctrCodeCoinDiff);
pstmt.setString(6, refSer); pstmt.setString(6, refSer);
pstmt.setString(7, refId); pstmt.setString(7, refId);
pstmt.setString(8, entryBatchNo); pstmt.setString(8, entryBatchNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
count = rs.getInt("count"); count = rs.getInt("count");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if (count > 1 ) if (count > 1 )
{ {
// multiple records found for summ. updation // multiple records found for summ. updation
errCode = "VTGLTRAN1"; errCode = "VTGLTRAN1";
errString = getMsg("Duplicate records for coin difference updation were found in gltran [" +refSer +"]",errCode, conn); errString = getMsg("Duplicate records for coin difference updation were found in gltran [" +refSer +"]",errCode, conn);
return errString; return errString;
} }
else if (count == 1) else if (count == 1)
{ {
sql = "delete from gltran " sql = "delete from gltran "
+ " where acct_prd = ? " + " where acct_prd = ? "
+ " and prd_code = ? " + " and prd_code = ? "
+ " and site_code = ? " + " and site_code = ? "
...@@ -2120,26 +2191,26 @@ public class UnpostFin extends ProcessEJB ...@@ -2120,26 +2191,26 @@ public class UnpostFin extends ProcessEJB
+ " and ref_id = ? " + " and ref_id = ? "
+ " and tran_id__trace = ? "; + " and tran_id__trace = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, acctPrd); pstmtUpd.setString(1, acctPrd);
pstmtUpd.setString(2, prdCode); pstmtUpd.setString(2, prdCode);
pstmtUpd.setString(3, siteCode); pstmtUpd.setString(3, siteCode);
pstmtUpd.setString(4, acctCodeCoinDiff); pstmtUpd.setString(4, acctCodeCoinDiff);
pstmtUpd.setString(5, cctrCodeCoinDiff); pstmtUpd.setString(5, cctrCodeCoinDiff);
pstmtUpd.setString(6, refSer); pstmtUpd.setString(6, refSer);
pstmtUpd.setString(7, refId); pstmtUpd.setString(7, refId);
pstmtUpd.setString(8, entryBatchNo); pstmtUpd.setString(8, entryBatchNo);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1) if(count != 1)
{ {
errCode = "DS000NR1D"; errCode = "DS000NR1D";
errString = getMsg("Error deleting gltran [" +refSer +"]",errCode, conn); errString = getMsg("Error deleting gltran [" +refSer +"]",errCode, conn);
return errString; return errString;
}
} }
} }
}
} }
sql = "delete from gltrace where ref_ser = ? and ref_id = ? "; sql = "delete from gltrace where ref_ser = ? and ref_id = ? ";
...@@ -2155,7 +2226,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2155,7 +2226,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Error deleting gltrace [" +refSer +"]",errCode, conn); errString = getMsg("Error deleting gltrace [" +refSer +"]",errCode, conn);
return errString; return errString;
} }
} }
catch(Exception exception) catch(Exception exception)
{ {
...@@ -2191,7 +2262,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2191,7 +2262,7 @@ public class UnpostFin extends ProcessEJB
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -2214,7 +2285,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2214,7 +2285,7 @@ public class UnpostFin extends ProcessEJB
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null; PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
int count = 0; int count = 0;
try try
{ {
//// Changed By Surender : 17/05/2001 as per MR Kandarp Inst. //// Changed By Surender : 17/05/2001 as per MR Kandarp Inst.
...@@ -2238,9 +2309,9 @@ public class UnpostFin extends ProcessEJB ...@@ -2238,9 +2309,9 @@ public class UnpostFin extends ProcessEJB
//end if //end if
//// ////
sql = " SELECT tran_id, ref_ser, ref_no, tot_amt, adj_amt, ref_ser_adj, ref_no_adj, net_amt, tran_id__rcv " sql = " SELECT tran_id, ref_ser, ref_no, tot_amt, adj_amt, ref_ser_adj, ref_no_adj, net_amt, tran_id__rcv "
+ " FROM receivables_adj " + " FROM receivables_adj "
+ " WHERE ((ref_ser = 'S-INV' AND ref_no = ?) OR (ref_ser_adj = 'S-INV' AND ref_no_adj = ?)) " ; + " WHERE ((ref_ser = 'S-INV' AND ref_no = ?) OR (ref_ser_adj = 'S-INV' AND ref_no_adj = ?)) " ;
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, invoiceId); pstmt1.setString(1, invoiceId);
pstmt1.setString(2, invoiceId); pstmt1.setString(2, invoiceId);
...@@ -2271,32 +2342,32 @@ public class UnpostFin extends ProcessEJB ...@@ -2271,32 +2342,32 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
// if recTotal = (adjAmount + recAdj) then // if recTotal = (adjAmount + recAdj) then
// status = 'A' // status = 'A'
// else // else
status = "P"; status = "P";
// end if // end if
statDate = (Timestamp) Calendar.getInstance().getTime(); statDate = (Timestamp) Calendar.getInstance().getTime();
sql = "update receivables " sql = "update receivables "
+" set adj_amt = adj_amt - ?, " +" set adj_amt = adj_amt - ?, "
+ " status = ?, " + " status = ?, "
+ " stat_date = ? " + " stat_date = ? "
+ " where tran_ser = ? " + " where tran_ser = ? "
+ " ref_no = ? " ; + " ref_no = ? " ;
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, adjAmount); pstmtUpd.setDouble(1, adjAmount);
pstmtUpd.setString(2, status); pstmtUpd.setString(2, status);
pstmtUpd.setTimestamp(3, statDate); pstmtUpd.setTimestamp(3, statDate);
pstmtUpd.setString(4, refSer); pstmtUpd.setString(4, refSer);
pstmtUpd.setString(5, refNO); pstmtUpd.setString(5, refNO);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
if(count != 1) if(count != 1)
{ {
errCode = "DS000NR"; errCode = "DS000NR";
...@@ -2307,7 +2378,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2307,7 +2378,7 @@ public class UnpostFin extends ProcessEJB
if ("R-ADV".equals(refSer)) if ("R-ADV".equals(refSer))
{ {
sql = "select fin_entity, site_code, cust_code, acct_code, cctr_code,curr_code, exch_rate " sql = "select fin_entity, site_code, cust_code, acct_code, cctr_code,curr_code, exch_rate "
+ " from receivables where tran_ser = ? and ref_no = ? " ; + " from receivables where tran_ser = ? and ref_no = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refSer); pstmt.setString(1, refSer);
...@@ -2329,7 +2400,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2329,7 +2400,7 @@ public class UnpostFin extends ProcessEJB
pstmt = null; pstmt = null;
sql = "select tran_date,eff_date " sql = "select tran_date,eff_date "
+ " from invoice where invoice_id = ? " ; + " from invoice where invoice_id = ? " ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, invoiceId); pstmt.setString(1, invoiceId);
...@@ -2343,7 +2414,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2343,7 +2414,7 @@ public class UnpostFin extends ProcessEJB
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
sundryBalMap = new HashMap(); sundryBalMap = new HashMap();
sundryBalMap.put("tran_date",new Timestamp(tranDate.getTime())); sundryBalMap.put("tran_date",new Timestamp(tranDate.getTime()));
sundryBalMap.put("eff_date",new Timestamp(effDate.getTime())); sundryBalMap.put("eff_date",new Timestamp(effDate.getTime()));
...@@ -2415,11 +2486,11 @@ public class UnpostFin extends ProcessEJB ...@@ -2415,11 +2486,11 @@ public class UnpostFin extends ProcessEJB
e.printStackTrace(); e.printStackTrace();
} }
} }
return errString; return errString;
} }
private String getMsg(String trace,String Code,Connection conn) throws ITMException, Exception private String getMsg(String trace,String Code,Connection conn) throws ITMException, Exception
{ {
String mainStr =""; String mainStr ="";
...@@ -2447,9 +2518,9 @@ public class UnpostFin extends ProcessEJB ...@@ -2447,9 +2518,9 @@ public class UnpostFin extends ProcessEJB
mainStr= begPart + trace + " </message><description>"; mainStr= begPart + trace + " </message><description>";
mainStr= mainStr+endDesc; mainStr= mainStr+endDesc;
begPart = null; begPart = null;
*/ */
itmDBAccessEJB = null; itmDBAccessEJB = null;
} }
catch(Exception e) catch(Exception e)
...@@ -2482,69 +2553,72 @@ public class UnpostFin extends ProcessEJB ...@@ -2482,69 +2553,72 @@ public class UnpostFin extends ProcessEJB
String errCode = "", siteCode = "", itemCode = "", locCode = "", lotNo = "", lotSl = "", porder = "", lineNoOrd = "", lineNoRcp = ""; String errCode = "", siteCode = "", itemCode = "", locCode = "", lotNo = "", lotSl = "", porder = "", lineNoOrd = "", lineNoRcp = "";
String sql = "", errString = ""; String sql = "", errString = "";
double quantity = 0; double quantity = 0;
int count = 0; int count = 0, lineNo = 0;
boolean isError = false; boolean isError = false;
PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null; PreparedStatement pstmt = null, pstmt1 = null, pstmtUpd = null, pstmt2 = null, pstmt3= null, pstmt4= null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
String sorder=null,lineNoSord=null,explevel=null,retrepflag=null;
HashMap strAllocate = new HashMap();
InvAllocTraceBean invBean = new InvAllocTraceBean();
try try
{ {
if ("P-RCP".equals(refSer.trim())) if ("P-RCP".equals(refSer.trim()))
{ {
sql = "select site_code, item_code, loc_code, lot_no, lot_sl, eff_qty, ref_line " sql = "select site_code, item_code, loc_code, lot_no, lot_sl, eff_qty, ref_line "
+ " from invtrace where ref_ser = ? and ref_id = ? and loc_code in('INTR','GIT') " ; + " from invtrace where ref_ser = ? and ref_id = ? ";//and loc_code in('INTR','GIT') " ;
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refSer); pstmt1.setString(1, refSer);
pstmt1.setString(2, refId); pstmt1.setString(2, refId);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
while(rs1.next()) while(rs1.next())
{ {
siteCode = rs1.getString("site_code"); siteCode = rs1.getString("site_code");
itemCode = rs1.getString("item_code"); itemCode = rs1.getString("item_code");
locCode = rs1.getString("loc_code"); locCode = rs1.getString("loc_code");
lotNo = rs1.getString("lot_no"); lotNo = rs1.getString("lot_no");
lotSl = rs1.getString("lot_sl"); lotSl = rs1.getString("lot_sl");
quantity = rs1.getDouble("eff_qty"); quantity = rs1.getDouble("eff_qty");
lineNoRcp = rs1.getString("site_code"); lineNoRcp = rs1.getString("ref_line");
if (quantity > 0)
sql = "select purc_order, line_no__ord from porcpdet "
+ " where tran_id = ? and line_no = ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId);
pstmt.setString(2, lineNoRcp);
rs = pstmt.executeQuery();
if(rs.next())
{ {
porder = rs.getString("purc_order"); sql = "select purc_order, line_no__ord from porcpdet "
lineNoOrd = rs.getString("line_no__ord"); + " where tran_id = ? and line_no = ? " ;
pstmt = conn.prepareStatement(sql);
sql = "update porddet set dlv_qty = dlv_qty - ? " pstmt.setString(1, refId);
+ " where purc_order = ? and line_no = ? "; pstmt.setString(2, lineNoRcp);
pstmtUpd = conn.prepareStatement(sql); rs = pstmt.executeQuery();
pstmtUpd.setDouble(1, quantity); if(rs.next())
pstmtUpd.setString(2, porder);
pstmtUpd.setString(3, lineNoOrd);
count = pstmtUpd.executeUpdate();
if (count != 1)
{ {
errCode = "DS000NR"; porder = rs.getString("purc_order");
errString = getMsg("Update purchase order detail failed ",errCode, conn); lineNoOrd = rs.getString("line_no__ord");
break;
sql = "update porddet set dlv_qty = dlv_qty - ? "
+ " where purc_order = ? and line_no = ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, porder);
pstmtUpd.setString(3, lineNoOrd);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn);
break;
}
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "update stock set quantity = quantity - ? " sql = "update stock set quantity = quantity - ? "
+ " where item_code = ? " + " where item_code = ? "
+ " and site_code = ? " + " and site_code = ? "
...@@ -2558,14 +2632,14 @@ public class UnpostFin extends ProcessEJB ...@@ -2558,14 +2632,14 @@ public class UnpostFin extends ProcessEJB
pstmtUpd.setString(4, locCode); pstmtUpd.setString(4, locCode);
pstmtUpd.setString(5, lotNo); pstmtUpd.setString(5, lotNo);
pstmtUpd.setString(6, lotSl); pstmtUpd.setString(6, lotSl);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count != 1) if (count != 1)
{ {
errCode = "DS000NR"; errCode = "DS000NR";
errString = getMsg("Update stock order detail failed ",errCode, conn); errString = getMsg("Update stock order detail failed ",errCode, conn);
break; break;
} }
} }
rs1.close(); rs1.close();
...@@ -2577,7 +2651,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2577,7 +2651,7 @@ public class UnpostFin extends ProcessEJB
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count <= 0) if (count <= 0)
{ {
...@@ -2585,14 +2659,14 @@ public class UnpostFin extends ProcessEJB ...@@ -2585,14 +2659,14 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Deleting invtrace failed ",errCode, conn); errString = getMsg("Deleting invtrace failed ",errCode, conn);
isError = true; isError = true;
return errString; return errString;
} }
sql = " update porcp set qc_reqd = 'N' where tran_id = ? "; sql = " update porcp set qc_reqd = 'N' where tran_id = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count != 1) if (count != 1)
{ {
...@@ -2600,7 +2674,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2600,7 +2674,7 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update purchase receipt failed ",errCode, conn); errString = getMsg("Update purchase receipt failed ",errCode, conn);
isError = true; isError = true;
return errString; return errString;
} }
} }
else if ("S-DSP".equals(refSer.trim())) else if ("S-DSP".equals(refSer.trim()))
...@@ -2611,60 +2685,323 @@ public class UnpostFin extends ProcessEJB ...@@ -2611,60 +2685,323 @@ public class UnpostFin extends ProcessEJB
// 4. stock to be allocated against the despatch // 4. stock to be allocated against the despatch
// 5. update despatch/despatchdet status with ' ' (single space) // 5. update despatch/despatchdet status with ' ' (single space)
// 6. update despatch confirmed as N // 6. update despatch confirmed as N
System.out.println("inside unpost save sale despatch: ref ser[ "+refSer+"] refId ["+refId);
sql = "select site_code, item_code, loc_code, lot_no, lot_sl, eff_qty, ref_line " sql = "select site_code, item_code, loc_code, lot_no, lot_sl, eff_qty, ref_line "
+ " from invtrace where ref_ser = ? and ref_id = ? " ; + " from invtrace where ref_ser = ? and ref_id = ? " ;
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refSer); pstmt1.setString(1, refSer);
pstmt1.setString(2, refId); pstmt1.setString(2, refId);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
System.out.println("sql---"+sql);
while(rs1.next()) while(rs1.next())
{ {
System.out.println("sql11---"+sql);
siteCode = rs1.getString("site_code"); siteCode = rs1.getString("site_code");
itemCode = rs1.getString("item_code"); itemCode = rs1.getString("item_code");
locCode = rs1.getString("loc_code"); locCode = rs1.getString("loc_code");
lotNo = rs1.getString("lot_no"); lotNo = rs1.getString("lot_no");
lotSl = rs1.getString("lot_sl"); lotSl = rs1.getString("lot_sl");
quantity = rs1.getDouble("eff_qty"); quantity = rs1.getDouble("eff_qty");
lineNoRcp = rs1.getString("site_code"); lineNoRcp = rs1.getString("ref_line");
//select --sale order--no---
sql = "select purc_order, line_no__ord from porcpdet " System.out.println(" Despatch details ref ser1 sitecode ["+siteCode+" ] item_code["+itemCode+"] loc_code"+locCode+" ]quantity"+quantity+" ]lineNoRcp"+lineNoRcp);
+ " where tran_id = ? and line_no = ? " ;
sql = "select sord_no,line_no__sord ,exp_lev from despatchdet where desp_id= ? and line_no=?" ;
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refId); pstmt.setString(1, refId);
pstmt.setString(2, lineNoRcp); pstmt.setString(2, lineNoRcp);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
porder = rs.getString("purc_order"); sorder = rs.getString("sord_no");
lineNoOrd = rs.getString("line_no__ord"); lineNoSord = rs.getString("line_no__sord");
explevel = rs.getString("exp_lev");//end
//added by monika
//(1)update qty_desptch,status
System.out.println("eff qty :"+quantity+ " sql");
if(quantity<0)
{
sql = "update sorditem set qty_desp = qty_desp + ? ,status= ? "
+ " where sale_order = ? and line_no=? and exp_lev=?";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, "P");
pstmtUpd.setString(3, sorder);
pstmtUpd.setString(4, lineNoSord);
pstmtUpd.setString(5, explevel);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn);
break;
}
//end
//(2)update sorddet set status
sql = "update sorddet set status='P' where sale_order = ? and line_no=?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1,sorder);
pstmt2.setString(2, lineNoSord);
count = pstmt2.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn);
break;
}
pstmt2.close();
pstmt2=null;//end
}
//(3)update stock set quantity with eff_qty
// sql = "update stock set quantity =(-1) * ? where item_code = ? "
sql = "update stock set quantity =quantity - ? where item_code = ? "
+ " and site_code = ? "
+ " and loc_code = ? "
+ " and lot_no = ? "
+ " and lot_sl = ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, itemCode);
pstmtUpd.setString(3, siteCode);
pstmtUpd.setString(4, locCode);
pstmtUpd.setString(5, lotNo);
pstmtUpd.setString(6, lotSl);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update stock order detail failed ",errCode, conn);
break;
}
pstmtUpd.close();
pstmtUpd=null;//end
//update invalocate trace
if(quantity<0)
{
strAllocate = null;
strAllocate = new HashMap();
strAllocate.put("ref_id",refId);
strAllocate.put("ref_line",lineNoRcp.substring(lineNoRcp.length()-3));
strAllocate.put("site_code",siteCode);
strAllocate.put("item_code",itemCode);
strAllocate.put("loc_code",locCode);
strAllocate.put("lot_no",lotNo);
strAllocate.put("lot_sl",lotSl);
strAllocate.put("alloc_qty",new Double(-1 * quantity));
strAllocate.put("chg_win","W_DESPATCH");
strAllocate.put("ref_ser","S-DSP");
String logMsg= refId +" "+explevel+" "+lineNoRcp.substring(lineNoRcp.length()-3) + " "+"Allocation of stock from DespatchPos";
strAllocate.put("alloc_ref",logMsg);
errString = invBean.updateInvallocTrace(strAllocate,conn);
sql ="UPDATE SORDITEM SET QTY_ALLOC = QTY_ALLOC - ? "
+"WHERE SALE_ORDER = ? "
+"AND LINE_NO = ? "
+"AND EXP_LEV = ? ";
System.out.println("Update sql :"+sql);
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1,quantity);
pstmtUpd.setString(2,sorder);
pstmtUpd.setString(3,lineNoSord);
pstmtUpd.setString(4,explevel);
count = pstmtUpd.executeUpdate();
System.out.println("Updated the no of records : updateCnt :"+count);
// pstmt.clearParameters();
sql = "update porddet set dlv_qty = dlv_qty - ? " pstmtUpd.close();
pstmtUpd=null;
}
//end
//update despatch /despatchdet
sql="update despatch set status = ? where desp_id= ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1," ");
pstmtUpd.setString(2, refId);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn);
break;
}
pstmtUpd.close();
pstmtUpd=null;//end
sql = "update despatchdet set status = ? where desp_id= ? and line_no=? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, " ");
pstmtUpd.setString(2, refId);
pstmtUpd.setString(3, lineNoRcp);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn);
break;
}
pstmtUpd.close();
pstmtUpd=null;//end
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
pstmt1.close();
pstmt1=null;
rs1.close();
rs1=null;
} // to check for sreturn--
/* 1. select invtrace and update stock with -1 * eff_qty
2. if ret_repl_flag in detail is P then allocate stock
3. update sreturn confirmed = 'N', tran_id__crn = null*/
//start
else if ("S-RET".equals(refSer.trim()))
{
sql = "select site_code, item_code, loc_code, lot_no, lot_sl, eff_qty, ref_line "
+ " from invtrace where ref_ser = ? and ref_id = ? ";//and loc_code in('INTR','GIT') " ;
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refSer);
pstmt1.setString(2, refId);
rs1 = pstmt1.executeQuery();
while(rs1.next())
{
siteCode = rs1.getString("site_code");
itemCode = rs1.getString("item_code");
locCode = rs1.getString("loc_code");
lotNo = rs1.getString("lot_no");
lotSl = rs1.getString("lot_sl");
quantity = rs1.getDouble("eff_qty");
lineNoRcp = rs1.getString("ref_line");
System.out.println(" Despatch details ref ser1 sitecode ["+siteCode+" ] item_code["+itemCode+"] loc_code"+locCode+" ]quantity"+quantity+" ]lineNoRcp"+lineNoRcp);
//(1)update stock set quantity with eff_qty
//sql = "update stock set quantity =quantity - ? where item_code = ? "
sql = "update stock set quantity =quantity - ? where item_code = ? "
+ " and site_code = ? "
+ " and loc_code = ? "
+ " and lot_no = ? "
+ " and lot_sl = ? ";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, itemCode);
pstmtUpd.setString(3, siteCode);
pstmtUpd.setString(4, locCode);
pstmtUpd.setString(5, lotNo);
pstmtUpd.setString(6, lotSl);
count = pstmtUpd.executeUpdate();
if (count != 1)
{
errCode = "DS000NR";
errString = getMsg("Update stock order detail failed ",errCode, conn);
break;
}
pstmtUpd.close();//end
pstmtUpd=null;
lineNo = Integer.parseInt(lineNoRcp.trim());
sql = "select ret_rep_flag from sreturndet where tran_id = ? and line_no = ? " ;
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId);
pstmtUpd.setInt(2, lineNo);
rs = pstmtUpd.executeQuery();
if(rs.next())
{
retrepflag = rs.getString("ret_rep_flag");
}
rs.close();
rs = null;
System.out.println("retrepflag1 ["+retrepflag);
if(quantity<0 && "P".equals(retrepflag))
{
strAllocate = null;
strAllocate = new HashMap();
System.out.println("retrepflag1 ["+retrepflag);
strAllocate.put("ref_id",refId);
strAllocate.put("ref_line",lineNoRcp.substring(lineNoRcp.length()-3));
strAllocate.put("site_code",siteCode);
strAllocate.put("item_code",itemCode);
strAllocate.put("loc_code",locCode);
strAllocate.put("lot_no",lotNo);
strAllocate.put("lot_sl",lotSl);
strAllocate.put("alloc_qty",new Double(-1 * quantity));
strAllocate.put("chg_win","w_salesreturn_retn");
strAllocate.put("ref_ser","S-RET");
String logMsg= refId +" "+explevel+" "+lineNoRcp.substring(lineNoRcp.length()-3) + " "+"Allocation of stock from UnpostFin";
strAllocate.put("alloc_ref",logMsg);
errString = invBean.updateInvallocTrace(strAllocate,conn);
}
}
pstmt1.close();
pstmt1=null;
rs1.close();
rs1=null;
}
//end [MONIKA SALLA]
/* sql = "update porddet set dlv_qty = dlv_qty - ? "
+ " where purc_order = ? and line_no = ? "; + " where purc_order = ? and line_no = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setDouble(1, quantity); pstmtUpd.setDouble(1, quantity);
pstmtUpd.setString(2, porder); pstmtUpd.setString(2, porder);
pstmtUpd.setString(3, lineNoOrd); pstmtUpd.setString(3, lineNoOrd);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count != 1) if (count != 1)
{ {
errCode = "DS000NR"; errCode = "DS000NR";
errString = getMsg("Update purchase order detail failed ",errCode, conn); errString = getMsg("Update purchase order detail failed ",errCode, conn);
break; break;
} }
pstmtUpd=null;
pstmtUpd.close();
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;*/
sql = "update stock set quantity = quantity - ? " /* sql = "update stock set quantity = quantity - ? "
+ " where item_code = ? " + " where item_code = ? "
+ " and site_code = ? " + " and site_code = ? "
+ " and loc_code = ? " + " and loc_code = ? "
...@@ -2677,16 +3014,17 @@ public class UnpostFin extends ProcessEJB ...@@ -2677,16 +3014,17 @@ public class UnpostFin extends ProcessEJB
pstmtUpd.setString(4, locCode); pstmtUpd.setString(4, locCode);
pstmtUpd.setString(5, lotNo); pstmtUpd.setString(5, lotNo);
pstmtUpd.setString(6, lotSl); pstmtUpd.setString(6, lotSl);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count != 1) if (count != 1)
{ {
errCode = "DS000NR"; errCode = "DS000NR";
errString = getMsg("Update stock order detail failed ",errCode, conn); errString = getMsg("Update stock order detail failed ",errCode, conn);
break; break;
} }*/
}
/*}
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
...@@ -2696,7 +3034,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2696,7 +3034,7 @@ public class UnpostFin extends ProcessEJB
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refSer); pstmtUpd.setString(1, refSer);
pstmtUpd.setString(2, refId); pstmtUpd.setString(2, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count <= 0) if (count <= 0)
{ {
...@@ -2704,14 +3042,14 @@ public class UnpostFin extends ProcessEJB ...@@ -2704,14 +3042,14 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Deleting invtrace failed ",errCode, conn); errString = getMsg("Deleting invtrace failed ",errCode, conn);
isError = true; isError = true;
return errString; return errString;
} }
sql = " update porcp set qc_reqd = 'N' where tran_id = ? "; sql = " update porcp set qc_reqd = 'N' where tran_id = ? ";
pstmtUpd = conn.prepareStatement(sql); pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setString(1, refId); pstmtUpd.setString(1, refId);
count = pstmtUpd.executeUpdate(); count = pstmtUpd.executeUpdate();
if (count != 1) if (count != 1)
{ {
...@@ -2719,9 +3057,9 @@ public class UnpostFin extends ProcessEJB ...@@ -2719,9 +3057,9 @@ public class UnpostFin extends ProcessEJB
errString = getMsg("Update purchase receipt failed ",errCode, conn); errString = getMsg("Update purchase receipt failed ",errCode, conn);
isError = true; isError = true;
return errString; return errString;
} }*/
} //}
} }
...@@ -2732,7 +3070,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2732,7 +3070,7 @@ public class UnpostFin extends ProcessEJB
errCode = "DS000NR"; errCode = "DS000NR";
try try
{ {
errString = getMsg("Update purchase receipt failed ",errCode, conn); errString = getMsg("Update purchase receipt failed ",errCode, conn);
} }
catch (Exception t) {} catch (Exception t) {}
throw new ITMException(exception); throw new ITMException(exception);
...@@ -2766,7 +3104,7 @@ public class UnpostFin extends ProcessEJB ...@@ -2766,7 +3104,7 @@ public class UnpostFin extends ProcessEJB
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -2777,4 +3115,4 @@ public class UnpostFin extends ProcessEJB ...@@ -2777,4 +3115,4 @@ public class UnpostFin extends ProcessEJB
return (errString); return (errString);
} }
} }
\ No newline at end of file
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