package report_package;

import java.io.Serializable;
import java.text.SimpleDateFormat;
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.TrialInfo;

@ManagedBean(name="printFinalAccountReport")
@ViewScoped

public class PrintFinalAccountReportBean implements Serializable
{
	ArrayList<TrialInfo> accountList;
	boolean showTb, showPl, showBs;
	String headerName,tbDateStr,searchType,totalCreditStr,totalDebitStr,openingDrTotalStr,openingCrTotalStr;
	double totalDr,totalCr;
	private String endDate;
	private String startDate;
	
	public PrintFinalAccountReportBean()
	{
			HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
			accountList=(ArrayList<TrialInfo>) ss.getAttribute("finalAccList");
			searchType=(String)ss.getAttribute("searchType");
	        totalCreditStr= (String) ss.getAttribute("totalCreditStrP");
	        totalDebitStr= (String) ss.getAttribute("totalDebitStrP");
	        openingDrTotalStr=(String) ss.getAttribute("openingDrTotalStrP");
	        openingCrTotalStr=(String) ss.getAttribute("openingCrTotalStrP");
	        
			if(searchType.equals("Trial Balance"))
			 {
				showTb=true;
				showPl=false;
				showBs=false;
				headerName="Trial Balance";
			 }
			else if(searchType.equals("Profit And Loss"))
			 {
				showTb=false;
				showPl=true;
				showBs=false;
				headerName="Profit And Loss";
			 }
			else if(searchType.equals("Balance Sheet"))
			{
				showTb=false;
				showPl=false;
				showBs=true;
				headerName="Balance Sheet";
			}
			
		}



	public ArrayList<TrialInfo> getAccountList() {
		return accountList;
	}
	public void setAccountList(ArrayList<TrialInfo> accountList) {
		this.accountList = accountList;
	}
	public boolean isShowTb() {
		return showTb;
	}
	public void setShowTb(boolean showTb) {
		this.showTb = showTb;
	}
	public boolean isShowPl() {
		return showPl;
	}
	public void setShowPl(boolean showPl) {
		this.showPl = showPl;
	}
	public boolean isShowBs() {
		return showBs;
	}
	public void setShowBs(boolean showBs) {
		this.showBs = showBs;
	}
	public String getHeaderName() {
		return headerName;
	}
	public void setHeaderName(String headerName) {
		this.headerName = headerName;
	}
	public String getTbDateStr() {
		return tbDateStr;
	}
	public void setTbDateStr(String tbDateStr) {
		this.tbDateStr = tbDateStr;
	}
	public double getTotalDr() {
		return totalDr;
	}
	public void setTotalDr(double totalDr) {
		this.totalDr = totalDr;
	}
	public double getTotalCr() {
		return totalCr;
	}
	public void setTotalCr(double totalCr) {
		this.totalCr = totalCr;
	}
	public String getSearchType() {
		return searchType;
	}
	public void setSearchType(String searchType) {
		this.searchType = searchType;
	}
	public String getEndDate() {
		return endDate;
	}
	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	public String getStartDate() {
		return startDate;
	}
	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}
	public String getOpeningDrTotalStr() {
		return openingDrTotalStr;
	}
	public void setOpeningDrTotalStr(String openingDrTotalStr) {
		this.openingDrTotalStr = openingDrTotalStr;
	}
	public String getOpeningCrTotalStr() {
		return openingCrTotalStr;
	}
	public void setOpeningCrTotalStr(String openingCrTotalStr) {
		this.openingCrTotalStr = openingCrTotalStr;
	}
	public String getTotalCreditStr() {
		return totalCreditStr;
	}
	public void setTotalCreditStr(String totalCreditStr) {
		this.totalCreditStr = totalCreditStr;
	}
	public String getTotalDebitStr() {
		return totalDebitStr;
	}
	public void setTotalDebitStr(String totalDebitStr) {
		this.totalDebitStr = totalDebitStr;
	}

}