406 lines
10 KiB
Java
406 lines
10 KiB
Java
/*
|
|
* To change this template, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package com.rjconsultores.ventaboletos.entidad;
|
|
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
import javax.persistence.Basic;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.OneToMany;
|
|
import javax.persistence.SequenceGenerator;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.Temporal;
|
|
import javax.persistence.TemporalType;
|
|
import javax.persistence.Transient;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Parameter;
|
|
import org.hibernate.annotations.Type;
|
|
|
|
import com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital;
|
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
|
|
|
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
|
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
|
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
|
|
|
/**
|
|
*
|
|
* @author Administrador
|
|
*/
|
|
@AuditarClasse(nome = "Forma Pagamento", tela = "auditarClasse.FormaPago")
|
|
@Entity
|
|
@SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1)
|
|
@Table(name = "FORMA_PAGO")
|
|
public class FormaPago implements Serializable, Auditavel<FormaPago> {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@Id
|
|
@Basic(optional = false)
|
|
@GenericGenerator(name = "FOR_PAG_GEN_ID", strategy = "com.rjconsultores.ventaboletos.dao.util.FormaPagoGenerator")
|
|
@GeneratedValue(generator = "FOR_PAG_GEN_ID")
|
|
@Column(name = "FORMAPAGO_ID")
|
|
private Short formapagoId;
|
|
@Column(name = "DESCPAGO")
|
|
private String descpago;
|
|
@Column(name = "INDOPERACION")
|
|
private Short indoperacion;
|
|
@Column(name = "ACTIVO")
|
|
private Boolean activo;
|
|
@Column(name = "FECMODIF")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date fecmodif;
|
|
@Column(name = "USUARIO_ID")
|
|
private Integer usuarioId;
|
|
@Column(name = "EQUIVALENCIA_ID")
|
|
private String equivalenciaId;
|
|
@Column(name = "CVEPAGO")
|
|
private String cvePago;
|
|
@Column(name = "IMPFISCAL")
|
|
private Boolean impfiscal;
|
|
@NaoAuditar
|
|
@OneToMany(mappedBy = "formaPago")
|
|
private List<ConfigRestriccionPago> configRestriccionPagoList;
|
|
@NaoAuditar
|
|
@OneToMany(mappedBy = "formaPago")
|
|
private List<PricingFormapago> pricingFormapagoList;
|
|
@Column(name = "INDCONFERENCIAFISICACOMISSAO")
|
|
private Boolean indconferenciafisicacomissao;
|
|
|
|
@Column (name = "INDPERCENTUALDESCONTO")
|
|
private Boolean indPercentualDesconto;
|
|
|
|
@Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = {
|
|
@Parameter(name = "type", value = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate"),
|
|
@Parameter(name = "class", value = "com.rjconsultores.ventaboletos.enums.TipoFormapago"),
|
|
@Parameter(name = "sqlType", value = "4")/*Types.INTEGER*/,
|
|
@Parameter(name = "enumName", value = "false"),
|
|
@Parameter(name = "enumMethod", value = "getTipoFormapagoByValor")})
|
|
@Column(name = "TIPO_PAGO")
|
|
private com.rjconsultores.ventaboletos.enums.TipoFormapago tipoFormapago;
|
|
@Column(name = "CVESISTEMA")
|
|
private String cveSistema;
|
|
@Column(name = "INDRESTRICAOFORMAPAGO")
|
|
private String indRestricaoFormaPago;
|
|
|
|
@Column(name = "INDESTORNO")
|
|
private Boolean indProcessoEstorno;
|
|
|
|
@Column(name = "INDVOUCHERRODOVIARIA")
|
|
private Boolean indVoucherRodoviaria;
|
|
|
|
@Column(name = "INDTRANSFERENCIAREATIVACAO")
|
|
private Boolean indTransferenciaReativacao;
|
|
|
|
@Column(name = "VALORDESCONTO")
|
|
private BigDecimal valorDesconto;
|
|
|
|
@Column(name = "PERCENTUALDESCONTO")
|
|
private BigDecimal percentualDesconto;
|
|
|
|
|
|
@Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = {
|
|
@Parameter(name = "type", value = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate"),
|
|
@Parameter(name = "class", value = "com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital"),
|
|
@Parameter(name = "sqlType", value = "12")/*Types.VARCHAR*/,
|
|
@Parameter(name = "enumName", value = "true")})
|
|
@Column(name = "TIPO_CARTEIRA_DIGITAL")
|
|
private com.rjconsultores.ventaboletos.enums.TipoCarteiraDigital tipoCarteiraDigital;
|
|
|
|
@Column(name = "TIPOEVENTOEXTRA_ID")
|
|
private Long tipoEventoExtraId;
|
|
|
|
@Transient
|
|
@NaoAuditar
|
|
private FormaPago formaPagoClone;
|
|
|
|
@Column(name = "INDETICKET")
|
|
private Boolean indETicket;
|
|
|
|
public FormaPago() {
|
|
super();
|
|
}
|
|
|
|
public FormaPago(Short formapagoId) {
|
|
this();
|
|
this.formapagoId = formapagoId;
|
|
}
|
|
|
|
public FormaPago(Short formapagoId, String descpago) {
|
|
this();
|
|
this.formapagoId = formapagoId;
|
|
this.descpago = descpago;
|
|
}
|
|
|
|
public Short getFormapagoId() {
|
|
return formapagoId;
|
|
}
|
|
|
|
public void setFormapagoId(Short formapagoId) {
|
|
this.formapagoId = formapagoId;
|
|
}
|
|
|
|
public String getDescpago() {
|
|
return descpago;
|
|
}
|
|
|
|
public void setDescpago(String descpago) {
|
|
this.descpago = descpago;
|
|
}
|
|
|
|
public Boolean getActivo() {
|
|
return activo;
|
|
}
|
|
|
|
public void setActivo(Boolean activo) {
|
|
this.activo = activo;
|
|
}
|
|
|
|
public Date getFecmodif() {
|
|
return fecmodif;
|
|
}
|
|
|
|
public void setFecmodif(Date fecmodif) {
|
|
this.fecmodif = fecmodif;
|
|
}
|
|
|
|
public Integer getUsuarioId() {
|
|
return usuarioId;
|
|
}
|
|
|
|
public void setUsuarioId(Integer usuarioId) {
|
|
this.usuarioId = usuarioId;
|
|
}
|
|
|
|
public Short getIndoperacion() {
|
|
return indoperacion;
|
|
}
|
|
|
|
public void setIndoperacion(Short indoperacion) {
|
|
this.indoperacion = indoperacion;
|
|
}
|
|
|
|
public String getEquivalenciaId() {
|
|
return equivalenciaId;
|
|
}
|
|
|
|
public void setEquivalenciaId(String equivalenciaId) {
|
|
this.equivalenciaId = equivalenciaId;
|
|
}
|
|
|
|
public String getCvePago() {
|
|
return cvePago;
|
|
}
|
|
|
|
public void setCvePago(String cvePago) {
|
|
this.cvePago = cvePago;
|
|
}
|
|
|
|
public List<ConfigRestriccionPago> getConfigRestriccionPagoList() {
|
|
List<ConfigRestriccionPago> tmp = new ArrayList<ConfigRestriccionPago>();
|
|
if (configRestriccionPagoList != null) {
|
|
for (ConfigRestriccionPago crp : this.configRestriccionPagoList) {
|
|
if (crp.getActivo()) {
|
|
tmp.add(crp);
|
|
}
|
|
}
|
|
}
|
|
|
|
return tmp;
|
|
}
|
|
|
|
public void setConfigRestriccionPagoList(List<ConfigRestriccionPago> configRestriccionPagoList) {
|
|
this.configRestriccionPagoList = configRestriccionPagoList;
|
|
}
|
|
|
|
public List<PricingFormapago> getPricingFormapagoList() {
|
|
List<PricingFormapago> pfpgList = new ArrayList<PricingFormapago>();
|
|
if (pricingFormapagoList != null) {
|
|
for (PricingFormapago pfpg : this.pricingFormapagoList) {
|
|
if (pfpg.getActivo() == Pricing.ATIVO) {
|
|
pfpgList.add(pfpg);
|
|
}
|
|
}
|
|
}
|
|
return pfpgList;
|
|
}
|
|
|
|
public void setPricingFormapagoList(List<PricingFormapago> pricingFormapagoList) {
|
|
this.pricingFormapagoList = pricingFormapagoList;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
int hash = 0;
|
|
hash += (formapagoId != null ? formapagoId.hashCode() : 0);
|
|
return hash;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object object) {
|
|
// TODO: Warning - this method won't work in the case the id fields are not set
|
|
if (!(object instanceof FormaPago)) {
|
|
return false;
|
|
}
|
|
FormaPago other = (FormaPago) object;
|
|
if ((this.formapagoId == null && other.formapagoId != null) || (this.formapagoId != null && !this.formapagoId.equals(other.formapagoId))) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return getDescpago();
|
|
}
|
|
|
|
public Boolean getImpfiscal() {
|
|
return impfiscal;
|
|
}
|
|
|
|
public void setImpfiscal(Boolean impfiscal) {
|
|
this.impfiscal = impfiscal;
|
|
}
|
|
|
|
public Boolean getIndconferenciafisicacomissao() {
|
|
return indconferenciafisicacomissao;
|
|
}
|
|
|
|
public void setIndconferenciafisicacomissao(Boolean indconferenciafisicacomissao) {
|
|
this.indconferenciafisicacomissao = indconferenciafisicacomissao;
|
|
}
|
|
|
|
public TipoFormapago getTipoFormapago() {
|
|
return tipoFormapago;
|
|
}
|
|
|
|
public void setTipoFormapago(TipoFormapago tipoFormapago) {
|
|
this.tipoFormapago = tipoFormapago;
|
|
}
|
|
|
|
public String getCveSistema() {
|
|
return cveSistema;
|
|
}
|
|
|
|
public void setCveSistema(String cveSistema) {
|
|
this.cveSistema = cveSistema;
|
|
}
|
|
|
|
/**
|
|
* @return the indRestricaoFormaPago
|
|
*/
|
|
public String getIndRestricaoFormaPago() {
|
|
return indRestricaoFormaPago;
|
|
}
|
|
|
|
/**
|
|
* @param indRestricaoFormaPago the indRestricaoFormaPago to set
|
|
*/
|
|
public void setIndRestricaoFormaPago(String indRestricaoFormaPago) {
|
|
this.indRestricaoFormaPago = indRestricaoFormaPago;
|
|
}
|
|
|
|
public Boolean getIndProcessoEstorno() {
|
|
return indProcessoEstorno == null ? false : indProcessoEstorno;
|
|
}
|
|
|
|
public void setIndProcessoEstorno(Boolean indProcessoEstorno) {
|
|
this.indProcessoEstorno = indProcessoEstorno;
|
|
}
|
|
|
|
public Boolean getIndVoucherRodoviaria() {
|
|
return indVoucherRodoviaria == null ? false : indVoucherRodoviaria;
|
|
}
|
|
|
|
public void setIndVoucherRodoviaria(Boolean indVoucherRodoviaria) {
|
|
this.indVoucherRodoviaria = indVoucherRodoviaria;
|
|
}
|
|
|
|
public TipoCarteiraDigital getTipoCarteiraDigital() {
|
|
return tipoCarteiraDigital;
|
|
}
|
|
|
|
public void setTipoCarteiraDigital(TipoCarteiraDigital tipoCarteiraDigital) {
|
|
this.tipoCarteiraDigital = tipoCarteiraDigital;
|
|
}
|
|
|
|
public Boolean getIndTransferenciaReativacao() {
|
|
return indTransferenciaReativacao == null ? false : indTransferenciaReativacao;
|
|
}
|
|
|
|
public void setIndTransferenciaReativacao(Boolean indTransferenciaReativacao) {
|
|
this.indTransferenciaReativacao = indTransferenciaReativacao;
|
|
}
|
|
|
|
public Long getTipoEventoExtraId() {
|
|
return tipoEventoExtraId;
|
|
}
|
|
|
|
public void setTipoEventoExtraId(Long tipoEventoExtraId) {
|
|
this.tipoEventoExtraId = tipoEventoExtraId;
|
|
}
|
|
|
|
|
|
|
|
public Boolean getIndETicket() {
|
|
return indETicket == null ? false : indETicket;
|
|
}
|
|
|
|
public void setIndETicket(Boolean indETicket) {
|
|
this.indETicket = indETicket;
|
|
}
|
|
|
|
|
|
public Boolean getIndPercentualDesconto() {
|
|
return indPercentualDesconto;
|
|
}
|
|
|
|
public void setIndPercentualDesconto(Boolean indPercentualDesconto) {
|
|
this.indPercentualDesconto = indPercentualDesconto;
|
|
}
|
|
|
|
public BigDecimal getValorDesconto() {
|
|
return valorDesconto;
|
|
}
|
|
|
|
public void setValorDesconto(BigDecimal valorDesconto) {
|
|
this.valorDesconto = valorDesconto;
|
|
}
|
|
|
|
public BigDecimal getPercentualDesconto() {
|
|
return percentualDesconto;
|
|
}
|
|
|
|
public void setPercentualDesconto(BigDecimal percentualDesconto) {
|
|
this.percentualDesconto = percentualDesconto;
|
|
}
|
|
|
|
@Override
|
|
public FormaPago getCloneObject() throws CloneNotSupportedException {
|
|
return formaPagoClone;
|
|
}
|
|
|
|
@Override
|
|
public String getTextoInclusaoExclusao() {
|
|
return String.format("ID [%s]", getFormapagoId());
|
|
}
|
|
|
|
@Override
|
|
public void clonar() throws CloneNotSupportedException {
|
|
formaPagoClone = new FormaPago();
|
|
formaPagoClone = (FormaPago) this.clone();
|
|
|
|
}
|
|
|
|
}
|