Commit a2786f01 authored by mjadhav's avatar mjadhav

changes done for return calculation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98721 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 53488985
......@@ -434,7 +434,14 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
" and ( (invoice.tran_date >= ? ) and (invoice.tran_date <= ? ) or " +
" ((invoice.tran_date >= ? ) 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 cust_stock_inv.dlv_flg = 'N' ))) ";
" WHERE cust_stock_inv.invoice_id = invoice.invoice_id and cust_stock_inv.dlv_flg = 'N' ))) "+
" UNION " +
" SELECT distinct( cinv.invoice_id) " +
" FROM CUST_STOCK_INV cinv , " +
" invoice invoice WHERE cinv.invoice_id=invoice.invoice_id and " +
" invoice.cust_code = ? and invoice.item_ser= ? and invoice.confirmed = 'Y'" +
" and CASE WHEN cinv.dlv_flg IS NULL THEN 'N' ELSE cinv.dlv_flg END='N' ";
pstmt3 = conn.prepareStatement(sql);
pstmt3.setString(1,custCode.trim());
pstmt3.setString(2,siteCode.trim());
......@@ -444,6 +451,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt3.setTimestamp(6,ToDate);
pstmt3.setTimestamp(7,prdFrom);
pstmt3.setTimestamp(8,prdTo);
pstmt3.setString(9,custCode.trim());
pstmt3.setString(10,itemSer.trim());
rs3 = pstmt3.executeQuery();
while (rs3.next())
{
......@@ -692,7 +701,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
itemCode = this.genericUtility.getColumnValue("item_code", dom);
System.out.println("itemCode :"+itemCode);
if(itemCode == null)
if(itemCode == null:SA)
{
System.out.println("Error : No data found in item details!!");
errCode = "VTEMTITM";
......@@ -714,7 +723,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
opStockDom = Double.parseDouble(this.genericUtility.getColumnValue("op_stock", dom)) ;
}
else
{
{:SA
opStockDom=0.0;
}
......@@ -2020,19 +2029,17 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
tranDateStr=sdf.format(currentDate).toString();
tranDate=java.sql.Timestamp.valueOf(genericUtility.getValidDateString(tranDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");;
FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("FromDate :"+FromDate);
ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ToDate :"+ToDate);
/*---calculate previous month from input value period,start---*/
frmDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("frmDateTstmp :"+frmDateTstmp);
toDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("toDateTstmp :"+toDateTstmp);
prdFrom = getPreviousDate(FromDate,conn);
prdFrom = getPreviousDate(frmDateTstmp,conn);
System.out.println("prdFrom :"+prdFrom);
sql= " select FR_DATE,TO_DATE from period where ? "
+ " between FR_DATE and TO_DATE";
pstmt = conn.prepareStatement(sql);
......@@ -2040,25 +2047,21 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rs = pstmt.executeQuery();
if(rs.next())
{
prdFrom = rs.getTimestamp("FR_DATE");
prdTo = rs.getTimestamp("TO_DATE");
prdFrmDateTstmp = rs.getTimestamp("FR_DATE");
prdtoDateTstmp = rs.getTimestamp("TO_DATE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
prdFrmDateTstmp=prdFrom;
prdtoDateTstmp=prdTo;
// prdFrmDateTstmp=prdFrom;
// prdtoDateTstmp=prdTo;
System.out.println("prdFrmDateTstmp :"+prdFrmDateTstmp);
System.out.println("prdtoDateTstmp :"+prdtoDateTstmp);
/*---------------------------------------------------------------------------*/
/*-------------------------END----------------------------------------*/
sql= " SELECT TRAN_ID FROM CUST_STOCK WHERE CUST_CODE = ? " +
......@@ -2067,8 +2070,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt.setString(1, custCodeHd);
pstmt.setString(2, itemSerHd);
pstmt.setString(3, orderType);
pstmt.setTimestamp(4, FromDate);
pstmt.setTimestamp(5, ToDate);
pstmt.setTimestamp(4, frmDateTstmp);
pstmt.setTimestamp(5, toDateTstmp);
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -2123,32 +2126,30 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("receiptLast (case 4):"+receiptLast);
System.out.println("returnLast (case 4):"+returnLast);
System.out.println("lineNoCustSt (case 4):"+lineNoCustSt);
System.out.println("rateLast (case 4):"+rateLast);
frmDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
toDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("frmDateTstmp :"+frmDateTstmp);
System.out.println("toDateTstmp :"+toDateTstmp);
//frmDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//toDateTstmp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("frmDateTstmp :"+frmDateTstmp);
//System.out.println("toDateTstmp :"+toDateTstmp);
//receiptLast=GetRcpQty(custCodeHd,tranIdLast,orderType,frmDateTstmp,toDateTstmp,itemCodeLast,itemSerHd,conn);
System.out.println("-------calculate Receipt quantity for availble transcaion Id--------");
receiptLast=0.0;
receiptLast = GetRcpQty(selectedInvList,itemCodeLast,conn);
System.out.println("Receipt quantity cal for avaible transcation id :"+receiptLast);
//rcpBonLast = GetRcpBonQty(selectedInvList,itemCodeLast,conn) ;
//System.out.println("rcpBonLast :"+rcpBonLast);
System.out.println("-------calculate Receipt Frees quantity for availble transcaion Id--------");
rcpFreesLast=0.0;
rcpFreesLast=GetFreeQty(selectedInvList,itemCodeLast,conn);
System.out.println("rcpFreesLast :"+rcpFreesLast);
System.out.println("custCodeHd :"+custCodeHd);
System.out.println("orderType :"+orderType);
System.out.println("selectedInvList :"+selectedInvList);
......@@ -2158,21 +2159,29 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("prdtoDateTstmp :"+prdtoDateTstmp);
System.out.println("itemSerLast :"+itemSerLast);
System.out.println("-------calculate Transit quantity for availble transcaion Id--------");
transitQty=0.0;
transitQty=GetTransitQty(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("transitQty quantity cal for avaible transcation id :"+transitQty);
// transitQtyBonLast=GetTransitBon(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
// System.out.println("transitQtyBonLast :"+transitQtyBonLast);
System.out.println("-------calculate Transit Frees quantity for availble transcaion Id--------");
transitQtyFreesLast=0.0;
transitQtyFreesLast=GetTransitFrees(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("transitQtyFreesLast :"+transitQtyFreesLast);
////getRate(String custCode, Timestamp fromDate,Timestamp toDate, String itemCode,String siteCode,String itemSer,String orderType,Connection conn)
System.out.println("--cal rate for current transcation period");
System.out.println("-------calculate Rate for availble transcaion Id--------");
rateLast=0.0;
rateLast = getRate(custCodeHd,tranDate,itemCodeLast,conn);
System.out.println("rateLast :"+rateLast);
descrLast="";
sql = "Select descr from item "
+" where item_code = '" + itemCodeLast + "'";
pstmt1 = conn.prepareStatement( sql );
......@@ -2190,8 +2199,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
/*--------------view closing stock and sales of current transcation --------------------*/
/*--------------view closing stock of last month transcation --------------------*/
opStockLast=0.0;
if(tranIdLast.trim().length() > 0)
{
......@@ -2213,11 +2222,20 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
/*-----------------------------------------------------------------*/
/*-------------------Purchase Return calculation for privious or current period------------------*/
sretQty=0.0;
replQty=0.0;
retQty=0.0;
returnLast=0.0;
sretSiteCode="";
sretLocCode="";
sretLotSl="";
retRepFlag="";
invStat="";
System.out.println("-------calculate Return Quantity for availble transcaion Id--------");
sql =" SELECT B.QUANTITY__STDUOM QUANTITY, B.ITEM_CODE ITEM_CODE, "
+ " A.SITE_CODE SITE_CODE, B.LOC_CODE LOC_CODE, "
......@@ -2232,7 +2250,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
+" and a.item_ser = ? ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1,custCodeHd);
pstmt2.setTimestamp(2,prdFrmDateTstmp );
pstmt2.setTimestamp(2,frmDateTstmp );
pstmt2.setTimestamp(3,toDateTstmp );
pstmt2.setString(4,itemCodeLast);
pstmt2.setString(5,siteCodeHd);
......@@ -2243,8 +2261,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
sretQty = rs2.getDouble("QUANTITY");
sretSiteCode = rs2.getString("SITE_CODE");
sretLocCode = rs2.getString("LOC_CODE");
sretLotNo = rs2.getString("LOT_NO");
......@@ -2313,10 +2329,13 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itemList.add(itemCodeLast);
System.out.println("salesLast :"+salesLast);
System.out.println("replQty :"+replQty);
System.out.println("replQty :"+replQty);
System.out.println("returnLast :"+returnLast);
System.out.println("receiptLast :"+receiptLast);
System.out.println("-------calculate Primary Sales for availble transcaion Id--------");
primarySales=0.0;
if(receiptLast > (returnLast + replQty) )
{
primarySales = receiptLast - returnLast + replQty;
......@@ -2325,10 +2344,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
primarySales = receiptLast;
}
System.out.println("primarySales cal for avaible transcation id :"+primarySales);
System.out.println("primarySales cal for avaible transcation id :"+primarySales);
......@@ -2363,11 +2379,11 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<purc_rcp>").append("<![CDATA["+receiptLast+"]]>").append("</purc_rcp>");
valueXmlString.append("<purc_rcp__repl>").append("<![CDATA["+rcpFreesLast+"]]>").append("</purc_rcp__repl>");
valueXmlString.append("<purc_rcp__free>").append("<![CDATA[0]]>").append("</purc_rcp__free>");
valueXmlString.append("<purc_rcp__free>").append("<![CDATA[0.0]]>").append("</purc_rcp__free>");
valueXmlString.append("<purc_ret>").append("<![CDATA["+returnLast+"]]>").append("</purc_ret>");
valueXmlString.append("<purc_ret__repl>").append("<![CDATA["+replQty+"]]>").append("</purc_ret__repl>");
valueXmlString.append("<purc_ret__free>").append("<![CDATA[0]]>").append("</purc_ret__free>");
valueXmlString.append("<purc_ret__free>").append("<![CDATA[0.0]]>").append("</purc_ret__free>");
valueXmlString.append("<sales>").append("<![CDATA["+salesLast+"]]>").append("</sales>");
valueXmlString.append("<cl_stock protect='0'>").append("<![CDATA["+clStockNew+"]]>").append("</cl_stock>");
......@@ -2376,7 +2392,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<transit_qty>").append("<![CDATA["+transitQty+"]]>").append("</transit_qty>");
valueXmlString.append("<transit_qty__repl>").append("<![CDATA["+transitQtyFreesLast+"]]>").append("</transit_qty__repl>");
valueXmlString.append("<transit_qty__free>").append("<![CDATA[0]]>").append("</transit_qty__free>");
valueXmlString.append("<transit_qty__free>").append("<![CDATA[0.0]]>").append("</transit_qty__free>");
valueXmlString.append("<primary_sales>").append("<![CDATA["+primarySales+"]]>").append("</primary_sales>");
valueXmlString.append("</Detail4>");
......@@ -2395,26 +2411,28 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
//}
// commented code
System.out.println("coding for those item code which is other than previos item code,start !!!!!!!!!!!!!!!");
System.out.println("-----coding for those item code which is other than previos item code,start !!!!!!!!!!!!!!!");
//coding for those item code which is other than previos item code,start
ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
/* ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ToDate form 3 : "+ToDate);
if(fromdate != null)
{
FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
System.out.println("FromDate form 3 : "+FromDate);
System.out.println("FromDate form 3 : "+FromDate);*/
tranDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(tranDateHd, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
frmDateTstmp=FromDate;
toDateTstmp=ToDate;
//frmDateTstmp=FromDate;
//toDateTstmp=ToDate;
orderDtTstmp=java.sql.Timestamp.valueOf(genericUtility.getValidDateString(tranDateHd, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("------retrive Item data which is not exist in last month or current moth transcation !!!!");
defData = getItemFromCust(custCodeHd,itemSerHd,tranIdLast,tranIdNew,selectedInvList,conn);
......@@ -2455,7 +2473,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itemSerDet = ( new DistCommon() ).getItemSer( itemCode, siteCodeHd, tranDtTstmp, custCodeHd, "C", conn );
System.out.println("itemSerDet :"+itemSerDet);
descrItem="";
unitItem="";
locTypeItem="";
rate=0.0;
sql = "Select descr, unit, loc_type ,sale_rate from item "
+" where item_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -2479,15 +2500,17 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
//rcpQty = GetRcpQty(custCodeHd,tranIdLast,orderType,selectedInvList,prdFrmDateTstmp,toDateTstmp,itemCode,itemSerHd,conn);
//rcpQty = GetRcpQty(custCodeHd,tranIdLast,orderType,selectedInvList,prdFrmDateTstmp,toDateTstmp,itemCode,itemSerHd,conn);
System.out.println("-- calculate recipt quantity which is not available for last or current month transcation !!!");
rcpQty=0.0;
rcpQty = GetRcpQty(selectedInvList,itemCode,conn);
System.out.println("Receipt quantity for not available in last or current tranaction"+"itemCode :"+itemCode +"Receipt Quantity :"+rcpQty);
// rcpQtyBon = GetRcpFreeQty( custCodeHd,tranIdLast,orderType,prdFrmDateTstmp, toDateTstmp,itemCode,itemSerHd, conn) ;
// System.out.println("rcpQtyBon :"+rcpQtyBon);
rcpBonAll = GetRcpBonQty(selectedInvList,itemCode,conn) ;
System.out.println("rcpBonAll :"+rcpBonAll);
//rcpBonAll=0.0;
//rcpBonAll = GetRcpBonQty(selectedInvList,itemCode,conn) ;
//System.out.println("rcpBonAll :"+rcpBonAll);
System.out.println("-- calculate Recipt Frees quantity which is not available for last or current month transcation !!!");
rcpFreesAll=0.0;
rcpFreesAll = GetFreeQty(selectedInvList,itemCode,conn) ;
System.out.println("rcpFreesAll :"+rcpFreesAll);
......@@ -2496,6 +2519,17 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("--------calculate All purchase return which other than previous or current transcation item code---------- ");
sretQtyAll=0.0;
retQtyAll=0.0;
replQtyAll=0.0;
sretQtyAllTot=0.0;
retRepFlagAll="";
sretSiteCodeAll="";
sretLocCodeAll="";
sretLotSlAll="";
invStat="";
sql =" SELECT B.QUANTITY__STDUOM QUANTITY, B.ITEM_CODE ITEM_CODE, "
+ " A.SITE_CODE SITE_CODE, B.LOC_CODE LOC_CODE, "
+ " B.LOT_NO LOT_NO, B.LOT_SL LOT_SL, B.RET_REP_FLAG RET_REP_FLAG "
......@@ -2509,7 +2543,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
+" and a.item_ser = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCodeHd);
pstmt.setTimestamp(2,prdFrmDateTstmp );
//pstmt.setTimestamp(2,prdFrmDateTstmp );frmDateTstmp
pstmt.setTimestamp(2,frmDateTstmp );
pstmt.setTimestamp(3,toDateTstmp );
pstmt.setString(4,itemCode);
pstmt.setString(5,siteCodeHd);
......@@ -2592,6 +2627,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("sretQtyAll :"+sretQtyAll);
System.out.println("replQtyAll :"+replQtyAll);
System.out.println("--calculate primary sales which is not included for current or previous month transcation------");
primarySalesAll=0.0;
if(rcpQty > (sretQtyAllTot + replQtyAll))
{
primarySalesAll = rcpQty - sretQtyAllTot + replQtyAll;
......@@ -2600,17 +2637,18 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
primarySalesAll = rcpQty;
}
System.out.println("Primary Sales for not available in last or current tranaction"+"itemCode :"+itemCode +"primarySales :"+primarySales);
System.out.println("--calculate Transit Quantoty which is not included for current or previous month transcation------");
transitQty=0.0;
transitQty=GetTransitQty(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("Transit quantity for not available in last or current tranaction"+"itemCode :"+itemCode +"Transit Quantity :"+transitQty);
transitQtyBon=GetTransitBon(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("transitQtyBon :"+transitQtyBon);
//transitQtyBon=0.0;
//transitQtyBon=GetTransitBon(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
//System.out.println("transitQtyBon :"+transitQtyBon);
System.out.println("--calculate Transit Frees Quantoty which is not included for current or previous month transcation------");
transitQtyFrees=0.0;
transitQtyFrees=GetTransitFrees(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("transitQtyFrees :"+transitQtyFrees);
......@@ -2618,7 +2656,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rateAll=0.0;
rateAll = getRate(custCodeHd,tranDate,itemCode,conn);
System.out.println("rateAll :"+rateAll);
System.out.println("Rate for not available in last or current tranaction"+"itemCode :"+itemCode +"rate :"+rate);
......@@ -2696,16 +2734,16 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<purc_rcp>").append("<![CDATA["+itemMap.get("mquantRcp@"+itemDomId)+"]]>").append("</purc_rcp>");
valueXmlString.append("<purc_rcp__repl>").append("<![CDATA["+itemMap.get("rcpFreesAll@"+itemDomId)+"]]>").append("</purc_rcp__repl>");
valueXmlString.append("<purc_rcp__free>").append("<![CDATA[0]]>").append("</purc_rcp__free>");
valueXmlString.append("<purc_rcp__free>").append("<![CDATA[0.0]]>").append("</purc_rcp__free>");
valueXmlString.append("<purc_ret>").append("<![CDATA["+itemMap.get("mquant@"+itemDomId)+"]]>").append("</purc_ret>");
valueXmlString.append("<purc_ret__repl >").append("<![CDATA["+itemMap.get("replQty@"+itemDomId)+"]]>").append("</purc_ret__repl>");
valueXmlString.append("<purc_ret__free >").append("<![CDATA[0]]>").append("</purc_ret__free>");
valueXmlString.append("<purc_ret__free >").append("<![CDATA[0.0]]>").append("</purc_ret__free>");
valueXmlString.append("<sales>").append("<![CDATA["+itemMap.get("msalesQty@"+itemDomId)+"]]>").append("</sales>");
valueXmlString.append("<transit_qty>").append("<![CDATA["+itemMap.get("transitQty@"+itemDomId)+"]]>").append("</transit_qty>");
valueXmlString.append("<transit_qty__free>").append("<![CDATA[0]]>").append("</transit_qty__free>");
valueXmlString.append("<transit_qty__free>").append("<![CDATA[0.0]]>").append("</transit_qty__free>");
valueXmlString.append("<transit_qty__repl>").append("<![CDATA["+itemMap.get("transitQtyFrees@"+itemDomId)+"]]>").append("</transit_qty__repl>");
valueXmlString.append("<primary_sales>").append("<![CDATA["+itemMap.get("primarySales@"+itemDomId)+"]]>").append("</primary_sales>");
......@@ -3105,7 +3143,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
/*-------------------------------------------------------------------------------------------------*/
private double GetTransitBon(String custCode, String orderType, String itemSer,String siteCode,String selectedInvList,String itemCode,java.sql.Timestamp fromDate, java.sql.Timestamp toDate,java.sql.Timestamp prdFrom, java.sql.Timestamp prdTo, Connection conn) throws Exception
/*private double GetTransitBon(String custCode, String orderType, String itemSer,String siteCode,String selectedInvList,String itemCode,java.sql.Timestamp fromDate, java.sql.Timestamp toDate,java.sql.Timestamp prdFrom, java.sql.Timestamp prdTo, Connection conn) throws Exception
{
NodeList parentNodeList=null;
NodeList childList = null;
......@@ -3185,11 +3223,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
//if(!(stockDlvFlg.equalsIgnoreCase("Y")))
if(dlvFlgTransit == 0)
{
/*System.out.println("transit invoice :"+invoiceId);
quantity = rs.getDouble("QUANTITY__STDUOM");
System.out.println("inv qty :"+quantity);
transitQty = transitQty + quantity;*/
if(selectedInvList.trim().length() > 0)
{
invoiceIdArray = selectedInvList.split(",");
......@@ -3254,7 +3288,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
System.out.println("bonusQty for transit :"+bonusQty);
return bonusQty ;
}
}*/
private double GetTransitFrees(String custCode, String orderType, String itemSer,String siteCode,String selectedInvList,String itemCode,java.sql.Timestamp fromDate, java.sql.Timestamp toDate,java.sql.Timestamp prdFrom, java.sql.Timestamp prdTo, Connection conn) throws Exception
......@@ -3279,7 +3313,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
// transit quantity for those which are included in period also for dlv flag 'N'
System.out.println("----calculate Transit Frees Quantity------------------");
sql = " select idet.QUANTITY__STDUOM,idet.invoice_id,idet.item_code from " +
"invdet idet where idet.item_code= ? and idet.invoice_id in " +
......@@ -3317,7 +3351,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
invoiceId = rs.getString("invoice_id");
System.out.println("invoiceId :"+invoiceId);
stockDlvFlg="N";
sql= "select count(*) as count from cust_stock_inv where invoice_id=? and dlv_flg='Y' ";
pstmt2 = conn.prepareStatement(sql);
......@@ -3342,19 +3376,19 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("inv qty :"+quantity);
transitQty = transitQty + quantity;*/
if(selectedInvList.trim().length() > 0)
/* if(selectedInvList.trim().length() > 0)
{
invoiceIdArray = selectedInvList.split(",");
*/
for (int i = 0; i < invoiceIdArray.length ;i++)
/*for (int i = 0; i < invoiceIdArray.length ;i++)
{
System.out.println(invoiceIdArray[i]);
invoiceSep = invoiceIdArray[i];
invoiceId = invoiceSep.replace("'", "");
System.out.println(invoiceId);
System.out.println(invoiceId);*/
sql = "select nature,quantity__stduom from sorddet where sale_order " +
......@@ -3381,9 +3415,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt3 = 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