package report_package;

import java.io.Serializable;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Date;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

import main_package.DataBaseConnection;
@ManagedBean(name="printSaleFixedAsset")
@ViewScoped

public class PrintSaleFixedAssetBean implements Serializable 
{
	Date startDate,endDate;
	ArrayList<BorrowerLenderInfo> list, saleList, pList;
	DataBaseReportMethods obj1=new DataBaseReportMethods();
	public PrintSaleFixedAssetBean()
	{
		Connection conn=DataBaseConnection.JAVAConnection();
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId = (int) ss.getAttribute("branchId");
		startDate=(Date)ss.getAttribute("startDate");
		endDate=(Date)ss.getAttribute("endDate");
		saleList=obj1.saleFixedAssetsFoAll(branchId,startDate, endDate, conn);
		try {
			conn.close();
		} catch (Exception e) {
			// TODO: handle exception
		}
		
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public ArrayList<BorrowerLenderInfo> getList() {
		return list;
	}

	public void setList(ArrayList<BorrowerLenderInfo> list) {
		this.list = list;
	}

	public ArrayList<BorrowerLenderInfo> getSaleList() {
		return saleList;
	}

	public void setSaleList(ArrayList<BorrowerLenderInfo> saleList) {
		this.saleList = saleList;
	}

	public ArrayList<BorrowerLenderInfo> getpList() {
		return pList;
	}

	public void setpList(ArrayList<BorrowerLenderInfo> pList) {
		this.pList = pList;
	}

	public DataBaseReportMethods getObj1() {
		return obj1;
	}

	public void setObj1(DataBaseReportMethods obj1) {
		this.obj1 = obj1;
	}
}
