Commit 0e872027 authored by kmandhre's avatar kmandhre

update sum of gross Weight, tare Weight and net Weight in header


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93435 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 161447f6
......@@ -45,11 +45,12 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
public String postSave(String winName,String editFlag,String tranId, String xtraParams,Connection conn) throws RemoteException,ITMException
{
String sql = "";
String sql = "",shipmentId = "";
GenericUtility genericUtility = GenericUtility.getInstance();
PreparedStatement pstmt = null;
ResultSet rs = null;
double amount = 0,netAmount=0,discAmount=0,taxAmount=0,noArt = 0; //net_amt =amount+tax_amt-disc_amt
double grossWeight = 0 ,tareWeight = 0 , netWeight = 0;
try
{
conn.setAutoCommit(false);
......@@ -67,7 +68,7 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
pstmt.close();
pstmt = null;
sql = "select sum(amount), sum(net_amt),sum(disc_amt),sum(tax_amt),sum(no_art) "
sql = "select sum(amount), sum(net_amt),sum(disc_amt),sum(tax_amt),sum(no_art) , sum(gross_weight) ,sum (tare_weight) , sum(net_weight ) "
+ " from distord_issdet where tran_id = ? ";
pstmt= conn.prepareStatement(sql);
//System.out.println("Second sql ["+sql + "]");
......@@ -80,14 +81,40 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
discAmount = rs.getDouble(3);
taxAmount = rs.getDouble(4);
noArt = rs.getDouble(5);
//added by kunal on 06/AUG/13
grossWeight = rs.getDouble(6);
tareWeight = rs.getDouble(7);
netWeight = rs.getDouble(8);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//added by kunal on 06/AUG/13
sql = "select shipment_id from distord_iss where tran_id = ? ";
pstmt= conn.prepareStatement(sql);
pstmt.setString( 1, tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
shipmentId = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(shipmentId != null && shipmentId.trim().length() > 0)
{
grossWeight = 0;
tareWeight = 0;
netWeight = 0;
}
sql = " update distord_iss set "
+ " amount = ?, net_amt = ?, discount = ? , tax_amt = ? , no_art = ? "
+ " amount = ?, net_amt = ?, discount = ? , tax_amt = ? , no_art = ? ,gross_weight = ? , tare_weight = ? , net_weight = ? "
+ " where tran_id = ? " ;
pstmt= conn.prepareStatement( sql );
//System.out.println("Fourth sql ["+sql + "]");
......@@ -97,7 +124,10 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
pstmt.setDouble( 3, discAmount );
pstmt.setDouble( 4, taxAmount );
pstmt.setDouble( 5, noArt );
pstmt.setString( 6, tranId );
pstmt.setDouble( 6, grossWeight );////added by kunal on 06/AUG/13
pstmt.setDouble( 7, tareWeight );//added by kunal on 06/AUG/13
pstmt.setDouble( 8, netWeight );//added by kunal on 06/AUG/13
pstmt.setString( 9, tranId );
pstmt.executeUpdate();
pstmt.close();
pstmt = 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