public void buscarPagos() {

        if (pago.getRuc() != null) {
            String jpql = "select p from Pagos p where p.ruc= :dato ";
            Query query = JPAUtil.getEntityManager().createQuery(jpql);
            query.setParameter("dato", pago.getRuc().toString());
            pagos = query.getResultList();
        } else {
            String jpql = "select p from Pagos p";
            Query query = JPAUtil.getEntityManager().createQuery(jpql);
            pagos = query.getResultList();
            System.out.println("ruc nulo");
        }

    }