Commit b7d917fa authored by ngadkari's avatar ngadkari

save data method used to insert in advance voucher

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198331 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1fe667db
...@@ -370,6 +370,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -370,6 +370,10 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
java.sql.Timestamp currDate = null; java.sql.Timestamp currDate = null;
currDate = new java.sql.Timestamp(System.currentTimeMillis()) ; currDate = new java.sql.Timestamp(System.currentTimeMillis()) ;
boolean isError = false ; boolean isError = false ;
//added by nandkumar gadkari on 08/03/19
String indnoHdr = "",indNo = "",unitStd = "", enqNo = "";
PreparedStatement pstmt2=null;
double totAmtProj=0.0,oqty = 0.0 ,quantity = 0.0 , ordqty = 0.0 ,totOrdQty = 0.0;
try try
{ {
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
...@@ -566,6 +570,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -566,6 +570,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
System.out.println("updCntupdCntupdCnt"+updCnt); System.out.println("updCntupdCntupdCnt"+updCnt);
if(updCnt == 1) if(updCnt == 1)
{ {
//added by nandkumar gadkari --------start---08/03/19
sql = "select ind_no,item_code,quantity__stduom, unit__std from porddet where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
indNo = checkNull(rs.getString("ind_no"));
//itemCode = rs.getString("item_code");
oqty = rs.getDouble("quantity__stduom");
unitStd= rs.getString("unit__std");
if(indNo != null && indNo.trim().length() > 0)
{
sql1 = "select quantity__stduom, ord_qty from indent where ind_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, indNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
cnt = 0;
quantity = rs1.getDouble("quantity__stduom") ;
ordqty = rs1.getDouble("ord_qty") ;
cnt++;
}
rs1.close();rs1 = null;
pstmt1.close();pstmt1 = null;
totOrdQty = ordqty - oqty ;
if(cnt > 0)
{
System.out.println("totOrdQty>>"+totOrdQty + "ordqty" +ordqty+"oqty"+oqty);
if(quantity > totOrdQty)
{
sql1 = "update indent set status = 'O',status_date = ?,ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
else
{
sql1 = "update indent set status = 'A',status_date = ?, ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
}
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit(); conn.commit();
isError = true; isError = true;
} }
...@@ -617,6 +687,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -617,6 +687,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
System.out.println("updCntupdCntupdCnt"+updCnt); System.out.println("updCntupdCntupdCnt"+updCnt);
if(updCnt == 1) if(updCnt == 1)
{ {
//added by nandkumar gadkari --------start---08/03/19
sql = "select ind_no,item_code,quantity__stduom, unit__std from porddet where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
indNo = checkNull(rs.getString("ind_no"));
//itemCode = rs.getString("item_code");
oqty = rs.getDouble("quantity__stduom");
unitStd= rs.getString("unit__std");
if(indNo != null && indNo.trim().length() > 0)
{
sql1 = "select quantity__stduom, ord_qty from indent where ind_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, indNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
cnt = 0;
quantity = rs1.getDouble("quantity__stduom") ;
ordqty = rs1.getDouble("ord_qty") ;
cnt++;
}
rs1.close();rs1 = null;
pstmt1.close();pstmt1 = null;
totOrdQty = ordqty - oqty ;
if(cnt > 0)
{
System.out.println("totOrdQty>>"+totOrdQty + "ordqty" +ordqty+"oqty"+oqty);
if(quantity > totOrdQty)
{
sql1 = "update indent set status = 'O',status_date = ?,ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
else
{
sql1 = "update indent set status = 'A',status_date = ?, ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
}
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit(); conn.commit();
isError = true; isError = true;
} }
...@@ -695,7 +831,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -695,7 +831,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
if((errString == null || errString.trim().length() == 0) && isError == false) if((errString == null || errString.trim().length() == 0) && isError == false)
{ {
System.out.println("Inside gbfPorderAdvance....."+errString); System.out.println("Inside gbfPorderAdvance....."+errString);
errString = gbfPorderAdvance(pOrder,0,"PO",conn); errString = gbfPorderAdvance(pOrder,0,"PO",xtraParams,conn); // xtraParams ADDED BY NANDKUMAR GADKARI ON 11/03/19
} }
System.out.println(" gbfPorderAdvance errString....."+errString); System.out.println(" gbfPorderAdvance errString....."+errString);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
...@@ -714,6 +850,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -714,6 +850,72 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
System.out.println("updCntupdCntupdCnt"+updCnt); System.out.println("updCntupdCntupdCnt"+updCnt);
if(updCnt == 1) if(updCnt == 1)
{ {
//added by nandkumar gadkari --------start---08/03/19
sql = "select ind_no,item_code,quantity__stduom, unit__std from porddet where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, pOrder);
rs = pstmt.executeQuery();
while(rs.next())
{
indNo = checkNull(rs.getString("ind_no"));
//itemCode = rs.getString("item_code");
oqty = rs.getDouble("quantity__stduom");
unitStd= rs.getString("unit__std");
if(indNo != null && indNo.trim().length() > 0)
{
sql1 = "select quantity__stduom, ord_qty from indent where ind_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, indNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
cnt = 0;
quantity = rs1.getDouble("quantity__stduom") ;
ordqty = rs1.getDouble("ord_qty") ;
cnt++;
}
rs1.close();rs1 = null;
pstmt1.close();pstmt1 = null;
totOrdQty = ordqty - oqty ;
if(cnt > 0)
{
System.out.println("totOrdQty>>"+totOrdQty + "ordqty" +ordqty+"oqty"+oqty);
if(quantity > totOrdQty)
{
sql1 = "update indent set status = 'O',status_date = ?,ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
else
{
sql1 = "update indent set status = 'A',status_date = ?, ord_qty = ?, unit__ord = ? where ind_no = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setTimestamp(1, currDate);
pstmt1.setDouble(2, totOrdQty);
pstmt1.setString(3, unitStd);
pstmt1.setString(4, indNo);
pstmt1.executeUpdate();
pstmt1.close();
pstmt1 = null;
}
}
}
}
rs.close();rs = null;
pstmt.close();pstmt = null;
//added by nandkumar gadkari------end----08/03/19
conn.commit(); conn.commit();
//isError = true; //isError = true;
} }
...@@ -3349,7 +3551,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3349,7 +3551,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
} }
return priceList; return priceList;
} }
private String gbfPorderAdvance(String tranId ,double adAdvPerc ,String asFlag ,Connection conn) throws Exception private String gbfPorderAdvance(String tranId ,double adAdvPerc ,String asFlag ,String xtraParams,Connection conn) throws Exception // xtraParams ADDED BY NANDKUMAR GADKARI ON 11/03/19
{ {
System.out.println("Inside gbfPorderAdvance..........."); System.out.println("Inside gbfPorderAdvance...........");
...@@ -3358,7 +3560,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3358,7 +3560,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
bankCode = "", finEnt = "" , lsCode = "" ,relAgnst = "" ,advType= "" ,sqlInsert = "" ,taxClass = "" , bankCode = "", finEnt = "" , lsCode = "" ,relAgnst = "" ,advType= "" ,sqlInsert = "" ,taxClass = "" ,
taxChap= "" ,taxEnv = "" ,siteCodeAdv = "",payMode = "", acctAp = "" ,acctApAdv = "",cctrAp = "" , cctrApAdv= "", taxChap= "" ,taxEnv = "" ,siteCodeAdv = "",payMode = "", acctAp = "" ,acctApAdv = "",cctrAp = "" , cctrApAdv= "",
invAcct= "" , acctCodeCr = "", cctrCodeCr = "" ,acctApItem = "",cctrApItem = "" , keyStr = "",vouchId = "",remarks = "", rndStr= "", invAcct= "" , acctCodeCr = "", cctrCodeCr = "" ,acctApItem = "",cctrApItem = "" , keyStr = "",vouchId = "",remarks = "", rndStr= "",
rndOff = "", rndTo= ""; //, = "",, = "", = "",, = "", = "",, = "", = "",, = "", = "", ; rndOff = "", rndTo= "",userId=""; //, = "",, = "", = "",, = "", = "",, = "", = "",, = "", = "", ;
double amount = 0.0, ordAmt = 0.0 ,totalPoamt = 0.0 ,exch = 0.0 ,taxAmt = 0.0,advPerc= 0.0,netAmtBase= 0.0, double amount = 0.0, ordAmt = 0.0 ,totalPoamt = 0.0 ,exch = 0.0 ,taxAmt = 0.0,advPerc= 0.0,netAmtBase= 0.0,
netAmt = 0.0 ,vouchAmt= 0.0 ,lcTax = 0.0 ; netAmt = 0.0 ,vouchAmt= 0.0 ,lcTax = 0.0 ;
int lineNo = 1,liRelAfter = 0 ,liRndTo = 0; int lineNo = 1,liRelAfter = 0 ,liRndTo = 0;
...@@ -3747,7 +3949,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3747,7 +3949,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
rs.close();rs = null; rs.close();rs = null;
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
StringBuffer xmlBuffkeyGen = new StringBuffer(); //COMMENTED BY NANDKUMAR GADKARI ON 11/03/19
/*StringBuffer xmlBuffkeyGen = new StringBuffer();
xmlBuffkeyGen.append("<Detail1 dbID='' domID=\"1\" objName=\"voucher\" objContext=\"1\">"); xmlBuffkeyGen.append("<Detail1 dbID='' domID=\"1\" objName=\"voucher\" objContext=\"1\">");
xmlBuffkeyGen.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />"); xmlBuffkeyGen.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuffkeyGen.append("<site_code><![CDATA["+site +"]]></site_code>"); xmlBuffkeyGen.append("<site_code><![CDATA["+site +"]]></site_code>");
...@@ -3759,8 +3962,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3759,8 +3962,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
xmlBuffkeyGen.append("</Detail1>"); xmlBuffkeyGen.append("</Detail1>");
TransIDGenerator tg = new TransIDGenerator(xmlBuffkeyGen.toString(), "BASE", CommonConstants.DB_NAME); TransIDGenerator tg = new TransIDGenerator(xmlBuffkeyGen.toString(), "BASE", CommonConstants.DB_NAME);
vouchId = tg.generateTranSeqID("VOUCH", "tran_id", keyStr, conn); System.out.println("vouchId :"+vouchId);*/
System.out.println("vouchId :"+vouchId);
if("ERROR".equalsIgnoreCase(vouchId)) if("ERROR".equalsIgnoreCase(vouchId))
{ {
...@@ -3835,7 +4037,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3835,7 +4037,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
} }
} }
sqlInsert = "Insert into voucher( tran_id ,tran_date,eff_date,supp_code,bill_no,bill_date,purc_order,curr_code,exch_rate," + //COMMENTED BY NANDKUMAR GADKARI ON 11/03/19
/* sqlInsert = "Insert into voucher( tran_id ,tran_date,eff_date,supp_code,bill_no,bill_date,purc_order,curr_code,exch_rate," +
"acct_code,cctr_code, bank_code ,auto_pay,adv_amt,cr_term,due_date ,chg_date,chg_user,chg_term,site_code," + "acct_code,cctr_code, bank_code ,auto_pay,adv_amt,cr_term,due_date ,chg_date,chg_user,chg_term,site_code," +
"fin_entity, bill_amt,tax_amt,tot_amt,tax_date,vouch_type, proj_code, confirmed,paid,conf_date, pay_mode, " + "fin_entity, bill_amt,tax_amt,tot_amt,tax_date,vouch_type, proj_code, confirmed,paid,conf_date, pay_mode, " +
"net_amt, net_amt__bc,diff_amt__exch ,supp_bill_amt ,acct_code__adv ,cctr_code__adv,tax_chap, tax_class, " + "net_amt, net_amt__bc,diff_amt__exch ,supp_bill_amt ,acct_code__adv ,cctr_code__adv,tax_chap, tax_class, " +
...@@ -3922,7 +4125,121 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3922,7 +4125,121 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
pstmt1.setString(1, vouchId); pstmt1.setString(1, vouchId);
pstmt1.executeUpdate(); pstmt1.executeUpdate();
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;*/
// ADDED BY NANDKUMAR GADKARI ON 11/03/19------------START---------------------------------------------
StringBuffer xmlBuff = new StringBuffer();
String xmlString = null;
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>");
xmlBuff.append("<objName><![CDATA[").append("voucher").append("]]></objName>");
xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
xmlBuff.append("<description>").append("Header0 members").append("</description>");
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"voucher\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<tran_date><![CDATA[" + sdf.format(currDate) + "]]></tran_date>");
xmlBuff.append("<eff_date><![CDATA[" + sdf.format(currDate) + "]]></eff_date>");
xmlBuff.append("<supp_code><![CDATA[" + supp + "]]></supp_code>");
xmlBuff.append("<bill_date><![CDATA[" +sdf.format(currDate) + "]]></bill_date>");
xmlBuff.append("<purc_order><![CDATA[" + tranId + "]]></purc_order>");
xmlBuff.append("<curr_code><![CDATA[" + curr + "]]></curr_code>");
xmlBuff.append("<exch_rate><![CDATA[" + exch + "]]></exch_rate>");
xmlBuff.append("<acct_code><![CDATA[" + acctAp + "]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA[" + cctrAp + "]]></cctr_code>");
xmlBuff.append("<bank_code><![CDATA[" + bankCode + "]]></bank_code>");
xmlBuff.append("<auto_pay><![CDATA[" + "Y" + "]]></auto_pay>");
xmlBuff.append("<adv_amt><![CDATA["+advPerc+"]]></adv_amt>");
xmlBuff.append("<cr_term><![CDATA[" + (crTerm==null?"":crTerm) + "]]></cr_term>");
if ( mileStoneDt != null )
{
xmlBuff.append("<due_date><![CDATA[" + sdf.format(mileStoneDt) + "]]></due_date>");
}
xmlBuff.append("<site_code><![CDATA[" + site + "]]></site_code>");
xmlBuff.append("<fin_entity><![CDATA[" + finEnt + "]]></fin_entity>");
if ( currDate != null )
{
xmlBuff.append("<tax_date><![CDATA[" + sdf.format(currDate) + "]]></tax_date>");
}
xmlBuff.append("<vouch_type><![CDATA[A]]></vouch_type>");
xmlBuff.append("<proj_code><![CDATA[" + proj + "]]></proj_code>");
xmlBuff.append("<confirmed><![CDATA[N]]></confirmed>");
xmlBuff.append("<pay_mode><![CDATA[" + (payMode==null?"":payMode) + "]]></pay_mode>");
xmlBuff.append("<rnd_off><![CDATA[" + rndOff + "]]></rnd_off>");
xmlBuff.append("<rnd_to><![CDATA[" + liRndTo + "]]></rnd_to>");
xmlBuff.append("<tran_mode><![CDATA[A]]></tran_mode>");
xmlBuff.append("<acct_code__adv><![CDATA[" + acctApAdv + "]]></acct_code__adv>");
xmlBuff.append("<cctr_code__adv><![CDATA[" + cctrApAdv + "]]></cctr_code__adv>");
xmlBuff.append("<bill_amt><![CDATA[0]]></bill_amt>");
xmlBuff.append("<tax_amt><![CDATA[0]]></tax_amt>");
xmlBuff.append("<tot_amt><![CDATA[0]]></tot_amt>");
xmlBuff.append("<net_amt><![CDATA[" + netAmt + "]]></net_amt>");
xmlBuff.append("<net_amt__bc><![CDATA[" + netAmtBase + "]]></net_amt__bc>");
xmlBuff.append("<diff_amt__exch><![CDATA[0]]></diff_amt__exch>");
xmlBuff.append("<supp_bill_amt><![CDATA[" + netAmt + "]]></supp_bill_amt>");
xmlBuff.append("<tax_chap><![CDATA[" +taxChap + "]]></tax_chap>");
xmlBuff.append("<tax_class><![CDATA[" + taxClass + "]]></tax_class>");
xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<remarks><![CDATA[" + remarks + "]]></remarks>");
xmlBuff.append("<chg_user><![CDATA[" + "BASE" + "]]></chg_user>");
xmlBuff.append("<chg_term><![CDATA[" + "BASE" + "]]></chg_term>");
xmlBuff.append("<chg_date><![CDATA[" + sdf.format(currentDateTime) + "]]></chg_date>");
xmlBuff.append("</Detail1>");
xmlBuff.append("<Detail4 dbID='' domID=\'1\' objName=\"voucher\" objContext=\"2\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no>"+(1)+"</line_no>");
xmlBuff.append("<acct_code><![CDATA[" + acctApAdv + "]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA[" + cctrApAdv + "]]></cctr_code>");
xmlBuff.append("<amount><![CDATA[" + advPerc + "]]></amount>");
xmlBuff.append("<tax_chap><![CDATA[" +taxChap + "]]></tax_chap>");
xmlBuff.append("<tax_class><![CDATA[" + taxClass + "]]></tax_class>");
xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<apply_tax><![CDATA[" + 0 + "]]></apply_tax>");
xmlBuff.append("</Detail4>");
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("advxmlBuff.toString() ["+xmlBuff.toString() + "]");
userId = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("userId" + userId);
errString = saveData(site,xmlBuff.toString(),userId, conn);
System.out.println("@@@@@2: retString:"+errString);
System.out.println("--retString finished--");
if (errString.indexOf("Success") > -1)
{
System.out.println("@@@@@@3: Success"+errString);
errString = "";
}
// ADDED BY NANDKUMAR GADKARI ON 11/03/19------------END---------------------------------------------
} }
} }
...@@ -3937,6 +4254,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -3937,6 +4254,8 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
pstmt.setInt(2, lineNo); pstmt.setInt(2, lineNo);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close();
pstmt = null;
} }
} }
...@@ -4125,7 +4444,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -4125,7 +4444,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
rs.close();rs = null; rs.close();rs = null;
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
StringBuffer xmlBuffkeyGen = new StringBuffer(); //COMMENTED BY NANDKUMAR GADKARI ON 11/03/19
/*StringBuffer xmlBuffkeyGen = new StringBuffer();
xmlBuffkeyGen.append("<Detail1 dbID='' domID=\"1\" objName=\"voucher\" objContext=\"1\">"); xmlBuffkeyGen.append("<Detail1 dbID='' domID=\"1\" objName=\"voucher\" objContext=\"1\">");
xmlBuffkeyGen.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />"); xmlBuffkeyGen.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuffkeyGen.append("<site_code><![CDATA["+site +"]]></site_code>"); xmlBuffkeyGen.append("<site_code><![CDATA["+site +"]]></site_code>");
...@@ -4140,7 +4461,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -4140,7 +4461,7 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
TransIDGenerator tg = new TransIDGenerator(xmlBuffkeyGen.toString(), "BASE", CommonConstants.DB_NAME); TransIDGenerator tg = new TransIDGenerator(xmlBuffkeyGen.toString(), "BASE", CommonConstants.DB_NAME);
vouchId = tg.generateTranSeqID("VOUCH", "tran_id", keyStr, conn); vouchId = tg.generateTranSeqID("VOUCH", "tran_id", keyStr, conn);
System.out.println("vouchId :"+vouchId); System.out.println("vouchId :"+vouchId);*/
if("ERROR".equalsIgnoreCase(vouchId)) if("ERROR".equalsIgnoreCase(vouchId))
{ {
...@@ -4212,7 +4533,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -4212,7 +4533,9 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
} }
} }
System.out.println("liRndTo"+liRndTo ); System.out.println("liRndTo"+liRndTo );
sqlInsert = " Insert into voucher( tran_id ,tran_date,eff_date,supp_code,bill_no,bill_date,purc_order,curr_code,exch_rate," +
//commented by nandkumar gadkari on 11/03/19
/*sqlInsert = " Insert into voucher( tran_id ,tran_date,eff_date,supp_code,bill_no,bill_date,purc_order,curr_code,exch_rate," +
" acct_code,cctr_code, bank_code ,auto_pay,adv_amt,cr_term,due_date ,chg_date,chg_user,chg_term,site_code," + " acct_code,cctr_code, bank_code ,auto_pay,adv_amt,cr_term,due_date ,chg_date,chg_user,chg_term,site_code," +
" fin_entity, bill_amt,tax_amt,tot_amt,tax_date,vouch_type, proj_code, confirmed,paid,conf_date, pay_mode, " + " fin_entity, bill_amt,tax_amt,tot_amt,tax_date,vouch_type, proj_code, confirmed,paid,conf_date, pay_mode, " +
" net_amt, net_amt__bc,diff_amt__exch ,supp_bill_amt ,acct_code__adv ,cctr_code__adv,tax_chap, tax_class, " + " net_amt, net_amt__bc,diff_amt__exch ,supp_bill_amt ,acct_code__adv ,cctr_code__adv,tax_chap, tax_class, " +
...@@ -4299,7 +4622,121 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -4299,7 +4622,121 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
pstmt1.setString(1, vouchId); pstmt1.setString(1, vouchId);
pstmt1.executeUpdate(); pstmt1.executeUpdate();
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;*/
// ADDED BY NANDKUMAR GADKARI ON 11/03/19------------START---------------------------------------------
StringBuffer xmlBuff = new StringBuffer();
String xmlString = null;
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>");
xmlBuff.append("<objName><![CDATA[").append("voucher").append("]]></objName>");
xmlBuff.append("<pageContext><![CDATA[").append("1").append("]]></pageContext>");
xmlBuff.append("<objContext><![CDATA[").append("1").append("]]></objContext>");
xmlBuff.append("<editFlag><![CDATA[").append("A").append("]]></editFlag>");
xmlBuff.append("<focusedColumn><![CDATA[").append("").append("]]></focusedColumn>");
xmlBuff.append("<action><![CDATA[").append("SAVE").append("]]></action>");
xmlBuff.append("<elementName><![CDATA[").append("").append("]]></elementName>");
xmlBuff.append("<keyValue><![CDATA[").append("1").append("]]></keyValue>");
xmlBuff.append("<taxKeyValue><![CDATA[").append("").append("]]></taxKeyValue>");
xmlBuff.append("<saveLevel><![CDATA[").append("1").append("]]></saveLevel>");
xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
xmlBuff.append("<description>").append("Header0 members").append("</description>");
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"voucher\" objContext=\"1\">");
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<tran_date><![CDATA[" + sdf.format(currDate) + "]]></tran_date>");
xmlBuff.append("<eff_date><![CDATA[" + sdf.format(currDate) + "]]></eff_date>");
xmlBuff.append("<supp_code><![CDATA[" + supp + "]]></supp_code>");
xmlBuff.append("<bill_date><![CDATA[" +sdf.format(currDate) + "]]></bill_date>");
xmlBuff.append("<purc_order><![CDATA[" + tranId + "]]></purc_order>");
xmlBuff.append("<curr_code><![CDATA[" + curr + "]]></curr_code>");
xmlBuff.append("<exch_rate><![CDATA[" + exch + "]]></exch_rate>");
xmlBuff.append("<acct_code><![CDATA[" + acctAp + "]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA[" + cctrAp + "]]></cctr_code>");
xmlBuff.append("<bank_code><![CDATA[" + bankCode + "]]></bank_code>");
xmlBuff.append("<auto_pay><![CDATA[" + "Y" + "]]></auto_pay>");
xmlBuff.append("<adv_amt><![CDATA["+advPerc+"]]></adv_amt>");
xmlBuff.append("<cr_term><![CDATA[" + (crTerm==null?"":crTerm) + "]]></cr_term>");
if ( mileStoneDt != null )
{
xmlBuff.append("<due_date><![CDATA[" + sdf.format(mileStoneDt) + "]]></due_date>");
}
xmlBuff.append("<site_code><![CDATA[" + site + "]]></site_code>");
xmlBuff.append("<fin_entity><![CDATA[" + finEnt + "]]></fin_entity>");
if ( currDate != null )
{
xmlBuff.append("<tax_date><![CDATA[" + sdf.format(currDate) + "]]></tax_date>");
}
xmlBuff.append("<vouch_type><![CDATA[A]]></vouch_type>");
xmlBuff.append("<proj_code><![CDATA[" + proj + "]]></proj_code>");
xmlBuff.append("<confirmed><![CDATA[N]]></confirmed>");
xmlBuff.append("<pay_mode><![CDATA[" + (payMode==null?"":payMode) + "]]></pay_mode>");
xmlBuff.append("<rnd_off><![CDATA[" + rndOff + "]]></rnd_off>");
xmlBuff.append("<rnd_to><![CDATA[" + liRndTo + "]]></rnd_to>");
xmlBuff.append("<tran_mode><![CDATA[A]]></tran_mode>");
xmlBuff.append("<acct_code__adv><![CDATA[" + acctApAdv + "]]></acct_code__adv>");
xmlBuff.append("<cctr_code__adv><![CDATA[" + cctrApAdv + "]]></cctr_code__adv>");
xmlBuff.append("<bill_amt><![CDATA[0]]></bill_amt>");
xmlBuff.append("<tax_amt><![CDATA[0]]></tax_amt>");
xmlBuff.append("<tot_amt><![CDATA[0]]></tot_amt>");
xmlBuff.append("<net_amt><![CDATA[" + netAmt + "]]></net_amt>");
xmlBuff.append("<net_amt__bc><![CDATA[" + netAmtBase + "]]></net_amt__bc>");
xmlBuff.append("<diff_amt__exch><![CDATA[0]]></diff_amt__exch>");
xmlBuff.append("<supp_bill_amt><![CDATA[" + netAmt + "]]></supp_bill_amt>");
xmlBuff.append("<tax_chap><![CDATA[" +taxChap + "]]></tax_chap>");
xmlBuff.append("<tax_class><![CDATA[" + taxClass + "]]></tax_class>");
xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<remarks><![CDATA[" + remarks + "]]></remarks>");
xmlBuff.append("<chg_user><![CDATA[" + "BASE" + "]]></chg_user>");
xmlBuff.append("<chg_term><![CDATA[" + "BASE" + "]]></chg_term>");
xmlBuff.append("<chg_date><![CDATA[" + sdf.format(currentDateTime) + "]]></chg_date>");
xmlBuff.append("</Detail1>");
xmlBuff.append("<Detail4 dbID='' domID=\'1\' objName=\"voucher\" objContext=\"2\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
xmlBuff.append("<tran_id/>");
xmlBuff.append("<line_no>"+(1)+"</line_no>");
xmlBuff.append("<acct_code><![CDATA[" + acctApAdv + "]]></acct_code>");
xmlBuff.append("<cctr_code><![CDATA[" + cctrApAdv + "]]></cctr_code>");
xmlBuff.append("<amount><![CDATA[" + advPerc + "]]></amount>");
xmlBuff.append("<tax_chap><![CDATA[" +taxChap + "]]></tax_chap>");
xmlBuff.append("<tax_class><![CDATA[" + taxClass + "]]></tax_class>");
xmlBuff.append("<tax_env><![CDATA[" + taxEnv + "]]></tax_env>");
xmlBuff.append("<apply_tax><![CDATA[" + 0 + "]]></apply_tax>");
xmlBuff.append("</Detail4>");
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("advxmlBuff.toString() ["+xmlBuff.toString() + "]");
userId = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("userId" + userId);
errString = saveData(site,xmlBuff.toString(),userId, conn);
System.out.println("@@@@@2: retString:"+errString);
System.out.println("--retString finished--");
if (errString.indexOf("Success") > -1)
{
System.out.println("@@@@@@3: Success"+errString);
errString = "";
}
// ADDED BY NANDKUMAR GADKARI ON 11/03/19------------END---------------------------------------------
} }
} }
} }
...@@ -4312,9 +4749,13 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por ...@@ -4312,9 +4749,13 @@ public class PorderConf extends ActionHandlerEJB implements PorderConfLocal, Por
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
pstmt.setInt(2, lineNo); pstmt.setInt(2, lineNo);
pstmt.executeUpdate(); pstmt.executeUpdate();
pstmt.close();
pstmt = null;
} }
} }
} }
rsNew.close();rsNew = null;
pstmtNew.close();pstmtNew = null;
} }
System.out.println("errString IN ADVANCE"+errString); System.out.println("errString IN ADVANCE"+errString);
......
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