fixes bug #6874
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@50603 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
022fd0f624
commit
6b0cd58838
|
@ -41,4 +41,6 @@ public interface EmpresaDAO {
|
|||
public void actualizaInscEstadual(InscricaoEstadual inscricaoEstadual);
|
||||
|
||||
public List<Empresa> buscaLike(String nombempresa);
|
||||
|
||||
public List<Empresa> obtenerTodosIncluindoEmpresaTodas();
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao.hibernate;
|
|||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
@ -46,6 +47,7 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
public List<Empresa> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.ne("empresaId", -1));
|
||||
c.addOrder(Order.asc("nombempresa"));
|
||||
|
||||
return c.list();
|
||||
|
@ -57,15 +59,21 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
c.add(Restrictions.eq("nombempresa", nombempresa));
|
||||
c.add(Restrictions.eq("indExterna", indExterna));
|
||||
c.add(Restrictions.eq("indTipo", indTipo));
|
||||
c.add(Restrictions.ne("empresaId", -1));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
public List<Empresa> buscarTodosExceto(List<Empresa> empresa, Integer... idEmpresa) {
|
||||
if(idEmpresa == null || idEmpresa.length == 0) {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
List<Empresa> empresaList = new ArrayList<Empresa>();
|
||||
for (Integer id : idEmpresa) {
|
||||
for (Empresa e : empresa) {
|
||||
e.getEmpresaId().equals(id);
|
||||
List<Integer> lsEmpresa = Arrays.asList(idEmpresa);
|
||||
for (Empresa e : empresa) {
|
||||
if(!lsEmpresa.contains(e.getEmpresaId())) {
|
||||
empresaList.add(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,6 +85,7 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.eq("indExterna", Boolean.FALSE));
|
||||
c.add(Restrictions.ne("empresaId", -1));
|
||||
|
||||
c.addOrder(Order.asc("nombempresa"));
|
||||
|
||||
|
@ -106,6 +115,7 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
sb.append(" select pc.empresaId.empresaId from PtovtaComissao pc ");
|
||||
sb.append(" where pc.activo = 1 and pc.puntoventaId.puntoventaId = :puntoventaId ");
|
||||
sb.append(" )");
|
||||
sb.append(" and em.empresaId != -1 ");
|
||||
sb.append(" order by em.nombempresa");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
|
@ -140,6 +150,7 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.add(Restrictions.like("nombempresa", nombempresa, MatchMode.START));
|
||||
c.add(Restrictions.ne("empresaId", -1));
|
||||
|
||||
c.addOrder(Order.asc("nombempresa"));
|
||||
|
||||
|
@ -172,4 +183,14 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Empresa> obtenerTodosIncluindoEmpresaTodas() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.addOrder(Order.asc("nombempresa"));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import javax.persistence.TemporalType;
|
|||
public class FormaPago implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FORMA_PAGO_SEQ")
|
||||
|
@ -61,11 +62,19 @@ public class FormaPago implements Serializable {
|
|||
private Boolean indconferenciafisicacomissao;
|
||||
|
||||
public FormaPago() {
|
||||
super();
|
||||
}
|
||||
|
||||
public FormaPago(Short formapagoId) {
|
||||
this();
|
||||
this.formapagoId = formapagoId;
|
||||
}
|
||||
|
||||
public FormaPago(Short formapagoId, String descpago) {
|
||||
this();
|
||||
this.formapagoId = formapagoId;
|
||||
this.descpago = descpago;
|
||||
}
|
||||
|
||||
public Short getFormapagoId() {
|
||||
return formapagoId;
|
||||
|
|
|
@ -50,6 +50,9 @@ public class FormaPagoDet implements Serializable {
|
|||
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||
@ManyToOne
|
||||
private PuntoVenta puntoVenta;
|
||||
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||
@ManyToOne
|
||||
private Empresa empresa;
|
||||
|
||||
|
||||
@OneToOne
|
||||
|
@ -150,4 +153,12 @@ public class FormaPagoDet implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.FormaPagoDet[formapagodetId=" + formapagodetId + "]";
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue