Commit f1faafb9 authored by rtiwari's avatar rtiwari

update to set gross_weight. nett_weight


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95127 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f1319ba0
......@@ -17,6 +17,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
......@@ -1109,7 +1110,15 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
xmlBuff.append("<purc_order><![CDATA["+ purcOrder +"]]></purc_order>");
xmlBuff.append("<tran_code><![CDATA["+ tranCode.trim() +"]]></tran_code>");
xmlBuff.append("<price_list><![CDATA["+ pricelist.trim() +"]]></price_list>");
xmlBuff.append("<price_list__clg><![CDATA["+ pricelistClg.trim() +"]]></price_list__clg>");
if(pricelistClg != null && pricelistClg.trim().length() > 0)
{
xmlBuff.append("<price_list__clg><![CDATA["+ pricelistClg.trim() +"]]></price_list__clg>");
}
else
{
xmlBuff.append("<price_list__clg><![CDATA["+ pricelist.trim() +"]]></price_list__clg>");
}
xmlBuff.append("<sales_pers><![CDATA["+ salespers.trim() +"]]></sales_pers>");
xmlBuff.append("<sales_pers__1><![CDATA["+ salespers1.trim() +"]]></sales_pers__1>");
xmlBuff.append("<sales_pers__2><![CDATA["+ salespers1.trim() +"]]></sales_pers__2>");
......@@ -1494,6 +1503,15 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
String xmlString = null,retString = null;
ITMDBAccessEJB itmDBAccessLocal = null;
DistCommon dComm = new DistCommon();
String dimension="";
double qtyStk=0d,grossWeight=0d,tareWeight=0d,netWeight=0d,palletWt=0d,cAllocQty=0d,cQty=0d;
double balQty = 0d;
double grossPer = 0d;
double netPer = 0d;
double tarePer = 0d;
double grossWeight1 = 0d,tareWeight1 = 0d,netWeight1 = 0d;
DecimalFormat df = new DecimalFormat("#########.###");
String sqlTemp ="";
try
{
System.out.println("@@@@@@@ despatchOrder function called");
......@@ -1657,6 +1675,83 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
pstmt1.close();
pstmt1 = null;
// ADDED BY RITESH ON 26/05/13 START
sqlTemp ="SELECT A.EXP_DATE, "
+"A.QUANTITY, "
+"A.SITE_CODE__MFG, "
+"A.MFG_DATE, "
+"A.PACK_CODE, "
+"A.GROSS_WEIGHT, "
+"A.TARE_WEIGHT, "
+"A.NET_WEIGHT, "
+"A.DIMENSION, "
+"A.SUPP_CODE__MFG, "
+"A.QTY_PER_ART, "
+"A.GROSS_WT_PER_ART, "
+"A.TARE_WT_PER_ART ,"
+"A.PALLET_WT, "
+"A.ALLOC_QTY "
+"FROM STOCK A "
+"WHERE A.ITEM_CODE = '"+itemCode+"' "
+"AND A.SITE_CODE = '"+siteCodeDet+"' "
+"AND A.LOC_CODE = '"+locCode+"' "
+"AND A.LOT_NO = '"+lotNo+"' "
+"AND A.LOT_SL = '"+lotSl+"' ";
System.out.println("sqlGetWeight :"+sqlTemp);
pstmt1 = conn.prepareStatement(sqlTemp);
rs1 = pstmt1.executeQuery(sqlTemp);
if (rs1.next())
{
qtyStk = rs1.getDouble("QUANTITY");
grossWeight = rs1.getDouble("GROSS_WEIGHT");
tareWeight = rs1.getDouble("TARE_WEIGHT");
netWeight = rs1.getDouble("NET_WEIGHT");
dimension = rs1.getString("DIMENSION");
palletWt = rs1.getDouble("PALLET_WT");
cAllocQty = rs1.getDouble("alloc_qty");
}
rs1.close();
rs1 =null;
pstmt1.close();
pstmt1 = null;
System.out.println(" qtyStk @@@1 ::["+qtyStk+"]");
if(quantity != null && quantity.trim().length() > 0)
{
cQty = Double.parseDouble(quantity);
}
balQty = cQty - cAllocQty;
if (qtyStk > balQty)
{
qtyStk = balQty;
}
System.out.println(" qtyStk @@@2 ::["+qtyStk+"]");
System.out.println(" balQty @@@ ::["+qtyStk+"]");
if (qtyStk > 0)
{
grossPer = (grossWeight / qtyStk) ;
grossPer = df.parse(df.format(grossPer)).doubleValue();
System.out.println("grossPer :"+grossPer);
netPer = (netWeight / qtyStk);
netPer = df.parse(df.format(netPer)).doubleValue();
System.out.println("netPer :"+netPer);
tarePer = (tareWeight / qtyStk);
tarePer = df.parse(df.format(tarePer)).doubleValue();
System.out.println("tarePer :"+tarePer);
grossWeight1 = (balQty * grossPer);
System.out.println("grossWeight1 :"+grossWeight1);
netWeight1 = (balQty * netPer);
System.out.println("netWeight1 :"+netWeight1);
tareWeight1 = (balQty * tarePer);
System.out.println("tareWeight1 :"+tareWeight1);
grossWeight1 = df.parse(df.format(grossWeight1)).doubleValue();
netWeight1 = df.parse(df.format(netWeight1)).doubleValue();
tareWeight1 = df.parse(df.format(tareWeight1)).doubleValue();
System.out.println("stk > 0 :: grossWeight1:["+grossWeight1+"]netWeight1:["+netWeight1+"]tareWeight1:["+tareWeight1+"]");
}
// ADDED BY RITESH ON 26/05/13 END
lnno ++;
System.out.println("--LINE NO--"+lnno);
xmlBuff.append("<Detail2 dbID='' domID=\"1\" objName=\"despatch\" objContext=\"2\">");
......@@ -1695,6 +1790,14 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
xmlBuff.append("<tot_net_amt><![CDATA["+ netAmt +"]]></tot_net_amt>");
xmlBuff.append("<quantity__inv><![CDATA["+ quantity +"]]></quantity__inv>");
xmlBuff.append("<quantity__real><![CDATA["+ quantity +"]]></quantity__real>");
// ADDED BY RITESH ON 26/05/13 START
xmlBuff.append("<gross_weight>").append("<![CDATA[").append(grossWeight1).append("]]>").append("</gross_weight>");
xmlBuff.append("<nett_weight>").append("<![CDATA[").append(netWeight1).append("]]>").append("</nett_weight>");
xmlBuff.append("<tare_weight>").append("<![CDATA[").append(tareWeight1).append("]]>").append("</tare_weight>");
xmlBuff.append("<dimension><![CDATA["+ dimension +"]]></dimension>");
xmlBuff.append("<pallet_wt><![CDATA["+ palletWt +"]]></pallet_wt>");
xmlBuff.append("<pack_code><![CDATA["+ packCode +"]]></pack_code>");
// ADDED BY RITESHON 26/05/13 END
xmlBuff.append("</Detail2>");
}
lnno = 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