Commit fbf717f3 authored by manohar's avatar manohar

This commit was generated by cvs2svn to compensate for changes in r62, which

included commits to RCS files with non-trunk default branches.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91127 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a6a92a4b
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import ibase.webitm.utility.GenericUtility;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.*;
import javax.ejb.*;
import ibase.webitm.ejb.*;
import org.w3c.dom.*;
import ibase.webitm.utility.ITMException;
import ibase.utility.CommonConstants;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import ibase.webitm.utility.*;
import ibase.system.config.*;
import javax.naming.InitialContext;
import ibase.webitm.utility.ITMException;
import ibase.webitm.utility.GenericUtility;
import java.io.File;
import ibase.system.config.ConnDriver;
import javax.ejb.Stateless;
@Stateless
public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSaveLocal,DissIssuePosSaveRemote // SessionBean
{
public String postSave() throws RemoteException,ITMException
{
return "";
}
public String postSaveRec() throws RemoteException, ITMException
{
return "";
}
public String postSaveRec(String xmlString1, String domId, String objContext, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
return "";
}
public String postSave(String winName,String editFlag,String tranId, String xtraParams,Connection conn) throws RemoteException,ITMException
{
String sql = "";
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
try
{
conn.setAutoCommit(false);
sql = "update distord_issdet set "
+" amount = quantity * rate , "
+" disc_amt = quantity * rate * discount/100 , "
+ " net_amt = quantity * rate + tax_amt - (quantity * rate * discount/100 ) "
+ " where tran_id = ? ";
pstmt= conn.prepareStatement(sql);
//System.out.println("First sql ["+ sql + "] tranId [" + tranId + "]");
pstmt.setString( 1, tranId );
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
sql = "select sum(amount), sum(net_amt),sum(disc_amt),sum(tax_amt),sum(no_art) "
+ " from distord_issdet where tran_id = ? ";
pstmt= conn.prepareStatement(sql);
//System.out.println("Second sql ["+sql + "]");
pstmt.setString( 1, tranId );
rs = pstmt.executeQuery();
if (rs.next())
{
amount = rs.getDouble(1);
netAmount = rs.getDouble(2);
discAmount = rs.getDouble(3);
taxAmount = rs.getDouble(4);
noArt = rs.getDouble(5);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " update distord_iss set "
+ " amount = ?, net_amt = ?, discount = ? , tax_amt = ? , no_art = ? "
+ " where tran_id = ? " ;
pstmt= conn.prepareStatement( sql );
//System.out.println("Fourth sql ["+sql + "]");
pstmt.setDouble( 1, amount );
pstmt.setDouble( 2, netAmount );
pstmt.setDouble( 3, discAmount );
pstmt.setDouble( 4, taxAmount );
pstmt.setDouble( 5, noArt );
pstmt.setString( 6, tranId );
pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(pstmt != null)pstmt.close();
pstmt = null;
}catch(Exception d)
{
d.printStackTrace();
throw new ITMException(d);
}
}
return "";
}
}// end of DissIssuePosSaveEJB class
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
@Local
public interface DissIssuePosSaveLocal extends ValidatorLocal //, EJBObject
{
public String postSave(String winName,String editFlag,String tranId, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
package ibase.webitm.ejb.dis;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
@Remote
public interface DissIssuePosSaveRemote extends ValidatorRemote //, EJBObject
{
public String postSave(String winName,String editFlag,String tranId, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSaveRec(String xmlString1,String domID,String objContext,String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException;
}
\ No newline at end of file
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