/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.arrebol.taxiservicios.beans.stocktaking.invoice;

import com.arrebol.taxiservicios.beans.TaxiGenericBean;
import com.arrebol.taxiservicios.controller.admin.ExpenseCompanyController;
import com.arrebol.taxiservicios.controller.admin.ExpenseController;
import com.arrebol.taxiservicios.controller.admin.PaymentCustomerController;
import com.arrebol.taxiservicios.controller.admin.SaleController;
import com.arrebol.taxiservicios.controller.admin.SanctionController;
import com.arrebol.taxiservicios.controller.admin.TaxesController;
import com.arrebol.taxiservicios.controller.catalog.LocationController;
import com.arrebol.taxiservicios.controller.payroll.PayrollController;
import com.arrebol.taxiservicios.controller.stocktaking.InvoiceController;
import com.arrebol.taxiservicios.controller.stocktaking.KardexOutStocktakingController;
import com.arrebol.taxiservicios.controller.stocktaking.ServiceOrderController;
import com.arrebol.taxiservicios.model.admin.Expense;
import com.arrebol.taxiservicios.model.admin.ExpenseCompany;
import com.arrebol.taxiservicios.model.admin.Sale;
import com.arrebol.taxiservicios.model.admin.Sanction;
import com.arrebol.taxiservicios.model.admin.Taxes;
import com.arrebol.taxiservicios.model.catalog.Location;
import com.arrebol.taxiservicios.model.payroll.Payroll;
import com.arrebol.taxiservicios.model.stocktaking.Invoice;
import com.arrebol.taxiservicios.model.stocktaking.InvoiceHasProduct;
import com.arrebol.taxiservicios.model.stocktaking.ServiceOrder;
import com.arrebol.taxiservicios.model.stocktaking.view.KardexOutStocktakingView;
import com.arrebol.taxiservicios.model.stocktaking.view.StocktakingInvoiceView;
import com.arrebol.taxiservicios.model.view.report.PaymentClient;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 *
 * @author pc one
 */
@Named("auditBean")
@ViewScoped
public class auditBean extends TaxiGenericBean implements Serializable {

    final Logger logger = LogManager.getLogger(ChangeAmountProductBean.class);
    private LocationController locationcontroller;
    private List<Location> listLocation;
    private String idLocation;
    private Date genericStartDate;
    private Date genericEndDate;
    private Date genericStartDateMasUno;
    private Date genericEndDateMasUno;
    private Date today;
    private List<Sale> sales;
    
    private SaleController saleController;
    private Double totalSaving;
    private Double totalMutual;
    private Double totalSales;
    
    private ExpenseController expenseController;
    private ExpenseCompanyController expenseCompanyController;
    private ServiceOrderController serviceOrderController;
    private KardexOutStocktakingController kardexOutStockTakingController;
    private SanctionController sanctionController;
    private PaymentCustomerController paymentClientController;
    private TaxesController taxesController;
    private PayrollController payrollController;
    private InvoiceController invoiceController;
    
    private List<Expense> expensesAbono;
    private List<Expense> expensesIngresosCajaChica;
    private List<ExpenseCompany> expensesIngresosGeneral;
    private List<ServiceOrder> serviceOrder;
    private List<Expense> expensesEgresosCajaChica;
    private List<ExpenseCompany> expensesEgresosGeneral;
    private List<Expense> expensesEgresosCajaChicaInversion;
    private List<ExpenseCompany> expensesEgresosGeneralInversion;
    private List<Payroll> payroll;
    private List<StocktakingInvoiceView> invoice;
    private List<InvoiceHasProduct> detailsinvoice;

    private List<KardexOutStocktakingView> refacciones; 
    private List<Sanction> sanctionIn;
    private List<Sanction> sanctionOut;
    private List<PaymentClient> paymentClient;
    private List<Taxes> taxes;
    
    private Double totalAbono;
    private Double totalIngresoCajaChica;
    private Double totalIngresosGeneral;
    private Double totalEgresosCajaChica;
    private Double totalEgresosGeneral;
    private Double totalEgresosCajaChicaInversion;
    private Double totalEgresosGeneralInversion;
    private Double totalServiceOrder;
    private Double totalRefacciones;
    private Double totalSanctionIn;
    private Double totalSanctionOut;
    private Double totalPaymentClient;
    private Double totalTaxes;
    private Double totalContratos;
    private Double totalUtilidadIn;
    private Double totalUtilidadOut;
    private Double totalUtlidad;
    private Double totalPayRoll;
    private Double totalInvoice;
    
    public void updateInfo(){
        
        totalSaving= 0D;
        totalMutual=0D;
        totalSales=0D;
        totalAbono =0D;
        totalIngresoCajaChica=0D;
        totalIngresosGeneral=0D;
        totalEgresosCajaChica=0D;
        totalEgresosGeneral=0D;
        totalEgresosCajaChicaInversion=0D;
        totalEgresosGeneralInversion=0D;
        totalServiceOrder=0D;
        totalSanctionIn=0D;
        totalSanctionOut=0D;
        totalPaymentClient=0D;
        totalTaxes=0D;
        totalContratos=0D;
        totalUtilidadIn=0D;
        totalUtilidadOut=0D;
        totalUtlidad=0D;
        totalPayRoll=0D;
        totalInvoice=0D;
        
    
    
        updateSale();
        updateIngresos();
        updateEgresos();
        updateServiceOrder();
        updateSanction();
        updatePaymentClient();
        updateTaxes();
        updatePayroll();
        updateInvoice();
        
        totalUtilidadIn= totalContratos + totalSaving+ totalMutual + totalSales + totalAbono + 
                totalIngresoCajaChica + totalIngresosGeneral +
                totalServiceOrder + totalSanctionIn + totalRefacciones;
        
        totalUtilidadOut= totalPaymentClient + totalEgresosCajaChica + totalEgresosGeneral+
                totalEgresosCajaChicaInversion + totalEgresosGeneralInversion +
                totalTaxes + totalSanctionOut + totalPayRoll + totalInvoice;
        
        totalUtlidad = totalUtilidadIn-totalUtilidadOut;
    
    }
    
    public void updateSale(){
        
        setSales(getSaleController().getSalesAllByLocation(getGenericStartDate(), getGenericEndDate(), getIdLocation()));
        
        getSales().forEach(total -> {
            totalSales = totalSales + total.getPayDay();
        });
        
        getSales().forEach(total -> {
            totalSaving = totalSaving + total.getPaySaving();
        });
        
        getSales().forEach(total -> {
            totalMutual = totalMutual + total.getAccident();
        });
    }

    public void updateIngresos(){
    
        setExpensesAbono(getExpenseController().fillExpenseDataTableBetweenDatesAbono(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        getExpensesAbono().forEach(total -> {
            totalAbono = totalAbono + total.getPayment();
        });
        
        setExpensesIngresosCajaChica(getExpenseController().fillExpenseDataTableBetweenDatesIngresosCajaChica(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        setExpensesIngresosGeneral(getExpenseCompanyController().fillExpenseCompanyDataTableBetweenDatesIngresosGeneral(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        getExpensesIngresosCajaChica().forEach(total -> {
            totalIngresoCajaChica = totalIngresoCajaChica + total.getPayment();
        });
        
        getExpensesIngresosGeneral().forEach(total -> {
            totalIngresosGeneral = totalIngresosGeneral + total.getAmount().doubleValue();
        });
        
    }
    
    public void updateEgresos(){
    
        
        setExpensesEgresosCajaChica(getExpenseController().fillExpenseDataTableBetweenDatesEgresosCajaChica(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        setExpensesEgresosGeneral(getExpenseCompanyController().fillExpenseCompanyDataTableBetweenDatesEgresosGeneral(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        setExpensesEgresosCajaChicaInversion(getExpenseController().fillExpenseDataTableBetweenDatesEgresosCajaChicaInversion(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        setExpensesEgresosGeneralInversion(getExpenseCompanyController().fillExpenseCompanyDataTableBetweenDatesEgresosGeneralInversion(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        getExpensesEgresosCajaChica().forEach(total -> {
            totalEgresosCajaChica = totalEgresosCajaChica + total.getPayment();
        });
        
        getExpensesEgresosGeneral().forEach(total -> {
            totalEgresosGeneral = totalEgresosGeneral + total.getAmount().doubleValue();
        });
        
        getExpensesEgresosCajaChicaInversion().forEach(total -> {
            totalEgresosCajaChicaInversion = totalEgresosCajaChicaInversion + total.getPayment();
        });
        
        getExpensesEgresosGeneralInversion().forEach(total -> {
            totalEgresosGeneralInversion = totalEgresosGeneralInversion + total.getAmount().doubleValue();
        });
        
    }
    
    public void updateServiceOrder(){
        
        setServiceOrder(getServiceOrderController().findServiceOrderPayedByDates(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        getServiceOrder().forEach(total -> {
            totalServiceOrder = totalServiceOrder + total.getTotal();
        });
        
        setRefacciones(getKardexOutStockTakingController().fillKardexOutDataTableBetweenDates(genericStartDateMasUno, genericEndDateMasUno, idLocation));
        
        getRefacciones().forEach(total ->{
            totalRefacciones = totalRefacciones + total.getPriceToPay();
        });
        
    }
    public void updateSanction(){
        setSanctionIn(getSanctionController().fillSanctionDataTableBetweenDatesIngresos(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        
        setSanctionOut(getSanctionController().fillSanctionDataTableBetweenDatesEgresos(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        
        getSanctionIn().forEach(total ->{
            totalSanctionIn = totalSanctionIn + total.getPayment();
        });
        
        getSanctionOut().forEach(total ->{
            totalSanctionOut = totalSanctionOut + total.getPayment();
        });
    
    }
    
    public void updatePaymentClient(){
        setPaymentClient(getPaymentClientController().fillDataTableBetweenDatesLocation(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        
        getPaymentClient().forEach(total ->{
            totalPaymentClient = totalPaymentClient + total.getTotalPayment();
            totalContratos= totalContratos + total.getTotalContrato();
        });
    }
    
    public void updateTaxes(){
        setTaxes(getTaxesController().findTaxesBetweenDates(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
    
        getTaxes().forEach(total ->{
            totalTaxes = totalTaxes + total.getAmount().doubleValue();
        });
    }
    
    public void updatePayroll(){
        setPayroll(getPayrollController().findPayrollBetweenDates(getGenericStartDateMasUno(), getGenericEndDateMasUno(), idLocation));
        
        getPayroll().forEach(total->{
            totalPayRoll = totalPayRoll + total.getTotal();
        });
    
    }
    
    public void updateInvoice(){
        
        setInvoice(getInvoiceController().fillDataTableBetweenDatesByLocation(getGenericStartDateMasUno(), getGenericEndDateMasUno(),idLocation));
        
        getInvoice().forEach(total->{
            totalInvoice = totalInvoice + total.getTotal();
        });
        
    }
    
    public List<InvoiceHasProduct> getDetailsInvoice(String id) {
        logger.info("getDetailsInvoice");
        try {
            setDetailsinvoice(getInvoiceController().findAllProductByInvoiceId(id));

            logger.info("detailsInvoice loaded size " + detailsinvoice.size());
        } catch (Exception e) {
            logger.error("getDetailsInvoice", e);
        }
        return null == detailsinvoice ? new ArrayList<>() : detailsinvoice;
    }
    
    @PostConstruct
    public void init() {
        logger.info("init");
        LocalDate fechaLocalHoy = LocalDate.now();
        LocalDate fechaLocalMenosUmMes = fechaLocalHoy.minusMonths(1);
        
        LocalDate fechaLocalHoyMasUno = fechaLocalHoy.plusDays(1);
        LocalDate fechaLocalMenosUnMesMasUno = fechaLocalMenosUmMes.plusDays(1);
        
        locationcontroller = new LocationController();
        setSaleController(new SaleController());
        setExpenseController(new ExpenseController());
        setExpenseCompanyController(new ExpenseCompanyController());
        setServiceOrderController(new ServiceOrderController());
        setKardexOutStockTakingController(new KardexOutStocktakingController());
        setSanctionController(new SanctionController());
        setPaymentClientController(new PaymentCustomerController());
        setTaxesController(new TaxesController());
        setPayrollController(new PayrollController());
        setInvoiceController(new InvoiceController());
        listLocation = locationcontroller.fillLocationDatatable();
        setToday(new Date());
        setGenericEndDate(Date.from(fechaLocalHoy.atStartOfDay(ZoneId.systemDefault()).toInstant()));
        setGenericStartDate(Date.from(fechaLocalMenosUmMes.atStartOfDay(ZoneId.systemDefault()).toInstant()));
        setGenericEndDateMasUno(Date.from(fechaLocalHoyMasUno.atStartOfDay(ZoneId.systemDefault()).toInstant()));
        setGenericStartDateMasUno(Date.from(fechaLocalMenosUnMesMasUno.atStartOfDay(ZoneId.systemDefault()).toInstant()));
        
        totalSaving= 0D;
        totalMutual=0D;
        totalSales=0D;
        totalAbono =0D;
        totalIngresoCajaChica=0D;
        totalIngresosGeneral=0D;
        totalEgresosCajaChica=0D;
        totalEgresosGeneral=0D;
        totalEgresosCajaChicaInversion=0D;
        totalEgresosGeneralInversion=0D;
        totalServiceOrder=0D;
        totalRefacciones=0D;
        totalSanctionIn=0D;
        totalSanctionOut=0D;
        totalPaymentClient=0D;
        totalTaxes=0D;
        totalContratos=0D;
        totalUtilidadIn=0D;
        totalUtilidadOut=0D;
        totalUtlidad=0D;
        totalPayRoll=0D;
        totalInvoice=0D;
    }

    public LocationController getLocationcontroller() {
        return locationcontroller;
    }

    public void setLocationcontroller(LocationController locationcontroller) {
        this.locationcontroller = locationcontroller;
    }

    public List<Location> getListLocation() {
        return listLocation;
    }

    public void setListLocation(List<Location> listLocation) {
        this.listLocation = listLocation;
    }

    public Date getGenericStartDate() {
        return genericStartDate;
    }

    public void setGenericStartDate(Date genericStartDate) {
        this.genericStartDate = genericStartDate;
    }

    public Date getGenericEndDate() {
        return genericEndDate;
    }

    public void setGenericEndDate(Date genericEndDate) {
        this.genericEndDate = genericEndDate;
    }

    public Date getToday() {
        return today;
    }

    public void setToday(Date today) {
        this.today = today;
    }

    public List<Sale> getSales() {
        return sales;
    }

    public void setSales(List<Sale> sales) {
        this.sales = sales;
    }

    public Double getTotalSaving() {
        return totalSaving;
    }

    public void setTotalSaving(Double totalSaving) {
        this.totalSaving = totalSaving;
    }

    public Double getTotalMutual() {
        return totalMutual;
    }

    public void setTotalMutual(Double totalMutual) {
        this.totalMutual = totalMutual;
    }

    public Double getTotalSales() {
        return totalSales;
    }

    public void setTotalSales(Double totalSales) {
        this.totalSales = totalSales;
    }

    public SaleController getSaleController() {
        return saleController;
    }

    public void setSaleController(SaleController saleController) {
        this.saleController = saleController;
    }

    public String getIdLocation() {
        return idLocation;
    }

    public void setIdLocation(String idLocation) {
        this.idLocation = idLocation;
    }

    public ExpenseController getExpenseController() {
        return expenseController;
    }

    public void setExpenseController(ExpenseController expenseController) {
        this.expenseController = expenseController;
    }

    public List<Expense> getExpensesAbono() {
        return expensesAbono;
    }

    public void setExpensesAbono(List<Expense> expensesAbono) {
        this.expensesAbono = expensesAbono;
    }

    public List<Expense> getExpensesIngresosCajaChica() {
        return expensesIngresosCajaChica;
    }

    public void setExpensesIngresosCajaChica(List<Expense> expensesIngresosCajaChica) {
        this.expensesIngresosCajaChica = expensesIngresosCajaChica;
    }

    public List<ExpenseCompany> getExpensesIngresosGeneral() {
        return expensesIngresosGeneral;
    }

    public void setExpensesIngresosGeneral(List<ExpenseCompany> expensesIngresosGeneral) {
        this.expensesIngresosGeneral = expensesIngresosGeneral;
    }

    

    public Double getTotalAbono() {
        return totalAbono;
    }

    public void setTotalAbono(Double totalAbono) {
        this.totalAbono = totalAbono;
    }

    public Double getTotalIngresoCajaChica() {
        return totalIngresoCajaChica;
    }

    public void setTotalIngresoCajaChica(Double totalIngresoCajaChica) {
        this.totalIngresoCajaChica = totalIngresoCajaChica;
    }

    public Double getTotalIngresosGeneral() {
        return totalIngresosGeneral;
    }

    public void setTotalIngresosGeneral(Double totalIngresosGeneral) {
        this.totalIngresosGeneral = totalIngresosGeneral;
    }

    public List<Expense> getExpensesEgresosCajaChica() {
        return expensesEgresosCajaChica;
    }

    public void setExpensesEgresosCajaChica(List<Expense> expensesEgresosCajaChica) {
        this.expensesEgresosCajaChica = expensesEgresosCajaChica;
    }

    public List<ExpenseCompany> getExpensesEgresosGeneral() {
        return expensesEgresosGeneral;
    }

    public void setExpensesEgresosGeneral(List<ExpenseCompany> expensesEgresosGeneral) {
        this.expensesEgresosGeneral = expensesEgresosGeneral;
    }

    public Double getTotalEgresosCajaChica() {
        return totalEgresosCajaChica;
    }

    public void setTotalEgresosCajaChica(Double totalEgresosCajaChica) {
        this.totalEgresosCajaChica = totalEgresosCajaChica;
    }

    public Double getTotalEgresosGeneral() {
        return totalEgresosGeneral;
    }

    public void setTotalEgresosGeneral(Double totalEgresosGeneral) {
        this.totalEgresosGeneral = totalEgresosGeneral;
    }

    public ExpenseCompanyController getExpenseCompanyController() {
        return expenseCompanyController;
    }

    public void setExpenseCompanyController(ExpenseCompanyController expenseCompanyController) {
        this.expenseCompanyController = expenseCompanyController;
    }

    public List<ServiceOrder> getServiceOrder() {
        return serviceOrder;
    }

    public void setServiceOrder(List<ServiceOrder> serviceOrder) {
        this.serviceOrder = serviceOrder;
    }

    public ServiceOrderController getServiceOrderController() {
        return serviceOrderController;
    }

    public void setServiceOrderController(ServiceOrderController serviceOrderController) {
        this.serviceOrderController = serviceOrderController;
    }

    public Double getTotalServiceOrder() {
        return totalServiceOrder;
    }

    public void setTotalServiceOrder(Double totalServiceOrder) {
        this.totalServiceOrder = totalServiceOrder;
    }

    public KardexOutStocktakingController getKardexOutStockTakingController() {
        return kardexOutStockTakingController;
    }

    public void setKardexOutStockTakingController(KardexOutStocktakingController kardexOutStockTakingController) {
        this.kardexOutStockTakingController = kardexOutStockTakingController;
    }

    public List<KardexOutStocktakingView> getRefacciones() {
        return refacciones;
    }

    public void setRefacciones(List<KardexOutStocktakingView> refacciones) {
        this.refacciones = refacciones;
    }

    public Double getTotalRefacciones() {
        return totalRefacciones;
    }

    public void setTotalRefacciones(Double totalRefacciones) {
        this.totalRefacciones = totalRefacciones;
    }

    public SanctionController getSanctionController() {
        return sanctionController;
    }

    public void setSanctionController(SanctionController sanctionController) {
        this.sanctionController = sanctionController;
    }

    public List<Sanction> getSanctionIn() {
        return sanctionIn;
    }

    public void setSanctionIn(List<Sanction> sanctionIn) {
        this.sanctionIn = sanctionIn;
    }

    public List<Sanction> getSanctionOut() {
        return sanctionOut;
    }

    public void setSanctionOut(List<Sanction> sanctionOut) {
        this.sanctionOut = sanctionOut;
    }

    public Double getTotalSanctionIn() {
        return totalSanctionIn;
    }

    public void setTotalSanctionIn(Double totalSanctionIn) {
        this.totalSanctionIn = totalSanctionIn;
    }

    public Double getTotalSanctionOut() {
        return totalSanctionOut;
    }

    public void setTotalSanctionOut(Double totalSanctionOut) {
        this.totalSanctionOut = totalSanctionOut;
    }

    public PaymentCustomerController getPaymentClientController() {
        return paymentClientController;
    }

    public void setPaymentClientController(PaymentCustomerController paymentClientController) {
        this.paymentClientController = paymentClientController;
    }

    public List<PaymentClient> getPaymentClient() {
        return paymentClient;
    }

    public void setPaymentClient(List<PaymentClient> paymentClient) {
        this.paymentClient = paymentClient;
    }

    public Double getTotalPaymentClient() {
        return totalPaymentClient;
    }

    public void setTotalPaymentClient(Double totalPaymentClient) {
        this.totalPaymentClient = totalPaymentClient;
    }

    public TaxesController getTaxesController() {
        return taxesController;
    }

    public void setTaxesController(TaxesController taxesController) {
        this.taxesController = taxesController;
    }

    public List<Taxes> getTaxes() {
        return taxes;
    }

    public void setTaxes(List<Taxes> taxes) {
        this.taxes = taxes;
    }

    public Double getTotalTaxes() {
        return totalTaxes;
    }

    public void setTotalTaxes(Double totalTaxes) {
        this.totalTaxes = totalTaxes;
    }

    public Double getTotalContratos() {
        return totalContratos;
    }

    public void setTotalContratos(Double totalContratos) {
        this.totalContratos = totalContratos;
    }

    public Double getTotalUtilidadIn() {
        return totalUtilidadIn;
    }

    public void setTotalUtilidadIn(Double totalUtilidadIn) {
        this.totalUtilidadIn = totalUtilidadIn;
    }

    public Double getTotalUtilidadOut() {
        return totalUtilidadOut;
    }

    public void setTotalUtilidadOut(Double totalUtilidadOut) {
        this.totalUtilidadOut = totalUtilidadOut;
    }

    public Double getTotalUtlidad() {
        return totalUtlidad;
    }

    public void setTotalUtlidad(Double totalUtlidad) {
        this.totalUtlidad = totalUtlidad;
    }

    public List<Expense> getExpensesEgresosCajaChicaInversion() {
        return expensesEgresosCajaChicaInversion;
    }

    public void setExpensesEgresosCajaChicaInversion(List<Expense> expensesEgresosCajaChicaInversion) {
        this.expensesEgresosCajaChicaInversion = expensesEgresosCajaChicaInversion;
    }

    public List<ExpenseCompany> getExpensesEgresosGeneralInversion() {
        return expensesEgresosGeneralInversion;
    }

    public void setExpensesEgresosGeneralInversion(List<ExpenseCompany> expensesEgresosGeneralInversion) {
        this.expensesEgresosGeneralInversion = expensesEgresosGeneralInversion;
    }

    public Double getTotalEgresosCajaChicaInversion() {
        return totalEgresosCajaChicaInversion;
    }

    public void setTotalEgresosCajaChicaInversion(Double totalEgresosCajaChicaInversion) {
        this.totalEgresosCajaChicaInversion = totalEgresosCajaChicaInversion;
    }

    public Double getTotalEgresosGeneralInversion() {
        return totalEgresosGeneralInversion;
    }

    public void setTotalEgresosGeneralInversion(Double totalEgresosGeneralInversion) {
        this.totalEgresosGeneralInversion = totalEgresosGeneralInversion;
    }

    public PayrollController getPayrollController() {
        return payrollController;
    }

    public void setPayrollController(PayrollController payrollController) {
        this.payrollController = payrollController;
    }

    public List<Payroll> getPayroll() {
        return payroll;
    }

    public void setPayroll(List<Payroll> payroll) {
        this.payroll = payroll;
    }

    public Double getTotalPayRoll() {
        return totalPayRoll;
    }

    public void setTotalPayRoll(Double totalPayRoll) {
        this.totalPayRoll = totalPayRoll;
    }

    public Date getGenericStartDateMasUno() {
        return genericStartDateMasUno;
    }

    public void setGenericStartDateMasUno(Date genericStartDateMasUno) {
        this.genericStartDateMasUno = genericStartDateMasUno;
    }

    public Date getGenericEndDateMasUno() {
        return genericEndDateMasUno;
    }

    public void setGenericEndDateMasUno(Date genericEndDateMasUno) {
        this.genericEndDateMasUno = genericEndDateMasUno;
    }

    public InvoiceController getInvoiceController() {
        return invoiceController;
    }

    public void setInvoiceController(InvoiceController invoiceController) {
        this.invoiceController = invoiceController;
    }

    public List<StocktakingInvoiceView> getInvoice() {
        return invoice;
    }

    public void setInvoice(List<StocktakingInvoiceView> invoice) {
        this.invoice = invoice;
    }

    public Double getTotalInvoice() {
        return totalInvoice;
    }

    public void setTotalInvoice(Double totalInvoice) {
        this.totalInvoice = totalInvoice;
    }

    public List<InvoiceHasProduct> getDetailsinvoice() {
        return detailsinvoice;
    }

    public void setDetailsinvoice(List<InvoiceHasProduct> detailsinvoice) {
        this.detailsinvoice = detailsinvoice;
    }
    
    
    
    
    

}
