Commit 1536ffb7 authored by vkadam's avatar vkadam

Purchase order amendment issue (Update clg_rate, ACCT_CODE__AP_ADV,...

Purchase order amendment issue (Update clg_rate, ACCT_CODE__AP_ADV, CCTR_CODE__AP_ADV, taxtarn entries)


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96840 ce508802-f39f-4f6c-b175-0d175dae99d5
parent af7c357b
......@@ -19,8 +19,7 @@ import java.util.Calendar;
import java.util.Date;
@Stateless
public class POrderAmdConf extends ActionHandlerEJB implements
POrderAmdConfLocal, POrderAmdConfRemote
public class POrderAmdConf extends ActionHandlerEJB implements POrderAmdConfLocal, POrderAmdConfRemote
{
public String actionHandler() throws RemoteException, ITMException
......@@ -28,9 +27,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
return "";
}
public String actionHandler(String actionType, String xmlString,
String objContext, String xtraParams) throws RemoteException,
ITMException
public String actionHandler(String actionType, String xmlString, String objContext, String xtraParams) throws RemoteException, ITMException
{
System.out.println("item actionHandler(...) called............");
String str = "";
......@@ -41,23 +38,22 @@ POrderAmdConfLocal, POrderAmdConfRemote
return str;
}
public String confirm(String tranId, String xtraParams, String forcedFlag)
throws RemoteException, ITMException
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException, ITMException
{
System.out.println("POrderAmdConf confirm called..............");
String confirmed = "";
String sql = "";
//String sql1 = "";
//int status = 0;
//double frtAmt = 0.0;
//Date lrDate = null;
// String sql1 = "";
// int status = 0;
// double frtAmt = 0.0;
// Date lrDate = null;
Connection conn = null;
PreparedStatement pstmt = null;
//PreparedStatement pstmt1 = null;
// PreparedStatement pstmt1 = null;
ITMDBAccessEJB itmDBAccessEJB = null;
String errString = null,errCode="";
String errString = null, errCode = "";
ResultSet rs = null;
//ResultSet rs1 = null;
// ResultSet rs1 = null;
String purcOrder = "", poStatus = "", amdNo = "", workflowStatus = "";
int recCnt = 0, cnt = 0;
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
......@@ -74,21 +70,20 @@ POrderAmdConfLocal, POrderAmdConfRemote
amdNo = tranId;
if (tranId != null && tranId.trim().length() > 0)
{
purcOrder = setDescription("purc_order", "poamd_hdr","amd_no", tranId, conn);
purcOrder = setDescription("purc_order", "poamd_hdr", "amd_no", tranId, conn);
if (purcOrder != null && purcOrder.trim().length() > 0)
{
poStatus = setDescription("status", "porder","purc_order", purcOrder, conn);
poStatus = setDescription("status", "porder", "purc_order", purcOrder, conn);
if ("C".equalsIgnoreCase(poStatus) || "X".equalsIgnoreCase(poStatus) )
if ("C".equalsIgnoreCase(poStatus) || "X".equalsIgnoreCase(poStatus))
{
errString = "VTPOCX";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
sql = " select confirmed, (case when workflow_status is null then '0' else workflow_status end) "
+ " from poamd_hdr where amd_no = ? ";
sql = " select confirmed, (case when workflow_status is null then '0' else workflow_status end) " + " from poamd_hdr where amd_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
rs = pstmt.executeQuery();
......@@ -106,14 +101,13 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (recCnt == 0)
{
errString = "VTMCONF20";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
else if ("Y".equalsIgnoreCase(confirmed))
} else if ("Y".equalsIgnoreCase(confirmed))
{
errString = "VTPACONF1";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
......@@ -130,11 +124,11 @@ POrderAmdConfLocal, POrderAmdConfRemote
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@111 cnt["+cnt+"]");
System.out.println("@@@@@@@@111 cnt[" + cnt + "]");
if (cnt > 0)
{
errString = "VTPOHRDT";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
......@@ -151,24 +145,24 @@ POrderAmdConfLocal, POrderAmdConfRemote
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@222 cnt["+cnt+"]");
System.out.println("@@@@@@@@222 cnt[" + cnt + "]");
if (cnt > 0)
{
errString = "VTPOHRDT";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
if (errString == null || errString.trim().length() == 0)
{
errString = RetrievePordAmd(amdNo, xtraParams,conn);
errString = RetrievePordAmd(amdNo, xtraParams, conn);
}
}
}
if (errString == null || errString.trim().length() == 0)
{
errString = "PRCUSUCCES";
errString = itmDBAccessLocal.getErrorString("",errString,"");
errString = itmDBAccessLocal.getErrorString("", errString, "");
return errString;
}
......@@ -177,8 +171,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
{
e.printStackTrace();
throw new ITMException(e);
}
finally
} finally
{
try
{
......@@ -188,27 +181,24 @@ POrderAmdConfLocal, POrderAmdConfRemote
System.out.println("Transaction rollback... ");
conn.close();
conn = null;
}
else
} else
{
conn.commit(); // test
System.out.println("@@@@ Transaction commit... ");
conn.close();
conn = null;
}
}
catch (Exception e)
} catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
System.out.println("errString["+errString+"]:::::::::::errCode["+errCode+"]");
System.out.println("errString[" + errString + "]:::::::::::errCode[" + errCode + "]");
return errString;
}
private String RetrievePordAmd(String amdNo, String xtraParams,
Connection conn) throws RemoteException, ITMException
private String RetrievePordAmd(String amdNo, String xtraParams, Connection conn) throws RemoteException, ITMException
{
PreparedStatement pstmt = null, pstmt1 = null, pstmtSql = null;
......@@ -220,27 +210,24 @@ POrderAmdConfLocal, POrderAmdConfRemote
Timestamp sysDate = null;
GenericUtility genericUtility = GenericUtility.getInstance();
ITMDBAccessEJB itmDBAccessLocal = new ITMDBAccessEJB();
try {
System.out
.println("@@@@@@@@@@@@@@@ RetrievePordAmd confirm called..............");
try
{
System.out.println("@@@@@@@@@@@@@@@ RetrievePordAmd confirm called..............");
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDateStr = sdf.format(currentDate.getTime());
System.out.println("Now the date is :=> " + sysDateStr+":::loginEmpCode["+loginEmpCode+"]");
sysDate= Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("Now the date is :=> " + sysDateStr + ":::loginEmpCode[" + loginEmpCode + "]");
sysDate = Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
sql = " select a.tot_amt, case when a.vouch_adv_amt is null then 0 else a.vouch_adv_amt end "
+ " from porder a, poamd_hdr b "
+ " where a.purc_order = b.purc_order "
+ " and b.amd_no = ? ";
sql = " select a.tot_amt, case when a.vouch_adv_amt is null then 0 else a.vouch_adv_amt end " + " from porder a, poamd_hdr b " + " where a.purc_order = b.purc_order " + " and b.amd_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
poHdrTot = rs.getDouble(1);
vouchAdv = rs.getDouble(2);
}
......@@ -284,12 +271,12 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@ vouchAdv[" + vouchAdv+ "]:::::poHdrTot[" + poHdrTot + "]");
System.out.println("@@@@@@@@@ vouchAdv[" + vouchAdv + "]:::::poHdrTot[" + poHdrTot + "]");
if (vouchAdv > poHdrTot)
{
errCode = "VTADVEXCES";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
......@@ -299,13 +286,13 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (errCode != null && errCode.trim().length() > 0)
{
conn.rollback();
}
else
} else
{
sql = "select edi_option from transetup where tran_window = 'w_porderamd' ";
pstmtSql = conn.prepareStatement(sql);
rs = pstmtSql.executeQuery();
if (rs.next()) {
if (rs.next())
{
ediOption = rs.getString("EDI_OPTION");
}
rs.close();
......@@ -315,44 +302,41 @@ POrderAmdConfLocal, POrderAmdConfRemote
System.out.println("@@@@@@@@@@@@@@@ ediOption called next..............");
if ("2".equals(ediOption))
{
CreateRCPXML createRCPXML = new CreateRCPXML("w_porderamd","tran_id");
CreateRCPXML createRCPXML = new CreateRCPXML("w_porderamd", "tran_id");
dataStr = createRCPXML.getTranXML(amdNo, conn);
System.out.println("dataStr =[ " + dataStr + "]");
Document ediDataDom = genericUtility.parseString(dataStr);
E12CreateBatchLoadEjb e12CreateBatchLoad = new E12CreateBatchLoadEjb();
retString = e12CreateBatchLoad.createBatchLoad(ediDataDom,
"w_porderamd", "2", xtraParams, conn);
retString = e12CreateBatchLoad.createBatchLoad(ediDataDom, "w_porderamd", "2", xtraParams, conn);
createRCPXML = null;
e12CreateBatchLoad = null;
if (retString != null && "SUCCESS".equals(retString))
{
System.out.println("retString from batchload = ["
+ retString + "]");
System.out.println("retString from batchload = [" + retString + "]");
}
}
else {
else
{
CreateRCPXML createRCPXML = new CreateRCPXML("w_porderamd",
"tran_id");
CreateRCPXML createRCPXML = new CreateRCPXML("w_porderamd", "tran_id");
dataStr = createRCPXML.getTranXML(amdNo, conn);
System.out.println("dataStr =[ " + dataStr + "]");
Document ediDataDom = genericUtility.parseString(dataStr);
E12CreateBatchLoadEjb e12CreateBatchLoad = new E12CreateBatchLoadEjb();
retString = e12CreateBatchLoad.createBatchLoad(ediDataDom,"w_porderamd", ediOption, xtraParams, conn);
retString = e12CreateBatchLoad.createBatchLoad(ediDataDom, "w_porderamd", ediOption, xtraParams, conn);
createRCPXML = null;
e12CreateBatchLoad = null;
if (retString != null && "SUCCESS".equals(retString))
{
System.out.println("retString from batchload = ["+ retString + "]");
System.out.println("retString from batchload = [" + retString + "]");
}
}
System.out
.println("@@@@@@@@@@@@@@@ ediOption called end..............");
System.out.println("@@@@@@@@@@@@@@@ ediOption called end..............");
}
......@@ -370,7 +354,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (!(cnt == 1))
{
errCode = "VTNOAMD";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
......@@ -382,8 +366,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
{
conn.commit();
}
}
catch (Exception e)
} catch (Exception e)
{
System.out.println("Exception :conf ::" + e.getMessage() + ":");
e.printStackTrace();
......@@ -393,17 +376,17 @@ POrderAmdConfLocal, POrderAmdConfRemote
return errCode;
}
private String ConfirmPordAmd(String amdNo, Connection conn)
throws RemoteException, ITMException
private String ConfirmPordAmd(String amdNo, Connection conn) throws RemoteException, ITMException
{
PreparedStatement pstmt = null, pstmt1 = null, pstmt3 = null,pstmtSql = null;
ResultSet rs = null, rs1 = null,rs3 = null;
PreparedStatement pstmt = null, pstmt1 = null, pstmt3 = null, pstmtSql = null, pstmt4 = null;
ResultSet rs = null, rs1 = null, rs3 = null;
int cnt = 0;
// Document dom = null;
String retString = "", sql = "", sql1 = "", sql3 = "",purcOrder = "", lineNoOrd = "", errCode = "";
//String loginEmpCode = "", ediOption = "", dataStr = "";
//double pohdrTot = 0, vouchAdv = 0, amdDetTot = 0, poDetTot = 0, poHdrTot = 0;
String retString = "", sql = "", sql1 = "", sql3 = "", purcOrder = "", lineNoOrd = "", errCode = "", sql4 = null;
// String loginEmpCode = "", ediOption = "", dataStr = "";
// double pohdrTot = 0, vouchAdv = 0, amdDetTot = 0, poDetTot = 0,
// poHdrTot = 0;
Timestamp sysDate = null, taxDate = null, refDate = null, amdDate = null;
String siteCodeDlv = "", siteCodeOrd = "", siteCodeBill = "", deptCode = "", empCode = "", itemSer = "", taxOpt = "", crTerm = "";
String currCode = "", taxChapHdr = "", taxClassHdr = "", taxEnvHdr = "", remarks = "", projCode = "", salesPers = "", commPerc = "", commPercOn = "";
......@@ -422,6 +405,8 @@ POrderAmdConfLocal, POrderAmdConfRemote
String lineNoTax = "", taxCode = "", taxBase = "", taxPerc = "", chgStat = "", taxSet = "", effect = "", acctCodeReco = "";
String cctrCodeReco = "", recoPerc = "", acctCode = "", cctrCode = "", rateType = "", round = "", roundTo = "", taxForm = "";
String acctCodeApAdv = "", cctrCodeApAdv = ""; // VALLABH KADAM Add two
// new field 19/NOV/14
String chgUser = "", chgTerm = "", posted = "", payTax = "", orderOpt = "", bom = "", oldItem = "", lastTermLine = "";
double taxableAmt = 0, recoAmont = 0, dlvQuantity = 0, clgRate = 0, ordQty = 0, totOrdQty = 0, quantStduom = 0;
Timestamp taxFormDate = null, chgDate = null;
......@@ -441,14 +426,9 @@ POrderAmdConfLocal, POrderAmdConfRemote
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
String sysDateStr = sdf.format(currentDate.getTime());
System.out.println("Now the date is :=> " + sysDateStr);
sysDate= Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
sql = " select purc_order,site_code__dlv,site_code__ord,site_code__bill,dept_code,emp_code,item_ser,tax_opt,"
+ " cr_term,ord_amt,tax_amt,tot_amt,curr_code,exch_rate,tax_chap,tax_class,tax_env,remarks,tax_date,"
+ " proj_code,sales_pers,comm_perc,comm_perc__on,curr_code__comm,quot_no,tran_code,frt_amt,curr_code__frt,"
+ " frt_term,dlv_term,insurance_amt,curr_code__ins,emp_code__aprv,ref_date,amd_date,supp_code,"
+ " FRT_TYPE, FRT_RATE,FRT_AMT__QTY, FRT_AMT__FIXED "
+ " from poamd_hdr where amd_no = ? ";
sysDate = Timestamp.valueOf(genericUtility.getValidDateString(sysDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
sql = " select purc_order,site_code__dlv,site_code__ord,site_code__bill,dept_code,emp_code,item_ser,tax_opt," + " cr_term,ord_amt,tax_amt,tot_amt,curr_code,exch_rate,tax_chap,tax_class,tax_env,remarks,tax_date," + " proj_code,sales_pers,comm_perc,comm_perc__on,curr_code__comm,quot_no,tran_code,frt_amt,curr_code__frt," + " frt_term,dlv_term,insurance_amt,curr_code__ins,emp_code__aprv,ref_date,amd_date,supp_code," + " FRT_TYPE, FRT_RATE,FRT_AMT__QTY, FRT_AMT__FIXED " + " from poamd_hdr where amd_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
rs = pstmt.executeQuery();
......@@ -507,9 +487,34 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (cnt == 0)
{
errCode = "VTNOAMD";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
/**
* VALLABH select Advance account code CCTR code from header
* supp_code VALLABH KADAM 19/NOV/14 END
*/
sql = "select ACCT_CODE__AP_ADV,CCTR_CODE__AP_ADV from supplier where supp_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, suppCode);
rs = pstmt.executeQuery();
if (rs.next())
{
acctCodeApAdv = rs.getString("ACCT_CODE__AP_ADV");
cctrCodeApAdv = rs.getString("CCTR_CODE__AP_ADV");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/**
* VALLABH select Advance account code CCTR code from header
* supp_code VALLABH KADAM 19/NOV/14 END
*/
System.out.println("000000000000000 suppCode[" + suppCode + "]");
System.out.println("000000000000000 acctCodeApAdv[" + acctCodeApAdv + "]");
System.out.println("000000000000000 cctrCodeApAdv[" + cctrCodeApAdv + "]");
sql = " select count(*) from poamd_det where amd_no = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -529,13 +534,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
{
System.out.println("@@@@@@ inside cnt " + cnt);
sql1 = " select purc_order,line_no__ord,site_code,ind_no,item_code,quantity,rate,tax_amt,tot_amt,req_date,"
+ " conv__qty_stduom,conv__rtuom_stduom,quantity__stduom,rate__stduom,line_no,unit,discount,"
+ " discount_type,tax_class,tax_chap,tax_env,remarks,work_order,pack_code,pack_instr,acct_code__dr,"
+ " cctr_code__dr,acct_code__cr,cctr_code__cr,no_art,unit__std,unit__rate,dlv_date,loc_code,status,"
+ " specific_instr,supp_code_mnfr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no"
// +",rate__clg"
+ " from poamd_det where amd_no = ? ";
sql1 = " select purc_order,line_no__ord,site_code,ind_no,item_code,quantity,rate,tax_amt,tot_amt,req_date," + " conv__qty_stduom,conv__rtuom_stduom,quantity__stduom,rate__stduom,line_no,unit,discount," + " discount_type,tax_class,tax_chap,tax_env,remarks,work_order,pack_code,pack_instr,acct_code__dr," + " cctr_code__dr,acct_code__cr,cctr_code__cr,no_art,unit__std,unit__rate,dlv_date,loc_code,status," + " specific_instr,supp_code_mnfr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no" + " from poamd_det where amd_no = ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, amdNo);
rs1 = pstmt1.executeQuery();
......@@ -587,13 +586,15 @@ POrderAmdConfLocal, POrderAmdConfRemote
formNo = checknull(rs1.getString("form_no"));
System.out.println("@@@@@@@@ indNo [" + indNo + "]");
System.out.println("CLG rate select from poamd_det[" + rateClg + "]");
if (indNo != null && indNo.trim().length() > 0)
{
sql = " select quantity__stduom,ord_qty from indent where ind_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
quantity = rs.getDouble("quantity__stduom");
ordQty = rs.getDouble("ord_qty");
}
......@@ -608,7 +609,8 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.setString(1, purcOrder);
pstmt.setString(2, lineNoOrd);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
quantStduom = rs.getDouble("quantity__stduom");
}
rs.close();
......@@ -620,8 +622,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (quantity > totOrdQty)
{
sql = " update indent set status = 'O', status_date = ? , ord_qty = ?,"
+ " unit__ord = ? where ind_no = ? ";
sql = " update indent set status = 'O', status_date = ? , ord_qty = ?," + " unit__ord = ? where ind_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, sysDate);
pstmt.setDouble(2, totOrdQty);
......@@ -631,11 +632,10 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
}
else // status= 'L' (complete)
} else
// status= 'L' (complete)
{
sql = " update indent set status = 'L', status_date = ? , ord_qty = ? ,"
+ " unit__ord = ? where ind_no = ? ";
sql = " update indent set status = 'L', status_date = ? , ord_qty = ? ," + " unit__ord = ? where ind_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, sysDate);
pstmt.setDouble(2, totOrdQty);
......@@ -649,18 +649,16 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (updCnt == 0)
{
errCode = "VTINDUPD";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
System.out.println("@@@@@@ lineNoOrd indNo [" + indNo
+ "]:::lineNoOrd[" + lineNoOrd + "]");
System.out.println("@@@@@@ lineNoOrd indNo [" + indNo + "]:::lineNoOrd[" + lineNoOrd + "]");
if (lineNoOrd != null && lineNoOrd.trim().length() > 0)
{
System.out.println("@@@@@@ inside indNo [" + indNo
+ "]:::lineNoOrd[" + lineNoOrd + "]");
System.out.println("@@@@@@ inside indNo [" + indNo + "]:::lineNoOrd[" + lineNoOrd + "]");
sql3 = " select item_code from porddet where purc_order = ? and line_no = ? ";
pstmt3 = conn.prepareStatement(sql3);
......@@ -672,19 +670,14 @@ POrderAmdConfLocal, POrderAmdConfRemote
oldItem = rs3.getString("item_code");
{
System.out.println("@@@@@@@@@@oldItem["+oldItem+"]::::itemCode["+itemCode+"]");
if (!( itemCode.equalsIgnoreCase(oldItem) ))
System.out.println("@@@@@@@@@@oldItem[" + oldItem + "]::::itemCode[" + itemCode + "]");
if (!(itemCode.equalsIgnoreCase(oldItem)))
{
errCode = "VTITEMDIFF";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?,"
+ " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?,"
+ " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?,"
+ " tax_chap = ?, tax_env= ?,status = ?,status_date = ?, pack_instr = ?, specific_instr= ?,"
+ " supp_code__mnfr = ?,rate__clg = ?,special_instr = ?,dlv_date = ?,benefit_type = ?,"
+ " licence_no = ? where purc_order = ? and line_no = ? ";
sql = " update porddet set site_code = ?,quantity = ?,rate = ?,tax_amt = ?,tot_amt = ?," + " remarks = ?, discount_type = ?,discount = ?,req_date = ?,conv__qty_stduom = ?," + " conv__rtuom_stduom = ?,quantity__stduom = ?,rate__stduom = ?,tax_class = ?," + " tax_chap = ?, tax_env= ?,status = ?,status_date = ?, pack_instr = ?, specific_instr= ?," + " supp_code__mnfr = ?,rate__clg = ?,special_instr = ?,dlv_date = ?,benefit_type = ?," + " licence_no = ? where purc_order = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setDouble(2, quantity);
......@@ -707,8 +700,13 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.setString(19, packInstr);
pstmt.setString(20, specificInstr);
pstmt.setString(21, suppCodeMnfr);
// pstmt.setDouble(22, clgRate);
pstmt.setDouble(22, rateClg); //VALLABH KADAM 7-NOV-14 DI3ESUN002 change variable from (clgRate) to (rateClg)
// pstmt.setDouble(22, clgRate);
pstmt.setDouble(22, rateClg); // VALLABH KADAM
// 7-NOV-14
// DI3ESUN002
// change variable
// from [clgRate]
// to [rateClg]
pstmt.setString(23, specialInstr);
pstmt.setTimestamp(24, dlvDate);
pstmt.setString(25, benefitType);
......@@ -723,7 +721,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (!(updCnt == 1))
{
errCode = "VTORDDT1";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
......@@ -736,11 +734,9 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt = null;
lineNo = " " + lineNo;
lineNo = lineNo.substring(lineNo.length() - 3,
lineNo.length());
lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length());
sql = " select count(*) from taxtran where tran_code = 'P-AMD'"
+ " and tran_id = ? and line_no = ? and taxable_amt <> 0 and tax_amt <> 0 ";
sql = " select count(*) from taxtran where tran_code = 'P-AMD'" + " and tran_id = ? and line_no = ? and taxable_amt <> 0 and tax_amt <> 0 ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
pstmt.setString(2, lineNo);
......@@ -758,35 +754,40 @@ POrderAmdConfLocal, POrderAmdConfRemote
{
/*
sql = " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env," +
" taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount," +
" acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) " +
" select 'P-ORD',tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt," +
" tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code," +
" rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax " +
" from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo);
pstmt.setString(3, lineNo);
int cnt2 = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@1 cnt2["+cnt2+"]");
*/ /**/
sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
* sql =
* " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,"
* +
* " taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,"
* +
* " acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) "
* +
* " select 'P-ORD',tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt,"
* +
* " tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,"
* +
* " rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax "
* +
* " from taxtran where tran_code = ? and tran_id = ? and line_no = ? "
* ; pstmt = conn.prepareStatement(sql);
* pstmt.setString(1, "P-AMD");
* pstmt.setString(2, amdNo);
* pstmt.setString(3, lineNo); int cnt2 =
* pstmt.executeUpdate(); pstmt.close();
* pstmt = null;
*
* System.out.println("@@@@1 cnt2["+cnt2+"]")
* ;
*//**/
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo);
pstmt.setString(3, lineNo);
rs = pstmt.executeQuery();
if (rs.next()) {
// if (rs.next()) {
while (rs.next())
{ // Change fom if to while loop VALLABH
// KADAM 19/NOV/14
lineNoTax = rs.getString("line_no__tax");
taxCode = rs.getString("tax_code");
taxClass = rs.getString("tax_class");
......@@ -815,6 +816,52 @@ POrderAmdConfLocal, POrderAmdConfRemote
posted = rs.getString("posted");
taxFormDate = rs.getTimestamp("tax_form_date");
payTax = rs.getString("pay_tax");
/** Insert taxtran rows */
sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt4 = conn.prepareStatement(sql4);
pstmt4.setString(1, "P-ORD");
pstmt4.setString(2, purcOrder);
pstmt4.setString(3, lineNoOrd); // lineNo
// change
// by
// cpatil
// on
// 17/10/13
pstmt4.setString(4, lineNoTax);
pstmt4.setString(5, taxCode);
pstmt4.setString(6, taxClass);
pstmt4.setString(7, taxChap);
pstmt4.setString(8, taxBase);
pstmt4.setString(9, taxEnv);
pstmt4.setDouble(10, taxableAmt);
pstmt4.setString(11, taxPerc);
pstmt4.setDouble(12, taxAmt);
pstmt4.setString(13, chgStat);
pstmt4.setString(14, taxSet);
pstmt4.setString(15, effect);
pstmt4.setString(16, acctCodeReco);
pstmt4.setString(17, cctrCodeReco);
pstmt4.setString(18, recoPerc);
pstmt4.setDouble(19, recoAmont);
pstmt4.setString(20, acctCode);
pstmt4.setString(21, cctrCode);
pstmt4.setString(22, rateType);
pstmt4.setString(23, round);
pstmt4.setString(24, roundTo);
pstmt4.setString(25, taxForm);
pstmt4.setTimestamp(26, chgDate);
pstmt4.setString(27, chgUser);
pstmt4.setString(28, chgTerm);
pstmt4.setString(29, posted);
pstmt4.setTimestamp(30, taxFormDate);
pstmt4.setString(31, payTax);
cnt = pstmt4.executeUpdate();
pstmt4.close();
pstmt4 = null;
/** Indert taxtran rows END */
}
rs.close();
......@@ -822,58 +869,66 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-ORD");
pstmt.setString(2, purcOrder);
pstmt.setString(3, lineNoOrd); //lineNo change by cpatil on 17/10/13
pstmt.setString(4, lineNoTax);
pstmt.setString(5, taxCode);
pstmt.setString(6, taxClass);
pstmt.setString(7, taxChap);
pstmt.setString(8, taxBase);
pstmt.setString(9, taxEnv);
pstmt.setDouble(10, taxableAmt);
pstmt.setString(11, taxPerc);
pstmt.setDouble(12, taxAmt);
pstmt.setString(13, chgStat);
pstmt.setString(14, taxSet);
pstmt.setString(15, effect);
pstmt.setString(16, acctCodeReco);
pstmt.setString(17, cctrCodeReco);
pstmt.setString(18, recoPerc);
pstmt.setDouble(19, recoAmont);
pstmt.setString(20, acctCode);
pstmt.setString(21, cctrCode);
pstmt.setString(22, rateType);
pstmt.setString(23, round);
pstmt.setString(24, roundTo);
pstmt.setString(25, taxForm);
pstmt.setTimestamp(26, chgDate);
pstmt.setString(27, chgUser);
pstmt.setString(28, chgTerm);
pstmt.setString(29, posted);
pstmt.setTimestamp(30, taxFormDate);
pstmt.setString(31, payTax);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
/**/ System.out.println("@@@@1 cnt["+cnt+"]");
// sql =
// " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
// +
// " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
// +
// " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
// +
// " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
// + " posted,tax_form_date,pay_tax) "
// +
// " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
// pstmt = conn.prepareStatement(sql);
// pstmt.setString(1, "P-ORD");
// pstmt.setString(2, purcOrder);
// pstmt.setString(3, lineNoOrd); //lineNo
// change by cpatil on 17/10/13
// pstmt.setString(4, lineNoTax);
// pstmt.setString(5, taxCode);
// pstmt.setString(6, taxClass);
// pstmt.setString(7, taxChap);
// pstmt.setString(8, taxBase);
// pstmt.setString(9, taxEnv);
// pstmt.setDouble(10, taxableAmt);
// pstmt.setString(11, taxPerc);
// pstmt.setDouble(12, taxAmt);
// pstmt.setString(13, chgStat);
// pstmt.setString(14, taxSet);
// pstmt.setString(15, effect);
// pstmt.setString(16, acctCodeReco);
// pstmt.setString(17, cctrCodeReco);
// pstmt.setString(18, recoPerc);
// pstmt.setDouble(19, recoAmont);
// pstmt.setString(20, acctCode);
// pstmt.setString(21, cctrCode);
// pstmt.setString(22, rateType);
// pstmt.setString(23, round);
// pstmt.setString(24, roundTo);
// pstmt.setString(25, taxForm);
// pstmt.setTimestamp(26, chgDate);
// pstmt.setString(27, chgUser);
// pstmt.setString(28, chgTerm);
// pstmt.setString(29, posted);
// pstmt.setTimestamp(30, taxFormDate);
// pstmt.setString(31, payTax);
//
// cnt = pstmt.executeUpdate();
// pstmt.close();
// pstmt = null;
// /**/
// System.out.println("@@@@1 cnt["+cnt+"]");
}
// end if
}
}
else
// if (oldItem == null || oldItem.trim().length() == 0)
} else
// if (oldItem == null || oldItem.trim().length() == 0)
{
lineNo = " " + lineNo;
lineNo = lineNo.substring(lineNo.length() - 3, lineNo.length());
System.out.println("@@@@In the ELSE No item code found for purchase order and Line no");
if (cctrCodeDr == null)
{
cctrCodeDr = "";
......@@ -894,7 +949,12 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder); // v
pstmt.setString(2, lineNo); // line_no
// pstmt.setString(2, lineNo); // line_no
pstmt.setString(2, lineNoOrd); // line_no Change
// from [lineNo] to
// [lineNoOrd]
// VALLABH KADAM
// 17/NOV/14
pstmt.setString(3, siteCode); // site_code
pstmt.setString(4, indNo); // ind_no
pstmt.setString(5, itemCode); // item code
......@@ -934,48 +994,55 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.setString(35, cctrCodeCr); // cctr_code__cr
pstmt.setString(36, discountType); // discount_type
pstmt.setString(37, suppCodeMnfr); // supp_code__mnfr
pstmt.setString(38, orderOpt); //order_opt
pstmt.setString(39, bom); //bom_code
pstmt.setString(38, orderOpt); // order_opt
pstmt.setString(39, bom); // bom_code
pstmt.setString(40, specificInstr); //specific_instr
pstmt.setDouble(41, clgRate); // rate__clg
pstmt.setString(42, specialInstr); //special_instr
pstmt.setString(43, benefitType); //benefit_type
pstmt.setString(40, specificInstr); // specific_instr
// pstmt.setDouble(41, clgRate); // rate__clg
pstmt.setDouble(41, rateClg); // rate__clg Change
// from [clgRate] to
// [rateClg] VALLABH
// KADAM 17/NOV/14
pstmt.setString(42, specialInstr); // special_instr
pstmt.setString(43, benefitType); // benefit_type
pstmt.setString(44, licenceNo); // licence_no
pstmt.setString(45, dutyPaid); //duty_paid
pstmt.setString(46, formNo); //form_no
pstmt.setString(45, dutyPaid); // duty_paid
pstmt.setString(46, formNo); // form_no
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
/*
sql = " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env," +
" taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount," +
" acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) " +
" select 'P-ORD',tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt," +
" tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code," +
" rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax " +
" from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo);
pstmt.setString(3, lineNo);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@2 cnt["+cnt+"]");
*/
/**/ {
sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = 'P-AMD' and tran_id = ? and line_no = ? ";
/*
* sql =
* " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,"
* +
* " taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,"
* +
* " acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) "
* +
* " select 'P-ORD',tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt,"
* +
* " tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,"
* +
* " rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax "
* +
* " from taxtran where tran_code = ? and tran_id = ? and line_no = ? "
* ; pstmt = conn.prepareStatement(sql);
* pstmt.setString(1, "P-AMD"); pstmt.setString(2,
* amdNo); pstmt.setString(3, lineNo); cnt =
* pstmt.executeUpdate(); pstmt.close(); pstmt =
* null; System.out.println("@@@@2 cnt["+cnt+"]");
*/
/**/{
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = 'P-AMD' and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
pstmt.setString(2, lineNo);
rs = pstmt.executeQuery();
if (rs.next()) {
// if (rs.next()) {
while (rs.next())
{ // Change from if to while VALLABH KADAM
// 19/NOV/14
lineNoTax = rs.getString("line_no__tax");
taxCode = rs.getString("tax_code");
taxClass = rs.getString("tax_class");
......@@ -1004,6 +1071,50 @@ POrderAmdConfLocal, POrderAmdConfRemote
posted = rs.getString("posted");
taxFormDate = rs.getTimestamp("tax_form_date");
payTax = rs.getString("pay_tax");
/** Insert taxtran rows */
sql4 = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt4 = conn.prepareStatement(sql4);
pstmt4.setString(1, "P-ORD");
pstmt4.setString(2, purcOrder);
pstmt4.setString(3, lineNoOrd); // lineNo
// change by
// cpatil on
// 17/10/13
pstmt4.setString(4, lineNoTax);
pstmt4.setString(5, taxCode);
pstmt4.setString(6, taxClass);
pstmt4.setString(7, taxChap);
pstmt4.setString(8, taxBase);
pstmt4.setString(9, taxEnv);
pstmt4.setDouble(10, taxableAmt);
pstmt4.setString(11, taxPerc);
pstmt4.setDouble(12, taxAmt);
pstmt4.setString(13, chgStat);
pstmt4.setString(14, taxSet);
pstmt4.setString(15, effect);
pstmt4.setString(16, acctCodeReco);
pstmt4.setString(17, cctrCodeReco);
pstmt4.setString(18, recoPerc);
pstmt4.setDouble(19, recoAmont);
pstmt4.setString(20, acctCode);
pstmt4.setString(21, cctrCode);
pstmt4.setString(22, rateType);
pstmt4.setString(23, round);
pstmt4.setString(24, roundTo);
pstmt4.setString(25, taxForm);
pstmt4.setTimestamp(26, chgDate);
pstmt4.setString(27, chgUser);
pstmt4.setString(28, chgTerm);
pstmt4.setString(29, posted);
pstmt4.setTimestamp(30, taxFormDate);
pstmt4.setString(31, payTax);
cnt = pstmt4.executeUpdate();
pstmt4.close();
pstmt4 = null;
/** Insert in taxtran rows END */
}
rs.close();
......@@ -1011,65 +1122,72 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-ORD");
pstmt.setString(2, purcOrder);
pstmt.setString(3, lineNoOrd); //lineNo change by cpatil on 17/10/13
pstmt.setString(4, lineNoTax);
pstmt.setString(5, taxCode);
pstmt.setString(6, taxClass);
pstmt.setString(7, taxChap);
pstmt.setString(8, taxBase);
pstmt.setString(9, taxEnv);
pstmt.setDouble(10, taxableAmt);
pstmt.setString(11, taxPerc);
pstmt.setDouble(12, taxAmt);
pstmt.setString(13, chgStat);
pstmt.setString(14, taxSet);
pstmt.setString(15, effect);
pstmt.setString(16, acctCodeReco);
pstmt.setString(17, cctrCodeReco);
pstmt.setString(18, recoPerc);
pstmt.setDouble(19, recoAmont);
pstmt.setString(20, acctCode);
pstmt.setString(21, cctrCode);
pstmt.setString(22, rateType);
pstmt.setString(23, round);
pstmt.setString(24, roundTo);
pstmt.setString(25, taxForm);
pstmt.setTimestamp(26, chgDate);
pstmt.setString(27, chgUser);
pstmt.setString(28, chgTerm);
pstmt.setString(29, posted);
pstmt.setTimestamp(30, taxFormDate);
pstmt.setString(31, payTax);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@2 cnt["+cnt+"]");
// sql =
// " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
// +
// " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
// +
// " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
// +
// " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
// + " posted,tax_form_date,pay_tax) "
// +
// " values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) ";
// pstmt = conn.prepareStatement(sql);
// pstmt.setString(1, "P-ORD");
// pstmt.setString(2, purcOrder);
// pstmt.setString(3, lineNoOrd); //lineNo
// change by cpatil on 17/10/13
// pstmt.setString(4, lineNoTax);
// pstmt.setString(5, taxCode);
// pstmt.setString(6, taxClass);
// pstmt.setString(7, taxChap);
// pstmt.setString(8, taxBase);
// pstmt.setString(9, taxEnv);
// pstmt.setDouble(10, taxableAmt);
// pstmt.setString(11, taxPerc);
// pstmt.setDouble(12, taxAmt);
// pstmt.setString(13, chgStat);
// pstmt.setString(14, taxSet);
// pstmt.setString(15, effect);
// pstmt.setString(16, acctCodeReco);
// pstmt.setString(17, cctrCodeReco);
// pstmt.setString(18, recoPerc);
// pstmt.setDouble(19, recoAmont);
// pstmt.setString(20, acctCode);
// pstmt.setString(21, cctrCode);
// pstmt.setString(22, rateType);
// pstmt.setString(23, round);
// pstmt.setString(24, roundTo);
// pstmt.setString(25, taxForm);
// pstmt.setTimestamp(26, chgDate);
// pstmt.setString(27, chgUser);
// pstmt.setString(28, chgTerm);
// pstmt.setString(29, posted);
// pstmt.setTimestamp(30, taxFormDate);
// pstmt.setString(31, payTax);
//
// cnt = pstmt.executeUpdate();
// pstmt.close();
// pstmt = null;
// System.out.println("@@@@2 cnt["+cnt+"]");
} // end if
/**/ }
/**/
}
rs3.close();
rs3 = null;
pstmt3.close();
pstmt3 = null;
}
else
} else
{
sql = " select max(line_no) from porddet where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
if (rs.next()) {
if (rs.next())
{
lineNoPO = rs.getString(1);
}
rs.close();
......@@ -1077,17 +1195,16 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
System.out.println("@@@@@@lineNoPO1["+lineNoPO+"]");
System.out.println("@@@@@@lineNoPO1[" + lineNoPO + "]");
if (lineNoPO == null)
{
lineNoPO = "0";
}
int tempId = ( Integer.parseInt(lineNoPO.trim())+ 1);
int tempId = (Integer.parseInt(lineNoPO.trim()) + 1);
lineNoPO = " " + tempId;
lineNoPO = lineNoPO.substring(lineNoPO.length() - 3,lineNoPO.length());
System.out.println("@@@@@@lineNoPO4["+lineNoPO+"]");
lineNoPO = lineNoPO.substring(lineNoPO.length() - 3, lineNoPO.length());
System.out.println("@@@@@@lineNoPO4[" + lineNoPO + "]");
if (cctrCodeDr == null || cctrCodeDr.trim().length() == 0)
{
cctrCodeDr = " ";
......@@ -1103,13 +1220,15 @@ POrderAmdConfLocal, POrderAmdConfRemote
+ " tax_class,tax_chap,tax_env,remarks,work_order,unit__rate,conv__qty_stduom,conv__rtuom_stduom,"
+ " unit__std,quantity__stduom,rate__stduom,pack_code,no_art,pack_instr,acct_code__dr,"
+ " cctr_code__dr,acct_code__cr,cctr_code__cr,discount_type,supp_code__mnfr,order_opt,bom_code,"
+ " specific_instr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no ) "
+ " values ( " +
"?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,?,?,?,?,?," +
"?,?,?,?,?,? ) ";
+ " specific_instr,rate__clg,special_instr,benefit_type,licence_no,duty_paid,form_no,"
+ "acct_code__ap_adv,cctr_code__ap_adv) " // Add
// column
// for
// insert
// VALLABH
// KADAM
// 19/NOV/14
+ " values ( " + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,?,?,?," + "?,?,?,?,?,?,?,? ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
......@@ -1152,40 +1271,49 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.setString(38, orderOpt);
pstmt.setString(39, bom); // bom_code
pstmt.setString(40, specificInstr);
pstmt.setDouble(41, clgRate);
// pstmt.setDouble(41, clgRate);
pstmt.setDouble(41, rateClg); // Change from clgRate to
// rateClg VALLABH KADAM
// 17/NOV/14
pstmt.setString(42, specialInstr);
pstmt.setString(43, benefitType);
pstmt.setString(44, licenceNo);
pstmt.setString(45, dutyPaid);
pstmt.setString(46, formNo);
pstmt.setString(47, acctCodeApAdv);// Add column for
// insert VALLABH
// KADAM 19/NOV/14
pstmt.setString(48, cctrCodeApAdv);// Add column for
// insert VALLABH
// KADAM 19/NOV/14
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
if (cnt == 0)
{
/*
sql = " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env," +
" taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount," +
" acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) " +
" select 'P-ORD' ,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt," +
" tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code," +
" rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax " +
" from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo);
pstmt.setString(3, lineNo);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@3 cnt["+cnt+"]");
*/ /**/
sql = " select line_no__tax,tax_code,"
+ " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,"
+ " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to,"
+ " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax "
+ " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
/*
* sql =
* " insert into taxtran ( tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,"
* +
* " taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,"
* +
* " acct_code,cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax ) "
* +
* " select 'P-ORD' ,tran_id,line_no,line_no__tax,tax_code,tax_class,tax_chap,tax_base,tax_env,taxable_amt,"
* +
* " tax_perc,tax_amt,chg_stat,tax_set,effect,acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,"
* +
* " rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,posted ,tax_form_date, pay_tax "
* +
* " from taxtran where tran_code = ? and tran_id = ? and line_no = ? "
* ; pstmt = conn.prepareStatement(sql);
* pstmt.setString(1, "P-AMD"); pstmt.setString(2,
* amdNo); pstmt.setString(3, lineNo); cnt =
* pstmt.executeUpdate(); pstmt.close(); pstmt =
* null; System.out.println("@@@@3 cnt["+cnt+"]");
*//**/
sql = " select line_no__tax,tax_code," + " tax_class,tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set,effect," + " acct_code__reco,cctr_code__reco,reco_perc,reco_amount,acct_code,cctr_code,rate_type,round,round_to," + " tax_form,chg_date,chg_user,chg_term,posted,tax_form_date,pay_tax " + " from taxtran where tran_code = ? and tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-AMD");
pstmt.setString(2, amdNo);
......@@ -1228,20 +1356,12 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class,"
+ " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , "
+ " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code,"
+ " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term,"
+ " posted,tax_form_date,pay_tax) "
+ " values (" +
" ?,?,?,?,?,?,?,?,?,?," +
" ?,?,?,?,?,?,?,?,?,?," +
" ?,?,?,?,?,?,?,?,?,?," +
" ? ) ";
sql = " insert into taxtran (tran_code,tran_id,line_no,line_no__tax,tax_code,tax_class," + " tax_chap,tax_base,tax_env,taxable_amt,tax_perc,tax_amt,chg_stat,tax_set , " + " effect,acct_code__reco, cctr_code__reco,reco_perc,reco_amount,acct_code," + " cctr_code,rate_type,round,round_to,tax_form,chg_date,chg_user,chg_term," + " posted,tax_form_date,pay_tax) " + " values (" + " ?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?," + " ?,?,?,?,?,?,?,?,?,?," + " ? ) ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "P-ORD");
pstmt.setString(2, purcOrder);
pstmt.setString(3, lineNoOrd); //lineNo change by cpatil on 17/10/13
pstmt.setString(3, lineNoOrd); // lineNo change by
// cpatil on 17/10/13
pstmt.setString(4, lineNoTax);
pstmt.setString(5, taxCode);
pstmt.setString(6, taxClass);
......@@ -1274,8 +1394,8 @@ POrderAmdConfLocal, POrderAmdConfRemote
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("@@@@3 cnt["+cnt+"]");
/* */
System.out.println("@@@@3 cnt[" + cnt + "]");
/* */
sql = " update poamd_det set line_no__ord = ? where amd_no = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lineNoPO);
......@@ -1288,7 +1408,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (!(updCnt == 1))
{
errCode = "VTAMDDT";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
......@@ -1301,7 +1421,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
}
if (errCode == null || errCode.trim().length() == 0)
{
int cntTerm=0;
int cntTerm = 0;
sql = " select count(1) from poamd_term where amd_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
......@@ -1315,7 +1435,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@trem cntTerm:["+cntTerm+"]");
System.out.println("@@@@@@@@@trem cntTerm:[" + cntTerm + "]");
if (cntTerm > 0)
{
sql = " select max(line_no) from pord_term where purc_order = ? ";
......@@ -1324,24 +1444,24 @@ POrderAmdConfLocal, POrderAmdConfRemote
rs = pstmt.executeQuery();
if (rs.next())
{
lastTermLine = rs.getString(1) == null ? "0": rs.getString(1);
lastTermLine = rs.getString(1) == null ? "0" : rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@trem lastTermLine:["+lastTermLine+"]");
//for (int i = 1; i < Integer.parseInt(lastTermLine); i++)
System.out.println("@@@@@@@@@trem lastTermLine:[" + lastTermLine + "]");
// for (int i = 1; i < Integer.parseInt(lastTermLine); i++)
for (int i = 1; i <= cntTerm; i++)
{
System.out.println("@@@@@@@@@term for Line:["+i+"]::lineNo["+lineNo+"]");
System.out.println("@@@@@@@@@term for Line:[" + i + "]::lineNo[" + lineNo + "]");
// 31/10/13 manoharan print_opt added
sql = " select purc_order,line_no_ord,term_code,descr, print_opt from poamd_term where amd_no = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
//pstmt.setString(2, lineNo);
pstmt.setString(2, ""+i );
// pstmt.setString(2, lineNo);
pstmt.setString(2, "" + i);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -1356,10 +1476,10 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@@trem lineNoPO:["+lineNoPO+"]");
System.out.println("@@@@@@@@@trem lineNoPO:[" + lineNoPO + "]");
if (lineNoPO == null || lineNoPO.trim().length() == 0)
{
System.out.println("@@@@@@@@@trem insert executed.... lineNoPO:["+lineNoPO+"]");
System.out.println("@@@@@@@@@trem insert executed.... lineNoPO:[" + lineNoPO + "]");
int temp = Integer.parseInt(lastTermLine) + 1;
lastTermLine = "" + temp;
......@@ -1377,10 +1497,9 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
}
else
} else
{
System.out.println("@@@@@@@@@trem update executed.... lineNoPO:["+lineNoPO+"]");
System.out.println("@@@@@@@@@trem update executed.... lineNoPO:[" + lineNoPO + "]");
sql = " update pord_term set term_code = ?, descr = ?, print_opt = ? where purc_order = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, termCode);
......@@ -1394,7 +1513,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (!(updCnt == 1))
{
errCode = "VTORDTERM";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
......@@ -1402,13 +1521,10 @@ POrderAmdConfLocal, POrderAmdConfRemote
}
}
if (errCode == null || errCode.trim().length() == 0)
{
sql = " select sum(case when tax_amt is null then 0 else tax_amt end), sum(case when tot_amt is null then 0 else tot_amt end), "
+ " sum(case when tot_amt is null then 0 else tot_amt end - case when tax_amt is null then 0 else tax_amt end) "
+ " from porddet where purc_order = ? ";
sql = " select sum(case when tax_amt is null then 0 else tax_amt end), sum(case when tot_amt is null then 0 else tot_amt end), " + " sum(case when tot_amt is null then 0 else tot_amt end - case when tax_amt is null then 0 else tax_amt end) " + " from porddet where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
......@@ -1425,8 +1541,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (errCode == null || errCode.trim().length() == 0)
{
sql = " select sum(case when net_amt is null then 0 else net_amt end) from voucher where purc_order = ? "
+ " and vouch_type = ? and confirmed = ? ";
sql = " select sum(case when net_amt is null then 0 else net_amt end) from voucher where purc_order = ? " + " and vouch_type = ? and confirmed = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, purcOrder);
pstmt.setString(2, "A");
......@@ -1444,7 +1559,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
if (totAmtS < vouchAmt)
{
errCode = "ORDLESSVCH";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
}
......@@ -1465,16 +1580,11 @@ POrderAmdConfLocal, POrderAmdConfRemote
rs = null;
pstmt.close();
pstmt = null;
// 31/10/13 manoharan emp_code__aprv should not be changed to amendment approver
// 31/10/13 manoharan emp_code__aprv should not be changed to
// amendment approver
if (cnt > 0)
{
sql = " update porder set amd_no = ?, amd_date=?, site_code__dlv=?, site_code__ord=?,site_code__bill=?,dept_code=?,"
+ "supp_code=?,emp_code=?,item_ser=?,tax_opt=?,cr_term=?,ord_amt=?,tax_amt=?,tot_amt=?,curr_code=?,exch_rate=?,"
+ "tax_chap=?,tax_class=?,tax_env=?,remarks=?,tax_date=?,proj_code=?,sales_pers=?,comm_perc=?,comm_perc__on=?,"
+ "curr_code__comm=?,quot_no=?,tran_code=?,frt_amt=?,curr_code__frt=?,frt_term=?,dlv_term=?,insurance_amt =?,"
+ "curr_code__ins =?,ref_date=?,advance=?, "
+ "frt_type = ?, frt_rate=?, frt_amt__qty=? , frt_amt__fixed = ? "
+ " where purc_order = ? ";
sql = " update porder set amd_no = ?, amd_date=?, site_code__dlv=?, site_code__ord=?,site_code__bill=?,dept_code=?," + "supp_code=?,emp_code=?,item_ser=?,tax_opt=?,cr_term=?,ord_amt=?,tax_amt=?,tot_amt=?,curr_code=?,exch_rate=?," + "tax_chap=?,tax_class=?,tax_env=?,remarks=?,tax_date=?,proj_code=?,sales_pers=?,comm_perc=?,comm_perc__on=?," + "curr_code__comm=?,quot_no=?,tran_code=?,frt_amt=?,curr_code__frt=?,frt_term=?,dlv_term=?,insurance_amt =?," + "curr_code__ins =?,ref_date=?,advance=?, " + "frt_type = ?, frt_rate=?, frt_amt__qty=? , frt_amt__fixed = ? " + " where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, amdNo);
pstmt.setTimestamp(2, amdDate);
......@@ -1510,7 +1620,7 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.setString(32, dlvTerm);
pstmt.setDouble(33, insuranceAmt);
pstmt.setString(34, currCodeIns);
//pstmt.setString(35, empCodeAprv);
// pstmt.setString(35, empCodeAprv);
pstmt.setTimestamp(35, refDate);
pstmt.setString(36, advance);
pstmt.setString(37, frtType);
......@@ -1522,24 +1632,23 @@ POrderAmdConfLocal, POrderAmdConfRemote
pstmt.close();
pstmt = null;
}
else
} else
{
errCode = "VTPORD1";
errCode = itmDBAccessLocal.getErrorString("",errCode,"");
errCode = itmDBAccessLocal.getErrorString("", errCode, "");
return errCode;
}
if( updCnt > 0 )
if (updCnt > 0)
{
double updFrtAmtQty=0;
double updFrtAmtQty = 0;
System.out.println("@@@@@@@@ for cross update into java.....");
sql = " select frt_type, frt_rate, frt_amt__qty, frt_amt__fixed from porder where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
if(rs.next())
if (rs.next())
{
frtType = rs.getString("frt_type");
frtRate = rs.getDouble("frt_rate");
......@@ -1550,36 +1659,35 @@ POrderAmdConfLocal, POrderAmdConfRemote
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@frtType["+frtType+"]frtRate["+frtRate+"]frtAmtQty["+frtAmtQty+"]frtAmtFixed["+frtAmtFixed+"]");
System.out.println("@@@@frtType[" + frtType + "]frtRate[" + frtRate + "]frtAmtQty[" + frtAmtQty + "]frtAmtFixed[" + frtAmtFixed + "]");
if("F".equalsIgnoreCase(frtType))
if ("F".equalsIgnoreCase(frtType))
{
sql = " update porder set frt_amt__fixed = ? ,frt_amt = ? ,frt_amt__qty = 0 where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, ( frtAmtFixed + frtAmtQty) );
pstmt.setDouble(2, ( frtAmtFixed + frtAmtQty) );
pstmt.setDouble(1, (frtAmtFixed + frtAmtQty));
pstmt.setDouble(2, (frtAmtFixed + frtAmtQty));
pstmt.setString(3, purcOrder);
updCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
else if("Q".equalsIgnoreCase(frtType))
} else if ("Q".equalsIgnoreCase(frtType))
{
sql = " select quantity from porddet where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder);
pstmt.setString(1, purcOrder);
rs = pstmt.executeQuery();
while(rs.next())
while (rs.next())
{
quantity = rs.getDouble("quantity");
updFrtAmtQty = updFrtAmtQty + ( quantity * frtRate ) ;
updFrtAmtQty = updFrtAmtQty + (quantity * frtRate);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@updFrtAmtQty["+updFrtAmtQty+"]");
System.out.println("@@@@@updFrtAmtQty[" + updFrtAmtQty + "]");
sql = " update porder set frt_amt__qty = ? , frt_amt= ? , frt_amt__fixed = 0 where purc_order = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, updFrtAmtQty);
......@@ -1615,22 +1723,19 @@ POrderAmdConfLocal, POrderAmdConfRemote
return string;
}
private String setDescription(String descr, String table, String field,
String value, Connection conn) throws SQLException
private String setDescription(String descr, String table, String field, String value, Connection conn) throws SQLException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
System.out.println("@@@@@@@@table[" + table + "]:::field[" + field
+ "]::value[" + value + "]");
sql = "select " + descr + " from " + table + " where " + field
+ " = ? ";
System.out.println("@@@@@@@@table[" + table + "]:::field[" + field + "]::value[" + value + "]");
sql = "select " + descr + " from " + table + " where " + field + " = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, value);
rs = pstmt.executeQuery();
if (rs.next())
{
descr = checknull (rs.getString(1));
descr = checknull(rs.getString(1));
}
rs.close();
rs = null;
......
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