Commit 7225aa12 authored by cpatil's avatar cpatil

fright rate calculation code modified


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98438 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f1f2eb43
......@@ -10,7 +10,8 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.utility.GenericUtility;
// import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat;
......@@ -31,7 +32,9 @@ import java.sql.Timestamp;
public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, ShipmentLocICRemote
{
GenericUtility genericUtility = GenericUtility.getInstance();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
//method for validation
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
......@@ -121,7 +124,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
if(childNodeName.equalsIgnoreCase("shipment_id"))
{
shipmentId = genericUtility.getColumnValue("shipment_id", dom);
shipmentId = checkNull(genericUtility.getColumnValue("shipment_id", dom));
//Shipment Date should not be blank.
String keyFlag = setDescription("key_flag", "transetup", "tran_window", "w_shipment_loc", conn);
......@@ -718,6 +721,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
rs = null;
pstmt.close();
pstmt = null;
System.out.println("COUNT["+cnt+"]");
if( cnt > 0)
{
retStr = "TRUE";
......@@ -778,7 +782,8 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
GenericUtility genericUtility = GenericUtility.getInstance();
// GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
ConnDriver connDriver = new ConnDriver();
int currentFormNo =0;
......@@ -798,6 +803,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
int i=0,noArt=0;
Timestamp despDate=null;
double netWeightCIss=0;
try
{
......@@ -1291,13 +1297,13 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
{
System.out.println("@@@@@@@@ itemchange charge_code called @@@@@@@@");
chargeCode = genericUtility.getColumnValue("charge_code", dom);
shipmentId = genericUtility.getColumnValue("shipment_id", dom1);
chargeCode = genericUtility.getColumnValue("charge_code", dom)==null?"":genericUtility.getColumnValue("charge_code", dom).trim();
shipmentId = genericUtility.getColumnValue("shipment_id", dom1)==null?"":genericUtility.getColumnValue("shipment_id", dom1).trim();
frtList = genericUtility.getColumnValue("frt_list", dom1);
stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1);
stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1);
loadType = genericUtility.getColumnValue("load_type", dom1);
frtList = genericUtility.getColumnValue("frt_list", dom1)==null?"":genericUtility.getColumnValue("frt_list", dom1).trim();
stanCodeFrom = genericUtility.getColumnValue("stan_code__from", dom1)==null?"":genericUtility.getColumnValue("stan_code__from", dom1).trim();
stanCodeTo = genericUtility.getColumnValue("stan_code__to", dom1)==null?"":genericUtility.getColumnValue("stan_code__to", dom1).trim();
loadType = genericUtility.getColumnValue("load_type", dom1)==null?"":genericUtility.getColumnValue("load_type", dom1).trim();
/*
sql = " select c.descr,b.charges_mode,b.amount,b.charge_code__add,sequence " +
" from shipment a, freight_rate_det b, gencodes c " +
......@@ -1332,9 +1338,9 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.setString(3,stanCodeTo );
pstmt.setString(4,loadType );
pstmt.setString(5,shipmentId );
pstmt.setString(6,"CHARGE_CODE" );
pstmt.setString(7,chargeCode );
// pstmt.setString(5,shipmentId );
pstmt.setString(5,"CHARGE_CODE" );
pstmt.setString(6,chargeCode );
rs = pstmt.executeQuery();
if(rs.next())
......@@ -1432,7 +1438,24 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
pstmt.close();
pstmt = null;
nettWeight = (nettWeight + netWeight) * amount;
sql = " select nvl(sum(gross_weight),0) from CONSUME_ISS " +
" where cons_issue in ( select ref_id from ship_docs where shipment_id = ? ) and confirmed = 'Y' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, shipmentId);
rs = pstmt.executeQuery();
if( rs.next())
{
grossWeightCIss = rs.getDouble(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("@@@@@@@@grossWeightCIss["+grossWeightCIss+"]");
nettWeight = (nettWeight + netWeight + grossWeightCIss ) * amount;
valueXmlString.append("<amount>").append("<![CDATA["+nettWeight+"]]>").append("</amount>");
}
else if ("V".equalsIgnoreCase(mode) ) //volume
......@@ -1492,7 +1515,7 @@ public class ShipmentLocIC extends ValidatorEJB implements ShipmentLocICLocal, S
System.out.println("@@@@@2 stanCodeShip ["+ stanCodeShip + "]");
stationaDescr = setDescription("descr", "station", "stan_code", stanCodeShip, conn);
valueXmlString.append("<stationa_descr protect = \"1\">").append("<![CDATA["+stationaDescr+"]]>").append("</stationa_descr>");
}
} //stationa_descr
else if( currentColumn.trim().equalsIgnoreCase( "stan_code__dlv" ) )
......
......@@ -265,7 +265,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
updCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("updCnt["+updCnt+"]");
frtAmt = val;
}
else
......@@ -277,7 +277,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
updCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
System.out.println("updCnt["+updCnt+"]");
frtAmt = minValue;
} //end if
......@@ -378,13 +378,13 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
}
val = val + frtAmt;
}
else
{
val = frtAmt;
} // end if
System.out.println("@@@@@@ val["+val+"]chargeRate["+chargeRate+"]");
val = ( val * chargeRate)/100 ;
System.out.println("@@@@@@ val["+val+"]");
}
else if("W".equalsIgnoreCase(chargesMode)) // ls_mode = 'W' then//weight
{
......@@ -438,6 +438,7 @@ public class RecalFrtAct extends ActionHandlerEJB implements RecalFrtActLocal, R
val = ( tempNettWeight + tempNetWeight + grossWeightCIss ) * chargeRate ;
System.out.println("@@@@@@ val["+val+"]chargeRate["+chargeRate+"]");
} // end if
......
......@@ -246,6 +246,11 @@ public class ShipmentLocDefaultAct extends ActionHandlerEJB implements ShipmentL
valueXmlString.append("</Detail>\r\n");
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("valueXmlString =" + valueXmlString.toString());
valueXmlString.append("</Root>\r\n");
......
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