920 lines
28 KiB
Java
920 lines
28 KiB
Java
package com.rjconsultores.ventaboletos.vo.comissao;
|
||
|
||
import java.math.BigDecimal;
|
||
import java.util.Date;
|
||
import java.util.Set;
|
||
import org.apache.commons.lang.StringUtils;
|
||
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 {
|
||
|
||
private Long boletoId;
|
||
private Long boletoOriginalId;
|
||
private Integer empresaId;
|
||
private Integer puntoVentaId;
|
||
private String datavenda;
|
||
private Integer tipoVenta;
|
||
private String indstatusboleto;
|
||
private Integer motivoCancelacionId;
|
||
private Integer motivoCancelacionOriginal1;
|
||
private Integer motivoCancelacionOriginal2;
|
||
private String descmotivocancelacion;
|
||
private BigDecimal valorpagado;
|
||
private BigDecimal seguro;
|
||
private BigDecimal pedagio;
|
||
private BigDecimal embarque;
|
||
private BigDecimal excessoBagagem;
|
||
private BigDecimal seguroOpcional;
|
||
private BigDecimal seguroOutros;
|
||
private Boolean ptoVtaOrigem;
|
||
private String numAsiento;
|
||
private String numAsientoVinculado;
|
||
private String numFolioSistema;
|
||
private String numSeriePreimpresa;
|
||
private String numFolioPreImpreso;
|
||
private String uf;
|
||
private String desccategoria;
|
||
private String nombpasajero;
|
||
private Integer status;
|
||
private String numoperacion;
|
||
private Integer tipoVentaOriginal1;
|
||
private Integer tipoVentaOriginal2;
|
||
private Integer ocdId;
|
||
|
||
private Integer estadoId;
|
||
private Integer formapagoId;
|
||
private String descpago;
|
||
private Boolean indconferenciafisicacomissao;
|
||
private BigDecimal importeFp;
|
||
|
||
private Set<FormapagoVO> formapagos;
|
||
private BigDecimal icmsBase;
|
||
private String nombusuario;
|
||
private Integer comempformapagoId;
|
||
private Integer comempcategoriaId;
|
||
private Long logconferenciaId;
|
||
|
||
private boolean exigeConferenciaDevolvido;
|
||
private Boolean indcarboletosdevolvidosconf;
|
||
|
||
private boolean exigeConferenciaAba;
|
||
|
||
private boolean conferido;
|
||
|
||
private Date feccorrida;
|
||
|
||
private Integer corridaId;
|
||
|
||
public Integer getEmpresaId() {
|
||
return empresaId;
|
||
}
|
||
|
||
public void setEmpresaId(Integer empresaId) {
|
||
this.empresaId = empresaId;
|
||
}
|
||
|
||
public Integer getPuntoVentaId() {
|
||
return puntoVentaId;
|
||
}
|
||
|
||
public void setPuntoVentaId(Integer puntoVentaId) {
|
||
this.puntoVentaId = puntoVentaId;
|
||
}
|
||
|
||
public String getDatavenda() {
|
||
return datavenda;
|
||
}
|
||
|
||
public void setDatavenda(String datavenda) {
|
||
this.datavenda = datavenda;
|
||
}
|
||
|
||
public Integer getTipoVenta() {
|
||
return tipoVenta;
|
||
}
|
||
|
||
public void setTipoVenta(Integer tipoVenta) {
|
||
this.tipoVenta = tipoVenta;
|
||
}
|
||
|
||
public Integer getMotivoCancelacionId() {
|
||
return motivoCancelacionId;
|
||
}
|
||
|
||
public void setMotivoCancelacionId(Integer motivoCancelacionId) {
|
||
this.motivoCancelacionId = motivoCancelacionId;
|
||
}
|
||
|
||
public BigDecimal getValorpagado() {
|
||
return valorpagado;
|
||
}
|
||
|
||
public void setValorpagado(BigDecimal valorpagado) {
|
||
this.valorpagado = valorpagado;
|
||
}
|
||
|
||
public BigDecimal getSeguro() {
|
||
return seguro;
|
||
}
|
||
|
||
public void setSeguro(BigDecimal seguro) {
|
||
this.seguro = seguro;
|
||
}
|
||
|
||
public BigDecimal getPedagio() {
|
||
return pedagio;
|
||
}
|
||
|
||
public void setPedagio(BigDecimal pedagio) {
|
||
this.pedagio = pedagio;
|
||
}
|
||
|
||
public BigDecimal getEmbarque() {
|
||
return embarque;
|
||
}
|
||
|
||
public void setEmbarque(BigDecimal embarque) {
|
||
this.embarque = embarque;
|
||
}
|
||
|
||
public BigDecimal getExcessoBagagem() {
|
||
return excessoBagagem;
|
||
}
|
||
|
||
public void setExcessoBagagem(BigDecimal excessoBagagem) {
|
||
this.excessoBagagem = excessoBagagem;
|
||
}
|
||
|
||
public BigDecimal getSeguroOpcional() {
|
||
return seguroOpcional;
|
||
}
|
||
|
||
public void setSeguroOpcional(BigDecimal seguroOpcional) {
|
||
this.seguroOpcional = seguroOpcional;
|
||
}
|
||
|
||
public BigDecimal getSeguroOutros() {
|
||
return seguroOutros;
|
||
}
|
||
|
||
public void setSeguroOutros(BigDecimal seguroOutros) {
|
||
this.seguroOutros = seguroOutros;
|
||
}
|
||
|
||
public Boolean isPtoVtaOrigem() {
|
||
return ptoVtaOrigem;
|
||
}
|
||
|
||
public void setPtoVtaOrigem(Boolean ptoVtaOrigem) {
|
||
this.ptoVtaOrigem = ptoVtaOrigem;
|
||
}
|
||
|
||
public String getIndstatusboleto() {
|
||
return indstatusboleto;
|
||
}
|
||
|
||
public void setIndstatusboleto(String indstatusboleto) {
|
||
this.indstatusboleto = indstatusboleto;
|
||
}
|
||
|
||
public Long getBoletoId() {
|
||
return boletoId;
|
||
}
|
||
|
||
public void setBoletoId(Long boletoId) {
|
||
this.boletoId = boletoId;
|
||
}
|
||
|
||
public void setBoletoOriginalId(Long boletoOriginalId) {
|
||
this.boletoOriginalId = boletoOriginalId;
|
||
}
|
||
|
||
public Long getBoletoOriginalId() {
|
||
return boletoOriginalId;
|
||
}
|
||
|
||
public String getNumAsiento() {
|
||
return numAsiento;
|
||
}
|
||
|
||
public void setNumAsiento(String numAsiento) {
|
||
this.numAsiento = numAsiento;
|
||
}
|
||
|
||
public String getNumFolioSistema() {
|
||
return numFolioSistema;
|
||
}
|
||
|
||
public void setNumFolioSistema(String numFolioSistema) {
|
||
this.numFolioSistema = numFolioSistema;
|
||
}
|
||
|
||
public String getNumSeriePreimpresa() {
|
||
return numSeriePreimpresa;
|
||
}
|
||
|
||
public void setNumSeriePreimpresa(String numSeriePreimpresa) {
|
||
this.numSeriePreimpresa = numSeriePreimpresa;
|
||
}
|
||
|
||
public String getNumFolioPreImpreso() {
|
||
return numFolioPreImpreso;
|
||
}
|
||
|
||
public void setNumFolioPreImpreso(String numFolioPreImpreso) {
|
||
this.numFolioPreImpreso = numFolioPreImpreso;
|
||
}
|
||
|
||
public String getUf() {
|
||
return uf;
|
||
}
|
||
|
||
public void setUf(String uf) {
|
||
this.uf = uf;
|
||
}
|
||
|
||
public String getDesccategoria() {
|
||
return desccategoria;
|
||
}
|
||
|
||
public void setDesccategoria(String desccategoria) {
|
||
this.desccategoria = desccategoria;
|
||
}
|
||
|
||
public Boolean getPtoVtaOrigem() {
|
||
return ptoVtaOrigem;
|
||
}
|
||
|
||
public Integer getStatus() {
|
||
return status;
|
||
}
|
||
|
||
public void setStatus(Integer status) {
|
||
this.status = status;
|
||
}
|
||
|
||
public String getStatusDescricao() {
|
||
StatusLogConferencia statusLogConferencia = StatusLogConferencia.getStatusLogConferencia(status);
|
||
if (statusLogConferencia != null) {
|
||
return statusLogConferencia.toString();
|
||
}
|
||
return "";
|
||
}
|
||
|
||
public String getDescFormapagos() {
|
||
StringBuilder sFormapagos = new StringBuilder();
|
||
for (FormapagoVO formapago : formapagos) {
|
||
if (sFormapagos.length() > 0) {
|
||
sFormapagos.append(", ");
|
||
}
|
||
sFormapagos.append(formapago.getDescpago());
|
||
}
|
||
|
||
return sFormapagos.toString();
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
final int prime = 31;
|
||
int result = 1;
|
||
result = prime * result + ((getBoletoId() == null) ? 0 : getBoletoId().hashCode());
|
||
return result;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object obj) {
|
||
if (this == obj)
|
||
return true;
|
||
if (obj == null)
|
||
return false;
|
||
BoletoComissao other = (BoletoComissao) obj;
|
||
if (getBoletoId() == null) {
|
||
if (other.getBoletoId() != null)
|
||
return false;
|
||
}
|
||
else if (!getBoletoId().equals(other.getBoletoId()))
|
||
return false;
|
||
return true;
|
||
}
|
||
|
||
public Integer getFormapagoId() {
|
||
return formapagoId;
|
||
}
|
||
|
||
public void setFormapagoId(Integer formapagoId) {
|
||
this.formapagoId = formapagoId;
|
||
}
|
||
|
||
public String getDescpago() {
|
||
return descpago;
|
||
}
|
||
|
||
public void setDescpago(String descpago) {
|
||
this.descpago = descpago;
|
||
}
|
||
|
||
public Boolean getIndconferenciafisicacomissao() {
|
||
return indconferenciafisicacomissao;
|
||
}
|
||
|
||
public void setIndconferenciafisicacomissao(Boolean indconferenciafisicacomissao) {
|
||
this.indconferenciafisicacomissao = indconferenciafisicacomissao;
|
||
}
|
||
|
||
public Set<FormapagoVO> getFormapagos() {
|
||
return formapagos;
|
||
}
|
||
|
||
public void setFormapagos(Set<FormapagoVO> formapagos) {
|
||
this.formapagos = formapagos;
|
||
}
|
||
|
||
public BigDecimal getIcmsBase() {
|
||
return icmsBase;
|
||
}
|
||
|
||
public void setIcmsBase(BigDecimal icmsBase) {
|
||
this.icmsBase = icmsBase;
|
||
}
|
||
|
||
public String getDescmotivocancelacion() {
|
||
return descmotivocancelacion;
|
||
}
|
||
|
||
public void setDescmotivocancelacion(String descmotivocancelacion) {
|
||
this.descmotivocancelacion = descmotivocancelacion;
|
||
}
|
||
|
||
public Integer getEstadoId() {
|
||
return estadoId;
|
||
}
|
||
|
||
public void setEstadoId(Integer estadoId) {
|
||
this.estadoId = estadoId;
|
||
}
|
||
|
||
public String getNumAsientoVinculado() {
|
||
return numAsientoVinculado;
|
||
}
|
||
|
||
public void setNumAsientoVinculado(String numAsientoVinculado) {
|
||
this.numAsientoVinculado = numAsientoVinculado;
|
||
}
|
||
|
||
public BigDecimal getTotal() {
|
||
return BigDecimal.ZERO
|
||
.add(getValorpagado())
|
||
.add(getEmbarque())
|
||
.add(getSeguro())
|
||
.add(getPedagio())
|
||
.add(getSeguro());
|
||
}
|
||
|
||
public String getDescTipoVenta() {
|
||
return DescricaoTipoVenta.getDescricaoTipoVenta(getTipoVenta());
|
||
}
|
||
|
||
public String getSituacaoBilhete() {
|
||
if (isOcd()) {
|
||
return "OCD";
|
||
}
|
||
else if ((isStatusCancelado()) && (isMotivocancelacionDevolvido() || isMotivocancelacionCancelado())
|
||
&& StringUtils.isNotBlank(getDescmotivocancelacion())) {
|
||
return getDescmotivocancelacion();
|
||
}
|
||
else if ((isStatusVendido() || isStatusCancelado())
|
||
&& !isMotivocancelacionDevolvido() && !isMotivocancelacionCancelado()) {
|
||
if (isStatusCancelado() && isMotivocancelacionTrocado()) {
|
||
return "B. VENDIDO TROCADO";
|
||
}
|
||
else if (isStatusVendido() && isMotivocancelacionTransferido()) {
|
||
return "B. VENDIDO TRANSFERIDO";
|
||
}
|
||
}
|
||
else if (isStatusTroca()) {
|
||
if (isVendaBilheteTroca(getTipoVenta()) || isVendaGap(getTipoVenta())) {
|
||
return "B. DA TROCA";
|
||
}
|
||
else if (isVendaBilheteTransferencia(getTipoVenta()) || isVendaGap(getTipoVenta())) {
|
||
return "B. DA TRANSFERENCIA";
|
||
}
|
||
else if (isVendaBilheteConfirmaAberto(getTipoVenta())) {
|
||
return "CONFIRMA<4D><41>O ABERTO";
|
||
}
|
||
}
|
||
|
||
IndStatusBoleto indStatusBoleto = IndStatusBoleto.getIndStatusBoleto(getIndstatusboleto());
|
||
return indStatusBoleto != null ? indStatusBoleto.getValue() : "";
|
||
}
|
||
|
||
public boolean isOcd() {
|
||
return getOcdId() != null && isStatusCancelado() && isMotivocancelacionDevolvido();
|
||
}
|
||
|
||
public String getNombusuario() {
|
||
return nombusuario;
|
||
}
|
||
|
||
public void setNombusuario(String nombusuario) {
|
||
this.nombusuario = nombusuario;
|
||
}
|
||
|
||
public BigDecimal getImporteFp() {
|
||
return importeFp;
|
||
}
|
||
|
||
public void setImporteFp(BigDecimal importeFp) {
|
||
this.importeFp = importeFp;
|
||
}
|
||
|
||
public Integer getComempformapagoId() {
|
||
return comempformapagoId;
|
||
}
|
||
|
||
public void setComempformapagoId(Integer comempformapagoId) {
|
||
this.comempformapagoId = comempformapagoId;
|
||
}
|
||
|
||
public Integer getComempcategoriaId() {
|
||
return comempcategoriaId;
|
||
}
|
||
|
||
public void setComempcategoriaId(Integer comempcategoriaId) {
|
||
this.comempcategoriaId = comempcategoriaId;
|
||
}
|
||
|
||
public boolean isExigeConferencia() {
|
||
return getComempcategoriaId() != null || getComempformapagoId() != null;
|
||
}
|
||
|
||
public boolean isExigeConferenciaBoletoDevolvido() {
|
||
return exigeConferenciaDevolvido;
|
||
}
|
||
|
||
public boolean isConferido() {
|
||
return conferido;
|
||
}
|
||
|
||
public void setConferido(boolean conferido) {
|
||
this.conferido = conferido;
|
||
}
|
||
|
||
public Long getLogconferenciaId() {
|
||
return logconferenciaId;
|
||
}
|
||
|
||
public void setLogconferenciaId(Long logconferenciaId) {
|
||
this.logconferenciaId = logconferenciaId;
|
||
}
|
||
|
||
public String getNumoperacion() {
|
||
return numoperacion;
|
||
}
|
||
|
||
public void setNumoperacion(String numoperacion) {
|
||
this.numoperacion = numoperacion;
|
||
}
|
||
|
||
public Integer getTipoVentaOriginal() {
|
||
return tipoVentaOriginal2 != null ? tipoVentaOriginal2
|
||
: tipoVentaOriginal1 != null ? tipoVentaOriginal1 : tipoVenta;
|
||
}
|
||
|
||
public Integer getTipoVentaOriginal1() {
|
||
return tipoVentaOriginal1;
|
||
}
|
||
|
||
public void setTipoVentaOriginal1(Integer tipoVentaOriginal1) {
|
||
this.tipoVentaOriginal1 = tipoVentaOriginal1;
|
||
}
|
||
|
||
public Integer getTipoVentaOriginal2() {
|
||
return tipoVentaOriginal2;
|
||
}
|
||
|
||
public void setTipoVentaOriginal2(Integer tipoVentaOriginal2) {
|
||
this.tipoVentaOriginal2 = tipoVentaOriginal2;
|
||
}
|
||
|
||
public Integer getOcdId() {
|
||
return ocdId;
|
||
}
|
||
|
||
public void setOcdId(Integer ocdId) {
|
||
this.ocdId = ocdId;
|
||
}
|
||
|
||
private boolean isBoletoOriginal() {
|
||
return boletoOriginalId == null
|
||
&& getMotivoCancelacionOriginal() != null
|
||
&& getMotivoCancelacionOriginal() == Constantes.MVO_CANCEL_BOLETO_AGRUPAMENTO.intValue();
|
||
}
|
||
|
||
public Integer getMotivoCancelacionOriginal() {
|
||
return motivoCancelacionOriginal2 != null ? motivoCancelacionOriginal2 : motivoCancelacionOriginal1;
|
||
}
|
||
|
||
public Integer getMotivoCancelacionOriginal1() {
|
||
return motivoCancelacionOriginal1;
|
||
}
|
||
|
||
public void setMotivoCancelacionOriginal1(Integer motivoCancelacionOriginal1) {
|
||
this.motivoCancelacionOriginal1 = motivoCancelacionOriginal1;
|
||
}
|
||
|
||
public Integer getMotivoCancelacionOriginal2() {
|
||
return motivoCancelacionOriginal2;
|
||
}
|
||
|
||
public void setMotivoCancelacionOriginal2(Integer motivoCancelacionOriginal2) {
|
||
this.motivoCancelacionOriginal2 = motivoCancelacionOriginal2;
|
||
}
|
||
|
||
public boolean isVendaManual(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_MANUAL.intValue();
|
||
}
|
||
|
||
public boolean isVendaGap(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_BOLETO_REMOTO.intValue()
|
||
|| tipoVenta == Constantes.TPV_CALL_CENTER.intValue()
|
||
|| tipoVenta == Constantes.TPV_POR_INTERNET.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteNormal(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_DIRECTO_NORMAL.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteTroca(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_TRANSFERENCIAS.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteTransferencia(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_CAMBIO_VIAJE.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteManual(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_MANUAL.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteAberto(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_BOLETO_ABIERTO.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteConfirmaAberto(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_CONFIRMA_ABIERTO.intValue();
|
||
}
|
||
|
||
public boolean isVendaBilheteCheckin(Integer tipoVenta) {
|
||
return tipoVenta == Constantes.TPV_CHECKIN_VIAGEM.intValue();
|
||
}
|
||
|
||
public boolean isSemMotivocancelacion() {
|
||
return getMotivoCancelacionId() == null;
|
||
}
|
||
|
||
public boolean isMotivocancelacionAgrupamento() {
|
||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_BOLETO_AGRUPAMENTO.intValue();
|
||
}
|
||
|
||
public boolean isMotivocancelacionCancelado() {
|
||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_CANCELACION.intValue();
|
||
}
|
||
|
||
public boolean isMotivocancelacionDevolvido() {
|
||
return !isSemMotivocancelacion() && (getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO.intValue()
|
||
|| getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_50.intValue()
|
||
|| getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_100.intValue());
|
||
}
|
||
|
||
public boolean isMotivocancelacionEntregaGap() {
|
||
return !isSemMotivocancelacion()
|
||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_BOLETO_ENTREGADO.intValue();
|
||
}
|
||
|
||
public boolean isMotivocancelacionTransferido() {
|
||
return !isSemMotivocancelacion()
|
||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_TRANSFERENCIA.intValue();
|
||
}
|
||
|
||
public boolean isMotivocancelacionTrocado() {
|
||
return !isSemMotivocancelacion()
|
||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_TROCA.intValue();
|
||
}
|
||
|
||
public boolean isMotivocancelacionCheckin() {
|
||
return !isSemMotivocancelacion()
|
||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_CHECKIN.intValue();
|
||
}
|
||
|
||
/** ABA BILHETE MANUAL */
|
||
public boolean isBilhetesManualVendido() {
|
||
return isVendaBilheteManual(getTipoVenta()) && isStatusVendido();
|
||
}
|
||
|
||
/** ABA BILHETE VENDIDO */
|
||
public boolean isBilheteNormalVendido() {
|
||
if (nombpasajero.startsWith("ABILIO"))
|
||
System.out.println("break point");
|
||
|
||
return (isVendaBilheteNormal(getTipoVenta()) && isSemMotivocancelacion()
|
||
&& isStatusVendido()) // Venda sem altera<72><61>o
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado()) // Venda trocada
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido()) // Venda transferida
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado()) // Venda cancelada
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido()) // Venda devolvida
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionAgrupamento() && isBoletoOriginal()) // Agrupamento de corrida
|
||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCheckin()) // Venda normal Checkin
|
||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) // Venda troca Checkin
|
||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) // Venda transferencia Checkin
|
||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) // Novo bilhete da troca
|
||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusVendido() && isSemMotivocancelacion()) // Novo bilhete de agrupamento de corrida
|
||
|| (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
|
||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) // Novo bilhete transferido cancelado
|
||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusEntregue() && isSemMotivocancelacion()); // bilhete transferido entregue
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteNormalTrocado() {
|
||
return isVendaBilheteNormal(getTipoVenta()) && isStatusCancelado()
|
||
&& isMotivocancelacionTrocado();
|
||
}
|
||
|
||
/** ABA BILHETE VENDIDO */
|
||
public boolean isBilheteNormalChekin() {
|
||
return isVendaBilheteCheckin(getTipoVenta()) && isStatusVendido();
|
||
}
|
||
|
||
/** ABA BILHETE VENDIDO */
|
||
public boolean isBilheteAberto() {
|
||
return isVendaBilheteAberto(getTipoVenta()) && isStatusVendido();
|
||
}
|
||
|
||
/** ABA BILHETE VENDIDO */
|
||
public boolean isBilheteConfirmaAbertoTroca() {
|
||
return isVendaBilheteConfirmaAberto(getTipoVenta()) && isStatusTroca();
|
||
}
|
||
|
||
/** ABA BILHETE CANCELADO */
|
||
public boolean isBilheteConfirmadoAbertoCancelado() {
|
||
return isVendaBilheteConfirmaAberto(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionCancelado();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteAbertoDevolvido() {
|
||
return isVendaBilheteConfirmaAberto(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteAbertoDevolvidoTrocado() {
|
||
return isVendaBilheteConfirmaAberto(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteEntregaAberto() {
|
||
return isVendaBilheteAberto(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteNormalDevolvido() {
|
||
return isVendaBilheteNormal(getTipoVenta()) && isMotivocancelacionDevolvido() && isStatusCancelado();
|
||
}
|
||
|
||
/** ABA BILHETE CANCELADO */
|
||
public boolean isBilheteNormalCancelado() {
|
||
return isVendaBilheteNormal(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteNormalTrocadoDevolvido() {
|
||
return isVendaBilheteTroca(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteTrocadoDevolvido() {
|
||
return isVendaBilheteTroca(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteNormalTransferidoDevolvido() {
|
||
return isVendaBilheteTransferencia(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteNormalTransferidoTrocado() {
|
||
return isVendaBilheteTransferencia(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado();
|
||
}
|
||
|
||
/** ABA BILHETE CANCELADO */
|
||
public boolean isBilheteNormalTrocadoCancelado() {
|
||
return isVendaBilheteTroca(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionCancelado();
|
||
}
|
||
|
||
/** ABA GAP VENDIDA */
|
||
public boolean isBilheteGapVendido() {
|
||
return (isVendaGap(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido()
|
||
&& isSemNumFolioSistema()) // Gap sem altera<72><61>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() && 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() && isSemNumFolioSistema();
|
||
}
|
||
|
||
/** ABA GAP DEVOLVIDO */
|
||
public boolean isBilheteGapTrocadoDevolvido() {
|
||
return isVendaGap(getTipoVenta()) && isMotivocancelacionTrocado()
|
||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||
}
|
||
|
||
/** ABA GAP CANCELADO */
|
||
public boolean isBilheteGapTrocadoCancelado() {
|
||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado()
|
||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||
}
|
||
|
||
/** ABA GAP CANCELADO */
|
||
public boolean isBilheteGapCancelado() {
|
||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado()
|
||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||
}
|
||
|
||
/** ABA GAP DEVOLVIDO */
|
||
public boolean isBilheteGapDevolvido() {
|
||
return isVendaGap(getTipoVenta()) && isMotivocancelacionDevolvido()
|
||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||
}
|
||
|
||
/** ABA BILHETE VENDIDO */
|
||
public boolean isBilheteEntregaGap() {
|
||
return isVendaGap(getTipoVenta()) && isStatusEntregue() && isComNumFolioSistema();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteEntregaGapTrocado() {
|
||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||
&& isMotivocancelacionTrocado() && isComNumFolioSistema();
|
||
}
|
||
|
||
/** ABA BILHETE DEVOLVIDO */
|
||
public boolean isBilheteEntregaGapDevolvido() {
|
||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||
&& isMotivocancelacionDevolvido() && isComNumFolioSistema();
|
||
}
|
||
|
||
/** ABA BILHETE CANCELADO */
|
||
public boolean isBilheteEntregaGapCancelado() {
|
||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||
&& isMotivocancelacionCancelado() && isComNumFolioSistema();
|
||
}
|
||
|
||
public boolean isStatusVendido() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.V);
|
||
}
|
||
|
||
public boolean isStatusCancelado() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.C);
|
||
}
|
||
|
||
public boolean isStatusEntregue() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.E);
|
||
}
|
||
|
||
public boolean isStatusTroca() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.T);
|
||
}
|
||
|
||
public boolean isStatusExtraviado() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.X);
|
||
}
|
||
|
||
public boolean isStatusMarcado() {
|
||
return getIndstatusboletoEnum().equals(IndStatusBoleto.M);
|
||
}
|
||
|
||
public String getNombpasajero() {
|
||
return nombpasajero;
|
||
}
|
||
|
||
public void setNombpasajero(String nombpasajero) {
|
||
this.nombpasajero = nombpasajero;
|
||
}
|
||
|
||
public IndStatusBoleto getIndstatusboletoEnum() {
|
||
return IndStatusBoleto.getIndStatusBoleto(getIndstatusboleto());
|
||
}
|
||
|
||
public Boolean getIndcarboletosdevolvidosconf() {
|
||
return indcarboletosdevolvidosconf;
|
||
}
|
||
|
||
public void setIndcarboletosdevolvidosconf(Boolean indcarboletosdevolvidosconf) {
|
||
this.indcarboletosdevolvidosconf = indcarboletosdevolvidosconf;
|
||
}
|
||
|
||
public boolean getExigeConferenciaDevolvido() {
|
||
return exigeConferenciaDevolvido;
|
||
}
|
||
|
||
public void setExigeConferenciaDevolvido(boolean exigeConferenciaDevolvido) {
|
||
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();
|
||
}
|
||
|
||
}
|