package main_package;

import java.io.IOException;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;

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 org.primefaces.context.RequestContext;
import org.primefaces.model.UploadedFile;

import report_package.BorrowerLenderInfo;

@ManagedBean(name = "managePersonalLoan")
@ViewScoped
public class ManagePersonalLoanBean implements Serializable
{   
	
	DataBaseMethods obj=new DataBaseMethods();
	private static final long serialVersionUID = 1L;
	ArrayList<LoanInfo> pList,activeLoanList,closeLoanList,multiSelectList;
	LoanInfo selectedLoan;
	String searchType = "All", searchLoan = "All", newDsaCode, dsaCode = "-1", loanSearchType = "unpaid",userId,remark;
	ArrayList<SelectItem> freqList, loanList, dsaList;
	ArrayList<BorrowerLenderInfo> manualChargesList;
	BorrowerLenderInfo selectedRow;
	String doc1Path,doc2Path,doc3Path,doc4Path,doc5Path,doc6Path,doc7Path,doc8Path,doc9Path,doc10Path, loanNo;
	UploadedFile doc1photo, doc2photo, doc3photo, doc4photo, doc5photo,doc6photo, doc7photo, doc8photo, doc9photo, doc10photo;
	Date emiDate, chargesDate;
	int totalLoan, chargesAmount;
	boolean showData, showBtn, disDsa, printOne, printTwo, printThree, printFour, printFive, printSix, printSeven, printEight, printNine, printTenth, printEleventh,printTwelfth,printThirteen,printFourteen;
	boolean finPFirst,finPSecound,finPThird,finPfour,finPFive,finPSix,finPSeven;
	boolean finazone;
	boolean printInsuranseFormat;
	Date fromDate, toDate;
	
	
	
	public ManagePersonalLoanBean()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId =(int) ss.getAttribute("branchId");
		Connection conn=DataBaseConnection.JAVAConnection();
		freqList=obj.frequencySelectItemListFormLoanTable(branchId,"personalloan",conn);
		dsaList=obj.allDsaList(branchId,"",conn);
		userId=obj.userId();
		String empDataStatus=obj.checkSMessageApiDetailFromTable("employee_wise_data", "",conn);
		
		if(obj.userType().equals("employee") && empDataStatus.equalsIgnoreCase("active"))
		{
			dsaCode = obj.dsaCodeByEmpUserId(userId, conn);
			disDsa = true;
		}
		
		try 
		{
			conn.close();
		} 
		catch (SQLException e) 
		{
			e.printStackTrace();
		}
		
		selectedLoan=(LoanInfo) ss.getAttribute("selectedLoan");
		
		UserInfo selected = (UserInfo) ss.getAttribute("selectedDataForHeaderBean");
		if (!selected.firm_name.equalsIgnoreCase("null") &&
			    selected.firm_name.equalsIgnoreCase("FINAZONE MICRO SERVICES FOUNDATION")) 
		{	
			finazone=true;
		}
		
		fromDate = toDate = new Date();
		searchData();
	}
	
	public void freqWiseLoanList()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId =(int) ss.getAttribute("branchId");
		Connection conn=DataBaseConnection.JAVAConnection();
		showBtn=true;
		loanList=obj.loanNoListFreqWise(searchType,"personalloan",branchId,conn);
		try {
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	public void viewDocument()
	{    
		 
		 selectedLoan=new DataBaseMethods().loanDocumentsForView("personalloan",selectedLoan.getLoanNo(),selectedLoan);
		 loanNo = selectedLoan.getLoanNo();
		 
		 doc1Path=selectedLoan.getDoc1PathForEdit();
		 doc2Path=selectedLoan.getDoc2PathForEdit();
		 doc3Path=selectedLoan.getDoc3PathForEdit();
		 doc4Path=selectedLoan.getDoc4PathForEdit();
		 doc5Path=selectedLoan.getDoc5PathForEdit();
		 doc6Path=selectedLoan.getDoc6PathForEdit();
		 doc7Path=selectedLoan.getDoc7PathForEdit();
		 doc8Path=selectedLoan.getDoc8PathForEdit();
		 doc9Path=selectedLoan.getDoc9PathForEdit();
		 doc10Path=selectedLoan.getDoc10PathForEdit();
		 
	}
	
	public String updateDocument() throws IOException
	{
		if (doc1photo != null && doc1photo.getSize() > 0 && doc1photo.getSize()<1048576) 
		{
			doc1Path = doc1photo.getFileName();
			String exten[]=doc1Path.split("\\.");
			doc1Path=loanNo+"_1"+"."+exten[1];
			obj.makeProfile(doc1photo, doc1Path);
		}
		
		if (doc2photo != null && doc2photo.getSize() > 0 && doc2photo.getSize()<1048576) 
		{
			doc2Path = doc2photo.getFileName();
			String exten[]=doc2Path.split("\\.");
			doc2Path=loanNo+"_2"+"."+exten[1];
			obj.makeProfile(doc2photo, doc2Path);
		}
		
		if (doc3photo != null && doc3photo.getSize() > 0 && doc3photo.getSize()<1048576) 
		{
			doc3Path = doc3photo.getFileName();
			String exten[]=doc3Path.split("\\.");
			doc3Path=loanNo+"_3"+"."+exten[1];
			obj.makeProfile(doc3photo, doc3Path);
		}
		
		if (doc4photo != null && doc4photo.getSize() > 0 && doc4photo.getSize()<1048576) 
		{
			doc4Path = doc4photo.getFileName();
			String exten[]=doc4Path.split("\\.");
			doc4Path=loanNo+"_4"+"."+exten[1];
			obj.makeProfile(doc4photo, doc4Path);
		}
		
		
		if (doc5photo != null && doc5photo.getSize() > 0 && doc5photo.getSize()<1048576) 
		{
			doc5Path = doc5photo.getFileName();
			String exten[]=doc5Path.split("\\.");
			doc5Path=loanNo+"_5"+"."+exten[1];
			obj.makeProfile(doc5photo, doc5Path);
		}
		
		
		if (doc6photo != null && doc6photo.getSize() > 0 && doc6photo.getSize()<1048576) 
		{
			doc6Path = doc6photo.getFileName();
			String exten[]=doc6Path.split("\\.");
			doc6Path=loanNo+"_6"+"."+exten[1];
			obj.makeProfile(doc6photo, doc6Path);
		}
		
		if (doc7photo != null && doc7photo.getSize() > 0 && doc7photo.getSize()<1048576) 
		{
			doc7Path = doc7photo.getFileName();
			String exten[]=doc7Path.split("\\.");
			doc7Path=loanNo+"_7"+"."+exten[1];
			obj.makeProfile(doc7photo, doc7Path);
		}
		
		
		if (doc8photo != null && doc8photo.getSize() > 0 && doc8photo.getSize()<1048576) 
		{
			doc8Path = doc8photo.getFileName();
			String exten[]=doc8Path.split("\\.");
			doc8Path=loanNo+"_8"+"."+exten[1];
			obj.makeProfile(doc8photo, doc8Path);
		}
		
		if (doc9photo != null && doc9photo.getSize() > 0 && doc9photo.getSize()<1048576) 
		{
			doc9Path = doc9photo.getFileName();
			String exten[]=doc9Path.split("\\.");
			doc9Path=loanNo+"_9"+"."+exten[1];
			obj.makeProfile(doc9photo, doc9Path);
		}
		
		
		if (doc10photo != null && doc10photo.getSize() > 0 && doc10photo.getSize()<1048576) 
		{
			doc10Path = doc10photo.getFileName();
			String exten[]=doc10Path.split("\\.");
			doc10Path=loanNo+"_10"+"."+exten[1];
			obj.makeProfile(doc10photo, doc10Path);
		}
		

		int i=obj.updateLoanDocumentDetail(selectedLoan.getId(), "personalloan", doc1Path, doc2Path, doc3Path, doc4Path, doc5Path, doc6Path, doc7Path, doc8Path, doc9Path, doc10Path);
	    System.out.println("value of the i  return is :"+i);
		if(i>=1)
		{
			FacesContext fc=FacesContext.getCurrentInstance();
			fc.addMessage(null, new FacesMessage(" Documents Upload Sucessfully Done"));
		}
		else
		{
			FacesContext fc=FacesContext.getCurrentInstance();
			fc.addMessage(null, new FacesMessage("Error in Documents Upload"));
		}
		return "managePersonalLoan.xhtml";
	}
	
	
	public void searchData()
	{  
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId =(int) ss.getAttribute("branchId");
		System.out.println(branchId + " " + dsaCode + " " + loanSearchType + " " + searchType + " " + searchLoan);
		pList = obj.personalLoanListByDate(branchId,dsaCode, loanSearchType, searchType, searchLoan);
		totalLoan=pList.size();
		showData=true;
	}
	
	public void manualChargesData()
	{
		manualChargesList=obj.manualChargesDataList(selectedLoan.getLoanNo(), "personalloan");
	}
	
	public void deleteEntry()
	{
		int i=obj.deleteManualChargeEntry(selectedRow.getId());
		if(i>0)
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Manual Charges Deleted Sucessfully..."));
			manualChargesData();
		}
		else
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error Occurred!!! Please Try Again...."));
		}
	}
	
	public void updateDsa()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId =(int) ss.getAttribute("branchId");
		if(multiSelectList.size()>0)
		{
			int count=0;
			Connection conn=DataBaseConnection.JAVAConnection();
			for(LoanInfo uu: multiSelectList)
			{
				if(!uu.getDsacode().equals(newDsaCode))
				{
					count+=obj.updateDsaInLoanAccount(uu.getId(), newDsaCode, "personalloan", conn);
				}
			}
			
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(count+" Account Has been Successfully Tranfer in the Code of "+newDsaCode));
			pList = obj.personalLoanListByDate(branchId,dsaCode, loanSearchType, searchType, searchLoan);
			try {
				conn.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Dear User, Please Select at least one Loan Account for Transfer"));
		}
	}
	
	public void firstEmiDueDate()
	{
		emiDate=selectedLoan.getEmiDate();
	}
	
	public void viewPersonalLoan()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		ss.setAttribute("selectedLoan", selectedLoan);
		ss.setAttribute("pageName", "editViewPersonalLoan.xhtml");
		
		RequestContext.getCurrentInstance().execute("window.open('viewPersonalLoan.xhtml')");
	}
	    	
	public void printSanctionLoan()
    {
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
        ss.setAttribute("selectedLoan",selectedLoan);
        
        if(printOne==true)
        {
        	 RequestContext.getCurrentInstance().execute("window.open('printFormatOfSanctionNote.xhtml')");
        }
        
        if(printTwo==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printSanctionLetter.xhtml')");
        }
        
        if(printThree==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printRepaymentSchedule.xhtml')");
        }
        
        if(printFour==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printRepayment.xhtml')");
        }
        
        if(printFive==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printDpn.xhtml')");
        }
        
        if(printSix==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printAgreementForm.xhtml')");
        }
        
        if(printSeven==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printDisbursementLetter.xhtml')");
        }
        
        if(printEight==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printDpnHindi.xhtml')");
        }
        
        if(printNine==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printWelcomeLetter.xhtml')");
        }
        
        if(printTenth==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printLoanApplicationForm.xhtml')");
            
            UserInfo selecteduser=new UserInfo();
            selecteduser=obj.allShareHoldersForView(selectedLoan.getShareHolderNo(), selecteduser);
            selecteduser=obj.allShareHoldersForView(selecteduser.getShareHolderNo(),selecteduser);
    		ss.setAttribute("selecteduserForPrintRegForm",selecteduser);
        }
        
        if(printEleventh==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printLoanForm.xhtml')");
        }
        if(printTwelfth==true)
        {
            RequestContext.getCurrentInstance().execute("window.open('printAgreementFormII.xhtml')");

        }
        if(printThirteen == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printChequeForm.xhtml')");
        }
        
        if(printFourteen == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printChequeG1Form.xhtml')");
        }
        
        if(printInsuranseFormat == true)
        {
        	if (Double.valueOf(selectedLoan.getInsuranceFee()) == 0)
        	{
        		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Insurance Fee is Zero"));
        		return;
			}
        	
        	UserInfo selecteduser=new UserInfo();
            selecteduser=obj.allShareHoldersForView(selectedLoan.getShareHolderNo(), selecteduser);
            selecteduser=obj.allShareHoldersForView(selecteduser.getShareHolderNo(),selecteduser);
    		ss.setAttribute("selecteduserForPrintRegForm",selecteduser);
        	
        	RequestContext.getCurrentInstance().execute("window.open('printInsuranceCertificate.xhtml')");
        	RequestContext.getCurrentInstance().execute("window.open('printInsuranceCertificateHindi.xhtml')");
        }
        
        if(finPFirst == true )
        {
        	RequestContext.getCurrentInstance().execute("window.open('PrintFinazoneSactionLetter.xhtml')");

        }
        if(finPSecound == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printDemandPromissoryNote.xhtml')");
        }
        
        if(finPThird == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printInsuranceConsent.xhtml')");
        }
        if(finPfour == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printDemandPrommisory2.xhtml')");
        }
        
        if(finPFive == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printLoanReceipt.xhtml')");
        }
        	
        if(finPSix == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('PrintConsentLetter.xhtml')");
        }
        
        if(finPSeven == true)
        {
        	RequestContext.getCurrentInstance().execute("window.open('printAgreementIII.xhtml')");
        }
        
    }
	
	public void editPersonalLoan()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		ss.setAttribute("selectedLoan", selectedLoan);
		
		RequestContext.getCurrentInstance().execute("window.open('editPersonalLoan.xhtml')");
	}
	
	public void printAgreementForm()
    {
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
        ss.setAttribute("selectedLoan",selectedLoan);
        RequestContext.getCurrentInstance().execute("window.open('printAgreementForm.xhtml')");
    }
	

	public void updateEmiDueDate()
	{
		HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		int branchId =(int) ss.getAttribute("branchId");
		Connection conn=DataBaseConnection.JAVAConnection();
		if(emiDate.equals(selectedLoan.getEmiDate()))
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Dear User, You Can't Update Same FIRST EMI DATE Again. Please Try Again...."));
		}
		else
		{
			int i=obj.updateFirstEMIDate("personalloan", selectedLoan.getLoanNo(),emiDate, conn);
			if(i>0)
			{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("FIRST EMI DATE Update Sucessfully."));
				pList = obj.personalLoanListByDate(branchId,dsaCode, loanSearchType, searchType, searchLoan);
			}
			
			else
			{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error in updation."));
			}
		}
		
		try {
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void addCharges()
	{
		if(chargesAmount>0)
		{
			int i=obj.addManualCharges(selectedLoan.getLoanNo(), "personalloan", chargesDate, chargesAmount, remark);
			if(i>0)
			{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Manual Charges added Sucessfully..."));
			}
			else
			{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error Occurred!!! Please Try Again...."));
			}
		}
		else
		{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Dear User, Charges Must be Greater Than ZERO. Please Try Again...."));
		}
	}
	
	public void grtPrint() {
		if (multiSelectList != null && multiSelectList.size()>0) {
			ArrayList<UserInfo> list1 = new ArrayList<>();
			
			Connection conn = DataBaseConnection.JAVAConnection();
			
			String loanOfficerName = "";
			
			for (LoanInfo li : multiSelectList) {
				UserInfo ff = new UserInfo();
				
				System.out.println("Selected Loan No = " + li.getLoanNo());
				System.out.println("Selected ShareHolder = " + li.getShareHolderNo());
				System.out.println("Selected Loan Amount = " + li.getLoanAmtInt());
				System.out.println("Selected Loan Purpose = " + li.getLoanPurpose());
				
				  if (loanOfficerName.equals("")) {
				        loanOfficerName = li.getDsaName();
				    }
				
				ff = obj.memberBasicDetail(li.getShareHolderNo(), conn);

				ff.setLoan(li.getLoanAmount());

				ff.setWord(li.getLoanAmountWord());

				ff.setReason(li.getLoanPurpose());

	            list1.add(ff);
				
			}
			
			HttpSession ss = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
			
			 ss.setAttribute("list", list1);

		        
		        ss.setAttribute("center", "");
		        ss.setAttribute("loanOfficerName", loanOfficerName);
		        System.out.println("loanOfficer" + loanOfficerName);
		        try {
					conn.close();
				} catch (Exception e) {
                     e.printStackTrace();
				}
		        
		        RequestContext.getCurrentInstance()
	            .execute("window.open('selectedAcccount.xhtml')");
			
		}else {
			FacesContext.getCurrentInstance().addMessage(
		            null,
		            new FacesMessage(
		                "Please Select At Least One Loan Account For GRT Print."
		            )
		        );
		}
	}
	
	
	public LoanInfo getSelectedLoan() {
		return selectedLoan;
	}
	public void setSelectedLoan(LoanInfo selectedLoan) {
		this.selectedLoan = selectedLoan;
	}
	public ArrayList<LoanInfo> getpList() {
		return pList;
	}
	public void setpList(ArrayList<LoanInfo> pList) {
		this.pList = pList;
	}

	public String getSearchType() {
		return searchType;
	}

	public void setSearchType(String searchType) {
		this.searchType = searchType;
	}

	public ArrayList<SelectItem> getFreqList() {
		return freqList;
	}

	public void setFreqList(ArrayList<SelectItem> freqList) {
		this.freqList = freqList;
	}

	public Date getEmiDate() {
		return emiDate;
	}

	public void setEmiDate(Date emiDate) {
		this.emiDate = emiDate;
	}

	public int getTotalLoan() {
		return totalLoan;
	}

	public void setTotalLoan(int totalLoan) {
		this.totalLoan = totalLoan;
	}

	public boolean isShowData() {
		return showData;
	}

	public void setShowData(boolean showData) {
		this.showData = showData;
	}

	public String getSearchLoan() {
		return searchLoan;
	}

	public void setSearchLoan(String searchLoan) {
		this.searchLoan = searchLoan;
	}

	public ArrayList<SelectItem> getLoanList() {
		return loanList;
	}

	public void setLoanList(ArrayList<SelectItem> loanList) {
		this.loanList = loanList;
	}

	public boolean isShowBtn() {
		return showBtn;
	}

	public void setShowBtn(boolean showBtn) {
		this.showBtn = showBtn;
	}

	public ArrayList<LoanInfo> getMultiSelectList() {
		return multiSelectList;
	}

	public void setMultiSelectList(ArrayList<LoanInfo> multiSelectList) {
		this.multiSelectList = multiSelectList;
	}

	public String getNewDsaCode() {
		return newDsaCode;
	}

	public void setNewDsaCode(String newDsaCode) {
		this.newDsaCode = newDsaCode;
	}

	public ArrayList<SelectItem> getDsaList() {
		return dsaList;
	}

	public void setDsaList(ArrayList<SelectItem> dsaList) {
		this.dsaList = dsaList;
	}

	public String getDsaCode() {
		return dsaCode;
	}

	public void setDsaCode(String dsaCode) {
		this.dsaCode = dsaCode;
	}

	public String getLoanSearchType() {
		return loanSearchType;
	}

	public void setLoanSearchType(String loanSearchType) {
		this.loanSearchType = loanSearchType;
	}

	public boolean isDisDsa() {
		return disDsa;
	}

	public void setDisDsa(boolean disDsa) {
		this.disDsa = disDsa;
	}

	public boolean isPrintOne() {
		return printOne;
	}

	public void setPrintOne(boolean printOne) {
		this.printOne = printOne;
	}

	public boolean isPrintTwo() {
		return printTwo;
	}

	public void setPrintTwo(boolean printTwo) {
		this.printTwo = printTwo;
	}

	public boolean isPrintThree() {
		return printThree;
	}

	public void setPrintThree(boolean printThree) {
		this.printThree = printThree;
	}

	public boolean isPrintFour() {
		return printFour;
	}

	public void setPrintFour(boolean printFour) {
		this.printFour = printFour;
	}

	public boolean isPrintFive() {
		return printFive;
	}

	public void setPrintFive(boolean printFive) {
		this.printFive = printFive;
	}

	public boolean isPrintSix() {
		return printSix;
	}

	public void setPrintSix(boolean printSix) {
		this.printSix = printSix;
	}

	public boolean isPrintSeven() {
		return printSeven;
	}

	public void setPrintSeven(boolean printSeven) {
		this.printSeven = printSeven;
	}

	public boolean isPrintEight() {
		return printEight;
	}

	public void setPrintEight(boolean printEight) {
		this.printEight = printEight;
	}

	public boolean isPrintNine() {
		return printNine;
	}

	public void setPrintNine(boolean printNine) {
		this.printNine = printNine;
	}

	public boolean isPrintTenth() {
		return printTenth;
	}

	public void setPrintTenth(boolean printTenth) {
		this.printTenth = printTenth;
	}

	public boolean isPrintEleventh() {
		return printEleventh;
	}

	public void setPrintEleventh(boolean printEleventh) {
		this.printEleventh = printEleventh;
	}

	public ArrayList<BorrowerLenderInfo> getManualChargesList() {
		return manualChargesList;
	}

	public void setManualChargesList(ArrayList<BorrowerLenderInfo> manualChargesList) {
		this.manualChargesList = manualChargesList;
	}

	public int getChargesAmount() {
		return chargesAmount;
	}

	public void setChargesAmount(int chargesAmount) {
		this.chargesAmount = chargesAmount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getChargesDate() {
		return chargesDate;
	}

	public void setChargesDate(Date chargesDate) {
		this.chargesDate = chargesDate;
	}

	public BorrowerLenderInfo getSelectedRow() {
		return selectedRow;
	}

	public void setSelectedRow(BorrowerLenderInfo selectedRow) {
		this.selectedRow = selectedRow;
	}

	public boolean isPrintTwelfth() {
		return printTwelfth;
	}

	public void setPrintTwelfth(boolean printTwelfth) {
		this.printTwelfth = printTwelfth;
	}

	public boolean isPrintThirteen() {
		return printThirteen;
	}

	public void setPrintThirteen(boolean printThirteen) {
		this.printThirteen = printThirteen;
	}

	public boolean isPrintFourteen() {
		return printFourteen;
	}

	public void setPrintFourteen(boolean printFourteen) {
		this.printFourteen = printFourteen;
	}

	public DataBaseMethods getObj() {
		return obj;
	}

	public void setObj(DataBaseMethods obj) {
		this.obj = obj;
	}

	public ArrayList<LoanInfo> getActiveLoanList() {
		return activeLoanList;
	}

	public void setActiveLoanList(ArrayList<LoanInfo> activeLoanList) {
		this.activeLoanList = activeLoanList;
	}

	public ArrayList<LoanInfo> getCloseLoanList() {
		return closeLoanList;
	}

	public void setCloseLoanList(ArrayList<LoanInfo> closeLoanList) {
		this.closeLoanList = closeLoanList;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getDoc1Path() {
		return doc1Path;
	}

	public void setDoc1Path(String doc1Path) {
		this.doc1Path = doc1Path;
	}

	public String getDoc2Path() {
		return doc2Path;
	}

	public void setDoc2Path(String doc2Path) {
		this.doc2Path = doc2Path;
	}

	public String getDoc3Path() {
		return doc3Path;
	}

	public void setDoc3Path(String doc3Path) {
		this.doc3Path = doc3Path;
	}

	public String getDoc4Path() {
		return doc4Path;
	}

	public void setDoc4Path(String doc4Path) {
		this.doc4Path = doc4Path;
	}

	public String getDoc5Path() {
		return doc5Path;
	}

	public void setDoc5Path(String doc5Path) {
		this.doc5Path = doc5Path;
	}

	public UploadedFile getDoc1photo() {
		return doc1photo;
	}

	public void setDoc1photo(UploadedFile doc1photo) {
		this.doc1photo = doc1photo;
	}

	public UploadedFile getDoc2photo() {
		return doc2photo;
	}

	public void setDoc2photo(UploadedFile doc2photo) {
		this.doc2photo = doc2photo;
	}

	public UploadedFile getDoc3photo() {
		return doc3photo;
	}

	public void setDoc3photo(UploadedFile doc3photo) {
		this.doc3photo = doc3photo;
	}

	public UploadedFile getDoc4photo() {
		return doc4photo;
	}

	public void setDoc4photo(UploadedFile doc4photo) {
		this.doc4photo = doc4photo;
	}

	public UploadedFile getDoc5photo() {
		return doc5photo;
	}

	public void setDoc5photo(UploadedFile doc5photo) {
		this.doc5photo = doc5photo;
	}

	public String getLoanNo() {
		return loanNo;
	}

	public void setLoanNo(String loanNo) {
		this.loanNo = loanNo;
	}

	public String getDoc6Path() {
		return doc6Path;
	}

	public void setDoc6Path(String doc6Path) {
		this.doc6Path = doc6Path;
	}

	public String getDoc7Path() {
		return doc7Path;
	}

	public void setDoc7Path(String doc7Path) {
		this.doc7Path = doc7Path;
	}

	public String getDoc8Path() {
		return doc8Path;
	}

	public void setDoc8Path(String doc8Path) {
		this.doc8Path = doc8Path;
	}

	public String getDoc9Path() {
		return doc9Path;
	}

	public void setDoc9Path(String doc9Path) {
		this.doc9Path = doc9Path;
	}

	public String getDoc10Path() {
		return doc10Path;
	}

	public void setDoc10Path(String doc10Path) {
		this.doc10Path = doc10Path;
	}

	public UploadedFile getDoc6photo() {
		return doc6photo;
	}

	public void setDoc6photo(UploadedFile doc6photo) {
		this.doc6photo = doc6photo;
	}

	public UploadedFile getDoc7photo() {
		return doc7photo;
	}

	public void setDoc7photo(UploadedFile doc7photo) {
		this.doc7photo = doc7photo;
	}

	public UploadedFile getDoc8photo() {
		return doc8photo;
	}

	public void setDoc8photo(UploadedFile doc8photo) {
		this.doc8photo = doc8photo;
	}

	public UploadedFile getDoc9photo() {
		return doc9photo;
	}

	public void setDoc9photo(UploadedFile doc9photo) {
		this.doc9photo = doc9photo;
	}

	public UploadedFile getDoc10photo() {
		return doc10photo;
	}

	public void setDoc10photo(UploadedFile doc10photo) {
		this.doc10photo = doc10photo;
	}

	public boolean isFinPFirst() {
		return finPFirst;
	}

	public void setFinPFirst(boolean finPFirst) {
		this.finPFirst = finPFirst;
	}

	public boolean isFinPSecound() {
		return finPSecound;
	}

	public void setFinPSecound(boolean finPSecound) {
		this.finPSecound = finPSecound;
	}

	public boolean isFinPThird() {
		return finPThird;
	}

	public void setFinPThird(boolean finPThird) {
		this.finPThird = finPThird;
	}

	public boolean isFinPfour() {
		return finPfour;
	}

	public void setFinPfour(boolean finPfour) {
		this.finPfour = finPfour;
	}

	public boolean isFinPFive() {
		return finPFive;
	}

	public void setFinPFive(boolean finPFive) {
		this.finPFive = finPFive;
	}

	public boolean isFinazone() {
		return finazone;
	}

	public void setFinazone(boolean finazone) {
		this.finazone = finazone;
	}

	public boolean isFinPSix() {
		return finPSix;
	}

	public void setFinPSix(boolean finPSix) {
		this.finPSix = finPSix;
	}

	public boolean isFinPSeven() {
		return finPSeven;
	}

	public void setFinPSeven(boolean finPSeven) {
		this.finPSeven = finPSeven;
	}

	public Date getFromDate() {
		return fromDate;
	}

	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}

	public Date getToDate() {
		return toDate;
	}

	public void setToDate(Date toDate) {
		this.toDate = toDate;
	}

	public boolean isPrintInsuranseFormat() {
		return printInsuranseFormat;
	}

	public void setPrintInsuranseFormat(boolean printInsuranseFormat) {
		this.printInsuranseFormat = printInsuranseFormat;
	}
	
}