198 lines
4.6 KiB
Java
198 lines
4.6 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.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.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.OneToMany;
|
|
import javax.persistence.SequenceGenerator;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.Temporal;
|
|
import javax.persistence.TemporalType;
|
|
|
|
/**
|
|
*
|
|
* @author Administrador
|
|
*/
|
|
@Entity
|
|
@SequenceGenerator(name = "FORMA_PAGO_SEQ", sequenceName = "FORMA_PAGO_SEQ", allocationSize = 1)
|
|
@Table(name = "FORMA_PAGO")
|
|
public class FormaPago implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
@Id
|
|
@Basic(optional = false)
|
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "FORMA_PAGO_SEQ")
|
|
@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;
|
|
@OneToMany(mappedBy = "formaPago")
|
|
private List<ConfigRestriccionPago> configRestriccionPagoList;
|
|
@OneToMany(mappedBy = "formaPago")
|
|
private List<PricingFormapago> pricingFormapagoList;
|
|
|
|
public FormaPago() {
|
|
}
|
|
|
|
public FormaPago(Short formapagoId) {
|
|
this.formapagoId = formapagoId;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|