package report_package;

import group_head_package.DataBaseIncomeExpense;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpSession;

import main_package.DataBaseMethods;
import main_package.DataBaseMethodsHemant;
import main_package.DataBaseConnection;
import main_package.DataBaseMethodTaheer;
import main_package.HeaderBean;
import main_package.InstallmentInfo;
import main_package.UserInfo;
import org.primefaces.context.RequestContext;

@ManagedBean(name="cashFlowReport")
@ViewScoped

public class CashFlowReportBean implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	DataBaseReportMethods obj1=new DataBaseReportMethods();
	DataBaseMethods dbm=new DataBaseMethods();
	DataBaseMethodTaheer dbmt = new DataBaseMethodTaheer();
	String type="IN/OUT",basis,month="",year="", bankName,ssDate, firmName;
	
	ArrayList<SelectItem> yearList,monthList, bankList;
	
	ArrayList<InstallmentInfo> rdFdInterestList,fdInterestList,rdInterestList,paidInstallmentList,interestList;
	ArrayList<UserInfo> testList,rdFdList,inList,outList,finalList,companyWithdrawlList,companyDepositList,
						bankToBankTransferInList,bankToBankTransferOutList,depositList,loanPaymentList,rdPayList,applicantFeeList,particularList,
						shareCapitalList, insuranceFeeList,returnAmountList,extraExpenseList,shareAmountList, shareAmountBankList;
	ArrayList<UserInfo> withdrawlList,extraIncomeList,fixedDepositIncomeList, tdsSubList, instantLoanList, returnInstantBorrowList,fixedDepositExpenseList,loanAmountList
						,companyAmountTransferToBankList,bankAmountTransferToCompanyCash
						,otherDepositList,interestOnSavingsList,returnDSAList,salPayList;
	ArrayList<UserInfo> promotorsList,returnPromotorsList, returnPromotorsBankList, instantBorrowList, returnInstantLoanList, bankInList,loanPaymentBankList,rdPayBankList,customerDepositBankList,extraIncomeBankList,
						fixedDepositIncomeBankList,companyDepositListBank,companyAmountTransferToBankListForBankFlow
						,otherDepositListBank, odLoanReturnList, odLoanList;
	ArrayList<UserInfo> bankOutList,loanAmountBankList,customerWithdrawlBankList,returnDSABankList,salPayBankList, tdsSubBankList,returnAmountBankList,extraExpenseBankList,
						fixedDepositExpenseBankList,bankAmountTransferToCompanyCashListBank,companyWithdrawlListBank
						,bankToBankTransferOutListForBankFlow;
	ArrayList<UserInfo> cashTransCr,cashTransDr;
	
	boolean showCashBook,showParticular,renderDaily,renderCustom,renderMonthly,renderYearly,showReportTable,renderTransfer,renderIn,renderOut;
	double totalAmount=0,totalEntry=0,totalPenalty=0,inAmount=0,outAmount=0, totalIn, totalOut,netAmount=0.0, openingBalance;
	Date todayDate=null,startDate=new Date(),endDate=new Date(),startSessionDate,tdyDate,standard,date1,date2,date3,date4,date5,date6,date7,date8;
	Timestamp tdydt,stdt,stndrd,dt1,dt2,dt3,dt4,dt5,dt6,dt7,dt8;
	DecimalFormat dc=new DecimalFormat("##.##");
	int branchId;
	String branchName;
	String branchUserId;
	List<SelectItem> branchList ;
	DataBaseMethodsHemant dbmh = new DataBaseMethodsHemant();

	boolean disAll;
	String userType, cc;
	
	
	public CashFlowReportBean() 
	{
		basis="custom";
		bankList=new ArrayList<>();
		Connection conn=DataBaseConnection.JAVAConnection();
		bankList=new DataBaseIncomeExpense().allBankList(conn);
		HeaderBean hh=new HeaderBean();
		firmName=hh.getName();
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		branchUserId = (String) ss.getAttribute("branchUserId");
		branchList = new DataBaseMethods().branchList(branchUserId,conn);
		
		 cc=(String) ss.getAttribute("companyName");
	        
			userType= (String) ss.getAttribute("type");
			
		    disAll= dbmh.disAllByCompanyNameUserType(userType,cc);

		try {
			conn.close();
		} catch (Exception e) {
			// TODO: handle exception
		}		
	}
	
	public void checkTypeWithBasis()
	{
		if(basis.equals("custom"))
		{
			renderDaily=false;
			renderMonthly=false;
			renderYearly=false;
			renderCustom=true;
			todayDate=null;
			month="";
			year="";
		}
	}
	
	public void viewReport() throws SQLException, ParseException
	{	
		Connection connR = DataBaseConnection.JAVAConnection();
		
		if(branchId != 0)
		{
			branchName = new DataBaseMethods().branchNameByBranchId(branchId,connR);
			
			if(startDate.equals(endDate) || startDate.before(endDate))
			{
				String sDate="01-04-2017";
				
				SimpleDateFormat f = new SimpleDateFormat("dd-MM-yyyy");
				startSessionDate=f.parse(sDate);
				ssDate=new SimpleDateFormat("yyyy-MM-dd").format(startSessionDate.getTime());
				
				if(startDate.after(startSessionDate) || startDate.equals(startSessionDate))
				{
					bankName="N/A";
					
					if(type.equals("IN/OUT"))
					{
						renderTransfer=true;
						renderIn=renderOut=true;
						showParticular=true;
						in(todayDate,month,year,startDate,endDate);
						out(todayDate,month,year,startDate,endDate);
						finalList=new ArrayList<>();
						finalList.addAll(inList);
						finalList.addAll(outList);
						totalEntry=finalList.size();
						int i=1;
						totalAmount=totalPenalty=inAmount=outAmount=0;
						
						for(UserInfo uu : finalList)
						{
							uu.setSno(i++);
							if(uu.getType().equals("out"))
							{
								uu.setAmountOut(uu.getAmount());
								uu.setAmount(0);
								if(uu.getPayMode().equalsIgnoreCase("cash"))
								{
									outAmount+=uu.getAmountOut();
									outAmount=Double.valueOf(dc.format(outAmount));
									totalPenalty+=uu.getPenalty();
								}	
							}
							else
							{
								if((uu.getTransferredToBankName()==null || uu.getTransferredToBankName().equals("")))
								{
									inAmount+=uu.getAmount();
									inAmount=Double.valueOf(dc.format(inAmount));
									totalPenalty+=uu.getPenalty();
								}
							}
							
						} netAmount= inAmount - outAmount ;
						if(finalList.size()>0)
						{
							showReportTable=true;
						}
						else
						{
							showReportTable=false;
							FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("No Record Found!"));
							
						}
						totalAmount=Double.valueOf(dc.format(inAmount))+Double.valueOf(dc.format(outAmount));
						totalAmount=Double.valueOf(dc.format(totalAmount));
					}
						
					if(finalList.size()>0)
					{
						showCashBook=true;
					}
					else
					{
						showCashBook=false;
					}
					Collections.sort(finalList);
					
					for(int i=1;i<=finalList.size();i++)
					{
						finalList.get(i-1).setSno(i);
					}
				}
				else
				{
					FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Not a valid Date Selection For Current Finalnical Year !!!"));
				}
			}
			else
			{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Please Enter Date Properly !!!"));
			}
		}
		else
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Select Branch"));
		}
			
		
		
	}

	

	public void in(Date tdyDate, String mnth, String yr,Date strtdt,Date enddt) throws SQLException
	{
		Connection conn=DataBaseConnection.JAVAConnection();
		
		totalIn=0;
		
		inList=new ArrayList<>();
		totalAmount=totalEntry=totalPenalty=0;
		loanPaymentList=dbmt.loanEmiPaymentReportForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		rdPayList=obj1.allPayReceiptForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		depositList=obj1.depositPaymentListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		applicantFeeList=obj1.applicantFeeListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		extraIncomeList=obj1.allIncomeListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		fixedDepositIncomeList=obj1.allFixedDepositIncomeListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		bankAmountTransferToCompanyCash=obj1.amountTransferToCompanyByBankListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, bankName,conn);
		instantBorrowList=obj1.allInstantBorrowListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, "credit",bankName,conn);
		returnInstantLoanList=obj1.allInstantLoanListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, "debit",bankName,conn);
		promotorsList=obj1.allPromotorsListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,bankName,conn);
		odLoanReturnList=obj1.odLoanReturnListBetweenDate(branchId,tdyDate,mnth,yr,strtdt,enddt, bankName,conn);
		shareAmountList=obj1.shareAmountListCashAndBankFlow(branchId,tdyDate,month,year,startDate,endDate,"cash",conn);
		shareAmountList=obj1.shareAmountListCashAndBankFlowFromOtherShareInfo(branchId,tdyDate,month,year,startDate,endDate,"cash",conn,shareAmountList);
		cashTransCr = obj1.cashTrasnList(branchId, startDate, endDate,"Cr", conn);
		
		
		
		String sDate=new SimpleDateFormat("yyyy-MM-dd").format(startDate);
		double a=obj1.loanEmiPaymentForOpeningBalance(branchId,sDate,ssDate,conn);
		double b=obj1.rdPayListForOpeningBalance(branchId,sDate,ssDate,conn);
		double c=obj1.depositPayForOpeningBalance(branchId,sDate,ssDate,conn);
		double h=obj1.appFeeForOpeningBalance(branchId,sDate, ssDate,conn);
		double i=obj1.extraIncomeForOpeningBalance(branchId,sDate, ssDate,conn);
		double j=obj1.fdIncomeForOpeningBalance(branchId,sDate, ssDate,conn);
		double k=obj1.bankTransferAmountForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double l=obj1.PromotorAmountForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double m=obj1.instantBorrowForOpeningBalance(branchId,sDate, "credit", "cash", ssDate,conn);
		double n=obj1.instantLoanForOpeningBalance(branchId,sDate, "debit", "cash",ssDate,conn);
		double o=obj1.odLoanReturnAmountForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double p=obj1.cashTransferOpeningAmount(branchId,sDate,"Cr",conn);
		
		totalIn=a+b+c+h+i+j+k+l+m+n+o+p;
		
		inList.addAll(shareAmountList);
		inList.addAll(returnInstantLoanList);
		inList.addAll(instantBorrowList);
		inList.addAll(promotorsList);
		inList.addAll(loanPaymentList);
		inList.addAll(rdPayList);
		inList.addAll(depositList);
		inList.addAll(applicantFeeList);
		inList.addAll(extraIncomeList);
		inList.addAll(fixedDepositIncomeList);
		inList.addAll(bankAmountTransferToCompanyCash);
		inList.addAll(odLoanReturnList);
		inList.addAll(cashTransCr);
		
		try {
			conn.close();
		} catch (Exception e) {
			// TODO: handle exception
		}
		for(UserInfo ii : inList)
		{
			ii.setType("in");
		}
		
	}
	
	public void printBankBook() throws SQLException, ParseException
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		openingBalance=0;
		Connection conn=DataBaseConnection.JAVAConnection();
		bankInList=new ArrayList<>();bankOutList=new ArrayList<>();
		totalIn=totalOut=0;
		loanPaymentBankList=obj1.loanEmiPaymentReportForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		rdPayBankList=obj1.allPayReceiptForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		customerDepositBankList=obj1.depositPaymentListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		extraIncomeBankList=obj1.allIncomeListBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		fixedDepositIncomeBankList=obj1.allFixedDepositIncomeListBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		companyAmountTransferToBankListForBankFlow=obj1.amountTransferToBankByCompanyListForCashFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		otherDepositListBank=obj1.otherDepositListForCashFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		//companyWithdrawlListBank=obj1.BankAmountToCompanyForCashFlow(todayDate,month,year,startDate,endDate);
		bankToBankTransferOutListForBankFlow=obj1.bankToBankTransferForOutFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		instantBorrowList=obj1.allInstantBorrowListCashFlow(branchId,tdyDate,month,year,startDate,endDate, "credit",bankName,conn);
		returnInstantLoanList=obj1.allInstantLoanListCashFlow(branchId,tdyDate,month,year,startDate,endDate, "debit",bankName,conn);
		promotorsList=obj1.allPromotorsListCashFlow(branchId,tdyDate,month,year,startDate,endDate,bankName,conn);
		
		shareAmountBankList=obj1.shareAmountListCashAndBankFlow(branchId,tdyDate,month,year,startDate,endDate,bankName,conn);
		shareAmountBankList=obj1.shareAmountListCashAndBankFlowFromOtherShareInfo(branchId,tdyDate,month,year,startDate,endDate,bankName,conn,shareAmountBankList);
		
		for(UserInfo gg : bankToBankTransferOutListForBankFlow)
		{
			gg.setAmount(gg.getAmountOut());
			gg.setAmountOut(0);
		}
		
		String sDate=new SimpleDateFormat("yyyy-MM-dd").format(startDate);
		/*double a=obj1.loanEmiPayForBankOpeningBalance(sDate, bankName,ssDate,conn);
		double b=obj1.allPayReceiptForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double c=obj1.depositForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double d=obj1.allIncomePayForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double e=obj1.allFixedDepositForBankOpeningBalance(sDate, bankName,ssDate,conn);
		double f=obj1.amountTransferForBankOpeningBalance(sDate, bankName,ssDate,conn);
		double g=obj1.otherDepositForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double h=obj1.bankToBankTransferForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double i=obj1.instantBorrowForOpeningBalance(sDate, "credit", bankName, ssDate,conn);
		double j=obj1.instantLoanForOpeningBalance(sDate, "debit", bankName,ssDate,conn);
		double k=obj1.PromotorAmountForOpeningBalance(sDate, bankName,ssDate,conn);
		double s1=obj1.shareAmountOpeningBalance(sDate, ssDate, bankName,conn);
		s1+=obj1.shareAmountOpeningBalanceFromOtherShareInfo(sDate, ssDate, bankName,conn);
		totalIn+=a+b+c+d+e+g+h+i+j+k+s1;*/  // COMMENT BY GARG WEB INFOTECH, 13 MARCH, 2019
		
		totalIn+=dbm.closingBalanceOfBankIn(branchId,bankName, sDate,conn,"tb");
		double d=obj1.shareAmountOpeningBalance(branchId,sDate, ssDate, bankName,conn);
		d+=obj1.shareAmountOpeningBalanceFromOtherShareInfo(branchId,sDate, ssDate, bankName,conn);
		totalIn+=d;
		// System.out.println("Loan Emi: "+a+" All Pay; "+b+" deposit"+c+" all income"+d+" all fixed depo: "+e+" amount transfer: "+f+" other depo:"+g+" bank to bank:"+h  +"bank open in:  "+totalIn);
		
		bankInList.addAll(shareAmountBankList);
		bankInList.addAll(loanPaymentBankList);
		bankInList.addAll(rdPayBankList);
		bankInList.addAll(customerDepositBankList);
		bankInList.addAll(extraIncomeBankList);
		bankInList.addAll(fixedDepositIncomeBankList);
		bankInList.addAll(otherDepositListBank);
		//bankInList.addAll(companyAmountTransferToBankListForBankFlow);
		bankInList.addAll(bankToBankTransferOutListForBankFlow);
		//bankInList.addAll(companyWithdrawlListBank);
		bankInList.addAll(instantBorrowList);
		bankInList.addAll(returnInstantLoanList);
		bankInList.addAll(promotorsList);
		
		loanAmountBankList=obj1.loanAmountListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		customerWithdrawlBankList=obj1.withdrawlListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		returnAmountBankList=obj1.returnAmountListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		extraExpenseBankList=obj1.allExpenseListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		fixedDepositExpenseBankList=obj1.allFixedDepositExpenseListForCashFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		bankAmountTransferToCompanyCashListBank=obj1.amountTransferToCompanyByBankListForCashFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		returnInstantBorrowList=obj1.allInstantBorrowListCashFlow(branchId,tdyDate,month,year,startDate,endDate, "debit", bankName,conn);
		instantLoanList=obj1.allInstantLoanListCashFlow(branchId,tdyDate,month,year,startDate,endDate, "credit", bankName,conn);
		returnDSABankList=obj1.allReturnDSAListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		
		System.out.println("cc: " + cc + " type: " + userType);
		if ("SUDERSHANA FINANCE".equalsIgnoreCase(cc))
    	{
        	if ("masteradmin".equalsIgnoreCase(userType))
        	{
        		salPayBankList=obj1.allSalaryPayoutListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
        	}
    	}
		else
		{
			salPayBankList=obj1.allSalaryPayoutListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		}
		
		tdsSubBankList=obj1.allTdsSubListForBankFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		returnPromotorsBankList=obj1.allReturnPromotorsListCashFlow(branchId,tdyDate,month,year,startDate,endDate,bankName,conn);
		
		/*double m=obj1.loanAmountForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double n=obj1.withdrawForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double o=obj1.returnAmountForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double p=obj1.allExpensePayForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double q=obj1.allFdExpenseForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double r=obj1.amountTransferToCompanyForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double s=obj1.instantBorrowForOpeningBalance(sDate, "debit", bankName, ssDate,conn);
		double t=obj1.instantLoanForOpeningBalance(sDate, "credit", bankName, ssDate,conn);
		double u=obj1.returnPromotorAmountForOpeningBalance(sDate, bankName, ssDate,conn);
		double v=obj1.returnDSACommForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double w=obj1.salaryPayoutForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double x=obj1.allTdsPayForBankOpeningBalance(sDate, bankName, ssDate,conn);
		double y=obj1.returnPromotorAmountForOpeningBalance(sDate, bankName, ssDate,conn);
		
		totalOut+=m+n+o+p+q+r+s+t+u+v+w+x+y;*/  // COMMENT BY GARG WEB INFOTECH, 13 MARCH, 2019

		totalOut+=dbm.closingBalanceOfBankOut(branchId,bankName, sDate,conn,"tb");
		
		bankOutList.addAll(loanAmountBankList);
		bankOutList.addAll(customerWithdrawlBankList);
		bankOutList.addAll(returnAmountBankList);
		bankOutList.addAll(extraExpenseBankList);
		bankOutList.addAll(fixedDepositExpenseBankList);		
		bankOutList.addAll(bankAmountTransferToCompanyCashListBank);
		bankOutList.addAll(returnInstantBorrowList);		
		bankOutList.addAll(instantLoanList);
		bankOutList.addAll(returnDSABankList);
		if (salPayBankList!= null)
		{
			bankOutList.addAll(salPayBankList);
		}
		bankOutList.addAll(tdsSubBankList);
		bankOutList.addAll(returnPromotorsBankList);
		
		for(UserInfo hh : bankOutList)
		{
			hh.setAmountOut(hh.getAmount());
			hh.setAmount(0);
		}
		//System.out.println("???????????????"+totalIn+"-"+totalOut);
		openingBalance=totalIn-totalOut;
		openingBalance=Double.parseDouble(dc.format(openingBalance));
		
		ss.setAttribute("inlist",bankInList);
		ss.setAttribute("outList",bankOutList);
		String customDate=new SimpleDateFormat("dd/MM/yyyy").format(startDate)+"-"+new SimpleDateFormat("dd/MM/yyyy").format(endDate);
		ss.setAttribute("date",customDate);
		ss.setAttribute("bank", bankName);
		ss.setAttribute("balance",openingBalance);
		ss.setAttribute("dt", startDate);
		try {
			conn.close();
		} catch (Exception e2) {
			// TODO: handle exception
		}
		
		RequestContext.getCurrentInstance().execute("window.open('printBankBook.xhtml')");
		
	}
	//**************************************************************************************************************************
	
	public void out(Date tdyDate, String mnth, String yr,Date strtdt,Date enddt) throws SQLException
	{
		Connection conn=DataBaseConnection.JAVAConnection();

		totalOut=0;
		outList=new ArrayList<>();
		totalAmount=totalEntry=totalPenalty=0;
		loanAmountList=obj1.loanAmountListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		withdrawlList=obj1.withdrawlListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		returnAmountList=obj1.returnAmountListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		extraExpenseList=obj1.allExpenseListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		fixedDepositExpenseList=obj1.allFixedDepositExpenseListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, bankName,conn);
		companyAmountTransferToBankList=obj1.amountTransferToBankByCompanyListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, bankName,conn);
		//interestOnSavingsList=obj1.allInterestOnSavingsListForCashFlow(tdyDate,mnth,yr,strtdt,enddt);
		returnInstantBorrowList=obj1.allInstantBorrowListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, "debit", bankName,conn);
		instantLoanList=obj1.allInstantLoanListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt, "credit", bankName,conn);
		returnPromotorsList=obj1.allReturnPromotorsListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,bankName,conn);
		returnDSAList=obj1.allReturnDSAListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		
		System.out.println("cc: " + cc + " type: " + userType);
		if ("SUDERSHANA FINANCE".equalsIgnoreCase(cc))
    	{
        	if ("masteradmin".equalsIgnoreCase(userType))
        	{
        		salPayList=obj1.allSalaryPayoutListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
        	}
    	}
		else
		{
			salPayList=obj1.allSalaryPayoutListCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		}
		
		tdsSubList=obj1.allTdsSubListForCashFlow(branchId,tdyDate,mnth,yr,strtdt,enddt,conn);
		cashTransDr = obj1.cashTrasnList(branchId,startDate,endDate,"Dr",conn);
		
		//odLoanList=obj1.odLoanListBetweenDate(tdyDate,mnth,yr,strtdt,enddt, bankName,conn);
		
		String sDate=new SimpleDateFormat("yyyy-MM-dd").format(startDate);
		double a=obj1.loanAmountForOpeningBalance(branchId,sDate, ssDate,conn);
		double b=obj1.withdrawAmountForOpeningBalance(branchId,sDate, ssDate,conn);
		double c=obj1.returnAmountForOpeningBalance(branchId,sDate, ssDate,conn);
		double d=obj1.expenseForOpeningBalance(branchId,sDate, ssDate,conn);
		double e=obj1.fdExpenseForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double f=obj1.transferAmountForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double g=obj1.returnPromotorAmountForOpeningBalance(branchId,sDate, bankName, ssDate,conn);
		double j=obj1.returnDSACommForOpeningBalance(branchId,sDate, ssDate,conn);
		double k=obj1.salaryPayoutForOpeningBalance(branchId,sDate, ssDate,conn);
		double l=obj1.tdsForOpeningBalance(branchId,sDate, ssDate,conn);
		double s=obj1.instantBorrowForOpeningBalance(branchId,sDate, "debit", "cash", ssDate,conn);
		double t=obj1.instantLoanForOpeningBalance(branchId,sDate, "credit", "cash", ssDate,conn);
		double u=obj1.cashTransferOpeningAmount(branchId,sDate,"Dr",conn);
		//double u=obj1.odLoanReturnAmountForOpeningBalance(sDate, bankName, ssDate,conn);
	
		totalOut=a+b+c+d+e+f+g+j+k+l+s+t+u;
        //System.out.println("????????????????????? "+g);
		outList.addAll(loanAmountList);
		outList.addAll(returnPromotorsList);
		outList.addAll(withdrawlList);
		outList.addAll(returnAmountList);
		outList.addAll(extraExpenseList);
		outList.addAll(fixedDepositExpenseList);
		outList.addAll(companyAmountTransferToBankList);
		outList.addAll(instantLoanList);
		outList.addAll(returnInstantBorrowList);
		outList.addAll(returnDSAList);
		if (salPayList != null) 
		{
			outList.addAll(salPayList);
		}
		outList.addAll(tdsSubList);
		outList.addAll(cashTransDr);
	//	outList.addAll(odLoanList);
		//outList.addAll(interestOnSavingsList);
		for(UserInfo oo : outList)
		{
			oo.setType("out");
		}
		
	}
	
	public String cashBookReport() throws SQLException, ParseException
	{ 
		viewReport();
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId = (int) ss.getAttribute("branchId");
		Connection conn=DataBaseConnection.JAVAConnection();

		companyWithdrawlList=obj1.BankAmountToCompanyForCashFlow(branchId,todayDate,month,year,startDate,endDate,conn);
		companyDepositList=obj1.CompanyAmountToBankForCashFlow(branchId,todayDate,month,year,startDate,endDate,conn);
		//bankToBankTransferInList=obj1.bankToBankTransferForInFlow(todayDate,month,year,startDate,endDate);
		bankToBankTransferOutList=obj1.bankToBankTransferForOutFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		outList.addAll(companyDepositList);
		outList.addAll(bankToBankTransferOutList);
		inList.addAll(companyWithdrawlList);
		
		String sDate=new SimpleDateFormat("yyyy-MM-dd").format(startDate);
		
		double a=obj1.bankToBankAmountForOpeningBalance(branchId,sDate, ssDate,conn);
		double b=obj1.companyAmountToBankForOpeningBalance(branchId,sDate, ssDate,conn);
		double c=obj1.bankToBankTransferForOpeningBalance(branchId,sDate,ssDate,conn);
		double d=obj1.companyIssueShareCapital(branchId,sDate,"cash",conn, ssDate);
		
		totalIn+=a+c+d;
		totalOut+=b;
		openingBalance=totalIn-totalOut;
		
		ss.setAttribute("inlist",inList);
		ss.setAttribute("outList",outList);
		ss.setAttribute("balance",openingBalance);
		ss.setAttribute("dt", startDate);
		
		String customDate=new SimpleDateFormat("dd/MM/yyyy").format(startDate)+" To "+new SimpleDateFormat("dd/MM/yyyy").format(endDate);
		ss.setAttribute("date",customDate);
		try {
			conn.close();
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		inList=outList=new ArrayList<>();
		RequestContext.getCurrentInstance().execute("window.open('printCashBookReport.xhtml')");
		return "";
	}

	public void printCashBook2() throws SQLException, ParseException
	{
		double transCr=0.0,transDr=0.0;
		//openingBalance=totalIn=totalOut=0;
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		Connection conn=DataBaseConnection.JAVAConnection();
		companyWithdrawlList=obj1.BankAmountToCompanyForCashFlow(branchId,todayDate,month,year,startDate,endDate,conn);
		companyDepositList=obj1.CompanyAmountToBankForCashFlow(branchId,todayDate,month,year,startDate,endDate,conn);
		//bankToBankTransferInList=obj1.bankToBankTransferForInFlow(todayDate,month,year,startDate,endDate);
		bankToBankTransferOutList=obj1.bankToBankTransferForOutFlow(branchId,todayDate,month,year,startDate,endDate, bankName,conn);
		
		
		outList.addAll(companyDepositList);
		outList.addAll(bankToBankTransferOutList);
	
		inList.addAll(companyWithdrawlList);
		
		
		String sDate=new SimpleDateFormat("yyyy-MM-dd").format(startDate);
		
		double a=obj1.bankToBankAmountForOpeningBalance(branchId,sDate, ssDate,conn);
		double b=obj1.companyAmountToBankForOpeningBalance(branchId,sDate, ssDate,conn);
		double c=obj1.bankToBankTransferForOpeningBalance(branchId,sDate,ssDate,conn);
		//double d=obj1.companyIssueShareCapital(sDate,"cash",conn, ssDate);
		double d=obj1.shareAmountOpeningBalance(branchId,sDate, ssDate, "cash",conn);
		d+=obj1.shareAmountOpeningBalanceFromOtherShareInfo(branchId,sDate, ssDate, "cash",conn);
	
//		for(int i=0;i<cashTransCr.size();i++)
//		{
//			transCr = transCr+cashTransCr.get(i).getAmount();
//		}
//		
//		for(int i=0;i<cashTransDr.size();i++)
//		{
//			transDr = transDr+cashTransDr.get(i).getAmountOut();
//		}
		
		
		totalIn+=a+c+d;
		
		
		totalOut+=b;
		
		
		openingBalance=totalIn-totalOut;
		
		
		openingBalance=Double.parseDouble(dc.format(openingBalance));
		
		
		ss.setAttribute("inlist",inList);
		ss.setAttribute("outList",outList);
		ss.setAttribute("balance",openingBalance);
		ss.setAttribute("dt", startDate);
		
		String customDate=new SimpleDateFormat("dd/MM/yyyy").format(startDate)+"-"+new SimpleDateFormat("dd/MM/yyyy").format(endDate);
		ss.setAttribute("date",customDate);
		try {
			conn.close();
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		RequestContext.getCurrentInstance().execute("window.open('printCashBook2.xhtml')");
		inList=outList=new ArrayList<>();
	}
	
	public void print()
	{
		Date date=new Date();
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		ss.setAttribute("list",finalList);
		ss.setAttribute("total",totalAmount);
		ss.setAttribute("totalPenalty",totalPenalty);
		ss.setAttribute("size",totalEntry);
		//ss.setAttribute("type",type);
		ss.setAttribute("cashFlowtype",type);
		
		ss.setAttribute("basis",basis);
		ss.setAttribute("branchName", branchName);   //RR 13/05/2025
		if(basis.equals("daily"))
		{
			ss.setAttribute("date",new SimpleDateFormat("dd/MM/yyyy").format(todayDate));
		}
		else if(basis.equals("monthly"))
		{
			String monthName=dbm.monthList(Integer.valueOf(month));
			ss.setAttribute("date",(monthName+" - "+String.valueOf(date.getYear()+1900)));
		}
		else if(basis.equals("yearly"))
		{
			ss.setAttribute("date",year);
		}
		else if(basis.equals("custom"))
		{
			String customDate=new SimpleDateFormat("dd/MM/yyyy").format(startDate)+"-"+new SimpleDateFormat("dd/MM/yyyy").format(endDate);
			ss.setAttribute("date",customDate);
		}
			
		RequestContext.getCurrentInstance().execute("window.open('printCashFlowReport.xhtml')");
		
	}
	//****************************************************************************************************************
	
	public ArrayList<UserInfo> viewww(String type, Date strtdt, Date enddt)
	{
		Connection conn=DataBaseConnection.JAVAConnection();
		//total=0;
		setAllDates();
		interestList=new ArrayList<>();
		particularList=new ArrayList<>();
		paidInstallmentList=new ArrayList<>();
		testList=new ArrayList<>();
		boolean intfirst=false,intsecond=false,intthird=false,intfourth=false;
		for(UserInfo info : rdFdList)
		{
			UserInfo ii=new UserInfo();
			if(info.getScheme_type().equals(type))
			{
				ii.setScheme_type(info.getScheme_type());
				ii.setUser_no(info.getUser_no());
				ii.setOffice_date(info.getOffice_date());
				ii.setFirst_applicantName(info.getFirst_applicantName());
				ii.setInstallment_amount(info.getInstallment_amount());
				ii.setStrMatDate(info.getStrMatDate());
				
				particularList.add(ii);
			}
		}
		
		for(UserInfo uu : particularList)
		{
			
			paidInstallmentList=dbm.showInstallment(uu.getUser_no(),conn);
			if(paidInstallmentList!=null)
			{
				for(InstallmentInfo ll : paidInstallmentList)
				{
					InstallmentInfo oo=new InstallmentInfo();
					if(ll.getStatus().equals("Paid"))
					{
						oo.setUser_no(ll.getUser_no());
						oo.setCalc_interest(ll.getCalc_interest());
						oo.setOffice_date(uu.getOffice_date());
						oo.setStatus(ll.getStatus());
						oo.setInstlmntDate(ll.getInstlmntDate());
						oo.setName(ll.getName());
						oo.setIns_date(ll.getIns_date()); 
						interestList.add(oo);
					}
				}
			}
		}
		
		int i=0;
		int j=0;
		int year=0;
		for(InstallmentInfo ff : interestList)
		{
			String usercode="";
			double interest1=0,interest2=0,interest3=0,interest4=0;
			UserInfo ss=new UserInfo();
			Timestamp insdt=new Timestamp(ff.getInstlmntDate().getTime());

			if(i>0)
			{
				usercode=interestList.get(i-1).getUser_no();
			}
			
			if(!(usercode.equals(ff.getUser_no())))
			{
				j=0;
			}
			
			if(j==0)
			{
				year=ff.getOffice_date().getYear();
			}
			
			dt1.setYear(year);dt2.setYear(year);dt3.setYear(year);
			dt4.setYear(year);dt5.setYear(year);dt6.setYear(year);
			dt7.setYear(year);dt8.setYear(year);
			
			
			if((insdt.equals(dt1) || insdt.after(dt1)) && (insdt.equals(dt2) || insdt.before(dt2)))
			{
				
				if(intfirst==false || !(usercode.equals(ff.getUser_no())))
				{
					for(InstallmentInfo rr : interestList)
					{
						Timestamp insdt1=new Timestamp(rr.getInstlmntDate().getTime());
						if((ff.getUser_no().equals(rr.getUser_no()) && (insdt1.equals(dt1) || insdt1.after(dt1)) && (insdt1.equals(dt2) || insdt1.before(dt2)) ))
						{
							interest1=interest1+rr.getCalc_interest();
						}
					}
					intsecond=false;
					intfirst=true;
					intthird=false;
					intfourth=false;
					
					ss.setUser_no(ff.getUser_no());
					if(((dt2.after(stdt) || dt2.equals(stdt)) && (dt2.before(tdydt) || dt2.equals(tdydt))))
					{
						ss.setEntryDate(dt2);
						ss.setAmount(interest1);
						ss.setEntryDateStr(new SimpleDateFormat("dd/MM/yyyy").format(ss.getEntryDate()));
					}
				}
			}
			else if((insdt.equals(dt3) || insdt.after(dt3)) && (insdt.equals(dt4) || insdt.before(dt4)))
			{
				if(intsecond==false || !(usercode.equals(ff.getUser_no())))
				{
					for(InstallmentInfo rr : interestList)
					{
						Timestamp insdt1=new Timestamp(rr.getInstlmntDate().getTime());
						if((ff.getUser_no().equals(rr.getUser_no()) && (insdt1.equals(dt3) || insdt1.after(dt3)) && (insdt1.equals(dt4) || insdt1.before(dt4)) ))
						{
							interest2=interest2+rr.getCalc_interest();
						}
					}
					
					intsecond=true;
					intfirst=false;
					intthird=false;
					intfourth=false;
					
					ss.setUser_no(ff.getUser_no());
					
					if(((dt4.after(stdt) || dt4.equals(stdt)) && (dt4.before(tdydt) || dt4.equals(tdydt))))
					{
						
						ss.setEntryDate(dt4);
						ss.setAmount(interest2);
						ss.setEntryDateStr(new SimpleDateFormat("dd/MM/yyyy").format(ss.getEntryDate()));
					}
				}
			}
			else if((insdt.equals(dt5) || insdt.after(dt5)) && (insdt.equals(dt6) || insdt.before(dt6)))
			{	
				if(intthird==false || !(usercode.equals(ff.getUser_no())))
				{
					for(InstallmentInfo rr : interestList)
					{
						Timestamp insdt1=new Timestamp(rr.getInstlmntDate().getTime());
						if((ff.getUser_no().equals(rr.getUser_no()) && (insdt1.equals(dt5) || insdt1.after(dt5)) && (insdt1.equals(dt6) || insdt1.before(dt6)) ))
						{
							interest3=interest3+rr.getCalc_interest();
						}
					}
					
					intsecond=false;
					intfirst=false;
					intthird=true;
					intfourth=false;
					
					ss.setUser_no(ff.getUser_no());
					
					if(((dt6.after(stdt) || dt6.equals(stdt)) && (dt6.before(tdydt) || dt6.equals(tdydt))))
					{
						ss.setEntryDate(dt6);
						ss.setAmount(interest3);
						ss.setEntryDateStr(new SimpleDateFormat("dd/MM/yyyy").format(ss.getEntryDate()));
					}

				}
				year++;

			}
			else if((insdt.equals(dt7) || insdt.after(dt7)) && (insdt.equals(dt8) || insdt.before(dt8)))
			{
				if(intfourth==false || !(usercode.equals(ff.getUser_no())))
				{
					for(InstallmentInfo rr : interestList)
					{
				
						Timestamp insdt1=new Timestamp(rr.getInstlmntDate().getTime());
						if((ff.getUser_no().equals(rr.getUser_no()) && (insdt1.equals(dt7) || insdt1.after(dt7)) && (insdt1.equals(dt8) || insdt1.before(dt8)) ))
						{
							interest4=interest4+rr.getCalc_interest();
						}
					}
					
					intsecond=false;
					intfirst=false;
					intthird=false;
					intfourth=true;
					
					ss.setUser_no(ff.getUser_no());
					
					if(((dt8.after(stdt) || dt8.equals(stdt)) && (dt8.before(tdydt) || dt8.equals(tdydt))))
					{
						ss.setEntryDate(dt8);
						ss.setAmount(interest4);
						ss.setEntryDateStr(new SimpleDateFormat("dd/MM/yyyy").format(ss.getEntryDate()));
						
					}
				}
			}
				
			//****
			i++;j++;
			if(strtdt!=null && enddt!=null && (enddt.after(strtdt) || enddt.equals(strtdt)))
			{
				if(ss.getAmount()>0 && ((ss.getEntryDate().after(stdt) || ss.getEntryDate().equals(stdt)) && (ss.getEntryDate().before(tdydt) || ss.getEntryDate().equals(tdydt))))
				{
					ss.setFirst_applicantName(ff.getName());
					ss.setLoanNo(ff.getUser_no());
					ss.setPayMode("Cash");
					ss.setBank_name("");
					ss.setStatus(type+" Interest");
					ss.setTransferredToBankName("");
					testList.add(ss);
				}
			}
		}
		return testList;
	}
	
	//****************************************************************************************************************
	
	public void setAllDates()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId = (int) ss.getAttribute("branchId");
		date1=new Date();date2=new Date();
		date3=new Date();date4=new Date();
		date5=new Date();date6=new Date();
		date7=new Date();date8=new Date();
		
		dt1=new Timestamp(date1.getTime());dt2=new Timestamp(date2.getTime());
		dt3=new Timestamp(date3.getTime());dt4=new Timestamp(date4.getTime());
		dt5=new Timestamp(date5.getTime());dt6=new Timestamp(date6.getTime());
		dt7=new Timestamp(date7.getTime());dt8=new Timestamp(date8.getTime());
		

		standard=new Date();
		tdyDate=new Date();
		tdydt=new Timestamp(endDate.getTime());
		tdydt.setHours(0);tdydt.setMinutes(0);tdydt.setSeconds(0);tdydt.setNanos(0);
		
		stdt=new Timestamp(startDate.getTime());
		stdt.setHours(0);stdt.setMinutes(0);stdt.setSeconds(0);stdt.setNanos(0);
		
		stndrd=new Timestamp(endDate.getTime());
		stndrd.setDate(30);
		stndrd.setMonth(5);
		stndrd.setYear(endDate.getYear());
		stndrd.setHours(0);stndrd.setMinutes(0);stndrd.setSeconds(0);stndrd.setNanos(0);
		
		dt1.setDate(1);
		dt1.setMonth(3);
		dt1.setHours(0);dt1.setMinutes(0);dt1.setSeconds(0);dt1.setNanos(0);
		
		dt2.setDate(30);
		dt2.setMonth(5);
		dt2.setHours(0);dt2.setMinutes(0);dt2.setSeconds(0);dt2.setNanos(0);

		dt3.setDate(1);
		dt3.setMonth(6);
		dt3.setHours(0);dt3.setMinutes(0);dt3.setSeconds(0);dt3.setNanos(0);

		dt4.setDate(30);
		dt4.setMonth(8);
		dt4.setHours(0);dt4.setMinutes(0);dt4.setSeconds(0);dt4.setNanos(0);

		dt5.setDate(1);
		dt5.setMonth(9);
		dt5.setHours(0);dt5.setMinutes(0);dt5.setSeconds(0);dt5.setNanos(0);

		dt6.setDate(31);
		dt6.setMonth(11);
		dt6.setHours(0);dt6.setMinutes(0);dt6.setSeconds(0);dt6.setNanos(0);

		dt7.setDate(1);
		dt7.setMonth(0);
		dt7.setHours(0);dt7.setMinutes(0);dt7.setSeconds(0);dt7.setNanos(0);

		dt8.setDate(31);
		dt8.setMonth(2);
		dt8.setHours(0);dt8.setMinutes(0);dt8.setSeconds(0);dt8.setNanos(0);

		
		rdFdList=dbm.showUser(branchId,type);
	}
	
	
	
	public String getBranchName() {
		return branchName;
	}

	public void setBranchName(String branchName) {
		this.branchName = branchName;
	}

	public boolean isRenderDaily() {
		return renderDaily;
	}

	public void setRenderDaily(boolean renderDaily) {
		this.renderDaily = renderDaily;
	}

	public boolean isRenderMonthly() {
		return renderMonthly;
	}

	public void setRenderMonthly(boolean renderMonthly) {
		this.renderMonthly = renderMonthly;
	}

	public boolean isRenderYearly() {
		return renderYearly;
	}

	public void setRenderYearly(boolean renderYearly) {
		this.renderYearly = renderYearly;
	}

	public String getBasis() {
		return basis;
	}

	public void setBasis(String basis) {
		this.basis = basis;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public ArrayList<SelectItem> getYearList() {
		return yearList;
	}

	public void setYearList(ArrayList<SelectItem> yearList) {
		this.yearList = yearList;
	}

	public String getMonth() {
		return month;
	}

	public void setMonth(String month) {
		this.month = month;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public ArrayList<SelectItem> getMonthList() {
		return monthList;
	}

	public void setMonthList(ArrayList<SelectItem> monthList) {
		this.monthList = monthList;
	}

	public Date getTodayDate() {
		return todayDate;
	}

	public void setTodayDate(Date todayDate) {
		this.todayDate = todayDate;
	}

	public ArrayList<UserInfo> getFinalList() {
		return finalList;
	}

	public void setFinalList(ArrayList<UserInfo> finalList) {
		this.finalList = finalList;
	}
	public boolean isShowReportTable() {
		return showReportTable;
	}

	public void setShowReportTable(boolean showReportTable) {
		this.showReportTable = showReportTable;
	}

	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(double totalAmount) {
		this.totalAmount = totalAmount;
	}

	public double getTotalEntry() {
		return totalEntry;
	}

	public void setTotalEntry(double totalEntry) {
		this.totalEntry = totalEntry;
	}

	public double getTotalPenalty() {
		return totalPenalty;
	}

	public void setTotalPenalty(double totalPenalty) {
		this.totalPenalty = totalPenalty;
	}

	public boolean isRenderCustom() {
		return renderCustom;
	}

	public void setRenderCustom(boolean renderCustom) {
		this.renderCustom = renderCustom;
	}

	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 boolean isRenderTransfer() {
		return renderTransfer;
	}

	public void setRenderTransfer(boolean renderTransfer) {
		this.renderTransfer = renderTransfer;
	}

	public boolean isRenderIn() {
		return renderIn;
	}

	public void setRenderIn(boolean renderIn) {
		this.renderIn = renderIn;
	}

	public boolean isRenderOut() {
		return renderOut;
	}

	public void setRenderOut(boolean renderOut) {
		this.renderOut = renderOut;
	}

	public double getInAmount() {
		return inAmount;
	}

	public void setInAmount(double inAmount) {
		this.inAmount = inAmount;
	}

	public double getOutAmount() {
		return outAmount;
	}

	public void setOutAmount(double outAmount) {
		this.outAmount = outAmount;
	}

	public boolean isShowParticular() {
		return showParticular;
	}

	public void setShowParticular(boolean showParticular) {
		this.showParticular = showParticular;
	}

	public boolean isShowCashBook() {
		return showCashBook;
	}

	public void setShowCashBook(boolean showCashBook) {
		this.showCashBook = showCashBook;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public ArrayList<SelectItem> getBankList() {
		return bankList;
	}

	public void setBankList(ArrayList<SelectItem> bankList) {
		this.bankList = bankList;
	}

	public double getTotalIn() {
		return totalIn;
	}

	public void setTotalIn(double totalIn) {
		this.totalIn = totalIn;
	}

	public double getTotalOut() {
		return totalOut;
	}

	public void setTotalOut(double totalOut) {
		this.totalOut = totalOut;
	}

	public double getOpeningBalance() {
		return openingBalance;
	}

	public void setOpeningBalance(double openingBalance) {
		this.openingBalance = openingBalance;
	}
	public int getBranchId() {
		return branchId;
	}

	public void setBranchId(int branchId) {
		this.branchId = branchId;
	}

	public List<SelectItem> getBranchList() {
		return branchList;
	}

	public void setBranchList(List<SelectItem> branchList) {
		this.branchList = branchList;
	}

	public double getNetAmount() {
		return netAmount;
	}

	public void setNetAmount(double netAmount) {
		this.netAmount = netAmount;
	}

	public boolean isDisAll() {
		return disAll;
	}

	public void setDisAll(boolean disAll) {
		this.disAll = disAll;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getCc() {
		return cc;
	}

	public void setCc(String cc) {
		this.cc = cc;
	}

	
} 
