public void processBill()
    {
        QueryWarehouse bank = new QueryWarehouse();
        Date date = new Date();
        String currentDate = df.format(date);
        int compid = this.getCompanyIdCombo(comboCompany.getSelectedIndex());
        String tempQuery = "insert into joincompany_member_hdr (billdt) values ('"+currentDate+"')";
	Statement stmt = null;       
        int billid = 0;
	this.connect();
                
	try
        {
            stmt = conn.createStatement();
        }
                
	catch (SQLException e)
        {
            e.printStackTrace();
        }
		
	ResultSet rs;
        String compnameTemp = null;
        int compidTemp = 0;
        int memberidTemp = 0;
        String lastnameTemp = null;
        String firstnameTemp = null;
        String midinitTemp = null;
        
        try
        {
            stmt.executeQuery(tempQuery);
            tempQuery = bank.maxBillId();
            rs = stmt.executeQuery(tempQuery);
            if(rs.next())
                billid = rs.getInt("billid");
            
            rs = null;
            //System.out.println(billid);
            tempQuery = bank.joinDistinct(compid);
            rs = stmt.executeQuery(tempQuery);
            if(rs.next())
            {
                compnameTemp = rs.getString("compname");
                compidTemp = rs.getInt("compid");
                memberidTemp = rs.getInt("memberid");
                lastnameTemp = rs.getString("lastname");
                firstnameTemp = rs.getString("firstname");
                midinitTemp = rs.getString("midinit");
            }
            
        }
        catch(Exception x)
        {
            x.printStackTrace();
        }
        
        rs = null;
        ResultSet ps;
        try
        {
            //STEP ZERO : INITIATE BILLID
            tempQuery = "insert into joincompany_member (compname,compid,memberid,lastname,firstname,midinit,billid) values('"+compnameTemp+"','"+compidTemp+"','"+memberidTemp+"','"+lastnameTemp+"','"+firstnameTemp+"','"+midinitTemp+"','"+billid+"')";
            //STEP ONE - INSERT COMPANY - MEMBER JOIN
            stmt.addBatch(tempQuery);            
            //STEP TWO
            tempQuery = bank.currentMonthPeriod(finalFrom, finalUntil);
            
            stmt.addBatch(tempQuery);
            //STEP THREE
            int[] executeBatch = stmt.executeBatch();
            tempQuery = bank.selectJoinCompanyMember(compid);
            
            ps = stmt.executeQuery(tempQuery);
            while(ps.next())
            {
                firstname.add(ps.getString("firstname"));
                lastname.add(ps.getString("lastname"));
                midinit.add(ps.getString("midinit"));
                loanType.add(ps.getString("loantype"));
                monAmort.add(ps.getFloat("mon_amort"));
            }
            this.billReport();
        }
        
        catch (SQLException e)
        {
            e.printStackTrace();
	} catch (JRException ex) {
            Logger.getLogger(ProcessBillStatement.class.getName()).log(Level.SEVERE, null, ex);
        }
      
        finally
        {
            this.disconnect();
        }
    }