/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.contabilidad.FacadeConta;

import com.contabilidad.EntConta.VPagoEventual;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author obper
 */
@Stateless
public class VPagoEventualFacade extends AbstractFacade<VPagoEventual> implements VPagoEventualFacadeLocal {

    @PersistenceContext(unitName = "contabilidad")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public VPagoEventualFacade() {
        super(VPagoEventual.class);
    }

    @Override
    public List<VPagoEventual> obtnerHorasCal(Date fecha,String sucursal) {
        List<VPagoEventual> rs = new ArrayList<>();
        rs = (List<VPagoEventual>) em.createNativeQuery("{CALL obtener_pagos_n(?,?)}",
                VPagoEventual.class)
                .setParameter(1, fecha)
                .setParameter(2, sucursal).getResultList();

        return rs;
    }

}
