Commit 467a0cf3 authored by mjadhav's avatar mjadhav

invoice item code also included other than cust_stock_det


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98688 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bb1c18ef
......@@ -1448,6 +1448,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("todate (case 3):"+todate);
itemSer = genericUtility.getColumnValue("item_ser", dom1);
System.out.println("itemSer (case 3):"+itemSer);
siteCodeHd = genericUtility.getColumnValue("site_code", dom1);
System.out.println("siteCodeHd (case 3):"+siteCodeHd);
orderType = genericUtility.getColumnValue("order_type", dom1);
System.out.println("orderType (case 3):"+orderType);
......@@ -1546,7 +1548,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<tran_id>").append("<![CDATA["+tranIdNew+"]]>").append("</tran_id>");
valueXmlString.append("<invoice_id>").append("<![CDATA["+invoiceId+"]]>").append("</invoice_id>");
valueXmlString.append("<invoice_date>").append("<![CDATA["+sdf.format(invDate)+"]]>").append("</invoice_date>");
//valueXmlString.append("<lr_date>").append("<![CDATA["+invMap.get("lrDate@"+invDomid)+"]]>").append("</lr_date>");
//valueXmlString.append("<lr_date>").append("<![CDATA["+invsiteCodeMap.get("lrDate@"+invDomid)+"]]>").append("</lr_date>");
valueXmlString.append("<dlv_flg>").append("<![CDATA[Y]]>").append("</dlv_flg>");
//valueXmlString.append("<dlv_flg>").append("<![CDATA["+invMap.get("dlvFlag@"+i)+"]]>").append("</dlv_flg>");
valueXmlString.append("<net_amt>").append("<![CDATA["+netAmt+"]]>").append("</net_amt>");
......@@ -1591,7 +1593,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
System.out.println("FromDate : "+FromDate);
/*
varValueStr = dist.getDisparams("999999","SSD_TRANSIT_DAYS",conn);
......@@ -1658,7 +1660,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
sql = " SELECT distinct invoice.invoice_id invoice_id, " +
" invoice.tran_date as invoice_date ,'N' as DLV_FLG ,invoice.net_amt " +
" 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.site_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 <= ? ) ) )" +
......@@ -1675,14 +1677,15 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, orderType);
pstmt.setString(3, itemSer);
pstmt.setTimestamp(4, FromDate);
pstmt.setTimestamp(5, ToDate);
pstmt.setTimestamp(6, prdFrom);
pstmt.setTimestamp(7, prdTo);
pstmt.setString(8, custCode);
pstmt.setString(9, itemSer);
pstmt.setString(2, siteCodeHd);
pstmt.setString(3, orderType);
pstmt.setString(4, itemSer);
pstmt.setTimestamp(5, FromDate);
pstmt.setTimestamp(6, ToDate);
pstmt.setTimestamp(7, prdFrom);
pstmt.setTimestamp(8, prdTo);
pstmt.setString(9, custCode);
pstmt.setString(10, itemSer);
rs = pstmt.executeQuery();
while(rs.next())
{
......@@ -2291,7 +2294,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
orderDtTstmp=java.sql.Timestamp.valueOf(genericUtility.getValidDateString(tranDateHd, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
defData = getItemFromCust(custCodeHd,itemSerHd,tranIdLast,tranIdNew,conn);
defData = getItemFromCust(custCodeHd,itemSerHd,tranIdLast,tranIdNew,selectedInvList,conn);
itemResLen = defData.size();
......@@ -3036,9 +3039,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
......@@ -3552,7 +3552,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
private ArrayList getItemFromCust( String custCode, String itemSer, String lastTranId,String newTranId, Connection conn )
private ArrayList getItemFromCust( String custCode, String itemSer, String lastTranId,String newTranId,String selectedInvList, Connection conn )
{
long llCount = 0, llRowNum = 0;
String lsErrCode = null, lsCode = null, lsDescr = null, lsUnit = null, lsLocType = null,lsOpStock=null,
......@@ -3562,7 +3562,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
ResultSet rs = null,rs1 = null;
ItemDescr itemDescr = null;
ArrayList defData = new ArrayList();
String itemCode="";
String itemCode="",invItemCode="";
//lds_custstock = create nvo_datastore
//lds_custstock.reset()
//lds_custstock.dataobject = 'd_cust_stock_det_brow'
......@@ -3603,7 +3603,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
tranId = checkNull(rs.getString("tran_id"));
sql= "select distinct (item_code)as item_code ,op_stock,tran_id from cust_stock_det where tran_id= ?";
sql= "select distinct (item_code)as item_code ,cl_stock,tran_id from cust_stock_det where tran_id= ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, tranId);
rs1 = pstmt1.executeQuery();
......@@ -3616,7 +3616,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
itemDescr = new ItemDescr();
itemDescr.lsCode = rs1.getString("item_code");
itemDescr.lsOpStock= rs1.getString("op_stock");
itemDescr.lsOpStock= rs1.getString("cl_stock");
itemDescr.lsTranId= rs1.getString("tran_id");
System.out.println("item_code >>>"+rs1.getString("item_code"));
......@@ -3634,39 +3634,55 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("Item Code which is included other than previous transcation :"+itemList);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/*------------List if Item which are generated for new invoice for new itemcode----------------*/
System.out.println("--List if Item which are generated for new invoice for new itemcode-----");
sql = "select item_code from invdet where " +
"invoice_id in ("+selectedInvList+") ";
pstmt = conn.prepareStatement( sql );
rs = pstmt.executeQuery();
while( rs.next() )
{
invItemCode=rs.getString("item_code");
System.out.println("invItemCode :"+invItemCode);
//System.out.println("op_stock >>>"+ rs.getString("op_stock"));
if(!(itemList.contains(invItemCode)))
{
System.out.println("New itemcode added :"+invItemCode);
itemDescr = new ItemDescr();
itemDescr.lsCode = invItemCode;
itemDescr.lsOpStock= "0.0";
defData.add(itemDescr);
itemList.add(invItemCode);
}
//itemDescr.lsDescr = rs.getString("op_stock");
// itemDescr.lsUnit = rs.getString( "unit" );
// itemDescr.lsLocType = rs.getString( "loc_type" );
// itemDescr.lsItemSer = rs.getString( "item_ser" );
//defData.add( itemDescr );
//ll_row_num = lds_custstock.insertrow(0)
/*
strBuff.append( "<Detail>" );
strBuff.append( "<line_no>" ).append( llRowNum ).append( "</line_no>\n" );
strBuff.append( "<item_code>" ).append( lsCode ).append( "</item_code>" );
strBuff.append( "<item_descr>" ).append( lsDescr ).append( "</item_descr>" );
strBuff.append( "<unit>" ).append( lsUnit ).append( "</unit>" );
strBuff.append( "<loc_type>" ).append( lsLocType ).append( "</loc_type>" );
strBuff.append( "<item_ser>" ).append( lsItemSer ).append( "</item_ser>" );
strBuff.append( "</Detail>" );
*/
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/*---------------------------------------------------------------------------*/
System.out.println("Final itemList :"+itemList);
}catch( Exception ex )
{
ex.printStackTrace();
}finally
{
try{
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}catch( Exception e ){ e.printStackTrace(); }
}
//return strBuff.toString();
......
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