Commit 281521ac authored by ngadkari's avatar ngadkari

dispatch entry for Non Inventory Item.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186746 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2bf680ec
......@@ -1726,14 +1726,15 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
HashMap<String, HashMap> mainInvDespDetMap=new HashMap<String, HashMap>();
HashMap<String, Object> invDetBeanMap= new HashMap<String, Object>();
HashMap<String, String> stockDetMap=new HashMap<String, String>();
String invDespDetSql="",mFrDespDt="",mToDespDt="",lsAcctSchemedet="",lsFinscheme="",lsCustitemRef="",mfgDtStr="",ldExpDtStr="",ld_mfg_date = "",ld_exp_date = "";
String invDespDetSql="",mFrDespDt="",mToDespDt="",lsAcctSchemedet="",lsFinscheme="",lsCustitemRef="",mfgDtStr="",ldExpDtStr="",ld_mfg_date = "",ld_exp_date = "",ld_mfg_date1 = "",ld_exp_date1 = "";
String invDespDetStockSql="",site_code__mfg="",stk_opt="";
double lcDiscAmt=0.0,mTotDespQty=0.0,mTotStdQty=0.0,mRealQty=0.0;
int mNoArt=0,schemeCount=0,finSchemeCount = 0;
String desp_id="",line_no="",sord_no="", preSordNo = "",line_no__sord="",exp_lev="",item_code__ord="",item_code="",lot_no="",lot_sl="",quantity__ord="";
String quantity="",loc_code="",desp_conv__qty_stduom="",desp_unit__std="",unit="",desp_quantity__stduom="",tax_class="",tax_chap="",tax_env="";
String discount="",unit__rate="",sord_conv__qty_stduom="",conv__rtuom_stduom="",sord_unit__std="",sord_quantity__stduom="",sord_rate__stduom="";
String rate="",quantity_real="",quantity_inv="",invoice_id="",no_art="",rate__clg="",desp_rate__stduom="",disc_amt="",cust_item__ref="";
String disc_schem_billback_amt="",disc_schem_offinv_amt="",retString="";
String disc_schem_billback_amt="",disc_schem_offinv_amt="",retString="",site_code="";
double totalCommSp1=0.0,totalCommSp2=0.0,totalCommSp3=0.0,totalCommAmt=0.0;
double lc_desp_std_rate=0.0,totAmount = 0,costRate=0,rateStd = 0;
PreparedStatement pstmt=null, pstmt1 = null;
......@@ -1747,7 +1748,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
InvoiceDetBean invoiceDetBean= null;
try
{
invDespDetSql="SELECT despatchdet.desp_id,despatchdet.line_no,despatchdet.sord_no,despatchdet.line_no__sord,despatchdet.exp_lev,"
/*invDespDetSql="SELECT despatchdet.desp_id,despatchdet.line_no,despatchdet.sord_no,despatchdet.line_no__sord,despatchdet.exp_lev,"
+ "despatchdet.item_code__ord,despatchdet.item_code,despatchdet.lot_no,despatchdet.lot_sl,despatchdet.quantity__ord,"
+ "despatchdet.quantity,despatchdet.loc_code,despatchdet.status,despatchdet.conv__qty_stduom,despatchdet.unit__std,"
+ "despatchdet.unit,despatchdet.quantity__stduom as dquantity__stduom,despatchdet.tax_class,despatchdet.tax_chap,despatchdet.tax_env,"
......@@ -1773,15 +1774,40 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
//+ " AND( DESPATCHDET.SORD_NO = ?)"
+ " AND( DESPATCHDET.DESP_ID >= ?)"
+ " AND( DESPATCHDET.DESP_ID <= ? ) )"
+ " ORDER BY despatchdet.sord_no ASC,despatchdet.line_no__sord ASC,despatchdet.exp_lev ASC";*/// commented by nandkumar gadkari ON 20/06/18
//changes in sql by nandkumar gadkari on 20/06/18
invDespDetSql="SELECT despatchdet.desp_id,despatchdet.line_no,despatchdet.sord_no,despatchdet.line_no__sord,despatchdet.exp_lev,"
+ "despatchdet.item_code__ord,despatchdet.item_code,despatchdet.lot_no,despatchdet.lot_sl,despatchdet.quantity__ord,"
+ "despatchdet.quantity,despatchdet.loc_code,despatchdet.status,despatchdet.conv__qty_stduom,despatchdet.unit__std,"
+ "despatchdet.unit,despatchdet.quantity__stduom as dquantity__stduom,despatchdet.tax_class,despatchdet.tax_chap,despatchdet.tax_env,"
+ "sorddet.discount,sorddet.unit__rate,sorddet.conv__qty_stduom,sorddet.conv__rtuom_stduom,sorddet.unit__std,"
+ "sorddet.quantity__stduom as squantity__stduom,sorddet.rate__stduom as srate__stduom,sorddet.rate,despatchdet.quantity_real,despatchdet.quantity_inv,"
+ "despatchdet.invoice_id,despatchdet.no_art,despatchdet.rate__clg,despatchdet.rate__stduom as drate__stduom ,despatchdet.disc_amt,"
+ "despatchdet.cust_item__ref,despatchdet.disc_schem_billback_amt,despatchdet.disc_schem_offinv_amt, sorditem.nature, "
+ " (case when despatchdet.rate__std is null then 0 else despatchdet.rate__std end ) as rate__std,"
+ " (case when despatchdet.cost_rate is null then 0 else despatchdet.cost_rate end ) as cost_rate, sorddet.ITEM_DESCR,"
+ "item.stk_opt,sorditem.site_code"
+ " FROM despatchdet,sorddet, sorditem ,item"
+ " WHERE ( despatchdet.sord_no = sorddet.sale_order )"
+ " and( despatchdet.line_no__sord = sorddet.line_no )"
+ " and( sorditem.sale_order = sorddet.sale_order )"
+ " and( sorditem.line_no = sorddet.line_no )"
+ " and( sorditem.exp_lev = despatchdet.exp_lev )"
+ " and item.item_code = despatchdet.item_code "
+ " and( ( case when DESPATCHDET.STATUS is null then ' ' else despatchdet.STATUS end = ? )"
+ " AND( DESPATCHDET.DESP_ID >= ?)"
+ " AND( DESPATCHDET.DESP_ID <= ? ) )"
+ " ORDER BY despatchdet.sord_no ASC,despatchdet.line_no__sord ASC,despatchdet.exp_lev ASC";
pstmt=conn.prepareStatement(invDespDetSql);
pstmt.setString(1,status);
//pstmt.setString(2,sordNo);
pstmt.setString(2,despId);
pstmt.setString(3,despId);
rs=pstmt.executeQuery();
while(rs.next())
{
invTraceMap=new HashMap<String, String>();
desp_id=checknull(rs.getString("desp_id"));
......@@ -1841,32 +1867,64 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
disc_schem_offinv_amt=checknull(rs.getString("disc_schem_offinv_amt"));
lsLineType=checknull(rs.getString("nature"));
ld_mfg_date=rs.getString("mfg_date");
ld_exp_date=rs.getString("exp_date");
/*ld_mfg_date=rs.getString("mfg_date");
ld_exp_date=rs.getString("exp_date");*/// commented by nandkumar gadkari
site_code=checknull(rs.getString("site_code"));//added by nandkumar gadkari on 20/06/18
stk_opt=checknull(rs.getString("stk_opt"));//added by nandkumar gadkari on 20/06/18
costRate=rs.getDouble("cost_rate");
rateStd = rs.getDouble("rate__std");
invTraceMap.put("rate__std", "" + rateStd);
invTraceMap.put("cost_rate", "" + costRate);
invTraceMap.put("disc_amt", rs.getString("disc_amt"));
invTraceMap.put("item_descr", rs.getString("item_descr"));
////changes by nandkumar gadkari on 20/06/18----------------------Start------------------------------ for stk_opt <>0 item ---------
if (!"0".equalsIgnoreCase(stk_opt.trim()))
{
invDespDetStockSql="select site_code__mfg,mfg_date, exp_date from stock where item_code = ? and site_code =? and loc_code = ? "
+ "and lot_no = ? and lot_sl = ? ";
if(ld_mfg_date!=null)
pstmt1=conn.prepareStatement(invDespDetStockSql);
pstmt1.setString(1,item_code);
pstmt1.setString(2,site_code);
pstmt1.setString(3,loc_code);
pstmt1.setString(4,lot_no);
pstmt1.setString(5,lot_sl);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
site_code__mfg=checknull(rs1.getString("site_code__mfg"));
ld_mfg_date=rs1.getString("mfg_date");
ld_exp_date=rs1.getString("exp_date");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
/*if(ld_mfg_date!=null)
{
ld_mfg_date=genericUtility.getValidDateString(rs.getString("mfg_date"), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
}
if(ld_exp_date!=null)
{
ld_exp_date=genericUtility.getValidDateString(rs.getString("exp_date"), genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
}*/ //commented by nandkumar
if(ld_mfg_date!=null)
{
ld_mfg_date1=genericUtility.getValidDateString(ld_mfg_date, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
}
if(ld_exp_date!=null)
{
ld_exp_date1=genericUtility.getValidDateString(ld_exp_date, genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
}
}
//Timestamp ld_exp_date = rs.getTimestamp("exp_date");
//System.out.println("@@@@@@@@@ ld_mfg_date["+ld_mfg_date+"]ld_exp_date["+ld_exp_date+"]");
stockDetMap=new HashMap<String, String>();
stockDetMap.put("ls_site_code__mfg", checknull(rs.getString("site_code__mfg")));
stockDetMap.put("ld_mfg_date", ld_mfg_date);
stockDetMap.put("ld_exp_date", ld_exp_date);
stockDetMap.put("ls_site_code__mfg",/* checknull(rs.getString("site_code__mfg"))*/site_code__mfg );
stockDetMap.put("ld_mfg_date", ld_mfg_date1);
stockDetMap.put("ld_exp_date", ld_exp_date1);
////changes by nandkumar gadkari on 20/06/18----------------------end ------------------------------ for stk_opt <>0 item ---------
if(disc_schem_offinv_amt == null || disc_schem_offinv_amt.trim().length()==0)
{
......
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