diff --git a/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java b/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java index b99c49519..8ded6aa55 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java +++ b/src/com/rjconsultores/ventaboletos/entidad/FormaPago.java @@ -12,6 +12,8 @@ import java.util.List; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -21,6 +23,8 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +import com.rjconsultores.ventaboletos.enums.TipoFormapago; + /** * * @author Administrador @@ -60,6 +64,9 @@ public class FormaPago implements Serializable { private List pricingFormapagoList; @Column(name = "INDCONFERENCIAFISICACOMISSAO") private Boolean indconferenciafisicacomissao; + @Column(name = "TIPO_PAGO") + @Enumerated(EnumType.ORDINAL) + private TipoFormapago tipoFormapago; public FormaPago() { super(); @@ -213,4 +220,12 @@ public class FormaPago implements Serializable { public void setIndconferenciafisicacomissao(Boolean indconferenciafisicacomissao) { this.indconferenciafisicacomissao = indconferenciafisicacomissao; } + + public TipoFormapago getTipoFormapago() { + return tipoFormapago; + } + + public void setTipoFormapago(TipoFormapago tipoFormapago) { + this.tipoFormapago = tipoFormapago; + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/PacoteTarifa.java b/src/com/rjconsultores/ventaboletos/entidad/PacoteTarifa.java index ce33bbc70..9d9286abd 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PacoteTarifa.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PacoteTarifa.java @@ -43,6 +43,8 @@ public class PacoteTarifa implements Serializable { @JoinColumn(name = "TIPOTARIFAPACOTE_ID", referencedColumnName = "TIPOTARIFAPACOTE_ID") @ManyToOne private TipoTarifaPacote tipoTarifaPacote; + @Column(name = "INDVENDAWEB") + private Boolean indvendaweb; public PacoteTarifa() { super(); @@ -126,7 +128,7 @@ public class PacoteTarifa implements Serializable { return true; if (obj == null) return false; - if (getClass() != obj.getClass()) + if (!(obj instanceof PacoteTarifa)) return false; PacoteTarifa other = (PacoteTarifa) obj; if (pacotetarifaId == null) { @@ -142,4 +144,12 @@ public class PacoteTarifa implements Serializable { return "PacoteTarifa [pacotetarifaId=" + pacotetarifaId + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", pacote=" + pacote + ", tipoTarifaPacote=" + tipoTarifaPacote + "]"; } + public Boolean getIndvendaweb() { + return indvendaweb; + } + + public void setIndvendaweb(Boolean indvendaweb) { + this.indvendaweb = indvendaweb; + } + } diff --git a/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java new file mode 100644 index 000000000..14120c63e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java @@ -0,0 +1,41 @@ +package com.rjconsultores.ventaboletos.enums; + +import org.zkoss.util.resource.Labels; + +public enum TipoFormapago { + + DINHEIRO(0,Labels.getLabel("editarFormaPagoController.lblDinheiro.label")), + DEBITO(1,Labels.getLabel("editarFormaPagoController.lblDebito.label")), + CREDITO(2,Labels.getLabel("editarFormaPagoController.lblCredito.label")), + NOTA_CREDITO(3,Labels.getLabel("editarFormaPagoController.lblNotaCredito.label")), + TROCA_PASSAGEM(4,Labels.getLabel("editarFormaPagoController.lblTrocaPassagem.label")), + IMPRESSAO_PASSAGEM(5,Labels.getLabel("editarFormaPagoController.lblImpressaoPassagem.label")), + ORDEM_SERVICO(6,Labels.getLabel("editarFormaPagoController.lblOrdemServico.label")), + BOLETO_ABERTO(7,Labels.getLabel("editarFormaPagoController.lblBoletoAberto.label")), + PACOTE(8,Labels.getLabel("editarFormaPagoController.lblPacote.label")), + RESERVA(9,Labels.getLabel("editarFormaPagoController.lblReserva.label")), + CHEQUE(10,Labels.getLabel("editarFormaPagoController.lblCheque.label")), + DEPOSITO(11,Labels.getLabel("editarFormaPagoController.lblDeposito.label")); + + private Integer valor; + private String descricao; + + private TipoFormapago(Integer valor, String descricao) { + this.valor = valor; + this.descricao = descricao; + } + + public String getDescricao() { + return descricao; + } + + @Override + public String toString() { + return getDescricao(); + } + + public Integer getValor() { + return valor; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/PacoteTarifaService.java b/src/com/rjconsultores/ventaboletos/service/PacoteTarifaService.java index 880a3eaff..4471ff870 100644 --- a/src/com/rjconsultores/ventaboletos/service/PacoteTarifaService.java +++ b/src/com/rjconsultores/ventaboletos/service/PacoteTarifaService.java @@ -9,7 +9,7 @@ import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote; public interface PacoteTarifaService extends GenericService { - public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa); + public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb); public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/PacoteTarifaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/PacoteTarifaServiceImpl.java index 2e4c31ddf..48063ca4d 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/PacoteTarifaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/PacoteTarifaServiceImpl.java @@ -63,12 +63,13 @@ public class PacoteTarifaServiceImpl implements PacoteTarifaService { @Transactional(readOnly = false) @Override - public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa) { + public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa, Boolean indvendaweb) { if (pacoteTarifa == null) { pacoteTarifa = new PacoteTarifa(); } + pacoteTarifa.setIndvendaweb(indvendaweb); pacoteTarifa.setTarifa(tarifa); pacoteTarifa.setTipoTarifaPacote(tipoTarifaPacote); pacoteTarifa.setPacote(pacote);