Commit 36ccc612 authored by mjadhav's avatar mjadhav

changes done for pricelist calculation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98682 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b4c270b2
...@@ -411,9 +411,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -411,9 +411,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
sql = " SELECT count(*) as count FROM invoice invoice WHERE ( invoice.cust_code = ? ) " + sql = " SELECT count(*) as count FROM invoice invoice WHERE ( invoice.cust_code = ? ) " +
" and invoice.inv_type=? and invoice.item_ser=? and ( invoice.confirmed = 'Y' )" + " and invoice.inv_type=? and invoice.item_ser=? and ( invoice.confirmed = 'Y' )" +
" and ( (invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) or " + " and ( (invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) or " +
" ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) ) " + " ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) ) ) " ;
" and(exists (SELECT cust_stock_inv.invoice_id FROM cust_stock_inv cust_stock_inv " + /*" and(exists (SELECT cust_stock_inv.invoice_id FROM cust_stock_inv cust_stock_inv " +
" WHERE cust_stock_inv.invoice_id = invoice.invoice_id and cust_stock_inv.dlv_flg = 'N' ))) "; " WHERE cust_stock_inv.invoice_id = invoice.invoice_id and cust_stock_inv.dlv_flg = 'N' ))) ";*/
pstmt3 = conn.prepareStatement(sql); pstmt3 = conn.prepareStatement(sql);
pstmt3.setString(1,custCode.trim()); pstmt3.setString(1,custCode.trim());
pstmt3.setString(2,orderType.trim()); pstmt3.setString(2,orderType.trim());
...@@ -1071,7 +1071,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1071,7 +1071,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
String selectedInvList =""; String selectedInvList ="";
String invoiceIdDom=""; String invoiceIdDom="";
String locality_code=""; String locality_code="";
String childNodeName = ""; String childNodeName = "",lineNoStrDom="",lineNoStr="";
String invoiceIdList = ""; String invoiceIdList = "";
double sretQtyAll=0.0,rateAll=0.0; double sretQtyAll=0.0,rateAll=0.0;
String sretSiteCodeAll="",sretLocCodeAll="",sretLotNoAll="",sretLotSlAll="",retRepFlagAll=""; String sretSiteCodeAll="",sretLocCodeAll="",sretLotNoAll="",sretLotSlAll="",retRepFlagAll="";
...@@ -1217,6 +1217,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1217,6 +1217,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<cust_name>").append("<![CDATA["+custName+"]]>").append("</cust_name>"); valueXmlString.append("<cust_name>").append("<![CDATA["+custName+"]]>").append("</cust_name>");
valueXmlString.append("<site_code>").append("<![CDATA["+siteCode+"]]>").append("</site_code>"); valueXmlString.append("<site_code>").append("<![CDATA["+siteCode+"]]>").append("</site_code>");
//valueXmlString.append("<to_date>").append("<![CDATA["+sdf.format(currentDate)+"]]>").append("</to_date>"); //valueXmlString.append("<to_date>").append("<![CDATA["+sdf.format(currentDate)+"]]>").append("</to_date>");
valueXmlString.append("<order_type>").append("<![CDATA[]]>").append("</order_type>");
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
} }
if(currentColumn.trim().equals("order_type")) if(currentColumn.trim().equals("order_type"))
...@@ -1353,6 +1354,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1353,6 +1354,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("tranIdLast (case 2):"+tranIdLast);
sql= " SELECT TRAN_ID FROM CUST_STOCK WHERE CUST_CODE = ? " + sql= " SELECT TRAN_ID FROM CUST_STOCK WHERE CUST_CODE = ? " +
...@@ -1372,7 +1374,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1372,7 +1374,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
System.out.println("tranIdNew :"+tranIdNew); System.out.println("tranIdNew (case 2):"+tranIdNew);
// tranIdNew=""; // tranIdNew="";
if(tranIdNew.trim().length() > 0) if(tranIdNew.trim().length() > 0)
...@@ -1659,10 +1661,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1659,10 +1661,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
" FROM invoice invoice WHERE ( invoice.cust_code = ? ) and invoice.inv_type=? and invoice.item_ser=? and " + " FROM invoice invoice WHERE ( invoice.cust_code = ? ) and invoice.inv_type=? and invoice.item_ser=? and " +
" ( invoice.confirmed = 'Y' ) and ( (invoice.tran_date >= ? ) " + " ( invoice.confirmed = 'Y' ) and ( (invoice.tran_date >= ? ) " +
" and (invoice.tran_date <= ? ) or " + " and (invoice.tran_date <= ? ) or " +
" ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) )" + " ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) ) )" +
" and(exists (SELECT cust_stock_inv.invoice_id FROM cust_stock_inv cust_stock_inv " + /* " and(exists (SELECT cust_stock_inv.invoice_id FROM cust_stock_inv cust_stock_inv " +
" WHERE cust_stock_inv.invoice_id = invoice.invoice_id and " + " WHERE cust_stock_inv.invoice_id = invoice.invoice_id and " +
" cust_stock_inv.dlv_flg = 'N' )))" + " cust_stock_inv.dlv_flg = 'N' )))" +*/
" UNION " + " UNION " +
" SELECT distinct cinv.invoice_id ," + " SELECT distinct cinv.invoice_id ," +
" cinv.INVOICE_DATE,cinv.DLV_FLG ,cinv.net_amt FROM CUST_STOCK_INV cinv , " + " cinv.INVOICE_DATE,cinv.DLV_FLG ,cinv.net_amt FROM CUST_STOCK_INV cinv , " +
...@@ -1818,7 +1820,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1818,7 +1820,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
int parentNodeListLength1 = 0; int parentNodeListLength1 = 0;
NodeList parentNodeList3 = dom2.getElementsByTagName("Detail3"); NodeList parentNodeList3 = dom2.getElementsByTagName("Detail3");
int parentNodeListLength3 = parentNodeList3.getLength(); int parentNodeListLength3 = parentNodeList3.getLength();
System.out.println("parentNodeListLength3 Detail3:::::::::"+parentNodeListLength3); System.out.println("parentNodeListLength3 Detail4:::::::::"+parentNodeListLength3);
for (int selectedRow = 0; selectedRow < parentNodeListLength3; selectedRow++) for (int selectedRow = 0; selectedRow < parentNodeListLength3; selectedRow++)
{ {
...@@ -1981,15 +1983,15 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -1981,15 +1983,15 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
sql= "select item_code,unit,op_stock ,sales,purc_rcp,cl_stock,purc_ret,rate,line_no,transit_qty,item_ser ,purc_rcp__repl ,purc_rcp__free,purc_ret__repl,purc_ret__free,transit_qty__repl,transit_qty__free " + sql= "select item_code,unit,op_stock ,sales,purc_rcp,cl_stock,purc_ret,rate,line_no,transit_qty,item_ser ,purc_rcp__repl ,purc_rcp__free,purc_ret__repl,purc_ret__free,transit_qty__repl,transit_qty__free " +
" from cust_stock_det where tran_id=? "; " from cust_stock_det where tran_id=? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranIdLast); // pstmt.setString(1, tranIdLast);
/*if(tranIdNew.trim().length() == 0) if(tranIdNew.trim().length() == 0)
{ {
pstmt.setString(1, tranIdLast); pstmt.setString(1, tranIdLast);
} }
else else
{ {
pstmt.setString(1, tranIdNew); pstmt.setString(1, tranIdNew);
}*/ }
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
...@@ -2000,10 +2002,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2000,10 +2002,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itemCodeLast=checkNull(rs.getString("item_code")); itemCodeLast=checkNull(rs.getString("item_code"));
itemSerLast=checkNull(rs.getString("item_ser")); itemSerLast=checkNull(rs.getString("item_ser"));
unitLast=checkNull(rs.getString("unit")); unitLast=checkNull(rs.getString("unit"));
opStockLast=rs.getDouble("op_stock"); //opStockLast=rs.getDouble("op_stock");
//salesLast=rs.getDouble("sales"); salesLast=rs.getDouble("sales");
//receiptLast=rs.getDouble("purc_rcp"); //receiptLast=rs.getDouble("purc_rcp");
clStockLast=rs.getDouble("cl_stock"); clStockNew=rs.getDouble("cl_stock");
//returnLast=rs.getDouble("purc_ret"); //returnLast=rs.getDouble("purc_ret");
//rateLast=rs.getDouble("rate"); //rateLast=rs.getDouble("rate");
lineNoCustSt=rs.getInt("line_no"); lineNoCustSt=rs.getInt("line_no");
...@@ -2044,7 +2046,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2044,7 +2046,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("transitQty quantity cal for avaible transcation id :"+transitQty); System.out.println("transitQty quantity cal for avaible transcation id :"+transitQty);
System.out.println("--cal rate for current transcation period"); System.out.println("--cal rate for current transcation period");
rateLast = getRate(custCodeHd,tranDate,itemCode,conn); rateLast = getRate(custCodeHd,prdFrmDateTstmp,toDateTstmp,itemCodeLast,conn);
System.out.println("rateLast :"+rateLast); System.out.println("rateLast :"+rateLast);
sql = "Select descr from item " sql = "Select descr from item "
...@@ -2066,19 +2068,19 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2066,19 +2068,19 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
/*--------------view closing stock and sales of current transcation --------------------*/ /*--------------view closing stock and sales of current transcation --------------------*/
if(tranIdNew.trim().length() > 0) if(tranIdLast.trim().length() > 0)
{ {
sql= " select cl_stock , sales from cust_stock_det " + sql= " select cl_stock from cust_stock_det " +
" where tran_id=? and item_code=?"; " where tran_id=? and item_code=?";
pstmt4 = conn.prepareStatement(sql); pstmt4 = conn.prepareStatement(sql);
pstmt4.setString(1, tranIdNew); pstmt4.setString(1, tranIdLast);
pstmt4.setString(2, itemCodeLast); pstmt4.setString(2, itemCodeLast);
rs4 = pstmt4.executeQuery(); rs4 = pstmt4.executeQuery();
if(rs4.next()) if(rs4.next())
{ {
clStockNew=rs4.getDouble("cl_stock"); opStockLast=rs4.getDouble("cl_stock");
salesLast=rs4.getDouble("sales"); //salesLast=rs4.getDouble("sales");
} }
rs4.close(); rs4.close();
rs4 = null; rs4 = null;
...@@ -2221,8 +2223,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2221,8 +2223,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<tran_id><![CDATA["+ tranIdNew+"]]></tran_id>"); valueXmlString.append("<tran_id><![CDATA["+ tranIdNew+"]]></tran_id>");
} }
lineNoStr = " " + lineNoCustSt;
valueXmlString.append("<line_no>").append("<![CDATA["+lineNoCustSt+"]]>").append("</line_no>"); lineNoStr = lineNoStr.substring(lineNoStr.length() - 3);
System.out.println("lineNoStr " + lineNoStr);
valueXmlString.append("<line_no>").append("<![CDATA["+lineNoStr+"]]>").append("</line_no>");
valueXmlString.append("<item_code sSrvCallOnChg='1'>").append("<![CDATA["+itemCodeLast+"]]>").append("</item_code>"); valueXmlString.append("<item_code sSrvCallOnChg='1'>").append("<![CDATA["+itemCodeLast+"]]>").append("</item_code>");
valueXmlString.append("<item_ser>").append("<![CDATA["+itemSerLast+"]]>").append("</item_ser>"); valueXmlString.append("<item_ser>").append("<![CDATA["+itemSerLast+"]]>").append("</item_ser>");
valueXmlString.append("<descr>").append("<![CDATA["+descrLast+"]]>").append("</descr>"); valueXmlString.append("<descr>").append("<![CDATA["+descrLast+"]]>").append("</descr>");
...@@ -2231,7 +2235,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2231,7 +2235,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<unit>").append("<![CDATA["+unitLast+"]]>").append("</unit>"); valueXmlString.append("<unit>").append("<![CDATA["+unitLast+"]]>").append("</unit>");
//valueXmlString.append("<loc_type>").append("<![CDATA["+itemMap.get("mlType@"+i)+"]]>").append("</loc_type>"); //valueXmlString.append("<loc_type>").append("<![CDATA["+itemMap.get("mlType@"+i)+"]]>").append("</loc_type>");
valueXmlString.append("<rate>").append("<![CDATA["+rateLast+"]]>").append("</rate>"); valueXmlString.append("<rate>").append("<![CDATA["+rateLast+"]]>").append("</rate>");
valueXmlString.append("<op_stock protect='1'>").append("<![CDATA["+clStockLast+"]]>").append("</op_stock>"); valueXmlString.append("<op_stock protect='1'>").append("<![CDATA["+opStockLast+"]]>").append("</op_stock>");
valueXmlString.append("<purc_rcp>").append("<![CDATA["+receiptLast+"]]>").append("</purc_rcp>"); valueXmlString.append("<purc_rcp>").append("<![CDATA["+receiptLast+"]]>").append("</purc_rcp>");
valueXmlString.append("<purc_rcp__repl>").append("<![CDATA[0]]>").append("</purc_rcp__repl>"); valueXmlString.append("<purc_rcp__repl>").append("<![CDATA[0]]>").append("</purc_rcp__repl>");
...@@ -2475,7 +2479,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2475,7 +2479,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("Transit quantity for not available in last or current tranaction"+"itemCode :"+itemCode +"Transit Quantity :"+transitQty); System.out.println("Transit quantity for not available in last or current tranaction"+"itemCode :"+itemCode +"Transit Quantity :"+transitQty);
System.out.println("/*--cal Rate for all item code which is not included for current or previous item code.---*/"); System.out.println("/*--cal Rate for all item code which is not included for current or previous item code.---*/");
rateAll = getRate(custCodeHd,tranDate,itemCode,conn); rateAll = getRate(custCodeHd,prdFrmDateTstmp,toDateTstmp,itemCode,conn);
System.out.println("rateAll :"+rateAll); System.out.println("rateAll :"+rateAll);
System.out.println("Rate for not available in last or current tranaction"+"itemCode :"+itemCode +"rate :"+rate); System.out.println("Rate for not available in last or current tranaction"+"itemCode :"+itemCode +"rate :"+rate);
...@@ -2520,9 +2524,25 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2520,9 +2524,25 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itmDetCnt++; itmDetCnt++;
lineNoCustSt = lineNoCustSt + 1; lineNoCustSt = lineNoCustSt + 1;
valueXmlString.append( "<Detail4 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" ); valueXmlString.append( "<Detail4 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" );
/* if(tranIdLast.trim().length() == 0 && tranIdNew.trim().length() > 0 )
{
valueXmlString.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"E\" status=\"O\" />");
}
else
{
valueXmlString.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
}*/
valueXmlString.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />"); valueXmlString.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
valueXmlString.append("<tran_id><![CDATA["+ tranIdNew+"]]></tran_id>"); valueXmlString.append("<tran_id><![CDATA["+ tranIdNew+"]]></tran_id>");
valueXmlString.append("<line_no>").append("<![CDATA["+lineNoCustSt+"]]>").append("</line_no>"); lineNoStrDom = " " + lineNoCustSt;
lineNoStrDom = lineNoStrDom.substring(lineNoStrDom.length() - 3);
System.out.println("lineNoStrDom " + lineNoStrDom);
valueXmlString.append("<line_no>").append("<![CDATA["+lineNoStrDom+"]]>").append("</line_no>");
valueXmlString.append("<item_code sSrvCallOnChg='1'>").append("<![CDATA["+itemMap.get("itemCode@"+itemDomId)+"]]>").append("</item_code>"); valueXmlString.append("<item_code sSrvCallOnChg='1'>").append("<![CDATA["+itemMap.get("itemCode@"+itemDomId)+"]]>").append("</item_code>");
valueXmlString.append("<item_ser>").append("<![CDATA["+itemMap.get("mItemSer@"+itemDomId)+"]]>").append("</item_ser>"); valueXmlString.append("<item_ser>").append("<![CDATA["+itemMap.get("mItemSer@"+itemDomId)+"]]>").append("</item_ser>");
valueXmlString.append("<descr>").append("<![CDATA["+itemMap.get("mDescr@"+itemDomId)+"]]>").append("</descr>"); valueXmlString.append("<descr>").append("<![CDATA["+itemMap.get("mDescr@"+itemDomId)+"]]>").append("</descr>");
...@@ -2661,7 +2681,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2661,7 +2681,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
private double getRate(String custCode, Timestamp tranDate, String itemCode,Connection conn)throws RemoteException,ITMException private double getRate(String custCode, Timestamp fromDate,Timestamp toDate, String itemCode,Connection conn)throws RemoteException,ITMException
{ {
ibase.webitm.utility.GenericUtility genericUtility = new ibase.webitm.utility.GenericUtility(); ibase.webitm.utility.GenericUtility genericUtility = new ibase.webitm.utility.GenericUtility();
//System.out.println("[CustStockEJB]Calcuating rate for the custCode :"+custCode+": tranDate :"+tranDate+": itemCode :"+itemCode+":"); //System.out.println("[CustStockEJB]Calcuating rate for the custCode :"+custCode+": tranDate :"+tranDate+": itemCode :"+itemCode+":");
...@@ -2697,8 +2717,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2697,8 +2717,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt = conn.prepareStatement(selQuery); pstmt = conn.prepareStatement(selQuery);
pstmt.setString( 1, priceList ); pstmt.setString( 1, priceList );
pstmt.setString( 2, itemCode ); pstmt.setString( 2, itemCode );
pstmt.setTimestamp(3,tranDate); pstmt.setTimestamp(3,fromDate);
pstmt.setTimestamp(4,tranDate); pstmt.setTimestamp(4,toDate);
rs = pstmt.executeQuery( ); rs = pstmt.executeQuery( );
if( rs.next() ) if( rs.next() )
{ {
...@@ -2834,7 +2854,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2834,7 +2854,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
" or ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) ) )" + " or ((invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) ) )" +
" and invoice.invoice_id not in ("+selectedInvList+") )"; " and invoice.invoice_id not in ("+selectedInvList+") )";
*/ */
sql = " SELECT SUM( iv.QUANTITY__STDUOM ) QUANTITY " /*sql = " SELECT SUM( iv.QUANTITY__STDUOM ) QUANTITY "
+" FROM INVDET iv " +" FROM INVDET iv "
+" WHERE iv.item_code=? and iv.INVOICE_ID in " + +" WHERE iv.item_code=? and iv.INVOICE_ID in " +
" ( SELECT distinct invoice.invoice_id invoice_id FROM invoice invoice WHERE " + " ( SELECT distinct invoice.invoice_id invoice_id FROM invoice invoice WHERE " +
...@@ -2844,7 +2864,19 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal, ...@@ -2844,7 +2864,19 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
" and (invoice.tran_date <= ? ) ) and(exists (SELECT cust_stock_inv.invoice_id " + " and (invoice.tran_date <= ? ) ) and(exists (SELECT cust_stock_inv.invoice_id " +
" FROM cust_stock_inv cust_stock_inv WHERE cust_stock_inv.invoice_id = invoice.invoice_id and " + " FROM cust_stock_inv cust_stock_inv WHERE cust_stock_inv.invoice_id = invoice.invoice_id and " +
" cust_stock_inv.dlv_flg = 'N' ))) and invoice.invoice_id not in ("+selectedInvList+") ) "; " cust_stock_inv.dlv_flg = 'N' ))) and invoice.invoice_id not in ("+selectedInvList+") ) ";
*/
System.out.println("calculate transit quantity!!!!!!!!!!!");
sql = " SELECT SUM( iv.QUANTITY__STDUOM ) QUANTITY "
+" FROM INVDET iv "
+" WHERE iv.item_code=? and iv.INVOICE_ID in " +
" ( SELECT distinct invoice.invoice_id invoice_id FROM invoice invoice WHERE " +
" ( invoice.cust_code = ? ) and invoice.inv_type=? and invoice.item_ser=? and " +
" ( invoice.confirmed = 'Y' ) and ( (invoice.tran_date >=? ) " +
" and (invoice.tran_date <= ? ) or ((invoice.tran_date >=? ) " +
" and (invoice.tran_date <= ? ) ) ) and invoice.invoice_id not in ("+selectedInvList+") ) ";
pstmt = conn.prepareStatement( sql ); pstmt = conn.prepareStatement( sql );
......
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