Commit 3ab9ce57 authored by manohar's avatar manohar

Min rate history update bug fixing done


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104385 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9b18aa03
...@@ -3389,21 +3389,21 @@ public class PostOrderActivity { ...@@ -3389,21 +3389,21 @@ public class PostOrderActivity {
public String schemeHistoryUpd(String invoiceId, String siteCode, String tranType, Connection conn) throws ITMException, Exception public String schemeHistoryUpd(String invoiceId, String siteCode, String tranType, Connection conn) throws ITMException, Exception
{ {
String retString = "", sql = "", sqlDetData = "", lsScheme = "", lsDocValue = "", lsSchemeCode = ""; String retString = "", sql = "", sqlDetData = "", lsScheme = "", lsDocValue = "", lsSchemeCode = "";
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null; PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null,pstmtLot = null;
ResultSet rs = null, rs1 = null, rs2 = null; ResultSet rs = null, rs1 = null, rs2 = null,rsLot = null;
String custCode = "", xFldValue = "", lsItemCodeparent = "", lsOriginalItemCodeOrd = ""; String custCode = "", xFldValue = "", lsItemCodeparent = "", lsOriginalItemCodeOrd = "";
Timestamp tranDate = null; Timestamp tranDate = null;
String itemCode = "", itemCodeOrd = "", refNo = "", refLineNo = "", priceList = "", nature = "", lsOrderType = "", lsReturnable = "", lsReasCode = "", cLotNo1 = "", lsVarValue = ""; String itemCodeOld = "",itemCode = "", itemCodeOrd = "", refNo = "", refLineNo = "", priceList = "", nature = "", lsOrderType = "", lsReturnable = "", lsReasCode = "", lotNo = "", lsVarValue = "";
double totAmt = 0, totQty = 0, rate = 0, lcDiscount = 0.00, lcTotChargeQty = 0.00, lcTotFreeQty = 0.00, lcEffNetAmount = 0.00, ldSchCost = 0.00; double totAmt = 0, totQty = 0, rate = 0, lcDiscount = 0.00, lcTotChargeQty = 0.00, lcTotFreeQty = 0.00, lcEffNetAmount = 0.00, ldSchCost = 0.00;
String custCodeBill = "", lsStateCode = "", lsCountCode = ""; String custCodeBill = "", lsStateCode = "", lsCountCode = "";
Timestamp sysdate = new Timestamp((new Date()).getTime()); Timestamp sysdate = new Timestamp((new Date()).getTime());
String freeItem = "", lsColnameStr = "", lsSelectSql = ""; String freeItem = "",refNoOld ="", lsColnameStr = "", lsSelectSql = "";
String lsItemAry[] = null, lsColname[] = null; String lsItemAry[] = null, lsColname[] = null;
double FreeQty = 0, lcEffCostFree = 0.00, lcTotFreeEffCost = 0.00, ldChgAmt = 0.00, ldAmt = 0.00, ldTotAmt = 0.00, ldQtyStd = 0.00, ldEffCost = 0.00, lcFreeEffCost = 0.00; double FreeQty = 0, lcEffCostFree = 0.00, lcTotFreeEffCost = 0.00, ldChgAmt = 0.00, ldAmt = 0.00, ldTotAmt = 0.00, ldEffCost = 0.00, lcFreeEffCost = 0.00;
double ldQtyAry[] = null, ldAmtAry[] = null; double ldQtyAry[] = null, ldAmtAry[] = null;
int cnt = 0, llCtr = 0, llctrCol = 0, llCnt = 0, psCount = 0; int cnt = 0, llCtr = 0, llctrCol = 0, llCnt = 0, psCount = 0;
boolean lbOtherFreeItem = false, lbItemCharge = false, lbChkNull = false; boolean lbOtherFreeItem = false, lbItemCharge = false, lbChkNull = false;
; double ldQtyStd = 0.00;
long llSchemeNum = 0L; long llSchemeNum = 0L;
UserInfoBean userInfo = new UserInfoBean(); UserInfoBean userInfo = new UserInfoBean();
...@@ -3430,11 +3430,14 @@ public class PostOrderActivity { ...@@ -3430,11 +3430,14 @@ public class PostOrderActivity {
if (lsVarValue == null || lsVarValue.trim().length() == 0 || lsVarValue.equalsIgnoreCase("NULLFOUND")) if (lsVarValue == null || lsVarValue.trim().length() == 0 || lsVarValue.equalsIgnoreCase("NULLFOUND"))
{ {
llSchemeNum = 1; llSchemeNum = 1;
lbChkNull = true; //lbChkNull = true; // 13-jan-17 manoharan not required
// 13-Jan-17 manoharan
lsVarValue = "site_code,item_code,lot_no";
schemeKeyList.add(lsVarValue);
} else } else
{ {
llSchemeNum = Long.parseLong(lsVarValue); llSchemeNum = Long.parseLong(lsVarValue);
lbChkNull = false; //lbChkNull = false; // 13-jan-17 manoharan not required
//Changed by Santosh on 04/01/17 to change condition in for loop //Changed by Santosh on 04/01/17 to change condition in for loop
//for (int llCtrSch = 1; llCtrSch < llSchemeNum; llCtrSch++) // FOR LOOP [1] //for (int llCtrSch = 1; llCtrSch < llSchemeNum; llCtrSch++) // FOR LOOP [1]
for (int llCtrSch = 1; llCtrSch <= llSchemeNum; llCtrSch++) // FOR LOOP [1] for (int llCtrSch = 1; llCtrSch <= llSchemeNum; llCtrSch++) // FOR LOOP [1]
...@@ -3445,8 +3448,6 @@ public class PostOrderActivity { ...@@ -3445,8 +3448,6 @@ public class PostOrderActivity {
} }
} }
chgDate = Timestamp.valueOf(genericUtility.getValidDateString(chgDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); chgDate = Timestamp.valueOf(genericUtility.getValidDateString(chgDateStr, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
// GenericUtility genericUtility = GenericUtility.getInstance(); // GenericUtility genericUtility = GenericUtility.getInstance();
...@@ -3506,11 +3507,28 @@ public class PostOrderActivity { ...@@ -3506,11 +3507,28 @@ public class PostOrderActivity {
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
//ldEffCost = 0;
itemCode = rs.getString("item_code"); itemCode = rs.getString("item_code");
refNo = rs.getString("refNo"); refNo = rs.getString("refNo");
refLineNo = rs.getString("refLineNo"); refLineNo = rs.getString("refLineNo");
totAmt = rs.getDouble("totamt"); totAmt = rs.getDouble("totamt");
totQty = rs.getDouble("totqty"); totQty = rs.getDouble("totqty");
ldQtyStd = totQty; // 13-Jan-17 manoharan
ldAmt = totAmt;
if(!itemCodeOld.trim().equals(itemCode.trim()) || !refNoOld.trim().equals(refNo.trim()))
{
ldTotAmt = 0;
ldChgAmt = 0;
llCtr = 0;
lsItemAry1 = null;
ldQtyAry1 = null;
ldAmtAry1 = null;
lsItemAry1=new ArrayList();
ldQtyAry1=new ArrayList();
ldAmtAry1=new ArrayList();
}
if ("R".equalsIgnoreCase(tranType)) if ("R".equalsIgnoreCase(tranType))
{ {
itemCodeOrd = itemCode; itemCodeOrd = itemCode;
...@@ -3528,10 +3546,26 @@ public class PostOrderActivity { ...@@ -3528,10 +3546,26 @@ public class PostOrderActivity {
rs1 = null; rs1 = null;
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
if ((priceList.trim()).length() > 0) // 13-jan-17 manoharan lot_no required to pick rate, taken below inside distinct lot_no loop
//if ((priceList.trim()).length() > 0)
//{
// rate = distCommon.pickRate(priceList, sdf.format(sysdate), itemCode, "", "B", conn);
//}
sql = "select item_code__ord from sorditem where sale_order = ? and line_no = ? and item_code =? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refNo);
pstmt1.setString(2, refLineNo);
pstmt1.setString(3, itemCode);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{ {
rate = distCommon.pickRate(priceList, sdf.format(sysdate), itemCode, "", "B", conn); itemCodeOrd = rs1.getString(1);
} }
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
} }
llCtr++; llCtr++;
...@@ -3579,25 +3613,11 @@ public class PostOrderActivity { ...@@ -3579,25 +3613,11 @@ public class PostOrderActivity {
rs2 = null; rs2 = null;
sql = "select item_code__ord from sorditem " + " where sale_order = ? and line_no = ? and item_code =? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refNo);
pstmt1.setString(2, refLineNo);
pstmt1.setString(3, itemCode);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
itemCodeOrd = rs1.getString(1);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql = "select a.item_code as freeItem, sum(a.quantity) as FreeQty from sorditem a " sql = "select a.item_code as freeItem, sum(a.quantity) as FreeQty from sorditem a "
+ " where a.sale_order = ? " + " and line_no= ? " + " and nature = 'F' " + " where a.sale_order = ? and a.line_no= ? and a.nature = 'F' "
+ " and not exists (select b.item_code from sorditem b " + " where b.sale_order = ? " + " and not exists (select b.item_code from sorditem b where b.sale_order = ? "
+ " and b.line_no= ? " + " and a.item_code = b.item_code and nature = 'C' ) group by a.item_code "; + " and b.line_no= ? and a.item_code = b.item_code and nature = 'C' ) group by a.item_code ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, refNo); pstmt1.setString(1, refNo);
...@@ -3684,8 +3704,9 @@ public class PostOrderActivity { ...@@ -3684,8 +3704,9 @@ public class PostOrderActivity {
rs2 = null; rs2 = null;
lcFreeEffCost = ldEffCost; lcFreeEffCost = ldEffCost;
// 13-jan-17 manoharan blindly assigned true
lbItemCharge = true; //lbItemCharge = true;
lbItemCharge = false;
sql = "select nature from bomdet where bom_code = ? and item_code =?"; sql = "select nature from bomdet where bom_code = ? and item_code =?";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
...@@ -3700,6 +3721,10 @@ public class PostOrderActivity { ...@@ -3700,6 +3721,10 @@ public class PostOrderActivity {
pstmt2 = null; pstmt2 = null;
rs2.close(); rs2.close();
rs2 = null; rs2 = null;
if ("C".equals(nature))
{
lbItemCharge = true;
}
} }
if (ldEffCost == 0 && lbItemCharge) if (ldEffCost == 0 && lbItemCharge)
{ {
...@@ -3770,6 +3795,10 @@ public class PostOrderActivity { ...@@ -3770,6 +3795,10 @@ public class PostOrderActivity {
ldEffCost = (ldEffCost * lcDiscount / 100); ldEffCost = (ldEffCost * lcDiscount / 100);
} }
} }
// 13-jan-17 manoharan in case there is no scheme or discount then effe_cost is total value / total quantity
ldEffCost = totAmt / totQty;
if ("R".equalsIgnoreCase(tranType)) if ("R".equalsIgnoreCase(tranType))
{ {
...@@ -3779,523 +3808,464 @@ public class PostOrderActivity { ...@@ -3779,523 +3808,464 @@ public class PostOrderActivity {
sql = "select distinct lot_no from invoice_trace where invoice_id = ? and sord_no = ?" sql = "select distinct lot_no from invoice_trace where invoice_id = ? and sord_no = ?"
+ " and sord_line_no = ? and item_code = ? order by lot_no"; + " and sord_line_no = ? and item_code = ? order by lot_no";
} }
pstmt2 = conn.prepareStatement(sql); pstmtLot = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId); pstmtLot.setString(1, invoiceId);
pstmt2.setString(2, refNo); pstmtLot.setString(2, refNo);
pstmt2.setString(3, refLineNo); pstmtLot.setString(3, refLineNo);
pstmt2.setString(4, itemCode); pstmtLot.setString(4, itemCode);
rs2 = pstmt2.executeQuery(); rsLot = pstmtLot.executeQuery();
while (rs2.next()) while (rsLot.next())
{ {
cLotNo1 = rs2.getString("lot_no"); lotNo = rsLot.getString("lot_no");
} // 13-jan-17 manoharan moved from above as lot_no not available
pstmt2.close(); if ((priceList.trim()).length() > 0)
pstmt2 = null; {
rs2.close(); rate = distCommon.pickRate(priceList, sdf.format(sysdate), itemCode, lotNo, "B", conn);
rs2 = null; }
//System.out.println("@V@ llSchemeNum before for LOOP 1 :- ["+llSchemeNum+"]");
//for (int llCtrSch = 1; llCtrSch < llSchemeNum; llCtrSch++) // FOR LOOP [1]
// System.out.println("@V@ llSchemeNum before for LOOP 1 :- ["+llSchemeNum+"]"); for (int llCtrSch = 0; llCtrSch < schemeKeyList.size(); llCtrSch++)
//for (int llCtrSch = 1; llCtrSch < llSchemeNum; llCtrSch++) // FOR LOOP [1] {
for (int llCtrSch = 0; llCtrSch < schemeKeyList.size(); llCtrSch++) // System.out.println("@V@ FOR LOOP 1");
//if (!lbChkNull) // 13-jan-17 manoharan not required
{ //{
// System.out.println("@V@ FOR LOOP 1"); llctrCol = 0;
if (!lbChkNull) //lsScheme = "SCHEME_HIST_KEY" + llCtrSch;
{ lsVarValue = schemeKeyList.get(llCtrSch); //distCommon.getDisparams("999999", lsScheme, conn);
llctrCol = 0; lsColname = lsVarValue.split(",");
//lsScheme = "SCHEME_HIST_KEY" + llCtrSch; llctrCol = lsColname.length;
lsVarValue = schemeKeyList.get(llCtrSch); //distCommon.getDisparams("999999", lsScheme, conn); //}
lsColname = lsVarValue.split(","); lsDocValue = "";
llctrCol = lsColname.length; llCnt = 0;
} lsSchemeCode = "";
lsDocValue = "";
llCnt = 0;
lsSchemeCode = "";
// System.out.println("@V@ llctrCol before for LOOP 2 :- ["+llctrCol+"]");
for (llCnt = 0; llCnt < llctrCol; llCnt++) // FOR LOOP [2]
{
// System.out.println("@V@ FOR LOOP 2");
lsColnameStr = lsColname[llCnt];
if (lsColnameStr.trim().equalsIgnoreCase("site_code"))
{
lsDocValue = lsDocValue + ',' + siteCode.trim();
} else if (lsColnameStr.trim().equalsIgnoreCase("cust_code"))
{
lsDocValue = lsDocValue + ',' + custCode.trim();
}
else if (lsColnameStr.trim().equalsIgnoreCase("cust_code__bil"))
{
lsDocValue = lsDocValue + ',' + custCodeBill.trim();
}
//Added by Santosh on 04/01/17 to add Invoice Id in the doc key [Start]
else if (lsColnameStr.trim().equalsIgnoreCase("invoice_id"))
{
lsDocValue = lsDocValue + ',' + invoiceId.trim();
}
//Added by Santosh on 04/01/17 to add Invoice Id in the doc key [End]
else if (lsColnameStr.trim().equalsIgnoreCase("lot_no") || lsColnameStr.trim().equalsIgnoreCase("item_code"))
{
if ("R".equalsIgnoreCase(tranType))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + cLotNo1 + " and item_code ='" + itemCode + "'";
} else
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = " + refLineNo + " and lot_no ='" + cLotNo1 + "'" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
while (rs2.next())
{
xFldValue = checkNull(rs2.getString(1));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if ("I".equalsIgnoreCase(tranType) && periodScheme) // 06-Dec-16 manoharan periodScheme boolean variable considered to avoid checking for all item if no period scheme // System.out.println("@V@ llctrCol before for LOOP 2 :- ["+llctrCol+"]");
{ for (llCnt = 0; llCnt < llctrCol; llCnt++) // FOR LOOP [2]
if (lsColnameStr.equalsIgnoreCase("item_code") && (xFldValue != null && xFldValue.trim().length() > 0)) {
{ xFldValue = "";
sql = "select item_code__parent from item where item_code = ?";
pstmt2 = conn.prepareStatement(sql); lsColnameStr = lsColname[llCnt];
pstmt2.setString(1, xFldValue); //System.out.println("@V@ FOR LOOP (1) llCnt [" + llCnt+ "] lsColnameStr ["+ lsColnameStr+"] llCtrSch ["+ llCtrSch+ "] lsVarValue [" +lsVarValue +"]");
rs2 = pstmt2.executeQuery(); if (lsColnameStr.trim().equalsIgnoreCase("site_code"))
if (rs2.next()) {
{ lsDocValue = lsDocValue + ',' + siteCode.trim();
lsItemCodeparent = rs2.getString("item_code__parent"); } else if (lsColnameStr.trim().equalsIgnoreCase("cust_code"))
} {
pstmt2.close(); lsDocValue = lsDocValue + ',' + custCode.trim();
pstmt2 = null; }
rs2.close(); else if (lsColnameStr.trim().equalsIgnoreCase("cust_code__bil"))
rs2 = null; {
lsDocValue = lsDocValue + ',' + custCodeBill.trim();
}
//Added by Santosh on 04/01/17 to add Invoice Id in the doc key [Start]
else if (lsColnameStr.trim().equalsIgnoreCase("invoice_id"))
{
lsDocValue = lsDocValue + ',' + invoiceId.trim();
}
//Added by Santosh on 04/01/17 to add Invoice Id in the doc key [End]
else if (lsColnameStr.trim().equalsIgnoreCase("lot_no") || lsColnameStr.trim().equalsIgnoreCase("item_code"))
{
if ("R".equalsIgnoreCase(tranType))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + lotNo + " and item_code ='" + itemCode + "'";
} else
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = " + refLineNo + " and lot_no ='" + lotNo + "'" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
xFldValue = checkNull(rs2.getString(1));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if (lsItemCodeparent != null && lsItemCodeparent.trim().length() > 0) if ("I".equalsIgnoreCase(tranType) && periodScheme) // 06-Dec-16 manoharan periodScheme boolean variable considered to avoid checking for all item if no period scheme
{ {
// 06-dec-16 manoharan commented and taken out side loop if (lsColnameStr.equalsIgnoreCase("item_code") && (xFldValue != null && xFldValue.trim().length() > 0))
/* sql = "select order_type, state_code__dlv, count_code__dlv from sorder where sale_order = ?"; {
pstmt2 = conn.prepareStatement(sql); sql = "select item_code__parent from item where item_code = ?";
pstmt2.setString(1, refNo); pstmt2 = conn.prepareStatement(sql);
rs2 = pstmt2.executeQuery(); pstmt2.setString(1, xFldValue);
if (rs2.next()) rs2 = pstmt2.executeQuery();
{ if (rs2.next())
lsOrderType = rs2.getString("order_type"); {
lsStateCode = rs2.getString("state_code__dlv"); lsItemCodeparent = rs2.getString("item_code__parent");
lsCountCode = rs2.getString("count_code__dlv"); }
} pstmt2.close();
pstmt2.close(); pstmt2 = null;
pstmt2 = null; rs2.close();
rs2.close(); rs2 = null;
rs2 = null;
*/
lsSchemeCode = checkScheme(lsItemCodeparent, lsOrderType, custCode, siteCode, lsStateCode, lsCountCode, tranDate, conn);
if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0) if (lsItemCodeparent != null && lsItemCodeparent.trim().length() > 0)
{ {
sql = "select sum(tot_charge_qty), sum(tot_free_qty), sum(eff_net_amount), max(scheme_code)" // 06-dec-16 manoharan commented and taken out side loop
+ " from prd_scheme_trace where site_code= ? and cust_code= ? and item_code=?"; /* sql = "select order_type, state_code__dlv, count_code__dlv from sorder where sale_order = ?";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode); pstmt2.setString(1, refNo);
pstmt2.setString(2, custCode); rs2 = pstmt2.executeQuery();
pstmt2.setString(3, lsItemCodeparent); if (rs2.next())
rs2 = pstmt2.executeQuery(); {
if (rs2.next()) lsOrderType = rs2.getString("order_type");
{ lsStateCode = rs2.getString("state_code__dlv");
lcTotChargeQty = rs2.getDouble("tot_charge_qty"); lsCountCode = rs2.getString("count_code__dlv");
lcTotFreeQty = rs2.getDouble("tot_free_qty"); }
lcEffNetAmount = rs2.getDouble("eff_net_amount"); pstmt2.close();
lsScheme = rs2.getString("scheme_code"); pstmt2 = null;
} rs2.close();
pstmt2.close(); rs2 = null;
pstmt2 = null; */
rs2.close(); lsSchemeCode = checkScheme(lsItemCodeparent, lsOrderType, custCode, siteCode, lsStateCode, lsCountCode, tranDate, conn);
rs2 = null;
xFldValue = lsItemCodeparent; if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
lsSchemeCode = lsScheme; {
sql = "select sum(tot_charge_qty), sum(tot_free_qty), sum(eff_net_amount), max(scheme_code)"
+ " from prd_scheme_trace where site_code= ? and cust_code= ? and item_code=?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode);
pstmt2.setString(2, custCode);
pstmt2.setString(3, lsItemCodeparent);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
lcTotChargeQty = rs2.getDouble("tot_charge_qty");
lcTotFreeQty = rs2.getDouble("tot_free_qty");
lcEffNetAmount = rs2.getDouble("eff_net_amount");
lsScheme = rs2.getString("scheme_code");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if ((lcTotChargeQty + lcTotFreeQty) > 0) xFldValue = lsItemCodeparent;
{ lsSchemeCode = lsScheme;
ldEffCost = lcEffNetAmount / (lcTotChargeQty + lcTotFreeQty);
} else
{
ldEffCost = 0;
}
}
}
}
}
//Changed by Santosh on 03/01/17 to trim xFldValue
//lsDocValue = lsDocValue + "," + xFldValue;
lsDocValue = lsDocValue + "," + xFldValue.trim();
} else
{
if ("R".equalsIgnoreCase(tranType))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + cLotNo1 + "' and item_code ='" + itemCode + "'";
} else
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = '" + refLineNo + "' and lot_no ='" + cLotNo1 + "' and rate = " + rate + "" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
while (rs2.next())
{
xFldValue = checkNull(rs2.getString(1));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if ("I".equalsIgnoreCase(tranType)) if ((lcTotChargeQty + lcTotFreeQty) > 0)
{ {
if (lsColnameStr.equalsIgnoreCase("item_code") && (xFldValue != null && xFldValue.trim().length() > 0)) ldEffCost = lcEffNetAmount / (lcTotChargeQty + lcTotFreeQty);
{ } else
sql = "select item_code__parent from item where item_code = ?"; {
pstmt2 = conn.prepareStatement(sql); ldEffCost = 0;
pstmt2.setString(1, xFldValue); }
rs2 = pstmt2.executeQuery(); }
if (rs2.next()) }
{ }
lsItemCodeparent = rs2.getString("item_code__parent"); }
} //Changed by Santosh on 03/01/17 to trim xFldValue
pstmt2.close(); //lsDocValue = lsDocValue + "," + xFldValue;
pstmt2 = null; lsDocValue = lsDocValue + "," + xFldValue.trim();
rs2.close(); } else
rs2 = null; {
if ("R".equalsIgnoreCase(tranType))
{
lsSelectSql = "select " + lsColnameStr + " from sreturndet where tran_id = '" + invoiceId + "'" + " and line_no = " + refLineNo + " and lot_no ='" + lotNo + "' and item_code ='" + itemCode + "'";
} else
{
lsSelectSql = "select " + lsColnameStr + " from invoice_trace where invoice_id = '" + invoiceId + "'" + " and sord_line_no = '" + refLineNo + "' and lot_no ='" + lotNo + "' and rate = " + rate + "" + " and item_code ='" + itemCode + "' and item_code__ord = '" + itemCodeOrd + "' and sord_no ='" + refNo + "'";
}
pstmt2 = conn.prepareStatement(lsSelectSql);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
xFldValue = checkNull(rs2.getString(1));
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if (lsItemCodeparent != null && lsItemCodeparent.trim().length() > 0) if ("I".equalsIgnoreCase(tranType))
{ {
sql = "select order_type, state_code__dlv, count_code__dlv from sorder where sale_order = ?"; if (lsColnameStr.equalsIgnoreCase("item_code") && (xFldValue != null && xFldValue.trim().length() > 0))
pstmt2 = conn.prepareStatement(sql); {
pstmt2.setString(1, refNo); sql = "select item_code__parent from item where item_code = ?";
rs2 = pstmt2.executeQuery(); pstmt2 = conn.prepareStatement(sql);
if (rs2.next()) pstmt2.setString(1, xFldValue);
{ rs2 = pstmt2.executeQuery();
lsOrderType = rs2.getString("order_type"); if (rs2.next())
lsStateCode = rs2.getString("state_code__dlv"); {
lsCountCode = rs2.getString("count_code__dlv"); lsItemCodeparent = rs2.getString("item_code__parent");
} }
pstmt2.close(); pstmt2.close();
pstmt2 = null; pstmt2 = null;
rs2.close(); rs2.close();
rs2 = null; rs2 = null;
lsSchemeCode = checkScheme(lsItemCodeparent, lsOrderType, custCode, siteCode, lsStateCode, lsCountCode, tranDate, conn); if (lsItemCodeparent != null && lsItemCodeparent.trim().length() > 0)
{
sql = "select order_type, state_code__dlv, count_code__dlv from sorder where sale_order = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, refNo);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
lsOrderType = rs2.getString("order_type");
lsStateCode = rs2.getString("state_code__dlv");
lsCountCode = rs2.getString("count_code__dlv");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0) lsSchemeCode = checkScheme(lsItemCodeparent, lsOrderType, custCode, siteCode, lsStateCode, lsCountCode, tranDate, conn);
{
sql = "select sum(tot_charge_qty), sum(tot_free_qty), sum(eff_net_amount), max(scheme_code)"
+ " from prd_scheme_trace where site_code= ? and cust_code= ? and item_code=?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode);
pstmt2.setString(2, custCode);
pstmt2.setString(3, lsItemCodeparent);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
lcTotChargeQty = rs2.getDouble("tot_charge_qty");
lcTotFreeQty = rs2.getDouble("tot_free_qty");
lcEffNetAmount = rs2.getDouble("eff_net_amount");
lsScheme = rs2.getString("scheme_code");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
xFldValue = lsItemCodeparent; if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
lsSchemeCode = lsScheme; {
sql = "select sum(tot_charge_qty), sum(tot_free_qty), sum(eff_net_amount), max(scheme_code)"
+ " from prd_scheme_trace where site_code= ? and cust_code= ? and item_code=?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, siteCode);
pstmt2.setString(2, custCode);
pstmt2.setString(3, lsItemCodeparent);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
lcTotChargeQty = rs2.getDouble("tot_charge_qty");
lcTotFreeQty = rs2.getDouble("tot_free_qty");
lcEffNetAmount = rs2.getDouble("eff_net_amount");
lsScheme = rs2.getString("scheme_code");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if ((lcTotChargeQty + lcTotFreeQty) > 0) xFldValue = lsItemCodeparent;
{ lsSchemeCode = lsScheme;
ldEffCost = lcEffNetAmount / (lcTotChargeQty + lcTotFreeQty);
} else
{
ldEffCost = 0;
}
}
}
}
}
lsDocValue = lsDocValue + "," + xFldValue;
}
}// FOR LOOP [2] --END-- if ((lcTotChargeQty + lcTotFreeQty) > 0)
//System.out.println("lsDocValue>>>>>>["+lsDocValue+"]"); {
lsDocValue = lsDocValue.substring(1, lsDocValue.length()); ldEffCost = lcEffNetAmount / (lcTotChargeQty + lcTotFreeQty);
} else
{
ldEffCost = 0;
}
}
}
}
}
lsDocValue = lsDocValue + "," + xFldValue;
}
if ("I".equalsIgnoreCase(tranType)) }// FOR LOOP [2] --END--
{ //System.out.println("13-jan-17 lsDocValue>>>>>>["+lsDocValue+"]");
if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0) lsDocValue = lsDocValue.substring(1, lsDocValue.length());
{
lsOriginalItemCodeOrd = itemCodeOrd;
itemCodeOrd = lsSchemeCode;
}
}
//Added by Santosh on 04/01/17 to get invoice qty from invoice[Start]
sql = "SELECT SUM(QUANTITY) AS QUANTITY FROM INVDET WHERE INVOICE_ID = ? AND ITEM_CODE = ? GROUP BY ITEM_CODE";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId);
pstmt2.setString(2, itemCode);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
invQty = rs2.getDouble("QUANTITY");
}
if(pstmt2!=null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
//Added by Santosh on 04/01/17 to get invoice qty from invoice[End]
if (ldEffCost < rate && ldEffCost != 0)
{
sql = "select count(*) as cnt from min_rate_history where doc_key = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, lsDocValue);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
cnt = rs2.getInt("cnt");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if (cnt == 0) if ("I".equalsIgnoreCase(tranType))
{ {
sql = "insert into min_rate_history (doc_key, eff_cost, scheme_code, invoice_id, invoice_date, cust_code, item_code," if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
+ " site_code, lot_no, returnable,reas_code, chg_date, chg_user, chg_term, quantity, quantity_adj )" {
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; lsOriginalItemCodeOrd = itemCodeOrd;
pstmt2 = conn.prepareStatement(sql); itemCodeOrd = lsSchemeCode;
pstmt2.setString(1, lsDocValue); }
pstmt2.setDouble(2, ldEffCost); }
pstmt2.setString(3, itemCodeOrd); //Added by Santosh on 04/01/17 to get invoice qty from invoice[Start]
pstmt2.setString(4, invoiceId); sql = "SELECT SUM(QUANTITY) AS QUANTITY FROM INVDET WHERE INVOICE_ID = ? AND ITEM_CODE = ? GROUP BY ITEM_CODE";
pstmt2.setTimestamp(5, tranDate); pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(6, custCode); pstmt2.setString(1, invoiceId);
pstmt2.setString(7, itemCode); pstmt2.setString(2, itemCode);
pstmt2.setString(8, siteCode); rs2 = pstmt2.executeQuery();
pstmt2.setString(9, cLotNo1); if (rs2.next())
pstmt2.setString(10, lsReturnable); {
pstmt2.setString(11, lsReasCode); invQty = rs2.getDouble("QUANTITY");
pstmt2.setTimestamp(12, chgDate); }
pstmt2.setString(13, logInCode); if(pstmt2!=null)
pstmt2.setString(14, termId); {
//Added by Santosh on 04/01/17 to insert qty and qty_adj [Start] pstmt2.close();
pstmt2.setDouble(15, invQty); pstmt2 = null;
pstmt2.setDouble(16, 0.0); }
//Added by Santosh on 04/01/17 to insert qty and qty_adj End] if(rs2 != null)
cnt = pstmt2.executeUpdate(); {
rs2.close();
rs2 = null;
}
//Added by Santosh on 04/01/17 to get invoice qty from invoice[End]
if (ldEffCost < rate && ldEffCost != 0)
{
sql = "select count(*) as cnt from min_rate_history where doc_key = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, lsDocValue);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
cnt = rs2.getInt("cnt");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
pstmt2.close(); if (cnt == 0)
pstmt2 = null; {
} else sql = "insert into min_rate_history (doc_key, eff_cost, scheme_code, invoice_id, invoice_date, cust_code, item_code,"
{ + " site_code, lot_no, returnable,reas_code, chg_date, chg_user, chg_term, quantity, quantity_adj )"
sql = "select eff_cost from min_rate_history where doc_key = ?"; + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, lsDocValue); pstmt2.setString(1, lsDocValue);
rs2 = pstmt2.executeQuery(); pstmt2.setDouble(2, ldEffCost);
if (rs2.next()) pstmt2.setString(3, itemCodeOrd);
{ pstmt2.setString(4, invoiceId);
ldSchCost = rs2.getDouble("eff_cost"); pstmt2.setTimestamp(5, tranDate);
} pstmt2.setString(6, custCode);
pstmt2.close(); pstmt2.setString(7, itemCode);
pstmt2 = null; pstmt2.setString(8, siteCode);
rs2.close(); pstmt2.setString(9, lotNo);
rs2 = null; pstmt2.setString(10, lsReturnable);
pstmt2.setString(11, lsReasCode);
pstmt2.setTimestamp(12, chgDate);
pstmt2.setString(13, logInCode);
pstmt2.setString(14, termId);
//Added by Santosh on 04/01/17 to insert qty and qty_adj [Start]
pstmt2.setDouble(15, invQty);
pstmt2.setDouble(16, 0.0);
//Added by Santosh on 04/01/17 to insert qty and qty_adj End]
cnt = pstmt2.executeUpdate();
if (ldEffCost < ldSchCost && ldEffCost != 0) pstmt2.close();
{ pstmt2 = null;
sql = "update min_rate_history set eff_cost =?, scheme_code =?, chg_date =?, chg_user =?,chg_term =?," } else
+ "returnable = ?,reas_code =? where doc_key =?"; {
pstmt2 = conn.prepareStatement(sql); sql = "select eff_cost from min_rate_history where doc_key = ?";
pstmt2.setDouble(1, ldEffCost); pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(2, itemCodeOrd); pstmt2.setString(1, lsDocValue);
pstmt2.setTimestamp(3, chgDate); rs2 = pstmt2.executeQuery();
pstmt2.setString(4, logInCode); if (rs2.next())
pstmt2.setString(5, termId); {
pstmt2.setString(6, lsReturnable); ldSchCost = rs2.getDouble("eff_cost");
pstmt2.setString(7, lsReasCode); }
pstmt2.setString(8, lsDocValue); pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
cnt = pstmt2.executeUpdate(); if (ldEffCost < ldSchCost && ldEffCost != 0)
{
sql = "update min_rate_history set eff_cost =?, scheme_code =?, chg_date =?, chg_user =?,chg_term =?,"
+ "returnable = ?,reas_code =? where doc_key =?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setDouble(1, ldEffCost);
pstmt2.setString(2, itemCodeOrd);
pstmt2.setTimestamp(3, chgDate);
pstmt2.setString(4, logInCode);
pstmt2.setString(5, termId);
pstmt2.setString(6, lsReturnable);
pstmt2.setString(7, lsReasCode);
pstmt2.setString(8, lsDocValue);
pstmt2.close(); cnt = pstmt2.executeUpdate();
pstmt2 = null;
}
}
} else
{
sql = "select count(*) as cnt from min_rate_history where doc_key = ?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, lsDocValue);
rs2 = pstmt2.executeQuery();
if (rs2.next())
{
cnt = rs2.getInt("cnt");
}
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
if (cnt == 0) pstmt2.close();
{ pstmt2 = null;
if (ldEffCost != 0) }
{ }
sql = "insert into min_rate_history (doc_key, eff_cost, scheme_code, invoice_id, invoice_date, cust_code," } else
+ " item_code, site_code, lot_no, returnable,reas_code, chg_date, chg_user, chg_term, quantity, quantity_adj )" {
+ " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; sql = "select count(*) as cnt from min_rate_history where doc_key = ?";
pstmt2 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, lsDocValue); pstmt2.setString(1, lsDocValue);
pstmt2.setDouble(2, ldEffCost); rs2 = pstmt2.executeQuery();
pstmt2.setString(3, itemCodeOrd); if (rs2.next())
pstmt2.setString(4, invoiceId); {
pstmt2.setTimestamp(5, tranDate); cnt = rs2.getInt("cnt");
pstmt2.setString(6, custCode); }
pstmt2.setString(7, itemCode); pstmt2.close();
pstmt2.setString(8, siteCode); pstmt2 = null;
pstmt2.setString(9, cLotNo1); rs2.close();
pstmt2.setString(10, lsReturnable); rs2 = null;
pstmt2.setString(11, lsReasCode);
pstmt2.setTimestamp(12, chgDate);
pstmt2.setString(13, logInCode);
pstmt2.setString(14, termId);
//Added by Santosh on 04/01/17 to insert qty and qty_adj [Start]
pstmt2.setDouble(15, invQty);
pstmt2.setDouble(16, 0.0);
//Added by Santosh on 04/01/17 to insert qty and qty_adj End]
cnt = pstmt2.executeUpdate();
pstmt2.close(); if (cnt == 0)
pstmt2 = null; {
} if (ldEffCost != 0)
} else {
{ sql = "insert into min_rate_history (doc_key, eff_cost, scheme_code, invoice_id, invoice_date, cust_code,"
sql = "select eff_cost from min_rate_history where doc_key = ?"; + " item_code, site_code, lot_no, returnable,reas_code, chg_date, chg_user, chg_term, quantity, quantity_adj )"
pstmt2 = conn.prepareStatement(sql); + " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmt2.setString(1, lsDocValue); pstmt2 = conn.prepareStatement(sql);
rs2 = pstmt2.executeQuery(); pstmt2.setString(1, lsDocValue);
if (rs2.next()) pstmt2.setDouble(2, ldEffCost);
{ pstmt2.setString(3, itemCodeOrd);
ldSchCost = rs2.getDouble("eff_cost"); pstmt2.setString(4, invoiceId);
} pstmt2.setTimestamp(5, tranDate);
pstmt2.close(); pstmt2.setString(6, custCode);
pstmt2 = null; pstmt2.setString(7, itemCode);
rs2.close(); pstmt2.setString(8, siteCode);
rs2 = null; pstmt2.setString(9, lotNo);
pstmt2.setString(10, lsReturnable);
pstmt2.setString(11, lsReasCode);
pstmt2.setTimestamp(12, chgDate);
pstmt2.setString(13, logInCode);
pstmt2.setString(14, termId);
//Added by Santosh on 04/01/17 to insert qty and qty_adj [Start]
pstmt2.setDouble(15, invQty);
pstmt2.setDouble(16, 0.0);
//Added by Santosh on 04/01/17 to insert qty and qty_adj End]
cnt = pstmt2.executeUpdate();
if (ldEffCost < ldSchCost && ldEffCost != 0) pstmt2.close();
{ pstmt2 = null;
sql = "update min_rate_history set eff_cost =?, scheme_code =?, chg_date =?, chg_user =?,chg_term =?," }
+ "returnable = ?,reas_code =? where doc_key =?"; } else
pstmt2 = conn.prepareStatement(sql); {
pstmt2.setDouble(1, ldEffCost); sql = "select eff_cost from min_rate_history where doc_key = ?";
pstmt2.setString(2, itemCodeOrd); pstmt2 = conn.prepareStatement(sql);
pstmt2.setTimestamp(3, chgDate); pstmt2.setString(1, lsDocValue);
pstmt2.setString(4, logInCode); rs2 = pstmt2.executeQuery();
pstmt2.setString(5, termId); if (rs2.next())
pstmt2.setString(6, lsReturnable); {
pstmt2.setString(7, lsReasCode); ldSchCost = rs2.getDouble("eff_cost");
pstmt2.setString(8, lsDocValue); }
pstmt2.close();
pstmt2 = null;
rs2.close();
rs2 = null;
cnt = pstmt2.executeUpdate(); if (ldEffCost < ldSchCost && ldEffCost != 0)
{
sql = "update min_rate_history set eff_cost =?, scheme_code =?, chg_date =?, chg_user =?,chg_term =?,"
+ "returnable = ?,reas_code =? where doc_key =?";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setDouble(1, ldEffCost);
pstmt2.setString(2, itemCodeOrd);
pstmt2.setTimestamp(3, chgDate);
pstmt2.setString(4, logInCode);
pstmt2.setString(5, termId);
pstmt2.setString(6, lsReturnable);
pstmt2.setString(7, lsReasCode);
pstmt2.setString(8, lsDocValue);
pstmt2.close(); cnt = pstmt2.executeUpdate();
pstmt2 = null;
}
}
}
if ("I".equalsIgnoreCase(tranType))
{
if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
{
itemCodeOrd = lsOriginalItemCodeOrd;
lsOriginalItemCodeOrd = "";
lsSchemeCode = "";
}
}
}// FOR LOOP [1] --END--
// sql = "select count(*) as cnt from scheme_history where doc_key = ?"; pstmt2.close();
// pstmt2 = conn.prepareStatement(sql); pstmt2 = null;
// pstmt2.setString(1, lsDocValue); }
// rs2 = pstmt2.executeQuery(); }
// if (rs2.next()) }
// { if ("I".equalsIgnoreCase(tranType))
// cnt = rs2.getInt("cnt"); {
// } if (lsSchemeCode != null && lsSchemeCode.trim().length() > 0)
// pstmt2.close(); {
// pstmt2 = null; itemCodeOrd = lsOriginalItemCodeOrd;
// rs2.close(); lsOriginalItemCodeOrd = "";
// rs2 = null; lsSchemeCode = "";
// }
// if (cnt == 0) }
// { }// FOR LOOP [1] --END--
// sql = "insert into scheme_history (doc_key, eff_cost, scheme_code, invoice_id, invoice_date, cust_code, item_code, site_code, lot_no," + " chg_date, chg_user, chg_term ) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
// pstmt2 = conn.prepareStatement(sql); }
// pstmt2.setString(1, lsDocValue); pstmtLot.close();
// pstmt2.setDouble(2, ldEffCost); pstmtLot = null;
// pstmt2.setString(3, itemCodeOrd); rsLot.close();
// pstmt2.setString(4, invoiceId); rsLot = null;
// pstmt2.setTimestamp(5, tranDate);
// pstmt2.setString(6, custCode);
// pstmt2.setString(7, itemCode);
// pstmt2.setString(8, siteCode);
// pstmt2.setString(9, cLotNo1);
// pstmt2.setString(10, chgDate);
// pstmt2.setString(11, logInCode);
// pstmt2.setString(12, termId);
// cnt = pstmt2.executeUpdate();
//
// pstmt2.close();
// pstmt2 = null;
// } else
// {
// sql = "select eff_cost from scheme_history where doc_key = ?";
// pstmt2 = conn.prepareStatement(sql);
// pstmt2.setString(1, lsDocValue);
// rs2 = pstmt2.executeQuery();
// if (rs2.next())
// {
// ldSchCost = rs2.getDouble("eff_cost");
// }
// pstmt2.close();
// pstmt2 = null;
// rs2.close();
// rs2 = null;
//
// if (ldEffCost < ldSchCost && ldEffCost != 0)
// {
// sql = "update scheme_history set eff_cost =?, scheme_code =?, chg_date =?, chg_user =?,chg_term =?" + " where doc_key =?";
// pstmt2 = conn.prepareStatement(sql);
// pstmt2.setDouble(1, ldEffCost);
// pstmt2.setString(2, itemCodeOrd);
// pstmt2.setString(3, chgDate);
// pstmt2.setString(4, logInCode);
// pstmt2.setString(5, termId);
// pstmt2.setString(6, lsDocValue);
//
// cnt = pstmt2.executeUpdate();
//
// pstmt2.close();
// pstmt2 = null;
// }
// }
} }
itemCodeOld = itemCode;
refNoOld = refNo;
} }
rs.close(); rs.close();
rs = null; 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