Commit b7a3ffa8 authored by rsharma's avatar rsharma

DI90SUN059- DI90SUN060 increase speed of packlist and set proper grossweight ,netweight,tareweight.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91324 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6348f95f
......@@ -473,6 +473,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append("<alloc_qty>").append("<![CDATA[").append(stkAllocQty).append("]]>").append("</alloc_qty>\r\n");
valueXmlString.append("<no_art>").append("<![CDATA[").append(stkNoArt).append("]]>").append("</no_art>\r\n");
valueXmlString.append("<rate>").append("<![CDATA[").append(stkRate).append("]]>").append("</rate>\r\n");
setNodeValue( dom, "rate", stkRate );
valueXmlString.append("</Detail>\r\n");
}
}//end While loop
......@@ -1089,21 +1090,30 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "sord_no", (sordNo == null) ? "":sordNo );
valueXmlString.append("<line_no__sord isSrvCallOnChg='0'>").append(lineNoSord).append("</line_no__sord>"); //chg1
setNodeValue( dom, "line_no__sord", (lineNoSord == null) ? "":lineNoSord );
lineNoSord = getChangeSord(dom, dom1, "line_no__sord", xtraParams ,conn);
valueXmlString.append(lineNoSord); /// 16-08
//lineNoSord = getChangeSord(dom, dom1, "line_no__sord", xtraParams ,conn);
//valueXmlString.append(lineNoSord); /// 16-08
valueXmlString.append("<exp_lev isSrvCallOnChg='0'>").append(expLevel).append("</exp_lev>");
setNodeValue( dom, "exp_lev", (expLevel == null) ? "":expLevel );
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode.trim()).append("]]>").append("</item_code>\r\n");
setNodeValue( dom, "item_code", (itemCode == null) ? "":itemCode );
valueXmlString.append("<item_code__ord isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCodeOrd).append("]]>").append("</item_code__ord>\r\n");
setNodeValue( dom, "item_code__ord", (itemCodeOrd == null) ? "":itemCodeOrd );
valueXmlString.append("<item_descr isSrvCallOnChg='0'>").append("<![CDATA[").append(itemDescr).append("]]>").append("</item_descr>\r\n");
setNodeValue( dom, "item_descr", (itemDescr == null) ? "":itemDescr );
valueXmlString.append("<quantity__ord isSrvCallOnChg='0'>").append("<![CDATA[").append(orderedQty).append("]]>").append("</quantity__ord>\r\n");
setNodeValue( dom, "quantity__ord", orderedQty);
valueXmlString.append("<site_code isSrvCallOnChg='0'>").append("<![CDATA[").append(siteCodeDet).append("]]>").append("</site_code>\r\n");
setNodeValue( dom, "site_code", (siteCodeDet == null) ? "":siteCodeDet );
valueXmlString.append("<quantity_real isSrvCallOnChg='0'>").append("<![CDATA[").append(balQty).append("]]>").append("</quantity_real>\r\n");
setNodeValue( dom, "quantity_real", balQty );
valueXmlString.append("<unit isSrvCallOnChg='0'>").append("<![CDATA[").append(unit1).append("]]>").append("</unit>\r\n");
setNodeValue( dom, "unit", unit1 );
valueXmlString.append("<unit__std isSrvCallOnChg='0'>").append("<![CDATA[").append(unitStd1).append("]]>").append("</unit__std>\r\n");
setNodeValue( dom, "unit__std", unitStd1 );
valueXmlString.append("<conv__qty_stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(convQtyStduom).append("]]>").append("</conv__qty_stduom>\r\n");
setNodeValue( dom, "conv__qty_stduom", convQtyStduom );
valueXmlString.append("<conv__rtuom_stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(netWtPerArt).append("]]>").append("</conv__rtuom_stduom>\r\n");
setNodeValue( dom, "conv__rtuom_stduom", netWtPerArt );
valueXmlString.append("<pallet_wt isSrvCallOnChg='0'>").append("<![CDATA[").append(palletWt).append("]]>").append("</pallet_wt>\r\n");
//loc_code isSrvCallOnChg='0' to loc_code isSrvCallOnChg='1' by msalam on 051108 as rate__clg was not coming
valueXmlString.append("<loc_code isSrvCallOnChg='0'>").append(locCode).append("</loc_code>");
......@@ -1131,6 +1141,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
//valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(rateClg).append("]]>").append("</rate__clg>\r\n");
valueXmlString.append("<quantity isSrvCallOnChg='0'>").append(balQty).append("</quantity>");
setNodeValue( dom, "quantity", balQty );
valueXmlString.append("<tax_class isSrvCallOnChg='0'>").append("<![CDATA[").append((taxClass == null) ?"":taxClass).append("]]>").append("</tax_class>\r\n");
valueXmlString.append("<tax_chap isSrvCallOnChg='0'>").append("<![CDATA[").append((taxChap == null) ?"":taxChap).append("]]>").append("</tax_chap>\r\n");
valueXmlString.append("<tax_env isSrvCallOnChg='0'>").append("<![CDATA[").append((taxEnv == null) ?"":taxEnv).append("]]>").append("</tax_env>\r\n");
......@@ -1138,8 +1149,8 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "lot_sl", (lotSl == null) ? "":lotSl );
valueXmlString.append("<lot_no isSrvCallOnChg='0'>").append(lotNo).append("</lot_no>");//chg2
setNodeValue( dom, "lot_no", (lotNo == null) ? "":lotNo );
lotNo = getChangeSord(dom, dom1, "lot_no", xtraParams ,conn);
valueXmlString.append(lotNo); ///// 16-08
//lotNo = getChangeSord(dom, dom1, "lot_no", xtraParams ,conn);
//valueXmlString.append(lotNo); ///// 16-08
// 27/06/09 manoharan set the mfg_date and exp_date from stock
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if (expDate != null)
......@@ -1152,6 +1163,10 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
smfgDate = sdf.format(mfgDate).toString();
valueXmlString.append("<mfg_date isSrvCallOnChg='0'>").append(smfgDate).append("</mfg_date>");
}
lineNoSord = getChangeSord(dom, dom1, "line_no__sord", xtraParams ,conn);
valueXmlString.append(lineNoSord); /// 16-08
lotNo = getChangeSord(dom, dom1, "lot_no", xtraParams ,conn);
valueXmlString.append(lotNo); ///// 16-08
// end 27/06/09 manoharan set the mfg_date and exp_date from stock
valueXmlString.append("</Detail>");
/*
......@@ -3455,7 +3470,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
System.out.println("sql1 :"+sql1);
stmt1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs1 = stmt1.executeQuery(sql1);
//if(!rs1.next()) 11-08-10 big Change for Default button
if(!rs1.next())
{
if(locCode == null || locCode.trim().length() == 0)
......@@ -3810,9 +3825,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
{
//start change 10-08-2010
System.out.println("palletWt.."+palletWt);
System.out.println("qtyStk.."+qtyStk+"..grossWeight.."+grossWeight+"..grossWtPerArt.."+grossWtPerArt);
System.out.println("netWeight.."+netWeight+"..tareWeight.."+tareWeight+"..tareWtPerArt.."+tareWtPerArt);
if (qtyStk > 0)
{
grossPer = (grossWeight / qtyStk) ;
......@@ -4169,7 +4182,16 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append("<tax_class isSrvCallOnChg='0'>").append("<![CDATA[").append((taxClass == null) ?"":taxClass).append("]]>").append("</tax_class>\r\n");
valueXmlString.append("<tax_chap isSrvCallOnChg='0'>").append("<![CDATA[").append((taxChap == null) ?"":taxChap).append("]]>").append("</tax_chap>\r\n");
valueXmlString.append("<tax_env isSrvCallOnChg='0'>").append("<![CDATA[").append((taxEnv == null) ?"":taxEnv).append("]]>").append("</tax_env>\r\n");
// 18-08 change
lineNoOrd = getChangeSord(dom, dom1, "line_no__sord", xtraParams ,conn); // chg4
valueXmlString.append(lineNoOrd);
expLev = getChangeSord(dom, dom1, "exp_lev", xtraParams ,conn); // chg5
valueXmlString.append(expLev);
lotNo = getChangeSord(dom, dom1, "lot_no", xtraParams ,conn); // chg7 16-08
valueXmlString.append(lotNo);
lotSl = getChangeSord(dom, dom1, "lot_no", xtraParams ,conn); // chg8 16-08
valueXmlString.append(lotSl);
//end change
valueXmlString.append("</Detail>\r\n");
// End Addition - Piyush - 24/12/07
System.out.println( "Ic Str shb :: " + valueXmlString.toString() );
......@@ -4250,18 +4272,18 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
//valueXmlString.append("<lot_no isSrvCallOnChg='0'>").append("<![CDATA[").append(lotNo.trim()).append("]]>").append("</lot_no>\r\n");
//System.out.println( "lotNo :: " + lotNo.trim() );
valueXmlString.append("<line_no__sord isSrvCallOnChg='0'>").append("<![CDATA[").append(lineNoOrd.trim()).append("]]>").append("</line_no__sord>\r\n");
setNodeValue( dom, "line_no__sord", (lineNoOrd == null) ? "":lineNoOrd.trim() );
valueXmlString.append("<line_no__sord isSrvCallOnChg='0'>").append("<![CDATA[").append(lineNoOrd).append("]]>").append("</line_no__sord>\r\n");
setNodeValue( dom, "line_no__sord", (lineNoOrd == null) ? "":lineNoOrd );
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode.trim()).append("]]>").append("</item_code>\r\n");
setNodeValue( dom, "item_code", (itemCode == null) ? "":itemCode.trim() );
valueXmlString.append("<item_code isSrvCallOnChg='0'>").append("<![CDATA[").append(itemCode).append("]]>").append("</item_code>\r\n");
setNodeValue( dom, "item_code", (itemCode == null) ? "":itemCode );
//Un-Commented and made isSrvCallOnChg='1' - Gulzar 15/03/07
valueXmlString.append("<exp_lev isSrvCallOnChg='0'>").append("<![CDATA[").append(expLev.trim()).append("]]>").append("</exp_lev>\r\n"); //Un-Commented and made isSrvCallOnChg='1' - Gulzar 15/03/07
setNodeValue( dom, "exp_lev", (expLev == null) ? "":expLev.trim() );
valueXmlString.append("<exp_lev isSrvCallOnChg='0'>").append("<![CDATA[").append(expLev).append("]]>").append("</exp_lev>\r\n"); //Un-Commented and made isSrvCallOnChg='1' - Gulzar 15/03/07
setNodeValue( dom, "exp_lev", (expLev == null) ? "":expLev );
//for test by msalam
valueXmlString.append("<loc_code isSrvCallOnChg='0'>").append("<![CDATA[").append(locCode.trim()).append("]]>").append("</loc_code>\r\n"); //Made isSrvCallOnChg='1' - Gulzar 15/03/07 - For seting of mfg_date and exp_date
setNodeValue( dom, "loc_code", (locCode == null) ? "":locCode.trim() );
valueXmlString.append("<loc_code isSrvCallOnChg='0'>").append("<![CDATA[").append(locCode).append("]]>").append("</loc_code>\r\n"); //Made isSrvCallOnChg='1' - Gulzar 15/03/07 - For seting of mfg_date and exp_date
setNodeValue( dom, "loc_code", (locCode == null) ? "":locCode );
valueXmlString.append("<quantity_real isSrvCallOnChg='0'>").append("<![CDATA[").append(inputQty).append("]]>").append("</quantity_real>\r\n");
valueXmlString.append("<quantity__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(inputQty * convQtyStduom).append("]]>").append("</quantity__stduom>\r\n");
......@@ -4285,7 +4307,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append("<site_code__mfg isSrvCallOnChg='0'>").append("<![CDATA[").append(siteCodeMfg).append("]]>").append("</site_code__mfg>\r\n");
setNodeValue( dom, "site_code__mfg", (siteCodeMfg == null) ? "":siteCodeMfg );
/////
///
lineNoOrd = getChangeSord(dom, dom1, "line_no__sord", xtraParams ,conn); // chg9
valueXmlString.append(lineNoOrd);
expLev = getChangeSord(dom, dom1, "exp_lev", xtraParams ,conn); // chg9
......@@ -4295,6 +4317,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append(lotNo);
lotSl = getChangeSord(dom, dom1, "lot_sl", xtraParams ,conn); // chg12 16-08
valueXmlString.append(lotSl);
/*
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStduomrt).append("]]>").append("</rate__stduom>\r\n");
*/
......@@ -5477,13 +5500,15 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
String str = "" ,itemCodeOrd ="",saleord ="",saleordLine="" ,lineNoSord="" ,sItemRate = "";
double nettWeight = 0, sordExcRate = 0,sordQuantity =0;
double tareWeight = 0,qtyPerArt = 0,stcrate = 0, grossWeightArt = 0,tareWeightArt = 0, palletWt = 0;
String packInstr = "",dimension = "",expDate = "", mfgDate = "", siteMfg ="",retestDate ="";
String packInstr = "",dimension = "",siteMfg ="";
String trackShelfLife = "",stkOpt = "" ,explev ="" ,priceList ="" ,priceListClg ="" ,sDespDate="";
String priceListParent ="",sConv="" ,nature="" ,packCode="" ,sDiscAmt="" ,sRateStd="";
double pickRate = 0 ,conv =0 ,priceRateClg =0 ,pickRateClg =0 ,mNum3 =0 ,rate=0,sordRate=0;
double rateStduom = 0;
Timestamp despDate =null;
double rateStduom = 0 ,qty1=0 ,rateStduom1 = 0;
DecimalFormat df = new DecimalFormat("#########.###");
Timestamp despDate =null ,expDate = null ,mfgDate=null,retestDate=null;
int count = 0;
String sExpDate ="" ,sMfgDate="" ,sRetestDate="";
ArrayList arrList = new ArrayList();
......@@ -5497,7 +5522,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
try
{
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if(currentColumn !=null || currentColumn.trim().length() > 0)
{
if(currentColumn.equalsIgnoreCase("line_no__sord"))
......@@ -5512,7 +5537,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
pstmt.setString(2,mcode);
System.out.println("sql...... :");
rs = pstmt.executeQuery();
if(rs.next())
{
......@@ -5531,6 +5556,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
//rateStd = df.parse(df.format(rateStd)).doubleValue();
if(custItemCodeRef == null || custItemCodeRef.trim().length() ==0) ///&&
{
custCode = genericUtility.getColumnValue("cust_code",dom1);
......@@ -5646,7 +5672,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
System.out.println("sqlddd..item_code__ord:"+itemCode+"..quantity.."+mNum+"..exp_lev.."+mdescr1+"..item_code.."+itemCode);
sql = "Select unit__std, conv__qty_stduom, unit, pack_instr, (case when no_art is null then 0 else no_art end) "
+" from sorddet where sale_order = ? and line_no = ?";
pstmt = conn.prepareStatement(sql);
......@@ -5718,7 +5744,6 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "lot_no", (mdescr3 == null) ? "" : mdescr3 );
mloc = genericUtility.getColumnValue("lot_sl",dom);
System.out.println("lot_sl.."+mloc);
if(mdescr4 == null || mdescr4.trim().length() ==0)
{
......@@ -5752,8 +5777,6 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "discount", (mdiscount == null) ? "" : mdiscount );
arrList = distCommon.getConvQuantityFact(mUnit, mstunit, itemCode, mNum, mNum2 , conn); // arraylist
//conv = ((Double)qty.get(1)).doubleValue();
System.out.println("arrList... "+arrList);
mNum3 = Double.parseDouble(arrList.get(1).toString());
valueXmlString.append("<quantity__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(mNum3).append("]]>").append("</quantity__stduom>\r\n");
......@@ -5873,6 +5896,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
if("A".equalsIgnoreCase(priceVar))
{
rateStd = itemRate - (diffRate * ( itemRate / totRate) );
//rateStd = df.parse(df.format(rateStd)).doubleValue();
discAmt = diffRate * ( itemRate / totRate);
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStd).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", rateStd );
......@@ -5884,6 +5908,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
else if("D".equalsIgnoreCase(priceVar))
{
discAmt = diffRate * ( itemRate / totRate);
//itemRate = df.parse(df.format(itemRate)).doubleValue();
valueXmlString.append("<disc_amt isSrvCallOnChg='0'>").append("<![CDATA[").append(discAmt).append("]]>").append("</disc_amt>\r\n");
setNodeValue( dom, "discount", (mdiscount == null) ? "" : mdiscount );
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(itemRate).append("]]>").append("</rate__stduom>\r\n");
......@@ -5911,7 +5936,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
//effCost = df.parse(df.format(effCost)).doubleValue();
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(effCost).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", effCost );
valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(effCost).append("]]>").append("</rate__clg>\r\n");
......@@ -6087,7 +6112,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "unit", (mUnit == null) ? "" : mUnit );
arrList = distCommon.getConvQuantityFact(mUnit, mstunit, mdescr1, mNum, mNum2 , conn);
System.out.println("arrList2222 "+arrList);
System.out.println("arrList "+arrList);
mNum3 = Double.parseDouble(arrList.get(1).toString());
valueXmlString.append("<quantity__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(mNum3).append("]]>").append("</quantity__stduom>\r\n");
setNodeValue( dom, "quantity__stduom", mNum3 );
......@@ -6254,8 +6279,10 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
diffRate = totRate - rateStd;
if("A".equalsIgnoreCase(priceVar))
{
rateStd = itemRate - (diffRate * ( itemRate / totRate) );
//rateStd = itemRate - (diffRate * ( itemRate / totRate) ); // 18-08 change
discAmt = diffRate * ( itemRate / totRate);
//rateStd = df.parse(df.format(rateStd)).doubleValue();
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStd).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", rateStd);
valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStd).append("]]>").append("</rate__clg>\r\n");
......@@ -6266,6 +6293,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
else if("D".equalsIgnoreCase(priceVar))
{
discAmt = diffRate * ( itemRate / totRate);
//itemRate = df.parse(df.format(itemRate)).doubleValue();
valueXmlString.append("<disc_amt isSrvCallOnChg='0'>").append("<![CDATA[").append(discAmt).append("]]>").append("</disc_amt>\r\n");
setNodeValue( dom, "disc_amt", discAmt );
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(itemRate).append("]]>").append("</rate__stduom>\r\n");
......@@ -6293,7 +6321,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
//effCost = df.parse(df.format(effCost)).doubleValue();
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(effCost).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", effCost );
valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(effCost).append("]]>").append("</rate__clg>\r\n");
......@@ -6318,6 +6346,31 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
pstmt.close();
pstmt = null;
//arrList = distCommon.getConvQuantityFact(mstunit,mUnit, mdescr2, itemRate, rateStd , conn);
//rateStduom = Double.parseDouble(arrList.get(1).toString());
//START change 18-08-10 extra code
sql = "select rate__stduom from sorddet where sale_order = ?"
+" and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,mVal);
pstmt.setString(2,mcode);
rs = pstmt.executeQuery();
while(rs.next())
{
rateStd = rs.getDouble("rate__stduom");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// ed change
rateStduom =rateStd; // 18-08 -10
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStduom).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", rateStduom );
if("F".equalsIgnoreCase(nature))
{
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(0).append("]]>").append("</rate__stduom>\r\n");
......@@ -6325,13 +6378,6 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append("<line_type isSrvCallOnChg='0'>").append("<![CDATA[").append("F").append("]]>").append("</line_type>\r\n");
setNodeValue( dom, "line_type","F");
}
arrList = distCommon.getConvQuantityFact(mstunit,mUnit, mdescr2, itemRate, rateStd , conn);
rateStduom = Double.parseDouble(arrList.get(1).toString());
System.out.println("rateStduom...."+rateStduom);
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStduom).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", rateStduom );
//gbf_set_rate_conversion() //miss13 function
}
......@@ -6348,7 +6394,14 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
mVal1 = genericUtility.getColumnValue("unit__std",dom);
itemCode = genericUtility.getColumnValue("item_code",dom);
smNum1 = genericUtility.getColumnValue("conv__qty_stduom",dom);
System.out.println("quantity case...1111.. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum +" "+smNum1);
System.out.println("quantity case.. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum +" "+smNum1);
//itemCode = genericUtility.getColumnValue("item_code",dom);
siteCode = genericUtility.getColumnValue("site_code",dom);
locCode = genericUtility.getColumnValue("loc_code",dom);
lotNo = genericUtility.getColumnValue("lot_no",dom);
lotSl = genericUtility.getColumnValue("lot_sl",dom);
System.out.println("locCode :"+locCode+"lotNo :"+lotNo+" lotSl :"+lotSl);
if(itemCode == null)
{
itemCode = "";
......@@ -6373,7 +6426,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
System.out.println("unitStd2222...11.. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum);
System.out.println("unitStd.. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum);
if(mVal == null)
{
......@@ -6391,7 +6444,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
}
else
{
System.out.println("unitStd2222...11.. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum);
System.out.println("unitStd. :"+mVal+" "+mVal1+" "+itemCode+" "+mNum);
arrList = distCommon.getConvQuantityFact(mVal, mVal1, itemCode, mNum, mNum1 , conn);
mNum = Double.parseDouble(arrList.get(1).toString());
......@@ -6434,11 +6487,11 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
setNodeValue( dom, "no_art", noArt );
if(noArt == 0)
{
itemCode = genericUtility.getColumnValue("item_code",dom);
siteCode = genericUtility.getColumnValue("site_code",dom);
locCode = genericUtility.getColumnValue("loc_code",dom);
lotNo = genericUtility.getColumnValue("lot_no",dom);
lotSl = genericUtility.getColumnValue("lot_sl",dom);
//itemCode = genericUtility.getColumnValue("item_code",dom);
//siteCode = genericUtility.getColumnValue("site_code",dom);
//locCode = genericUtility.getColumnValue("loc_code",dom);
//lotNo = genericUtility.getColumnValue("lot_no",dom);
//lotSl = genericUtility.getColumnValue("lot_sl",dom);
sql = "select (case when qty_per_art is null then 0 else qty_per_art end) "
+" from stock where item_code = ? and site_code = ? "
......@@ -6518,7 +6571,9 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
noArt = Double.parseDouble(sNoArt);
}
grossWt = grossWt * noArt;
grossWt = df.parse(df.format(grossWt)).doubleValue();
nettWt = nettWt * noArt;
nettWt = df.parse(df.format(nettWt)).doubleValue();
sGrossWeight = genericUtility.getColumnValue("gross_weight",dom);
if(sGrossWeight != null && sGrossWeight.trim().length() > 0)
{
......@@ -6559,7 +6614,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
itemCodeOrd = genericUtility.getColumnValue("item_code__ord",dom);
applyPrice = null;
System.out.println("itemCodeOrd..:" +itemCodeOrd);
sql = "select apply_price from bom where bom_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCodeOrd);
......@@ -6604,7 +6659,8 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
lotSl = genericUtility.getColumnValue("lot_sl",dom);
saleord = genericUtility.getColumnValue("sord_no",dom);
saleordLine = genericUtility.getColumnValue("line_no__sord",dom);
System.out.println("lot_no AND lot_sl....:"+itemCode+"..."+siteCode+"..."+locCode+"..."+lotNo+"..."+lotSl+"..."+saleord+"..."+ saleordLine);
smNum = genericUtility.getColumnValue("quantity", dom);
System.out.println("lot_no AND lot_sl....:"+itemCode+"..."+siteCode+"..."+locCode+"..."+lotNo+"..."+lotSl+"..."+saleord+"..."+ saleordLine +"..QUANTITY"+smNum);
if(itemCode == null)
{
itemCode="";
......@@ -6627,7 +6683,8 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
+"(case when gross_wt_per_art is null then 0 else gross_wt_per_art end), "
+"(case when tare_wt_per_art is null then 0 else tare_wt_per_art end), "
+"exp_date, mfg_date, site_code__mfg, "
+"(case when pallet_wt is null then 0 else pallet_wt end),retest_date "
+"(case when pallet_wt is null then 0 else pallet_wt end),retest_date, "
+" quantity "
+" from stock where item_code = ? and "
+" site_code = ? and loc_code = ? and "
+"lot_no = ? and lot_sl = ? ";
......@@ -6650,23 +6707,29 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
stcrate = rs.getDouble(7);
grossWeightArt = rs.getDouble(8);
tareWeightArt = rs.getDouble(9);
expDate = rs.getString(10);
mfgDate = rs.getString(11);
expDate = rs.getTimestamp(10);
mfgDate = rs.getTimestamp(11);
siteMfg = rs.getString(12);
palletWt = rs.getDouble(13);
retestDate = rs.getString(14);
retestDate = rs.getTimestamp(14);
qty1 = rs.getDouble(15);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
smNum = genericUtility.getColumnValue(" quantity",dom);
//if(qty1 == 0.0 )
// {
//smNum = genericUtility.getColumnValue("quantity", dom);
if(smNum != null && smNum.trim().length() > 0)
{
mNum = Double.parseDouble(smNum);
}
qty1 = mNum;
//}*/
System.out.println("quantity :"+mNum);
sNoArt = genericUtility.getColumnValue(" no_art",dom);
if(sNoArt != null && sNoArt.trim().length() > 0)
{
......@@ -6677,17 +6740,21 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
if(qtyPerArt > 0)
{
valueXmlString.append("<no_art isSrvCallOnChg='0'>").append("<![CDATA[").append(Math.round(mNum/qtyPerArt)).append("]]>").append("</no_art>\r\n");
setNodeValue( dom, "no_art", (Math.round(mNum/qtyPerArt)));
setNodeValue( dom, "no_art", (Math.round(qty1/qtyPerArt)));
}
}
//qtyPerArt =0;//
if(qtyPerArt == 0)
{
qtyPerArt = 1;
grossWeight = (grossWeightArt/qtyPerArt) * mNum;
tareWeight = (tareWeightArt/qtyPerArt) * mNum;
}
grossWeight = (grossWeightArt/qtyPerArt) * qty1;
grossWeight = df.parse(df.format(grossWeight)).doubleValue();
tareWeight = (tareWeightArt/qtyPerArt) * qty1;
tareWeight = df.parse(df.format(tareWeight)).doubleValue();
nettWeight = grossWeight - tareWeight ;
System.out.println("grossWeight..."+grossWeight+"..tareWeight.."+tareWeight+"..nettWeight.."+nettWeight);
nettWeight = df.parse(df.format(nettWeight)).doubleValue();
sql = "select stk_opt ,(case when track_shelf_life is null then 'N' else track_shelf_life end) "
+" from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -6703,20 +6770,44 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
if(expDate != null)
{
sExpDate = sdf.format(expDate).toString();
}
else
{
sExpDate="";
}
if(mfgDate != null)
{
sMfgDate = sdf.format(mfgDate).toString();
}
else
{
sMfgDate="";
}
if(retestDate != null)
{
sRetestDate = sdf.format(retestDate).toString();
}
else
{
sRetestDate="";
}
if(!("0".equalsIgnoreCase(stkOpt)))
{
if("Y".equalsIgnoreCase(trackShelfLife) && expDate != null)
{
valueXmlString.append("<exp_date isSrvCallOnChg='0'>").append("<![CDATA[").append(expDate).append("]]>").append("</exp_date>\r\n");
setNodeValue( dom, "exp_date", expDate );
valueXmlString.append("<exp_date isSrvCallOnChg='0'>").append("<![CDATA[").append(sExpDate).append("]]>").append("</exp_date>\r\n");
setNodeValue( dom, "exp_date", sExpDate );
}
valueXmlString.append("<mfg_date isSrvCallOnChg='0'>").append("<![CDATA[").append(mfgDate).append("]]>").append("</mfg_date>\r\n");
setNodeValue( dom, "mfg_date", (mfgDate == null) ? "" : mfgDate );
valueXmlString.append("<mfg_date isSrvCallOnChg='0'>").append("<![CDATA[").append(sMfgDate).append("]]>").append("</mfg_date>\r\n");
setNodeValue( dom, "mfg_date", (sMfgDate == null) ? "" : sMfgDate );
valueXmlString.append("<site_code__mfg isSrvCallOnChg='0'>").append("<![CDATA[").append(siteMfg).append("]]>").append("</site_code__mfg>\r\n");
setNodeValue( dom, "site_code__mfg", (siteMfg == null) ? "" : siteMfg );
valueXmlString.append("<retest_date isSrvCallOnChg='0'>").append("<![CDATA[").append(retestDate).append("]]>").append("</retest_date>\r\n");
setNodeValue( dom, "retest_date", (retestDate == null) ? "" : retestDate );
valueXmlString.append("<retest_date isSrvCallOnChg='0'>").append("<![CDATA[").append(sRetestDate).append("]]>").append("</retest_date>\r\n");
setNodeValue( dom, "retest_date", (sRetestDate == null) ? "" : sRetestDate );
}
if(packInstr == null || packInstr.trim().length() == 0)
......@@ -6816,7 +6907,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
pstmt.close();
pstmt = null;
sDespDate = genericUtility.getColumnValue("desp_date",dom1);
System.out.println("desp_date....99999...:,dom1 " + sDespDate +"...priceList: "+priceList+" ..priceListClg"+priceListClg);
if(sDespDate == null)
{
sDespDate ="";
......@@ -6829,6 +6920,24 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
{
itemRate = Double.parseDouble(sItemRate);
}
//start change extra
sql = "select rate__stduom from sorddet where sale_order = ? and line_no = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,saleord);
pstmt.setString(2,saleordLine);
rs = pstmt.executeQuery();
if(rs.next())
{
rateStd = rs.getDouble("rate__stduom");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//end change 18-08-10
//cas24
if(mstunit == null)
{
......@@ -6838,9 +6947,10 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
{
mUnit="";
}
arrList = distCommon.getConvQuantityFact(mstunit,mUnit, siteCode, itemRate, mNum, conn);
//rateStduom = arrList.get(1);
rateStduom = Double.parseDouble(arrList.get(1).toString());
//arrList = distCommon.getConvQuantityFact(mstunit,mUnit, siteCode, itemRate, qty1, conn);
//rateStduom = Double.parseDouble(arrList.get(1).toString());
rateStduom = rateStd ; // 18-08 -10
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStduom).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "dimension", (dimension == null) ? "" : dimension );
......@@ -6882,15 +6992,15 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
rs = null;
pstmt.close();
pstmt = null;
System.out.println("priceListParent.. "+priceListParent);
listType = distCommon.getPriceListType(priceListParent , conn);
System.out.println("listType.. "+listType);
}
if("B".equalsIgnoreCase(listType))
{
pickRate = distCommon.pickRateGSM(priceList,sDespDate,itemCode,lotNo,"B",sordQuantity , conn); //miss23 function
System.out.println("pickRate :"+pickRate);
}
else
{
......@@ -6901,7 +7011,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
else if(count > 0)
{
pickRate = distCommon.pickRateGSM(priceList,sDespDate,itemCode,lotNo,"I",sordQuantity , conn);
System.out.println("count >0 pickRate :"+pickRate);
}
}
......@@ -6916,8 +7026,10 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
if(sConv ==null || conv == 0)
{
conv = 1;
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(pickRate * conv).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", (pickRate * conv) );
rateStduom1 = pickRate * conv;
//rateStduom1 = df.parse(df.format(rateStduom1)).doubleValue();
valueXmlString.append("<rate__stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(rateStduom1).append("]]>").append("</rate__stduom>\r\n");
setNodeValue( dom, "rate__stduom", rateStduom1 );
valueXmlString.append("<conv__rtuom_stduom isSrvCallOnChg='0'>").append("<![CDATA[").append(conv).append("]]>").append("</conv__rtuom_stduom>\r\n");///13-08
setNodeValue( dom, "conv__rtuom_stduom", (conv) );///13-08
}
......@@ -6928,7 +7040,7 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
if(priceListClg !=null && priceListClg.trim().length() > 0)
{
System.out.println("pickRateGSM calling ......"+lotNo+"...."+sordQuantity +" ..."+conn);
pickRateClg = distCommon.pickRateGSM(priceListClg,sDespDate,itemCode,lotNo,"B",sordQuantity , conn);
valueXmlString.append("<rate__clg isSrvCallOnChg='0'>").append("<![CDATA[").append(pickRateClg).append("]]>").append("</rate__clg>\r\n");
......@@ -6971,9 +7083,9 @@ public class DespatchAct extends ActionHandlerEJB implements DespatchActLocal, D
valueXmlString.append("<line_type isSrvCallOnChg='0'>").append("<![CDATA[").append('F').append("]]>").append("</line_type>\r\n");
setNodeValue( dom, "line_type", 'F' );
}
valueXmlString.append(getChangeSord(dom , dom1 , "quantity", xtraParams , conn));
valueXmlString.append(getChangeSord(dom , dom1 , "quantity", xtraParams , conn)); /// 17-08-10
}
// }
}
......
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