package report_package;

import java.io.Serializable;
import java.text.DecimalFormat;
import java.util.ArrayList;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

import main_package.LoanInfo;
import main_package.UserInfo;

import org.primefaces.context.RequestContext;

import other_package.ReportInfo;

@ManagedBean(name="loanStatement")
@ViewScoped
public class LoanStatementReportBean implements Serializable
{
	
ArrayList<UserInfo> list= new ArrayList<>();
double penaltyAmount=0.0,penaltyPaid=0.0,penaltyDue=0.0,totalChqCharge=0.0,paidChqCharge=0.0, total,recievedAmount;
LoanInfo selectedVal;
String operationType="";
public LoanStatementReportBean()
{
	total=0;
	recievedAmount=0;
	HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		list= (ArrayList<UserInfo>) ss.getAttribute("dailyPayList");
		penaltyAmount= (double) ss.getAttribute("penaltyAmount");
		penaltyPaid= (double) ss.getAttribute("penaltyPaid");
		penaltyDue= (double) ss.getAttribute("penaltyDue");
		totalChqCharge= (double) ss.getAttribute("totalChqCharge");
		paidChqCharge= (double) ss.getAttribute("paidChqCharge");
		selectedVal= (LoanInfo) ss.getAttribute("selectedVal");
	for(UserInfo ff: list)
	{
		total+=ff.getAmount();
		recievedAmount+=ff.getRecievedAmount();
	}
}


public double getPenaltyAmount() {
	return penaltyAmount;
}

public void setPenaltyAmount(double penaltyAmount) {
	this.penaltyAmount = penaltyAmount;
}

public double getPenaltyPaid() {
	return penaltyPaid;
}

public void setPenaltyPaid(double penaltyPaid) {
	this.penaltyPaid = penaltyPaid;
}

public double getPenaltyDue() {
	return penaltyDue;
}

public void setPenaltyDue(double penaltyDue) {
	this.penaltyDue = penaltyDue;
}

public double getTotalChqCharge() {
	return totalChqCharge;
}

public void setTotalChqCharge(double totalChqCharge) {
	this.totalChqCharge = totalChqCharge;
}

public double getPaidChqCharge() {
	return paidChqCharge;
}

public void setPaidChqCharge(double paidChqCharge) {
	this.paidChqCharge = paidChqCharge;
}

public LoanInfo getSelectedVal() {
	return selectedVal;
}

public void setSelectedVal(LoanInfo selectedVal) {
	this.selectedVal = selectedVal;
}

public double getTotal() {
	return total;
}

public void setTotal(double total) {
	this.total = total;
}


public ArrayList<UserInfo> getList() {
	return list;
}


public void setList(ArrayList<UserInfo> list) {
	this.list = list;
}


public double getRecievedAmount() {
	return recievedAmount;
}


public void setRecievedAmount(double recievedAmount) {
	this.recievedAmount = recievedAmount;
}





}
