package main_package;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
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 group_head_package.DataBaseIncomeExpense;

@ManagedBean(name = "salaryCreation")
@ViewScoped

public class salaryCreationAndPay implements Serializable
{	
	int lopDays;
	
	public int totalDays,workingDays;
	 
	
	public double salary1;
	
	public double salaryAmount, salary, basicYear, basicMonth, houseRentAllowance, specialAllowance, otherAllowance, GrossSalary, 
				  employeeEsicContribution, employeePfContribution, totalFixedPay, totalPfDeduction, TotalEsicDeduction, 
				  netCashInHand, basicMonthYear, houseRentAllowanceYear, specialAllowanceYear, otherAllowanceYear, 
				  GrossSalaryYear, employeeEsicContributionYear, employeePfContributionYear, totalFixedPayYear, 
				  totalPfDeductionYear, TotalEsicDeductionYear, incrementAmountGross, netCashInHandYear, incentive, 
				  arrearIncentive, arrearSalary, grandTotal, otherDeduction, fuelAmount;
	
	double EMPLOYEE_PF_RATE = 0.0;     // employee PF deduction
	double EMPLOYER_PF_RATE = 0.0;     // company PF contribution

	double EMPLOYEE_ESIC_RATE = 0.0;   // employee ESIC deduction
	double EMPLOYER_ESIC_RATE = 0.0;   // company ESIC contribution

	double ESIC_LIMIT = 0.0;
	double PF_WAGE_LIMIT = 0.0;     // optional, if PF capped
	boolean isPfApplicable = true;
	boolean isEsicApplicable = salary1 <= ESIC_LIMIT;
	boolean isPfLimitApply = false;     // true करोगे तो PF max 15000 basic पर लगेगा
	double basicPer;
	double hraPer ;
	double specialPer ;
	double advanceSalaryDeduction = 0.0;
	private ArrayList<AdvanceSalaryPayInfo> advanceSalaryDetails =
	        new ArrayList<AdvanceSalaryPayInfo>();
	
	
	String companyName;
	
	String lableEmpCode;
	
	String selectedYear, selectedMonth, selectEmployee;
	
	String name, description, selectedName, paymentMode, chequeNo, savingAccountNo, bankBranch, label, borrowAmount, savingNo, 
	   	   fromBank;
	
	public String employeeCode, funtion, employeeName, panNumber, desination, pfNumber, branch, uanNo, state, esicNo, bankName, 
				  bankAccountNo, dateOfJoining, designation;
	
	
	public Date salaryFromDate, salaryToDate;
	
	Date payDate = new Date(), chequeDate;
	
	
	boolean showCheque,showTransfer, pay;
	DataBaseMethodsRavi dbr= new DataBaseMethodsRavi();
	
	
	public static List<String> savingAccList;
	
	ArrayList<pfEsicModel>pfList; 
	ArrayList<SelectItem> list, bankList;
	ArrayList<SelectItem> monthList, yearList, employeeList;
	
	
	EmployeeInfo employeeInfo;
	BankInfo bank_info;
	UserInfo savingDetail;
	double netCashInHandAfterDeduction;

	double advanceAmt= 0.0;
	String salarySrtDate,salaryEndDate;
	int branchId;
	
	SimpleDateFormat sdfForDb = new SimpleDateFormat("yyyy-MM-dd");
	
	DataBaseMethodsSalary dbms = new DataBaseMethodsSalary();
	DbYashwant dby = new DbYashwant();
    DataBaseMethods obj = new DataBaseMethods();
    DataBaseMethodsRaviK dbrk = new DataBaseMethodsRaviK();
    DataBaseMethodTaheer dbmt = new DataBaseMethodTaheer();
		
	
    
	public salaryCreationAndPay()
	{
		HttpSession ss = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		branchId = (int) ss.getAttribute("branchId");
		companyName = (String) ss.getAttribute("companyName");
		System.out.println("company name is" + companyName);
		
		/*HttpSession ss=(HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		type=(String) ss.getAttribute("type");*/
		
		yearList = dbms.allYearList();
		monthList = dbms.allMonths();
		payDate = new Date();
		
    	Date date = obj.uniqueDate();
	    StringBuffer temp = new StringBuffer(String.valueOf(date));
		selectedYear = temp.substring(temp.length() - 4);
		
//		LocalDate today = LocalDate.now();
//		int month = today.getMonthValue(); // returns 1 for January, 12 for December
		
		pfList= dby.viewPfEsic();
		
		for(pfEsicModel pp : pfList)
		{
			EMPLOYEE_PF_RATE = pp.getEmployeePfRate();
			EMPLOYER_PF_RATE = pp.getEmployerPfRate();
			EMPLOYEE_ESIC_RATE = pp.getEmployeeEsicRate();
			EMPLOYER_ESIC_RATE = pp.getEmployerEsicRate();
			ESIC_LIMIT = pp.getEsicLimit();
			PF_WAGE_LIMIT = pp.getPfWageLimit();
			isPfApplicable= pp.isPfApplicable();
			isPfLimitApply= pp.isPfLimitApply();
			basicPer=pp.getBasicPer();
			hraPer=pp.getHraPer();
			specialPer= pp.getSpecialPer();
		}	
		
		String dd = "";
		employeeList = dbms.employeeListForSalary(branchId, dd);
	}
	
	
	public void salaryDateByMonth() {

	    if (selectedMonth == null || selectedMonth.trim().equals("")
	            || selectedYear == null || selectedYear.trim().equals("")) {
	        return;
	    }

	    try {

	        int month = Integer.parseInt(selectedMonth);
	        int year = Integer.parseInt(selectedYear);

	        Calendar cal = Calendar.getInstance();

	        // First date
	        cal.set(Calendar.YEAR, year);
	        cal.set(Calendar.MONTH, month - 1);
	        cal.set(Calendar.DAY_OF_MONTH, 1);

	        salaryFromDate = cal.getTime();
	        salarySrtDate =  sdfForDb.format(salaryFromDate);

	        // Last date
	        cal.set(Calendar.DAY_OF_MONTH,cal.getActualMaximum(Calendar.DAY_OF_MONTH));

	        salaryToDate = cal.getTime();
	        salaryEndDate = sdfForDb.format(salaryToDate);

	        // Total days
	        totalDays = cal.getActualMaximum(Calendar.DAY_OF_MONTH);

	        // Initially full month working days
	        workingDays = totalDays;

	        System.out.println("Salary From Date = " + salaryFromDate);
	        System.out.println("Salary To Date   = " + salaryToDate);
	        System.out.println("Total Days       = " + totalDays);
	        
	        

	    } catch (Exception e) {
	        e.printStackTrace();
	    }
	}
	
	
	public void incetiveCal()
	{
    	grandTotal = GrossSalary + incentive + arrearIncentive + arrearSalary + fuelAmount;
			
    	
    	        netCashInHand = grandTotal-advanceAmt;
    	    
    	    System.out.println("Gross Salary: " + GrossSalary);
    	    System.out.println("Incentive: " + incentive);
    	    System.out.println("Arrear Incentive: " + arrearIncentive);
    	    System.out.println("Arrear Salary: " + arrearSalary);
    	    System.out.println("Fuel Amount: " + fuelAmount);
    	    System.out.println("Grand Total: " + grandTotal);
	}
	
	 public void deductionCal()
		{
	    	double ne =	netCashInHand;
			
	    	if(otherDeduction!=0)
	    	{
	    		netCashInHandAfterDeduction = netCashInHand - otherDeduction; 
	    		netCashInHand = grandTotal - otherDeduction;
	    		System.out.println(netCashInHandAfterDeduction);
	    	}			
	    	else 
	    	{
	    		netCashInHandAfterDeduction= ne;
	    		netCashInHand = grandTotal - otherDeduction;
	    		System.out.println(netCashInHandAfterDeduction);
	    	}
		}  
	    
	
	
	public void fetchdeatail()
	{
		int dayMonth = dbms.calculateDayInMonth(Integer.parseInt(selectedMonth), Integer.parseInt(selectedYear));
		String dd = selectedYear + "-" + selectedMonth + "-" + dayMonth;
		totalDays = dayMonth;
		
		workingDays = 0;
		advanceAmt = dbr.getAdvanceSalaryAmount(selectEmployee, selectedMonth, selectedYear, branchId);

		salaryCreation();
		Connection conn = DataBaseConnection.JAVAConnection();
		System.out.println("advance amt"+advanceAmt);
		//advanceAmt = dbr.getAdvanceSalaryAmount(selectEmployee, selectedMonth, selectedYear, branchId);advanceAmt =dbrk.advanceAmountByEmp(selectEmployee, selectedMonth, salaryFromDate, salaryToDate, branchId, conn);
		
		String type = "SalaryAmount";
		String Amount = (dby.fetchEmployeeDetail(selectEmployee, type));
		 
		salary1= Double.parseDouble(Amount);
		salary = Double.parseDouble(Amount);
		 	
		type = "employeeCode";
		
		employeeCode = (dby.fetchEmployeeDetail(selectEmployee, type));
		lableEmpCode = dby.manageEmployeeId(employeeCode);
 
    	int c = dby.checkSalaryStatus(conn, employeeCode, selectedMonth, selectedYear);
    	if(c == 0)
    	{	
    		pay = true;
		 
    		type = "funtion";
			funtion = (dby.fetchEmployeeDetail(selectEmployee, type));
			 
			type = "employeeName";
			employeeName = (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "panNo";
			panNumber =  (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "designation";
			designation = dby.fetchEmployeeDetail(selectEmployee,type);
			
			type = "pfNo";
			pfNumber = (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "branch";
			branch =  (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "uanNo";
			uanNo =  (dby.fetchEmployeeDetail(selectEmployee,type));
			System.out.println(uanNo);
			 
			type = "state";
			state =  (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "esicNo";
			esicNo =  (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			 
			type = "bankAccNo";
			bankAccountNo =  (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "dateOfJoin";
			dateOfJoining = (dby.fetchEmployeeDetail(selectEmployee,type));
			 
			type = "bankName1";
			bankName =  (dby.fetchEmployeeDetail(selectEmployee,type)); 
    	}
    	else 
    	{	
    		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Employee Salary already Payout"));
    	}	
	}
	
	
	
	public void checkBank()
	{
		Connection conn = DataBaseConnection.JAVAConnection();
		bank_info = obj.obtainBankInfoById(bankName, conn);
		bankBranch = bank_info.getBank_branch();
		
	/*	address=bank_info.address;
		accNo=bank_info.acc_no;*/
		
		try 
		{
			conn.close();
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
	}
	
	
	
	public void savingAccountDetail()
	{	
		//System.out.println("sv: "+savingAccountNo);
		if(savingAccountNo.contains("/"))
		{
			savingNo = savingAccountNo.substring(0, savingAccountNo.indexOf("/"));
		}
		
		savingDetail = obj.savingAccountDetailByAccountNo(savingNo);
	}
	
	
	
	public List<String> completeText(String name)
	{
		HttpSession ss = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
		 int branchId = (int) ss.getAttribute("branchId");
		savingAccList = new DataBaseAutoCompAndDuplicate().savingAccountNo(branchId,name);
		if(savingAccList.size() == 0)
		{
			FacesContext.getCurrentInstance().addMessage(null, 
											new FacesMessage("Saving Account Is not opened till now of Selected Share Holder"));
		}
		return savingAccList;
	}	
    
	//salaryCalculation935130
	public void salaryCreation()
	{	
	
			lopDays = totalDays - workingDays;
			
			// month wise
			double perDaySalary = salary1 / totalDays;

			// Round before converting to int to avoid truncation
			salaryAmount = (int) Math.round(perDaySalary * workingDays);

			// Monthly salary breakdown
			basicMonth = Math.round(salaryAmount / 30.0 * 30 * 47 / 100.0);
			houseRentAllowance = Math.round(basicMonth * 50 / 100.0);
			specialAllowance = Math.round(basicMonth * 50 / 100.0);
			otherAllowance = Math.round(salaryAmount - basicMonth - houseRentAllowance - specialAllowance);

			// Yearly values
			basicMonthYear = basicMonth * 12;
			houseRentAllowanceYear = houseRentAllowance * 12;
			specialAllowanceYear = specialAllowance * 12;
			otherAllowanceYear = otherAllowance * 12;

			GrossSalaryYear = basicMonthYear + houseRentAllowanceYear + specialAllowanceYear + otherAllowanceYear;

			// Monthly gross
			GrossSalary = GrossSalaryYear / 12;

//			// ESIC and PF
//			employeeEsicContribution = (int) Math.round(GrossSalary * 3.25 / 100.0);
//			employeePfContribution = Math.round(basicMonth * 12 / 100.0);
//
//			// Yearly ESIC and PF
//			employeeEsicContributionYear = employeeEsicContribution * 12;
//			employeePfContributionYear = employeePfContribution * 12;

			totalFixedPayYear = GrossSalaryYear + employeeEsicContributionYear + employeePfContributionYear;
			totalFixedPay = totalFixedPayYear / 12;

//			// Deductions
//			totalPfDeductionYear = Math.round(basicMonthYear * 12 / 100.0);
//			TotalEsicDeductionYear = (int) Math.round(GrossSalaryYear * 0.75 / 100.0);

			// PF wage
			double pfWage = basicMonth;

			if (isPfLimitApply && pfWage > PF_WAGE_LIMIT) {
			    pfWage = PF_WAGE_LIMIT;
			}

			// PF deduction and employer contribution
			if (isPfApplicable) {
			    totalPfDeduction = Math.round(pfWage * EMPLOYEE_PF_RATE / 100.0);
			    employeePfContribution = Math.round(pfWage * EMPLOYER_PF_RATE / 100.0);
			} else {
			    totalPfDeduction = 0;
			    employeePfContribution = 0;
			}

			// ESIC deduction and employer contribution
			if (isEsicApplicable) {
			    TotalEsicDeduction = Math.round(GrossSalary * EMPLOYEE_ESIC_RATE / 100.0);
			    employeeEsicContribution = Math.round(GrossSalary * EMPLOYER_ESIC_RATE / 100.0);
			} else {
			    TotalEsicDeduction = 0;
			    employeeEsicContribution = 0;
			}

			// Yearly
			totalPfDeductionYear = totalPfDeduction * 12;
			TotalEsicDeductionYear = TotalEsicDeduction * 12;

			employeePfContributionYear = employeePfContribution * 12;
			employeeEsicContributionYear = employeeEsicContribution * 12;
			
			// Net cash yearly
			netCashInHandYear = GrossSalaryYear - totalPfDeductionYear - TotalEsicDeductionYear - advanceAmt;

//			// Monthly deductions
//			totalPfDeduction = Math.round(totalPfDeductionYear / 12.0);
//			TotalEsicDeduction = Math.round(TotalEsicDeductionYear / 12.0);

			// Conditional ESIC deduction removal
			
			if (salary1 > 21000) 
			{
			    TotalEsicDeduction = 0;
			    employeeEsicContribution = 0;
			}

			// Monthly net cash in hand
			netCashInHand = GrossSalary - totalPfDeduction - TotalEsicDeduction - otherDeduction - advanceAmt;
			grandTotal = GrossSalary;
		}
	
	
	
	
	public void checkPaymentMode()
	{
		Connection conn = DataBaseConnection.JAVAConnection();
		
		if(paymentMode.equalsIgnoreCase("Cash"))
		{
			showCheque = false;
		}
		else if(paymentMode.equalsIgnoreCase("Transfer"))
		{
			showCheque = false;
			showTransfer = true;
		}
		else
		{
			bankList = new ArrayList<>();
			bankList = new DataBaseIncomeExpense().allBankList(conn);
			label = paymentMode;
			showCheque = true;
		}
		
		try 
		{
			conn.close();
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
	}	
	
	
	
    public void paySalary()
    {
    	Connection conn = DataBaseConnection.JAVAConnection();
    	{
    		payDate = new Date();
    		Timestamp tt = null;
	    	
    		if(chequeDate != null)
	    	{
	    		tt = new Timestamp(getChequeDate().getTime());
	    	}
	    	
	    	Timestamp tf = new Timestamp(getPayDate().getTime());
	    	
	    	HttpSession ss = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
			int branchId = (int) ss.getAttribute("branchId");
	    	
	    	int i = dbmt.add_employee_salary(conn, employeeCode, selectEmployee, funtion, desination, pfNumber, uanNo, state, esicNo, 
	    									bankName, totalDays, bankAccountNo, workingDays, dateOfJoining, lopDays, basicMonth, 
	    									houseRentAllowance, specialAllowance, otherAllowance, GrossSalary, 
	    									employeeEsicContribution, employeePfContribution, totalFixedPay, totalPfDeduction, 
	    									TotalEsicDeduction, netCashInHand, paymentMode, tt, chequeNo, fromBank, description, tf, 
	    									selectedYear, selectedMonth, branchId, panNumber, designation, incentive, 
	    									arrearIncentive, arrearSalary, grandTotal, otherDeduction, salaryFromDate, salaryToDate, 
	    									fuelAmount, advanceAmt);
	    	
	    	if(i > 0)
	    	{
	    		Timestamp time=new Timestamp(new Date().getTime());
	            time.setMonth(Integer.parseInt(selectedMonth));
	            time.setDate(1);
	    		dbms.entryInSalaryLedger(selectEmployee, Integer.parseInt(selectedMonth), Integer.parseInt(selectedYear), 
	    								grandTotal+ advanceAmt, "Credit", "0", time, branchId);
//				dby.addSalaryPayout(selectEmployee, netCashInHand, "Debit", payDate, paymentMode, chequeNo, chequeDate, fromBank, 
//	    							bankBranch,description,branchId);
//
//    			if(paymentMode.equalsIgnoreCase("Cash"))
//				{
//			  		obj.decreaseCapitalCompanyAmount(branchId,(double)netCashInHand);
				  	FacesContext.getCurrentInstance().addMessage(null, 
				  										new FacesMessage("Employee Salary Create Sucessfully. Transaction"));
//				}
//    			else 
//				{
//    				obj.decreaseBankBalance(fromBank, netCashInHand,conn);
//    				FacesContext.getCurrentInstance().addMessage(null, 
//				  									new FacesMessage("Employee Salary Payout Sucessfully. Transaction Completed."));
//    			}
			    pay = false;
	    	}

//    	 	if(paymentMode.equalsIgnoreCase("Transfer"))
// 			{
// 				savingAccountDetail();
// 			}
//    	 
//    		int i = obj.addSalaryPayout(selectEmployee, netCashInHand, "Debit", payDate, paymentMode, chequeNo, chequeDate, 
//	    								bankName, bankBranch,description,branchId);
//			if(i > 0)
//			{
//				//no=obj.nextNo("borrower");
//				if(paymentMode.equalsIgnoreCase("Cash"))
//				{
//			  		obj.decreaseCapitalCompanyAmount(branchId,netCashInHand);
//			  		FacesContext.getCurrentInstance().addMessage(null, 
//	    											new FacesMessage("Employee Salary Payout Sucessfully. Transaction Completed."));
//				}
//				else if(paymentMode.equalsIgnoreCase("Transfer"))
//				{
//					obj.increaseSavingAccountAmountForOdLoan(netCashInHand, savingNo);
//					int a = obj.userDeposit(branchId, savingNo, String.valueOf(netCashInHand), payDate, paymentMode, chequeNo, 
//	    									chequeDate, bankName, "approved", "N/A", "Salary Credit", "");
//					/*new DataBaseIncomeExpense().addExpense(payDate, "Other_Dr", paymentMode, String.valueOf(amount), chequeNo, 
//	    													 bankBranch, bankName, chequeDate,"Salary Credit", "Salary Credit", 
//															 "0", "0", 0, "0");*/
//				
//					// Comment By Mr. Chetan Garg  4 Feb
//					FacesContext.getCurrentInstance().addMessage(null, 
//	    										new FacesMessage("Employee Salary Payout Sucessfully. Transaction Completed."));
//				}
//				else
//				{
//					FacesContext.getCurrentInstance().addMessage(null, 
//    					new FacesMessage("Employee Salary Payout Sucessfully. Please Approve Cheque to complete the transaction."));
//				}
//				
//	    		pay=false;			
//			}
	    	else
	    	{
	    		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error Occured!!!"));		
	    	}
    	}	
    }
	
    
    
    public void calculateWorkingDaysByFromAndToDate() 
    {
        workingDays = 0;

        if (salaryFromDate == null || salaryToDate == null) 
        {
            return;
        }

        long from = salaryFromDate.getTime();
        long to = salaryToDate.getTime();

        if (to < from) 
        {
            return;
        }

        long diffInMillis = to - from;
        workingDays = (int) (diffInMillis / (1000 * 60 * 60 * 24)) + 1; // +1 if inclusive
        
        salaryCreation();
    }

    public void showAdvanceSalaryDetails() {

        advanceSalaryDetails = dbr.getAdvanceSalaryPayList(
                selectEmployee,
                selectedMonth,
                selectedYear,
                branchId
        );
    }
    
	public ArrayList<SelectItem> getEmployeeList() {
		return employeeList;
	}

	public void setEmployeeList(ArrayList<SelectItem> employeeList) {
		this.employeeList = employeeList;
	}


	public String getEmployeeCode() {
		return employeeCode;
	}


	public void setEmployeeCode(String employeeCode) {
		this.employeeCode = employeeCode;
	}


	public String getFuntion() {
		return funtion;
	}


	public void setFuntion(String funtion) {
		this.funtion = funtion;
	}


	public String getEmployeeName() {
		return employeeName;
	}


	public void setEmployeeName(String employeeName) {
		this.employeeName = employeeName;
	}


	public String getPanNumber() {
		return panNumber;
	}

	public void setPanNumber(String panNumber) {
		this.panNumber = panNumber;
	}


	


	public String getPfNumber() {
		return pfNumber;
	}


	public void setPfNumber(String pfNumber) {
		this.pfNumber = pfNumber;
	}


	public String getBranch() {
		return branch;
	}


	public void setBranch(String branch) {
		this.branch = branch;
	}


	public String getUanNo() {
		return uanNo;
	}


	public void setUanNo(String uanNo) {
		this.uanNo = uanNo;
	}


	public String getState() {
		return state;
	}


	public void setState(String state) {
		this.state = state;
	}


	public String getEsicNo() {
		return esicNo;
	}


	public void setEsicNo(String esicNo) {
		this.esicNo = esicNo;
	}


	public String getBankName() {
		return bankName;
	}


	public void setBankName(String bankName) {
		this.bankName = bankName;
	}


	

	public String getBankAccountNo() {
		return bankAccountNo;
	}


	public void setBankAccountNo(String bankAccountNo) {
		this.bankAccountNo = bankAccountNo;
	}


	public String getDateOfJoining() {
		return dateOfJoining;
	}


	public void setDateOfJoining(String dateOfJoining) {
		this.dateOfJoining = dateOfJoining;
	}


	

	

	public ArrayList<SelectItem> getMonthList() {
		return monthList;
	}


	public void setMonthList(ArrayList<SelectItem> monthList) {
		this.monthList = monthList;
	}


	public ArrayList<SelectItem> getYearList() {
		return yearList;
	}


	public void setYearList(ArrayList<SelectItem> yearList) {
		this.yearList = yearList;
	}


	public EmployeeInfo getEmployeeInfo() {
		return employeeInfo;
	}


	public void setEmployeeInfo(EmployeeInfo employeeInfo) {
		this.employeeInfo = employeeInfo;
	}


	public String getSelectedYear() {
		return selectedYear;
	}


	public void setSelectedYear(String selectedYear) {
		this.selectedYear = selectedYear;
	}


	public String getSelectedMonth() {
		return selectedMonth;
	}


	public void setSelectedMonth(String selectedMonth) {
		this.selectedMonth = selectedMonth;
	}


	public String getSelectEmployee() {
		return selectEmployee;
	}


	public void setSelectEmployee(String selectEmployee) {
		this.selectEmployee = selectEmployee;
	}


	
	public int getTotalDays() {
		return totalDays;
	}


	public void setTotalDays(int totalDays) {
		this.totalDays = totalDays;
	}


	public int getWorkingDays() {
		return workingDays;
	}


	public void setWorkingDays(int workingDays) {
		this.workingDays = workingDays;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public String getSelectedName() {
		return selectedName;
	}


	public void setSelectedName(String selectedName) {
		this.selectedName = selectedName;
	}


	public String getPaymentMode() {
		return paymentMode;
	}


	public void setPaymentMode(String paymentMode) {
		this.paymentMode = paymentMode;
	}


	public String getChequeNo() {
		return chequeNo;
	}


	public void setChequeNo(String chequeNo) {
		this.chequeNo = chequeNo;
	}


	public String getSavingAccountNo() {
		return savingAccountNo;
	}


	public void setSavingAccountNo(String savingAccountNo) {
		this.savingAccountNo = savingAccountNo;
	}


	public String getBankBranch() {
		return bankBranch;
	}


	public void setBankBranch(String bankBranch) {
		this.bankBranch = bankBranch;
	}


	public String getLabel() {
		return label;
	}


	public void setLabel(String label) {
		this.label = label;
	}


	public String getBorrowAmount() {
		return borrowAmount;
	}


	public void setBorrowAmount(String borrowAmount) {
		this.borrowAmount = borrowAmount;
	}


	public String getSavingNo() {
		return savingNo;
	}


	public void setSavingNo(String savingNo) {
		this.savingNo = savingNo;
	}


	public ArrayList<SelectItem> getList() {
		return list;
	}


	public void setList(ArrayList<SelectItem> list) {
		this.list = list;
	}


	public ArrayList<SelectItem> getBankList() {
		return bankList;
	}


	public void setBankList(ArrayList<SelectItem> bankList) {
		this.bankList = bankList;
	}


	public boolean isShowCheque() {
		return showCheque;
	}


	public void setShowCheque(boolean showCheque) {
		this.showCheque = showCheque;
	}


	public boolean isShowTransfer() {
		return showTransfer;
	}


	public void setShowTransfer(boolean showTransfer) {
		this.showTransfer = showTransfer;
	}


	
	public Date getPayDate() {
		return payDate;
	}


	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}


	public Date getChequeDate() {
		return chequeDate;
	}


	public void setChequeDate(Date chequeDate) {
		this.chequeDate = chequeDate;
	}


	public String getFromBank() {
		return fromBank;
	}


	public void setFromBank(String fromBank) {
		this.fromBank = fromBank;
	}


	public boolean isPay() {
		return pay;
	}


	public void setPay(boolean pay) {
		this.pay = pay;
	}


	public String getDesination() {
		return desination;
	}


	public void setDesination(String desination) {
		this.desination = desination;
	}


	public String getDesignation() {
		return designation;
	}


	public void setDesignation(String designation) {
		this.designation = designation;
	}


	public double getSalary1() {
		return salary1;
	}


	public void setSalary1(double salary1) {
		this.salary1 = salary1;
	}


	public double getSalaryAmount() {
		return salaryAmount;
	}


	public void setSalaryAmount(double salaryAmount) {
		this.salaryAmount = salaryAmount;
	}


	public double getSalary() {
		return salary;
	}


	public void setSalary(double salary) {
		this.salary = salary;
	}


	public double getBasicYear() {
		return basicYear;
	}


	public void setBasicYear(double basicYear) {
		this.basicYear = basicYear;
	}


	public double getBasicMonth() {
		return basicMonth;
	}


	public void setBasicMonth(double basicMonth) {
		this.basicMonth = basicMonth;
	}


	public double getHouseRentAllowance() {
		return houseRentAllowance;
	}


	public void setHouseRentAllowance(double houseRentAllowance) {
		this.houseRentAllowance = houseRentAllowance;
	}


	public double getSpecialAllowance() {
		return specialAllowance;
	}


	public void setSpecialAllowance(double specialAllowance) {
		this.specialAllowance = specialAllowance;
	}


	public double getOtherAllowance() {
		return otherAllowance;
	}


	public void setOtherAllowance(double otherAllowance) {
		this.otherAllowance = otherAllowance;
	}


	public double getGrossSalary() {
		return GrossSalary;
	}


	public void setGrossSalary(double grossSalary) {
		GrossSalary = grossSalary;
	}


	public double getEmployeeEsicContribution() {
		return employeeEsicContribution;
	}


	public void setEmployeeEsicContribution(double employeeEsicContribution) {
		this.employeeEsicContribution = employeeEsicContribution;
	}


	public double getEmployeePfContribution() {
		return employeePfContribution;
	}


	public void setEmployeePfContribution(double employeePfContribution) {
		this.employeePfContribution = employeePfContribution;
	}


	public double getTotalFixedPay() {
		return totalFixedPay;
	}


	public void setTotalFixedPay(double totalFixedPay) {
		this.totalFixedPay = totalFixedPay;
	}


	public double getTotalPfDeduction() {
		return totalPfDeduction;
	}


	public void setTotalPfDeduction(double totalPfDeduction) {
		this.totalPfDeduction = totalPfDeduction;
	}


	public double getTotalEsicDeduction() {
		return TotalEsicDeduction;
	}


	public void setTotalEsicDeduction(double totalEsicDeduction) {
		TotalEsicDeduction = totalEsicDeduction;
	}


	public double getNetCashInHand() {
		return netCashInHand;
	}


	public void setNetCashInHand(double netCashInHand) {
		this.netCashInHand = netCashInHand;
	}


	public double getBasicMonthYear() {
		return basicMonthYear;
	}


	public void setBasicMonthYear(double basicMonthYear) {
		this.basicMonthYear = basicMonthYear;
	}


	public double getHouseRentAllowanceYear() {
		return houseRentAllowanceYear;
	}


	public void setHouseRentAllowanceYear(double houseRentAllowanceYear) {
		this.houseRentAllowanceYear = houseRentAllowanceYear;
	}


	public double getSpecialAllowanceYear() {
		return specialAllowanceYear;
	}


	public void setSpecialAllowanceYear(double specialAllowanceYear) {
		this.specialAllowanceYear = specialAllowanceYear;
	}


	public double getOtherAllowanceYear() {
		return otherAllowanceYear;
	}


	public void setOtherAllowanceYear(double otherAllowanceYear) {
		this.otherAllowanceYear = otherAllowanceYear;
	}


	public double getGrossSalaryYear() {
		return GrossSalaryYear;
	}


	public void setGrossSalaryYear(double grossSalaryYear) {
		GrossSalaryYear = grossSalaryYear;
	}


	public double getEmployeeEsicContributionYear() {
		return employeeEsicContributionYear;
	}


	public void setEmployeeEsicContributionYear(double employeeEsicContributionYear) {
		this.employeeEsicContributionYear = employeeEsicContributionYear;
	}
	 public double getFuelAmount() {
		return fuelAmount;
	}

	public void setFuelAmount(double fuelAmount) {
		this.fuelAmount = fuelAmount;
	}

	public double getEmployeePfContributionYear() {
		return employeePfContributionYear;
	}


	public void setEmployeePfContributionYear(double employeePfContributionYear) {
		this.employeePfContributionYear = employeePfContributionYear;
	}


	public double getTotalFixedPayYear() {
		return totalFixedPayYear;
	}


	public void setTotalFixedPayYear(double totalFixedPayYear) {
		this.totalFixedPayYear = totalFixedPayYear;
	}


	public double getTotalPfDeductionYear() {
		return totalPfDeductionYear;
	}


	public void setTotalPfDeductionYear(double totalPfDeductionYear) {
		this.totalPfDeductionYear = totalPfDeductionYear;
	}


	public double getTotalEsicDeductionYear() {
		return TotalEsicDeductionYear;
	}


	public void setTotalEsicDeductionYear(double totalEsicDeductionYear) {
		TotalEsicDeductionYear = totalEsicDeductionYear;
	}


	public double getIncrementAmountGross() {
		return incrementAmountGross;
	}


	public void setIncrementAmountGross(double incrementAmountGross) {
		this.incrementAmountGross = incrementAmountGross;
	}


	public double getNetCashInHandYear() {
		return netCashInHandYear;
	}


	public void setNetCashInHandYear(double netCashInHandYear) {
		this.netCashInHandYear = netCashInHandYear;
	}


	public DataBaseMethodsSalary getDbms() {
		return dbms;
	}


	public void setDbms(DataBaseMethodsSalary dbms) {
		this.dbms = dbms;
	}


	public DbYashwant getDby() {
		return dby;
	}


	public void setDby(DbYashwant dby) {
		this.dby = dby;
	}


	public DataBaseMethods getObj() {
		return obj;
	}


	public void setObj(DataBaseMethods obj) {
		this.obj = obj;
	}


	public BankInfo getBank_info() {
		return bank_info;
	}


	public void setBank_info(BankInfo bank_info) {
		this.bank_info = bank_info;
	}






	public UserInfo getSavingDetail() {
		return savingDetail;
	}






	public void setSavingDetail(UserInfo savingDetail) {
		this.savingDetail = savingDetail;
	}






	public static List<String> getSavingAccList() {
		return savingAccList;
	}






	public static void setSavingAccList(List<String> savingAccList) {
		salaryCreationAndPay.savingAccList = savingAccList;
	}






	public double getIncentive() {
		return incentive;
	}






	public void setIncentive(double incentive) {
		this.incentive = incentive;
	}






	public double getArrearIncentive() {
		return arrearIncentive;
	}






	public void setArrearIncentive(double arrearIncentive) {
		this.arrearIncentive = arrearIncentive;
	}






	public double getArrearSalary() {
		return arrearSalary;
	}






	public void setArrearSalary(double arrearSalary) {
		this.arrearSalary = arrearSalary;
	}






	public double getGrandTotal() {
		return grandTotal;
	}






	public void setGrandTotal(double grandTotal) {
		this.grandTotal = grandTotal;
	}






	public double getOtherDeduction() {
		return otherDeduction;
	}






	public void setOtherDeduction(double otherDeduction) {
		this.otherDeduction = otherDeduction;
	}

	public int getLopDays() {
		return lopDays;
	}

	public void setLopDays(int lopDays) {
		this.lopDays = lopDays;
	}

	public Date getSalaryFromDate() {
		return salaryFromDate;
	}

	public void setSalaryFromDate(Date salaryFromDate) {
		this.salaryFromDate = salaryFromDate;
	}

	public Date getSalaryToDate() {
		return salaryToDate;
	}

	public void setSalaryToDate(Date salaryToDate) {
		this.salaryToDate = salaryToDate;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getLableEmpCode() {
		return lableEmpCode;
	}

	public void setLableEmpCode(String lableEmpCode) {
		this.lableEmpCode = lableEmpCode;
	}



	

	public void setNetCashInHandAfterDeduction(double netCashInHandAfterDeduction) {
		this.netCashInHandAfterDeduction = netCashInHandAfterDeduction;
	}



	public double getNetCashInHandAfterDeduction() {
		return netCashInHandAfterDeduction;
	}



	public double getAdvanceAmt() {
		return advanceAmt;
	}



	public void setAdvanceAmt(double advanceAmt) {
		this.advanceAmt = advanceAmt;
	}



	public String getSalarySrtDate() {
		return salarySrtDate;
	}



	public void setSalarySrtDate(String salarySrtDate) {
		this.salarySrtDate = salarySrtDate;
	}



	public String getSalaryEndDate() {
		return salaryEndDate;
	}



	public void setSalaryEndDate(String salaryEndDate) {
		this.salaryEndDate = salaryEndDate;
	}



	public int getBranchId() {
		return branchId;
	}



	public void setBranchId(int branchId) {
		this.branchId = branchId;
	}


	public double getAdvanceSalaryDeduction() {
		return advanceSalaryDeduction;
	}


	public void setAdvanceSalaryDeduction(double advanceSalaryDeduction) {
		this.advanceSalaryDeduction = advanceSalaryDeduction;
	}


	public ArrayList<AdvanceSalaryPayInfo> getAdvanceSalaryDetails() {
		return advanceSalaryDetails;
	}


	public void setAdvanceSalaryDetails(ArrayList<AdvanceSalaryPayInfo> advanceSalaryDetails) {
		this.advanceSalaryDetails = advanceSalaryDetails;
	}
	
	
	

}