package main_package;

import java.io.Serializable;
import java.util.ArrayList;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
@ManagedBean(name="printLoanCalculator")
@ViewScoped

public class PrintLoanCalculatorBean implements Serializable
{
	ArrayList<LoanInfo> emiList;
	double loanAmount,interstRate,loanAmount2,interstRate2,duration, emiPayment, totalIntrest, monthlyIntrest;
	int frequency=12;
	double installment_amount,interest,maturity_value, totalDtAmount, totalDtPrincipal, totalDtInterest, discount;
	int terms;
	String label="Terms", calType="RD",loanType;
	boolean showFd, showRd=true,tblRndr;
	
	
	public PrintLoanCalculatorBean(){
	HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
	emiList=(ArrayList<LoanInfo>) ss.getAttribute("list");
	loanAmount=(double)ss.getAttribute("loanAmount");
	duration=(double)ss.getAttribute("duration");
	interstRate=(double)ss.getAttribute("interstRate");
	frequency=(int)ss.getAttribute("frequency");
	emiPayment=(double)ss.getAttribute("emi");
	totalIntrest=(double)ss.getAttribute("totalInterest");
	discount=(double)ss.getAttribute("discount");
	totalDtAmount=(double)ss.getAttribute("totalDtAmount");
	totalDtInterest=(double)ss.getAttribute("totalDtInterest");
	totalDtPrincipal=(double)ss.getAttribute("totalDtPrincipal");
	
	}


	public ArrayList<LoanInfo> getEmiList() {
		return emiList;
	}


	public void setEmiList(ArrayList<LoanInfo> emiList) {
		this.emiList = emiList;
	}


	public double getLoanAmount() {
		return loanAmount;
	}


	public void setLoanAmount(double loanAmount) {
		this.loanAmount = loanAmount;
	}


	public double getInterstRate() {
		return interstRate;
	}


	public void setInterstRate(double interstRate) {
		this.interstRate = interstRate;
	}


	public double getLoanAmount2() {
		return loanAmount2;
	}


	public void setLoanAmount2(double loanAmount2) {
		this.loanAmount2 = loanAmount2;
	}


	public double getInterstRate2() {
		return interstRate2;
	}


	public void setInterstRate2(double interstRate2) {
		this.interstRate2 = interstRate2;
	}


	public double getDuration() {
		return duration;
	}


	public void setDuration(double duration) {
		this.duration = duration;
	}


	public double getEmiPayment() {
		return emiPayment;
	}


	public void setEmiPayment(double emiPayment) {
		this.emiPayment = emiPayment;
	}


	public double getTotalIntrest() {
		return totalIntrest;
	}


	public void setTotalIntrest(double totalIntrest) {
		this.totalIntrest = totalIntrest;
	}


	public double getMonthlyIntrest() {
		return monthlyIntrest;
	}


	public void setMonthlyIntrest(double monthlyIntrest) {
		this.monthlyIntrest = monthlyIntrest;
	}


	public int getFrequency() {
		return frequency;
	}


	public void setFrequency(int frequency) {
		this.frequency = frequency;
	}


	public double getInstallment_amount() {
		return installment_amount;
	}


	public void setInstallment_amount(double installment_amount) {
		this.installment_amount = installment_amount;
	}


	public double getInterest() {
		return interest;
	}


	public void setInterest(double interest) {
		this.interest = interest;
	}


	public double getMaturity_value() {
		return maturity_value;
	}


	public void setMaturity_value(double maturity_value) {
		this.maturity_value = maturity_value;
	}


	public double getTotalDtAmount() {
		return totalDtAmount;
	}


	public void setTotalDtAmount(double totalDtAmount) {
		this.totalDtAmount = totalDtAmount;
	}


	public double getTotalDtPrincipal() {
		return totalDtPrincipal;
	}


	public void setTotalDtPrincipal(double totalDtPrincipal) {
		this.totalDtPrincipal = totalDtPrincipal;
	}


	public double getTotalDtInterest() {
		return totalDtInterest;
	}


	public void setTotalDtInterest(double totalDtInterest) {
		this.totalDtInterest = totalDtInterest;
	}


	public double getDiscount() {
		return discount;
	}


	public void setDiscount(double discount) {
		this.discount = discount;
	}


	public int getTerms() {
		return terms;
	}


	public void setTerms(int terms) {
		this.terms = terms;
	}


	public String getLabel() {
		return label;
	}


	public void setLabel(String label) {
		this.label = label;
	}


	public String getCalType() {
		return calType;
	}


	public void setCalType(String calType) {
		this.calType = calType;
	}


	public String getLoanType() {
		return loanType;
	}


	public void setLoanType(String loanType) {
		this.loanType = loanType;
	}


	public boolean isShowFd() {
		return showFd;
	}


	public void setShowFd(boolean showFd) {
		this.showFd = showFd;
	}


	public boolean isShowRd() {
		return showRd;
	}


	public void setShowRd(boolean showRd) {
		this.showRd = showRd;
	}


	public boolean isTblRndr() {
		return tblRndr;
	}


	public void setTblRndr(boolean tblRndr) {
		this.tblRndr = tblRndr;
	}
	
}
