fixes bug #7501
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@56440 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0a05c5917e
commit
020adf0561
|
@ -45,9 +45,9 @@ public interface ConferenciaComissaoDAO extends GenericDAO<Conferencia, Long> {
|
|||
|
||||
public List<LogConferencia> carregarLogConferencia(Long conferenciaId) throws BusinessException;
|
||||
|
||||
public boolean isBilhetesSemConferencia(Conferencia conferencia) throws BusinessException;
|
||||
/*public boolean isBilhetesSemConferencia(Conferencia conferencia) throws BusinessException;
|
||||
|
||||
public boolean isEventosFinanceirosSemConferencia(Conferencia conferencia) throws BusinessException;
|
||||
public boolean isEventosFinanceirosSemConferencia(Conferencia conferencia) throws BusinessException;*/
|
||||
|
||||
public boolean isConferenciaCompetenciaEncerrada(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao;
|
|||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpFormapago;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
@ -58,5 +59,9 @@ public interface EmpresaDAO {
|
|||
public ComEmpTipoEventoExtra adicionarComissaoTipoEventoExtra(ComEmpTipoEventoExtra comEmpTipoEventoExtra);
|
||||
|
||||
public void removerComissaoTipoEventoExtra(ComEmpTipoEventoExtra comEmpTipoEventoExtra);
|
||||
|
||||
public ComEmpConferencia suscribir(ComEmpConferencia comEmpConferencia);
|
||||
|
||||
public ComEmpConferencia actualizacion(ComEmpConferencia comEmpConferencia);
|
||||
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
StringBuilder sQuery = new StringBuilder("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", PV.NOMBPUNTOVENTA as \"nombpuntoventa\" ");
|
||||
sQuery.append("FROM PUNTO_VENTA PV ")
|
||||
.append("JOIN PTOVTA_EMPRESA PTE ON PTE.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ")
|
||||
.append("JOIN PTOVTA_EMPRESA PTE ON PTE.PUNTOVENTA_ID = PV.PUNTOVENTA_ID AND PTE.ACTIVO = 1 ")
|
||||
.append("WHERE PV.ACTIVO = 1 ");
|
||||
|
||||
if(empresa != null) {
|
||||
|
@ -342,7 +342,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
public Conferencia confirmarChegadaMalote(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
conferencia.setIndmaloterecebido(Boolean.TRUE);
|
||||
if(!isBilhetesSemConferencia(conferencia) && !isEventosFinanceirosSemConferencia(conferencia)) {
|
||||
if(conferencia.isSemPendenciaConferencia()) {
|
||||
return encerrarMovimentoDiario(conferencia);
|
||||
}
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
|
@ -438,11 +438,13 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.append("EE.IMPINGRESO AS \"impingreso\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", EE.DESCINFO AS \"descinfo\", ")
|
||||
.append("LOG.STATUS AS \"status\", FP.FORMAPAGO_ID AS \"formapagoId\", FP.DESCPAGO AS \"descpago\", ")
|
||||
.append("TEE.INDTIPO AS \"indtipo\", U.NOMBUSUARIO AS \"nombusuario\", LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", ")
|
||||
.append("COMFP.COMEMPFORMAPAGO_ID AS \"comempformapagoId\", COMTEE.COMEMPTIPOEVENTOEXTRA_ID AS \"comemptipoeventoextraId\" ")
|
||||
.append("COMFP.COMEMPFORMAPAGO_ID AS \"comempformapagoId\", COMTEE.COMEMPTIPOEVENTOEXTRA_ID AS \"comemptipoeventoextraId\", ")
|
||||
.append("CEC.INDEVENTOSFINANCEIROS AS \"exigeConferenciaAba\" ")
|
||||
.append("FROM EVENTO_EXTRA EE ")
|
||||
.append("JOIN TIPO_EVENTO_EXTRA TEE ON EE.TIPOEVENTOEXTRA_ID = TEE.TIPOEVENTOEXTRA_ID ")
|
||||
.append("INNER JOIN USUARIO U ON EE.USUARIO_ID = U.USUARIO_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.EVENTOEXTRA_ID = EE.EVENTOEXTRA_ID ")
|
||||
.append("LEFT JOIN COM_EMP_CONFERENCIA CEC ON EE.EMPRESA_ID = CEC.EMPRESA_ID AND CEC.ACTIVO = 1 ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.EVENTOEXTRA_ID = EE.EVENTOEXTRA_ID AND LOG.ACTIVO = 1 ")
|
||||
.append("LEFT JOIN FORMA_PAGO FP ON FP.FORMAPAGO_ID = EE.FORMAPAGO_ID ")
|
||||
.append("LEFT JOIN COM_EMP_FORMAPAGO COMFP ON COMFP.FORMAPAGO_ID = FP.FORMAPAGO_ID AND COMFP.EMPRESA_ID = EE.EMPRESA_ID AND COMFP.ACTIVO = 1 ")
|
||||
.append("LEFT JOIN COM_EMP_TIPOEVENTOEXTRA COMTEE ON COMTEE.TIPOEVENTOEXTRA_ID = TEE.TIPOEVENTOEXTRA_ID AND COMTEE.EMPRESA_ID = EE.EMPRESA_ID AND COMTEE.ACTIVO = 1 ")
|
||||
|
@ -477,6 +479,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.addScalar("indtipo", Hibernate.STRING)
|
||||
.addScalar("nombusuario", Hibernate.STRING)
|
||||
.addScalar("logconferenciaId", Hibernate.LONG)
|
||||
.addScalar("exigeConferenciaAba", Hibernate.BOOLEAN)
|
||||
.setResultTransformer(Transformers.aliasToBean(EventosFinanceirosVO.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
|
@ -594,7 +597,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.append("MC.DESCMOTIVO AS \"descmotivocancelacion\", U.NOMBUSUARIO AS \"nombusuario\", B.MOTIVOCANCELACION_ID AS \"motivocancelacionId\", ")
|
||||
.append("BF.IMPORTE AS \"importeFp\", COMFP.COMEMPFORMAPAGO_ID AS \"comempformapagoId\", COMCAT.COMEMPCATEGORIA_ID AS \"comempcategoriaId\", ")
|
||||
.append("BO1.TIPOVENTA_ID \"tipoVentaOriginal1\", BO2.TIPOVENTA_ID \"tipoVentaOriginal2\", OCD.OCD_ID \"ocdId\", ")
|
||||
.append("B.NOMBPASAJERO AS \"nombpasajero\", E.INDCARBOLETOSDEVOLVIDOSCONF AS \"indcarboletosdevolvidosconf\" ")
|
||||
.append("B.NOMBPASAJERO AS \"nombpasajero\", E.INDCARBOLETOSDEVOLVIDOSCONF AS \"indcarboletosdevolvidosconf\", ")
|
||||
.append("B.FECCORRIDA AS \"feccorrida\", B.CORRIDA_ID \"corridaId\" ")
|
||||
.append("FROM BOLETO B ")
|
||||
.append("LEFT JOIN BOLETO BO1 ON BO1.BOLETO_ID = B.BOLETOORIGINAL_ID ")
|
||||
.append("LEFT JOIN BOLETO BO2 ON BO2.BOLETO_ID = BO1.BOLETOORIGINAL_ID ")
|
||||
|
@ -665,6 +669,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.addScalar("ocdId", Hibernate.INTEGER)
|
||||
.addScalar("nombpasajero", Hibernate.STRING)
|
||||
.addScalar("indcarboletosdevolvidosconf", Hibernate.BOOLEAN)
|
||||
.addScalar("feccorrida", Hibernate.DATE)
|
||||
.addScalar("corridaId", Hibernate.INTEGER)
|
||||
.setResultTransformer(Transformers.aliasToBean(BoletoComissao.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
|
@ -677,6 +683,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
if(lsBoletoComissao.contains(boletoComissao)) {
|
||||
BoletoComissao aux = lsBoletoComissao.get(lsBoletoComissao.indexOf(boletoComissao));
|
||||
aux.setComempcategoriaId(boletoComissao.getComempcategoriaId() != null ? boletoComissao.getComempcategoriaId() : aux.getComempcategoriaId());
|
||||
aux.setComempformapagoId(boletoComissao.getComempformapagoId() != null ? boletoComissao.getComempformapagoId() : aux.getComempformapagoId());
|
||||
aux.getFormapagos().add(new FormapagoVO(boletoComissao.getFormapagoId(), boletoComissao.getDescpago(), boletoComissao.getIndconferenciafisicacomissao(), boletoComissao.getImporteFp()));
|
||||
lsBoletoComissao.set(lsBoletoComissao.indexOf(boletoComissao), aux);
|
||||
} else {
|
||||
|
@ -701,12 +709,15 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT O.OCD_ID AS \"ocdId\", O.NUMOPERACION AS \"numoperacion\", O.FECINC AS \"fecinc\", O.FECPAGAR AS \"fecpagar\", O.FECPAGO AS \"fecpago\", ")
|
||||
.append("O.INDPAGO AS \"indpago\", O.VALOR_PAGAR AS \"valorPagar\", (B.PRECIOPAGADO * (O.PENALIZACION / 100)) AS \"penalizacion\", LOG.STATUS AS \"status\", ")
|
||||
.append("U.NOMBUSUARIO AS \"nombusuario\", LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", U.CVEUSUARIO AS \"login\", B.NUMFOLIOSISTEMA AS \"numFolioSistema\" ")
|
||||
.append("U.NOMBUSUARIO AS \"nombusuario\", LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", U.CVEUSUARIO AS \"login\", B.NUMFOLIOSISTEMA AS \"numFolioSistema\", ")
|
||||
.append("CEC.INDOCD AS \"exigeConferenciaAba\" ")
|
||||
.append("FROM OCD O ")
|
||||
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = O.BOLETO_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.OCD_ID = O.OCD_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.OCD_ID = O.OCD_ID AND LOG.ACTIVO = 1 ")
|
||||
.append("INNER JOIN USUARIO U ON O.USUARIOPAGO_ID = U.USUARIO_ID ")
|
||||
.append("LEFT JOIN COM_EMP_CONFERENCIA CEC ON CEC.EMPRESA_ID = B.EMPRESACORRIDA_ID AND CEC.ACTIVO = 1 ")
|
||||
.append("WHERE O.ACTIVO = 1 ")
|
||||
.append("AND LOG.ACTIVO = 1 ")
|
||||
.append("AND TO_DATE(O.FECPAGO,'DD/MM/YY') = :datamovimento ")
|
||||
.append("AND O.INDPAGO = 1 ");
|
||||
|
||||
|
@ -733,9 +744,10 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.addScalar("penalizacion", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.addScalar("nombusuario", Hibernate.STRING)
|
||||
.addScalar("logconferenciaId", Hibernate.STRING)
|
||||
.addScalar("logconferenciaId", Hibernate.LONG)
|
||||
.addScalar("login", Hibernate.STRING)
|
||||
.addScalar("numFolioSistema", Hibernate.STRING)
|
||||
.addScalar("exigeConferenciaAba", Hibernate.BOOLEAN)
|
||||
.setResultTransformer(Transformers.aliasToBean(OcdVO.class));
|
||||
setParametros(qr, parametros);
|
||||
|
||||
|
@ -828,7 +840,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isBilhetesSemConferencia(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
|
@ -912,7 +924,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean isConferenciaCompetenciaEncerrada(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.EmpresaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpFormapago;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
@ -236,5 +237,17 @@ public class EmpresaHibernateDAO extends GenericHibernateDAO<Empresa, Integer> i
|
|||
public void removerComissaoTipoEventoExtra(ComEmpTipoEventoExtra comEmpTipoEventoExtra) {
|
||||
getSession().merge(comEmpTipoEventoExtra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComEmpConferencia suscribir(ComEmpConferencia comEmpConferencia) {
|
||||
getSession().save(comEmpConferencia);
|
||||
return comEmpConferencia;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComEmpConferencia actualizacion(ComEmpConferencia comEmpConferencia) {
|
||||
getSession().merge(comEmpConferencia);
|
||||
return comEmpConferencia;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,221 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(name = "COM_EMP_CONFERENCIA_SEQ", sequenceName = "COM_EMP_CONFERENCIA_SEQ", allocationSize = 1)
|
||||
@Table(name = "COM_EMP_CONFERENCIA")
|
||||
public class ComEmpConferencia implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "COM_EMP_CONFERENCIA_SEQ")
|
||||
@Column(name = "COMEMPCONFERENCIA_ID")
|
||||
private Long comempconferenciaId;
|
||||
|
||||
@Column(name = "INDBILHETEMANUAL")
|
||||
private Boolean indbilhetemanual;
|
||||
|
||||
@Column(name = "INDBILHETEVENDIDO")
|
||||
private Boolean indbilhetevendido;
|
||||
|
||||
@Column(name = "INDBILHETECANCELADO")
|
||||
private Boolean indbilhetecancelado;
|
||||
|
||||
@Column(name = "INDBILHETEDEVOLVIDO")
|
||||
private Boolean indbilhetedevolvido;
|
||||
|
||||
@Column(name = "INDGAPVENDIDO")
|
||||
private Boolean indgapvendido;
|
||||
|
||||
@Column(name = "INDGAPCANCELADO")
|
||||
private Boolean indgapcancelado;
|
||||
|
||||
@Column(name = "INDGAPDEVOLVIDO")
|
||||
private Boolean indgapdevolvido;
|
||||
|
||||
@Column(name = "INDEVENTOSFINANCEIROS")
|
||||
private Boolean indeventosfinanceiros;
|
||||
|
||||
@Column(name = "INDOCD")
|
||||
private Boolean indocd;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
|
||||
@Column(name = "ACTIVO")
|
||||
private boolean activo;
|
||||
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "FECMODIF")
|
||||
private Date fecmodif;
|
||||
|
||||
public ComEmpConferencia() {
|
||||
super();
|
||||
setIndbilhetecancelado(Boolean.FALSE);
|
||||
setIndbilhetevendido(Boolean.FALSE);
|
||||
setIndbilhetedevolvido(Boolean.FALSE);
|
||||
setIndgapcancelado(Boolean.FALSE);
|
||||
setIndgapdevolvido(Boolean.FALSE);
|
||||
setIndgapvendido(Boolean.FALSE);
|
||||
setIndeventosfinanceiros(Boolean.FALSE);
|
||||
setIndocd(Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Long getComempconferenciaId() {
|
||||
return comempconferenciaId;
|
||||
}
|
||||
|
||||
public void setComempconferenciaId(Long comempconferenciaId) {
|
||||
this.comempconferenciaId = comempconferenciaId;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public boolean isActivo() {
|
||||
return activo;
|
||||
}
|
||||
|
||||
public void setActivo(boolean activo) {
|
||||
this.activo = activo;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Date getFecmodif() {
|
||||
return fecmodif;
|
||||
}
|
||||
|
||||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getComempconferenciaId() == null) ? 0 : getComempconferenciaId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (!(obj instanceof ComEmpConferencia))
|
||||
return false;
|
||||
ComEmpConferencia other = (ComEmpConferencia) obj;
|
||||
if (getComempconferenciaId() == null) {
|
||||
if (other.getComempconferenciaId() != null)
|
||||
return false;
|
||||
} else if (!getComempconferenciaId().equals(other.getComempconferenciaId()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public Boolean getIndbilhetemanual() {
|
||||
return indbilhetemanual;
|
||||
}
|
||||
|
||||
public void setIndbilhetemanual(Boolean indbilhetemanual) {
|
||||
this.indbilhetemanual = indbilhetemanual;
|
||||
}
|
||||
|
||||
public Boolean getIndbilhetevendido() {
|
||||
return indbilhetevendido;
|
||||
}
|
||||
|
||||
public void setIndbilhetevendido(Boolean indbilhetevendido) {
|
||||
this.indbilhetevendido = indbilhetevendido;
|
||||
}
|
||||
|
||||
public Boolean getIndbilhetecancelado() {
|
||||
return indbilhetecancelado;
|
||||
}
|
||||
|
||||
public void setIndbilhetecancelado(Boolean indbilhetecancelado) {
|
||||
this.indbilhetecancelado = indbilhetecancelado;
|
||||
}
|
||||
|
||||
public Boolean getIndbilhetedevolvido() {
|
||||
return indbilhetedevolvido;
|
||||
}
|
||||
|
||||
public void setIndbilhetedevolvido(Boolean indbilhetedevolvido) {
|
||||
this.indbilhetedevolvido = indbilhetedevolvido;
|
||||
}
|
||||
|
||||
public Boolean getIndgapvendido() {
|
||||
return indgapvendido;
|
||||
}
|
||||
|
||||
public void setIndgapvendido(Boolean indgapvendido) {
|
||||
this.indgapvendido = indgapvendido;
|
||||
}
|
||||
|
||||
public Boolean getIndgapcancelado() {
|
||||
return indgapcancelado;
|
||||
}
|
||||
|
||||
public void setIndgapcancelado(Boolean indgapcancelado) {
|
||||
this.indgapcancelado = indgapcancelado;
|
||||
}
|
||||
|
||||
public Boolean getIndgapdevolvido() {
|
||||
return indgapdevolvido;
|
||||
}
|
||||
|
||||
public void setIndgapdevolvido(Boolean indgapdevolvido) {
|
||||
this.indgapdevolvido = indgapdevolvido;
|
||||
}
|
||||
|
||||
public Boolean getIndeventosfinanceiros() {
|
||||
return indeventosfinanceiros;
|
||||
}
|
||||
|
||||
public void setIndeventosfinanceiros(Boolean indeventosfinanceiros) {
|
||||
this.indeventosfinanceiros = indeventosfinanceiros;
|
||||
}
|
||||
|
||||
public Boolean getIndocd() {
|
||||
return indocd;
|
||||
}
|
||||
|
||||
public void setIndocd(Boolean indocd) {
|
||||
this.indocd = indocd;
|
||||
}
|
||||
|
||||
}
|
|
@ -82,6 +82,9 @@ public class Conferencia implements Serializable {
|
|||
@Transient
|
||||
private String numfoliosistema;
|
||||
|
||||
@Transient
|
||||
private boolean semPendenciaConferencia;
|
||||
|
||||
public Conferencia() {
|
||||
super();
|
||||
this.indboletogerado = Boolean.FALSE;
|
||||
|
@ -242,4 +245,12 @@ public class Conferencia implements Serializable {
|
|||
this.usuarioMaloteId = usuarioMaloteId;
|
||||
}
|
||||
|
||||
public boolean isSemPendenciaConferencia() {
|
||||
return semPendenciaConferencia;
|
||||
}
|
||||
|
||||
public void setSemPendenciaConferencia(boolean semPendenciaConferencia) {
|
||||
this.semPendenciaConferencia = semPendenciaConferencia;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -115,6 +115,10 @@ public class Empresa implements Serializable {
|
|||
@OneToMany(mappedBy = "empresa")
|
||||
@Where(clause="ACTIVO=1")
|
||||
private List<ComEmpTipoEventoExtra> comEmpTipoEventoExtras;
|
||||
|
||||
@OneToMany(mappedBy = "empresa")
|
||||
@Where(clause="ACTIVO=1")
|
||||
private List<ComEmpConferencia> comEmpConferencias;
|
||||
|
||||
public Empresa() {
|
||||
super();
|
||||
|
@ -444,6 +448,14 @@ public class Empresa implements Serializable {
|
|||
|
||||
public void setComEmpTipoEventoExtras(List<ComEmpTipoEventoExtra> comEmpTipoEventoExtras) {
|
||||
this.comEmpTipoEventoExtras = comEmpTipoEventoExtras;
|
||||
}
|
||||
|
||||
public List<ComEmpConferencia> getComEmpConferencias() {
|
||||
return comEmpConferencias;
|
||||
}
|
||||
|
||||
public void setComEmpConferencias(List<ComEmpConferencia> comEmpConferencias) {
|
||||
this.comEmpConferencias = comEmpConferencias;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,11 @@ public interface ConferenciaComissaoService extends GenericService<Conferencia,
|
|||
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento, Integer puntoventaId, Integer empresaId) throws BusinessException;
|
||||
|
||||
public boolean isBilhetesSemConferencia(Conferencia conferencia) throws BusinessException;
|
||||
public boolean isBilhetesSemConferencia(List<BoletoComissao> lsBoletoComissao) throws BusinessException;
|
||||
|
||||
public boolean isEventosFinanceirosSemConferencia(Conferencia conferencia) throws BusinessException;
|
||||
public boolean isEventosFinanceirosSemConferencia(List<EventosFinanceirosVO> lsEventosFinanceiros) throws BusinessException;
|
||||
|
||||
public boolean isOcdSemConferencia(List<OcdVO> lsOcd) throws BusinessException;
|
||||
|
||||
public BigDecimal totalizarBoletoComissao(List<BoletoComissao> lsBoletoComissao, IndStatusBoleto... statusBilhete) throws BusinessException;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.service;
|
|||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpFormapago;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
@ -58,4 +59,7 @@ public interface EmpresaService {
|
|||
public void removerComissaoTipoEventoExtra(ComEmpTipoEventoExtra comEmpTipoEventoExtra);
|
||||
|
||||
public List<Empresa> obtenerTodosIncluindoEmpresaTodas();
|
||||
|
||||
public ComEmpConferencia suscribirOrActualizacion(ComEmpConferencia comEmpConferencia);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@ import org.apache.log4j.Logger;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.dao.ConferenciaComissaoDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.EmpresaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.PuntoVentaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Conferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.LogConferencia;
|
||||
|
@ -153,28 +153,34 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return boletoComissaos;
|
||||
}
|
||||
|
||||
Empresa empresa = empresaDAO.obtenerID(conferencia.getEmpresa().getEmpresaId());
|
||||
ComEmpConferencia comEmpConferencia = null;
|
||||
if(empresa.getComEmpConferencias() != null && !empresa.getComEmpConferencias().isEmpty()) {
|
||||
comEmpConferencia = empresa.getComEmpConferencias().iterator().next();
|
||||
}
|
||||
|
||||
List<BoletoComissao> retorno = new ArrayList<BoletoComissao>();
|
||||
switch (boletoStatusComissao) {
|
||||
case BOLETOS_VENDIDOS:
|
||||
retorno.addAll(carregarBilhetesVendidos(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesVendidos(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
case BOLETO_MANUAL:
|
||||
retorno.addAll(carregarBilhetesManuais(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesManuais(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
case BOLETO_CANCELADO:
|
||||
retorno.addAll(carregarBilhetesCancelados(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesCancelados(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
case BOLETO_DEVOLVIDO:
|
||||
retorno.addAll(carregarBilhetesDevolvidos(boletoComissaos, StringUtils.isNotBlank(conferencia.getNumfoliosistema())));
|
||||
retorno.addAll(carregarBilhetesDevolvidos(boletoComissaos, StringUtils.isNotBlank(conferencia.getNumfoliosistema()), comEmpConferencia));
|
||||
break;
|
||||
case GAP_VENDIDOS:
|
||||
retorno.addAll(carregarBilhetesGapsVendidos(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesGapsVendidos(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
case GAP_CANCELADO:
|
||||
retorno.addAll(carregarBilhetesGapCancelados(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesGapCancelados(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
case GAP_DEVOLVIDO:
|
||||
retorno.addAll(carregarBilhetesGapDevolvidos(boletoComissaos));
|
||||
retorno.addAll(carregarBilhetesGapDevolvidos(boletoComissaos, comEmpConferencia));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -182,17 +188,22 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return retorno;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesManuais(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesManuais(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilhetesManualVendido()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetemanual());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
}
|
||||
}
|
||||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesVendidos(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesVendidos(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteNormalVendido() ||
|
||||
|
@ -201,6 +212,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
boletoComissao.isBilheteAberto() ||
|
||||
boletoComissao.isBilheteEntregaAberto()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetevendido());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
|
||||
}
|
||||
|
@ -208,13 +223,17 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesCancelados(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesCancelados(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteNormalCancelado() ||
|
||||
boletoComissao.isBilheteNormalTrocadoCancelado() ||
|
||||
boletoComissao.isBilheteAbertoCancelado() ||
|
||||
boletoComissao.isBilheteEntregaGapCancelado()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetecancelado());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
|
||||
|
@ -223,7 +242,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesDevolvidos(List<BoletoComissao> boletoComissaos, boolean pesquisa) {
|
||||
private Set<BoletoComissao> carregarBilhetesDevolvidos(List<BoletoComissao> boletoComissaos, boolean pesquisa, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteNormalDevolvido() ||
|
||||
|
@ -236,6 +255,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
|
||||
boletoComissao.setExigeConferenciaDevolvido(boletoComissao.getIndcarboletosdevolvidosconf() != null && !boletoComissao.getIndcarboletosdevolvidosconf());
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetedevolvido());
|
||||
}
|
||||
|
||||
if(pesquisa ||
|
||||
((boletoComissao.getIndcarboletosdevolvidosconf() != null && boletoComissao.getIndcarboletosdevolvidosconf()) || boletoComissao.getLogconferenciaId() != null)) {
|
||||
boletos.add(boletoComissao);
|
||||
|
@ -246,10 +269,14 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesGapsVendidos(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesGapsVendidos(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteGapVendido()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndgapvendido());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
|
||||
|
@ -258,21 +285,30 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesGapCancelados(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesGapCancelados(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteGapCancelado()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndgapcancelado());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
}
|
||||
}
|
||||
return boletos;
|
||||
}
|
||||
|
||||
private Set<BoletoComissao> carregarBilhetesGapDevolvidos(List<BoletoComissao> boletoComissaos) {
|
||||
private Set<BoletoComissao> carregarBilhetesGapDevolvidos(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
|
||||
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isBilheteGapDevolvido() ||
|
||||
boletoComissao.isBilheteGapTrocado()) {
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndgapdevolvido());
|
||||
}
|
||||
|
||||
boletos.add(boletoComissao);
|
||||
|
||||
|
@ -299,13 +335,25 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isBilhetesSemConferencia(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.isBilhetesSemConferencia(conferencia);
|
||||
public boolean isBilhetesSemConferencia(List<BoletoComissao> lsBoletoComissao) throws BusinessException {
|
||||
for (BoletoComissao boletoComissao : lsBoletoComissao) {
|
||||
if((boletoComissao.isExigeConferencia() || boletoComissao.isExigeConferenciaAba() || boletoComissao.isExigeConferenciaBoletoDevolvido()) &&
|
||||
(!boletoComissao.isConferido() && boletoComissao.getLogconferenciaId() == null)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEventosFinanceirosSemConferencia(Conferencia conferencia) throws BusinessException {
|
||||
return conferenciaComissaoDAO.isEventosFinanceirosSemConferencia(conferencia);
|
||||
public boolean isEventosFinanceirosSemConferencia(List<EventosFinanceirosVO> lsEventosFinanceiros) throws BusinessException {
|
||||
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
||||
if((eventosFinanceiros.isExigeConferencia() || (eventosFinanceiros.getExigeConferenciaAba() != null && eventosFinanceiros.getExigeConferenciaAba())) &&
|
||||
(!eventosFinanceiros.isConferido() && eventosFinanceiros.getLogconferenciaId() == null)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -333,8 +381,6 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
BigDecimal totalOcd = BigDecimal.ZERO;
|
||||
if(lsBoletoComissao != null) {
|
||||
for (BoletoComissao boletoComissao : lsBoletoComissao) {
|
||||
log.info(boletoComissao.getNumFolioSistema());
|
||||
log.info(boletoComissao.getSituacaoBilhete());
|
||||
if(boletoComissao.isOcd()) {
|
||||
totalOcd = totalOcd.add(boletoComissao.getTotal());
|
||||
} else if(boletoComissao.isStatusCancelado() && boletoComissao.isMotivocancelacionDevolvido()) {
|
||||
|
@ -390,64 +436,60 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
|
||||
carregarTotalFormapago(resumoComissao, boletoComissaos, lsEventosFinanceiros);
|
||||
|
||||
/*BigDecimal totalFormapagoDinheiro = getFormapagoDinheiro(resumoComissao);
|
||||
totalFormapagoDinheiro = totalFormapagoDinheiro.subtract(carregarTotalDevolvidosDinhero(boletoComissaos));
|
||||
totalFormapagoDinheiro = totalFormapagoDinheiro.subtract(totalOcd.getValorPagar());*/
|
||||
|
||||
resumoComissao.setValorDeposito(conferenciaComissaoDAO.carregarValorDepositoContaCorrente(conferencia.getEmpresa().getEmpresaId(), conferencia.getPuntoVenta().getPuntoventaId(), conferencia.getDatamovimento()));
|
||||
|
||||
return resumoComissao;
|
||||
}
|
||||
|
||||
private BigDecimal carregarTotalDevolvidosDinhero(List<BoletoComissao> boletoComissaos) {
|
||||
BigDecimal totalDevolvidoDinheiro = BigDecimal.ZERO;
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isStatusCancelado() && boletoComissao.isMotivocancelacionDevolvido() && !boletoComissao.isOcd()) {
|
||||
for (FormapagoVO formapago : boletoComissao.getFormapagos()) {
|
||||
if(formapago.getFormapagoId() == Constantes.FORMA_PAGO_DINHEIRO.intValue()) {
|
||||
totalDevolvidoDinheiro = totalDevolvidoDinheiro.add(formapago.getImporte());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return totalDevolvidoDinheiro;
|
||||
}
|
||||
|
||||
private BigDecimal getFormapagoDinheiro(ResumoComissao resumoComissao) {
|
||||
for (FormapagoVO formapago : resumoComissao.getTotalFormapago()) {
|
||||
if(formapago.getFormapagoId() == Constantes.FORMA_PAGO_DINHEIRO.intValue()) {
|
||||
return formapago.getImporte();
|
||||
}
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
private void carregarTotalFormapago(ResumoComissao resumoComissao, List<BoletoComissao> boletoComissaos, List<EventosFinanceirosVO> lsEventosFinanceiros) {
|
||||
List<FormapagoVO> totalFormapagos = new ArrayList<FormapagoVO>();
|
||||
for (BoletoComissao boletoComissao : boletoComissaos) {
|
||||
if(boletoComissao.isStatusVendido() &&
|
||||
(boletoComissao.isSemMotivocancelacion() || boletoComissao.isMotivocancelacionCancelado() || boletoComissao.isMotivocancelacionDevolvido())) {
|
||||
if(boletoComissao.isTotalizarFormapago()) {
|
||||
|
||||
for (FormapagoVO formapagoBoleto : boletoComissao.getFormapagos()) {
|
||||
FormapagoVO formapago;
|
||||
if(totalFormapagos.contains(formapagoBoleto)) {
|
||||
formapago = totalFormapagos.get(totalFormapagos.indexOf(formapagoBoleto));
|
||||
formapago.setImporte(formapagoBoleto.getImporte().add(formapago.getImporte()));
|
||||
} else {
|
||||
formapago = new FormapagoVO(formapagoBoleto.getFormapagoId(), formapagoBoleto.getDescpago(), null, formapagoBoleto.getImporte());
|
||||
formapago = new FormapagoVO(formapagoBoleto.getFormapagoId(), formapagoBoleto.getDescpago(), null, BigDecimal.ZERO);
|
||||
totalFormapagos.add(formapagoBoleto);
|
||||
}
|
||||
|
||||
if(boletoComissao.isStatusVendido() || boletoComissao.isStatusTroca()) {
|
||||
log.info("+"+formapagoBoleto.getImporteFormatado());
|
||||
formapago.add(formapagoBoleto.getImporte());
|
||||
log.info("Tipo: "+formapago.getDescpago()+" Valor atual: "+formapago.getImporteFormatado());
|
||||
} else if(boletoComissao.isStatusCancelado() &&
|
||||
(boletoComissao.isMotivocancelacionCancelado() || boletoComissao.isMotivocancelacionDevolvido() || boletoComissao.isMotivocancelacionTrocado())) {
|
||||
log.info("-"+formapagoBoleto.getImporteFormatado());
|
||||
formapago.subtract(formapagoBoleto.getImporte());
|
||||
log.info("Tipo: "+formapago.getDescpago()+" Valor atual: "+formapago.getImporteFormatado());
|
||||
} else {
|
||||
log.info("Nao encontrado"+boletoComissao.getMotivoCancelacionId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
log.info("----");
|
||||
}
|
||||
|
||||
for (EventosFinanceirosVO eventosFinanceiros : lsEventosFinanceiros) {
|
||||
FormapagoVO formapagoEventoFinanceiro = new FormapagoVO(eventosFinanceiros.getFormapagoId(), eventosFinanceiros.getDescpago(), null, eventosFinanceiros.getImpingreso());
|
||||
FormapagoVO formapagoEventoFinanceiro = new FormapagoVO(eventosFinanceiros.getFormapagoId(), eventosFinanceiros.getDescpago(), null, BigDecimal.ZERO);
|
||||
if(totalFormapagos.contains(formapagoEventoFinanceiro)) {
|
||||
FormapagoVO formapago = totalFormapagos.get(totalFormapagos.indexOf(formapagoEventoFinanceiro));
|
||||
formapago.setImporte(formapagoEventoFinanceiro.getImporte().add(formapago.getImporte()));
|
||||
formapagoEventoFinanceiro = totalFormapagos.get(totalFormapagos.indexOf(formapagoEventoFinanceiro));
|
||||
} else {
|
||||
totalFormapagos.add(formapagoEventoFinanceiro);
|
||||
}
|
||||
|
||||
if(eventosFinanceiros.isCredito()) {
|
||||
log.info("+"+eventosFinanceiros.getImpingreso());
|
||||
formapagoEventoFinanceiro.add(eventosFinanceiros.getImpingreso());
|
||||
log.info("Tipo: "+formapagoEventoFinanceiro.getDescpago()+" Valor atual: "+formapagoEventoFinanceiro.getImporteFormatado());
|
||||
} else if(eventosFinanceiros.isDebito()) {
|
||||
log.info("-"+eventosFinanceiros.getImpingreso());
|
||||
formapagoEventoFinanceiro.subtract(eventosFinanceiros.getImpingreso());
|
||||
log.info("Tipo: "+formapagoEventoFinanceiro.getDescpago()+" Valor atual: "+formapagoEventoFinanceiro.getImporteFormatado());
|
||||
}
|
||||
}
|
||||
resumoComissao.setTotalFormapago(totalFormapagos);
|
||||
}
|
||||
|
@ -518,7 +560,6 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
}
|
||||
confirmarChegadaMalote(conferencia);
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
|
@ -533,5 +574,15 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
|
|||
public boolean isConferenciaCompetenciaEncerrada(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
return conferenciaComissaoDAO.isConferenciaCompetenciaEncerrada(competencia, empresa, puntoVenta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOcdSemConferencia(List<OcdVO> lsOcd) throws BusinessException {
|
||||
for (OcdVO ocd : lsOcd) {
|
||||
if(ocd.isExigeConferenciaAba() && (!ocd.isConferido() && ocd.getLogconferenciaId() == null)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.rjconsultores.ventaboletos.dao.EmpresaDAO;
|
|||
import com.rjconsultores.ventaboletos.dao.EsquemaCorridaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.RutaEmpresaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpCategoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpConferencia;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpFormapago;
|
||||
import com.rjconsultores.ventaboletos.entidad.ComEmpTipoEventoExtra;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
|
@ -56,6 +57,10 @@ public class EmpresaServiceImpl implements EmpresaService {
|
|||
|
||||
@Transactional
|
||||
public Empresa suscribirActualizacion(Empresa entidad) throws BusinessException {
|
||||
ComEmpConferencia comEmpConferencia = null;
|
||||
if(entidad.getComEmpConferencias() != null && !entidad.getComEmpConferencias().isEmpty()) {
|
||||
comEmpConferencia = entidad.getComEmpConferencias().iterator().next();
|
||||
}
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
|
@ -71,6 +76,11 @@ public class EmpresaServiceImpl implements EmpresaService {
|
|||
entidad = empresaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
if(comEmpConferencia != null) {
|
||||
comEmpConferencia.setEmpresa(entidad);
|
||||
suscribirOrActualizacion(comEmpConferencia);
|
||||
}
|
||||
|
||||
return entidad;
|
||||
}
|
||||
|
||||
|
@ -192,4 +202,17 @@ public class EmpresaServiceImpl implements EmpresaService {
|
|||
public List<Empresa> obtenerTodosIncluindoEmpresaTodas(){
|
||||
return empresaDAO.obtenerTodosIncluindoEmpresaTodas();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ComEmpConferencia suscribirOrActualizacion(ComEmpConferencia comEmpConferencia) {
|
||||
if(comEmpConferencia.getComempconferenciaId() == null) {
|
||||
comEmpConferencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
comEmpConferencia.setFecmodif(Calendar.getInstance().getTime());
|
||||
comEmpConferencia.setActivo(Boolean.TRUE);
|
||||
return empresaDAO.suscribir(comEmpConferencia);
|
||||
} else {
|
||||
return empresaDAO.actualizacion(comEmpConferencia);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -9,6 +10,7 @@ import com.rjconsultores.ventaboletos.constantes.Constantes;
|
|||
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.IndStatusBoleto;
|
||||
import com.rjconsultores.ventaboletos.enums.comissao.StatusLogConferencia;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
|
||||
public class BoletoComissao {
|
||||
|
||||
|
@ -58,7 +60,12 @@ public class BoletoComissao {
|
|||
private boolean exigeConferenciaDevolvido;
|
||||
private Boolean indcarboletosdevolvidosconf;
|
||||
|
||||
private boolean exigeConferenciaAba;
|
||||
|
||||
private boolean conferido;
|
||||
|
||||
private Date feccorrida;
|
||||
private Integer corridaId;
|
||||
|
||||
public Integer getEmpresaId() {
|
||||
return empresaId;
|
||||
|
@ -367,7 +374,7 @@ public class BoletoComissao {
|
|||
return "OCD";
|
||||
} else if((isStatusCancelado()) && (isMotivocancelacionDevolvido() || isMotivocancelacionCancelado()) && StringUtils.isNotBlank(getDescmotivocancelacion())) {
|
||||
return getDescmotivocancelacion();
|
||||
} else if((isStatusCancelado()) && !isMotivocancelacionDevolvido() && !isMotivocancelacionCancelado()) {
|
||||
} else if((isStatusVendido() || isStatusCancelado()) && !isMotivocancelacionDevolvido() && !isMotivocancelacionCancelado()) {
|
||||
if (isMotivocancelacionTrocado()) {
|
||||
return "B. VENDIDO TROCADO";
|
||||
} else if (isMotivocancelacionTransferido()) {
|
||||
|
@ -564,7 +571,8 @@ public class BoletoComissao {
|
|||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado()) || // Venda cancelada
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido()) || // Venda devolvida
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) || // Novo bilhete da troca
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) || // Novo bilhete transferido
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusVendido() && isSemMotivocancelacion()) || // Novo bilhete de agrupamento de corrida
|
||||
//(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) || // Novo bilhete transferido
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) || // Novo bilhete da troca devolvido
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) || // Novo bilhete transferido devolvido
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) || // Novo bilhete da troca cancelado
|
||||
|
@ -628,64 +636,64 @@ public class BoletoComissao {
|
|||
|
||||
/** ABA GAP VENDIDA */
|
||||
public boolean isBilheteGapVendido() {
|
||||
return (isVendaGap(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap sem alteração
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionEntregaGap()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionEntregaGap()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap trocada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap transferida
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap cancelada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap devolvida
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap Novo bilhete da troca
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap Novo bilhete transferido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap Novo bilhete da troca devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap Novo bilhete transferido devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) && StringUtils.isBlank(getNumFolioSistema()) || // Gap Novo bilhete da troca cancelado
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) && StringUtils.isBlank(getNumFolioSistema()); // Gap Novo bilhete transferido cancelado
|
||||
return (isVendaGap(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido() && isSemNumFolioSistema()) || // Gap sem alteração
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado() && isSemNumFolioSistema()) || // Gap trocada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido() && isSemNumFolioSistema()) || // Gap transferida
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) || // Gap cancelada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap devolvida
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca
|
||||
//(isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion() && isSemNumFolioSistema()) || // Gap Novo bilhete transferido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) || // Gap Novo bilhete transferido devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca cancelado
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()); // Gap Novo bilhete transferido cancelado
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapTrocado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && StringUtils.isBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapTrocadoDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionTrocado() && isStatusCancelado() && StringUtils.isBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionTrocado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP CANCELADO */
|
||||
public boolean isBilheteGapTrocadoCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && StringUtils.isBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP CANCELADO */
|
||||
public boolean isBilheteGapCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && StringUtils.isBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionDevolvido() && isStatusCancelado() && StringUtils.isBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionDevolvido() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE VENDIDO */
|
||||
public boolean isBilheteEntregaGap() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusEntregue() && StringUtils.isNotBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isStatusEntregue() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE DEVOLVIDO */
|
||||
public boolean isBilheteEntregaGapTrocado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && StringUtils.isNotBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE DEVOLVIDO */
|
||||
public boolean isBilheteEntregaGapDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido() && StringUtils.isNotBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE CANCELADO */
|
||||
public boolean isBilheteEntregaGapCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionCancelado() && StringUtils.isNotBlank(getNumFolioSistema());
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionCancelado() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
public boolean isStatusVendido() {
|
||||
|
@ -740,4 +748,86 @@ public class BoletoComissao {
|
|||
this.exigeConferenciaDevolvido = exigeConferenciaDevolvido;
|
||||
}
|
||||
|
||||
private boolean isSemNumFolioSistema() {
|
||||
return StringUtils.isBlank(getNumFolioSistema());
|
||||
}
|
||||
|
||||
private boolean isComNumFolioSistema() {
|
||||
return StringUtils.isNotBlank(getNumFolioSistema());
|
||||
}
|
||||
|
||||
public boolean isExigeConferenciaAba() {
|
||||
return exigeConferenciaAba;
|
||||
}
|
||||
|
||||
public void setExigeConferenciaAba(boolean exigeConferenciaAba) {
|
||||
this.exigeConferenciaAba = exigeConferenciaAba;
|
||||
}
|
||||
|
||||
public Date getFeccorrida() {
|
||||
return feccorrida;
|
||||
}
|
||||
|
||||
public void setFeccorrida(Date feccorrida) {
|
||||
this.feccorrida = feccorrida;
|
||||
}
|
||||
|
||||
public Integer getCorridaId() {
|
||||
return corridaId;
|
||||
}
|
||||
|
||||
public void setCorridaId(Integer corridaId) {
|
||||
this.corridaId = corridaId;
|
||||
}
|
||||
|
||||
public String getFeccorridaServico() {
|
||||
StringBuilder str = new StringBuilder();
|
||||
if(getFeccorrida() != null) {
|
||||
str.append(DateUtil.getStringDate(getFeccorrida(), "dd/MM"));
|
||||
}
|
||||
|
||||
if(getCorridaId() != null) {
|
||||
if(str.length() > 0) {
|
||||
str.append(" - ");
|
||||
}
|
||||
|
||||
str.append(getCorridaId());
|
||||
}
|
||||
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
public boolean isBilheteGap() {
|
||||
return isBilheteGapVendido() ||
|
||||
isBilheteGapCancelado() ||
|
||||
isBilheteGapTrocado() ||
|
||||
isBilheteGapTrocadoCancelado() ||
|
||||
isBilheteGapTrocadoDevolvido();
|
||||
}
|
||||
|
||||
public boolean isTotalizarFormapago() {
|
||||
boolean totalizar = isTotalizarTipovenda();
|
||||
if(totalizar) {
|
||||
totalizar = !isOcd();
|
||||
}
|
||||
return totalizar;
|
||||
}
|
||||
|
||||
private boolean isTotalizarTipovenda() {
|
||||
return isBilhetesManualVendido() ||
|
||||
isBilheteNormalVendido() ||
|
||||
isBilheteNormalTrocado() ||
|
||||
isBilheteNormalTrocadoCancelado() ||
|
||||
isBilheteNormalTrocadoDevolvido() ||
|
||||
isBilheteNormalCancelado() ||
|
||||
isBilheteNormalDevolvido() ||
|
||||
isBilheteAberto() ||
|
||||
isBilheteGapCancelado() ||
|
||||
isBilheteGapDevolvido() ||
|
||||
isBilheteGapVendido() ||
|
||||
isBilheteGapTrocadoCancelado() ||
|
||||
isBilheteGapTrocadoDevolvido();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -29,6 +29,8 @@ public class EventosFinanceirosVO {
|
|||
private Long logconferenciaId;
|
||||
private boolean conferido;
|
||||
|
||||
private Boolean exigeConferenciaAba;
|
||||
|
||||
public Long getEventoextraId() {
|
||||
return eventoextraId;
|
||||
}
|
||||
|
@ -129,6 +131,10 @@ public class EventosFinanceirosVO {
|
|||
return StringUtils.isNotBlank(getIndtipo()) && "1".equals(getIndtipo());
|
||||
}
|
||||
|
||||
public boolean isDebito() {
|
||||
return StringUtils.isNotBlank(getIndtipo()) && "0".equals(getIndtipo());
|
||||
}
|
||||
|
||||
public String getDebitoCredito() {
|
||||
return isCredito() ? Labels.getLabel("conferenciaController.lbCredito.value") : Labels.getLabel("conferenciaController.lbDebito.value");
|
||||
}
|
||||
|
@ -177,4 +183,12 @@ public class EventosFinanceirosVO {
|
|||
return getComemptipoeventoextraId() != null || getComempformapagoId() != null;
|
||||
}
|
||||
|
||||
public Boolean getExigeConferenciaAba() {
|
||||
return exigeConferenciaAba;
|
||||
}
|
||||
|
||||
public void setExigeConferenciaAba(Boolean exigeConferenciaAba) {
|
||||
this.exigeConferenciaAba = exigeConferenciaAba;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -82,5 +82,13 @@ public class FormapagoVO {
|
|||
public String getImporteFormatado() {
|
||||
return BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(getImporte(), LocaleUtil.getLocale());
|
||||
}
|
||||
|
||||
public void add(BigDecimal importe) {
|
||||
this.importe = this.importe.add(importe != null ? importe : BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
public void subtract(BigDecimal importe) {
|
||||
this.importe = this.importe.subtract(importe != null ? importe : BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ public class OcdVO {
|
|||
private Integer status;
|
||||
private Long logconferenciaId;
|
||||
private boolean conferido;
|
||||
|
||||
private boolean exigeConferenciaAba;
|
||||
|
||||
public Long getOcdId() {
|
||||
return ocdId;
|
||||
|
@ -251,4 +253,12 @@ public class OcdVO {
|
|||
return nombusuarioLogin.toString();
|
||||
}
|
||||
|
||||
public boolean isExigeConferenciaAba() {
|
||||
return exigeConferenciaAba;
|
||||
}
|
||||
|
||||
public void setExigeConferenciaAba(boolean exigeConferenciaAba) {
|
||||
this.exigeConferenciaAba = exigeConferenciaAba;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue