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.CascadeType;
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.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.BooleanUtils;
import org.hibernate.annotations.Where;

import br.com.rjconsultores.auditador.annotations.AuditarClasse;
import br.com.rjconsultores.auditador.annotations.AuditarID;
import br.com.rjconsultores.auditador.annotations.AuditarLista;
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
import br.com.rjconsultores.auditador.interfaces.Auditavel;

@Entity
@AuditarClasse(nome = "ConfRestricaoCanalVenta", tela = "auditarClasse.ConfRestricaoCanalVenta")
@SequenceGenerator(name = "CONF_RESTRICAO_CANALVENTA_SEQ", sequenceName = "CONF_RESTRICAO_CANALVENTA_SEQ", allocationSize = 1)
@Table(name = "CONF_RESTRICAO_CANALVENTA")
public class ConfRestricaoCanalVenta implements Serializable, Cloneable, Auditavel<ConfRestricaoCanalVenta>{

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONF_RESTRICAO_CANALVENTA_SEQ")
	@Column(name = "CONFRESTRICAOCANALVENTA_ID")
	@AuditarID
	private Long confRestricaoCanalVentaId;
	@Column(name = "DESCCONFRESTRICAOCANALVENTA")
	private String descConfRestricaoCanalVenta;
	@OneToOne
	@JoinColumn(name = "TIPOPTOVTA_ID")
	@Deprecated
	private TipoPuntoVenta tipoPuntoVenta;
	@OneToOne
	@JoinColumn(name = "ORIGEN_ID")
	@Deprecated
	private Parada origem;
	@OneToOne
	@JoinColumn(name = "DESTINO_ID")
	@Deprecated
	private Parada destino;
	@Column(name = "TEMPOPERMITIR")
	@Deprecated
	private Date tempoPermitir;
	@Column(name = "CORRIDA_ID")
	private Integer corridaId;
	@Column(name = "FECCORRIDA")
	private Date fecCorrida;
	@Column(name = "SEGUNDA")
	@Deprecated
	private Boolean segunda;
	@Column(name = "TERCA")
	@Deprecated
	private Boolean terca;
	@Column(name = "QUARTA")
	@Deprecated
	private Boolean quarta;
	@Column(name = "QUINTA")
	@Deprecated
	private Boolean quinta;
	@Column(name = "SEXTA")
	@Deprecated
	private Boolean sexta;
	@Column(name = "SABADO")
	@Deprecated
	private Boolean sabado;
	@Column(name = "DOMINGO")
	@Deprecated
	private Boolean domingo;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	@OneToOne
	@JoinColumn(name = "RUTA_ID")
	private Ruta ruta;
	@AuditarLista(auditarEntidades = true, nome = "Exceções de Data Serviço")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<ConfRestricaoExcecao> lsConfRestricaoExcecao;
	@AuditarLista(auditarEntidades = true, nome = "Exceções de Pontos de Vendas")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<ConfRestricaoPtovta> lsConfRestricaoPtovta;
	@Column(name = "INDEXIBECONSULTAVENDAWEB")
	private Boolean indexibeconsultavendaweb;
	@Column(name = "INDEXIBECORRIDABLOQ")
	private Boolean indexibecorridabloq;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "EMPRESA_ID")
	private Empresa empresa;
	@Column(name = "FECINICIOVIGENCIA")
	@Temporal(TemporalType.TIMESTAMP)
	private Date feciniciovigencia;
	@Column(name = "FECFINVIGENCIA")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecfinvigencia;
	@Column(name = "INDRESTRICAODINAMICA")
	private Boolean indRestricaoDinamica;
	@AuditarLista(auditarEntidades = true, nome = "Exceções de Trechos")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@Where(clause="activo=1")
	private List<ConfRestricaoTramo> lsConfRestricaoTramo;
	@AuditarLista(auditarEntidades = true, nome = "lsConfRestricaoOrgaoConcedente")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<ConfRestricaoOrgaoConcedente> lsConfRestricaoOrgaoConcedente;
	@AuditarLista(auditarEntidades = true, nome = "lsConfRestricaoRutas")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<ConfRestricaoRutas> lsConfRestricaoRutas;
	@AuditarLista(auditarEntidades = true, nome = "lsConfRestricaoTramoOC")
	@OneToMany(mappedBy = "confRestricaoCanalVenta", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<ConfRestricaoTramoOC> lsConfRestricaoTramoOC;
	
	@Transient
	@NaoAuditar
	private ConfRestricaoCanalVenta confRestricaoCanalVentaClone;

	public ConfRestricaoCanalVenta() {
		super();
		indexibeconsultavendaweb = false;
		indexibecorridabloq = false;
	}

	public Long getConfRestricaoCanalVentaId() {
		return confRestricaoCanalVentaId;
	}

	public void setConfRestricaoCanalVentaId(Long confRestricaoCanalVentaId) {
		this.confRestricaoCanalVentaId = confRestricaoCanalVentaId;
	}

	public String getDescConfRestricaoCanalVenta() {
		return descConfRestricaoCanalVenta;
	}

	public void setDescConfRestricaoCanalVenta(String descConfRestricaoCanalVenta) {
		this.descConfRestricaoCanalVenta = descConfRestricaoCanalVenta;
	}

	@Deprecated
	public TipoPuntoVenta getTipoPuntoVenta() {
		return tipoPuntoVenta;
	}
	
	@Deprecated
	public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) {
		this.tipoPuntoVenta = tipoPuntoVenta;
	}

	@Deprecated
	public Parada getOrigem() {
		return origem;
	}
	@Deprecated
	public void setOrigem(Parada origem) {
		this.origem = origem;
	}
	@Deprecated
	public Parada getDestino() {
		return destino;
	}
	@Deprecated
	public void setDestino(Parada destino) {
		this.destino = destino;
	}
	@Deprecated
	public Date getTempoPermitir() {
		return tempoPermitir;
	}
	@Deprecated
	public void setTempoPermitir(Date tempoPermitir) {
		this.tempoPermitir = tempoPermitir;
	}

	public Integer getCorridaId() {
		return corridaId;
	}

	public void setCorridaId(Integer corridaId) {
		this.corridaId = corridaId;
	}

	public Date getFecCorrida() {
		return fecCorrida;
	}

	public void setFecCorrida(Date fecCorrida) {
		this.fecCorrida = fecCorrida;
	}
	@Deprecated
	public Boolean getSegunda() {
		return segunda;
	}
	@Deprecated
	public void setSegunda(Boolean segunda) {
		this.segunda = segunda;
	}
	@Deprecated
	public Boolean getTerca() {
		return terca;
	}
	@Deprecated
	public void setTerca(Boolean terca) {
		this.terca = terca;
	}
	@Deprecated
	public Boolean getQuarta() {
		return quarta;
	}
	@Deprecated
	public void setQuarta(Boolean quarta) {
		this.quarta = quarta;
	}
	@Deprecated
	public Boolean getQuinta() {
		return quinta;
	}
	@Deprecated
	public void setQuinta(Boolean quinta) {
		this.quinta = quinta;
	}
	@Deprecated
	public Boolean getSexta() {
		return sexta;
	}
	@Deprecated
	public void setSexta(Boolean sexta) {
		this.sexta = sexta;
	}
	@Deprecated
	public Boolean getSabado() {
		return sabado;
	}
	@Deprecated
	public void setSabado(Boolean sabado) {
		this.sabado = sabado;
	}
	@Deprecated
	public Boolean getDomingo() {
		return domingo;
	}
	@Deprecated
	public void setDomingo(Boolean domingo) {
		this.domingo = domingo;
	}

	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 Ruta getRuta() {
		return ruta;
	}

	public void setRuta(Ruta ruta) {
		this.ruta = ruta;
	}

	public Boolean getIndexibeconsultavendaweb() {
		return indexibeconsultavendaweb;
	}

	public void setIndexibeconsultavendaweb(Boolean indexibeconsultavendaweb) {
		this.indexibeconsultavendaweb = indexibeconsultavendaweb;
	}

	public Boolean getIndexibecorridabloq() {
		return indexibecorridabloq;
	}

	public void setIndexibecorridabloq(Boolean indexibecorridabloq) {
		this.indexibecorridabloq = indexibecorridabloq;
	}

	public List<ConfRestricaoExcecao> getLsConfRestricaoExcecao() {
		
	    List<ConfRestricaoExcecao> tmp = new ArrayList<ConfRestricaoExcecao>();
        if (lsConfRestricaoExcecao != null) {
            for (ConfRestricaoExcecao cm : this.lsConfRestricaoExcecao) {
                if (cm.getActivo()) {
                    tmp.add(cm);
                }
            }
        }
        return tmp;
        
	}

	public void setLsConfRestricaoExcecao(List<ConfRestricaoExcecao> lsConfRestricaoExcecao) {
		this.lsConfRestricaoExcecao = lsConfRestricaoExcecao;
	}
	

	public List<ConfRestricaoOrgaoConcedente> getLsConfRestricaoOrgaoConcedente() {
		
		List<ConfRestricaoOrgaoConcedente> lsTemp = new ArrayList<ConfRestricaoOrgaoConcedente>();
		if (this.lsConfRestricaoOrgaoConcedente != null) {
			for (ConfRestricaoOrgaoConcedente cre : this.lsConfRestricaoOrgaoConcedente) {
				if (cre.getActivo() == Boolean.TRUE) {
					lsTemp.add(cre);
				}
			}
			return lsTemp;
		}
		return null;
	}

	public void setLsConfRestricaoOrgaoConcedente(List<ConfRestricaoOrgaoConcedente> lsConfRestricaoOrgaoConcedente) {
		this.lsConfRestricaoOrgaoConcedente = lsConfRestricaoOrgaoConcedente;
	}
	
	public List<ConfRestricaoRutas> getLsConfRestricaoRutas() {
		if (this.lsConfRestricaoRutas != null) {
			List<ConfRestricaoRutas> lsTemp = new ArrayList<ConfRestricaoRutas>();

			for (ConfRestricaoRutas cre : this.lsConfRestricaoRutas) {
				if (cre.getActivo() == Boolean.TRUE) {
					lsTemp.add(cre);
				}
			}

			lsConfRestricaoRutas = lsTemp;
			return lsConfRestricaoRutas;
		}

		return null;
	}

	public void setLsConfRestricaoRutas(List<ConfRestricaoRutas> lsConfRestricaoRutas) {
		this.lsConfRestricaoRutas = lsConfRestricaoRutas;
	}

	public List<ConfRestricaoTramoOC> getLsConfRestricaoTramoOC() {
		if (this.lsConfRestricaoTramoOC != null) {
			List<ConfRestricaoTramoOC> lsTemp = new ArrayList<ConfRestricaoTramoOC>();

			for (ConfRestricaoTramoOC cre : this.lsConfRestricaoTramoOC) {
				if (cre.getActivo() == Boolean.TRUE) {
					lsTemp.add(cre);
				}
			}

			lsConfRestricaoTramoOC = lsTemp;
			return lsConfRestricaoTramoOC;
		}

		return null;
	}

	public void setLsConfRestricaoTramoOC(List<ConfRestricaoTramoOC> lsConfRestricaoTramoOC) {
		this.lsConfRestricaoTramoOC = lsConfRestricaoTramoOC;
	}

	public List<ConfRestricaoPtovta> getLsConfRestricaoPtovta() {
		if (this.lsConfRestricaoPtovta != null) {
			List<ConfRestricaoPtovta> lsTemp = new ArrayList<ConfRestricaoPtovta>();

			for (ConfRestricaoPtovta cre : this.lsConfRestricaoPtovta) {
				if (cre.getActivo() == Boolean.TRUE) {
					lsTemp.add(cre);
				}
			}

			lsConfRestricaoPtovta = lsTemp;
			return lsConfRestricaoPtovta;
		}

		return null;
	}

	public void setLsConfRestricaoPtovta(List<ConfRestricaoPtovta> lsConfRestricaoPtovta) {
		this.lsConfRestricaoPtovta = lsConfRestricaoPtovta;
	}
	
	public Empresa getEmpresa() {
		return empresa;
	}

	public void setEmpresa(Empresa empresa) {
		this.empresa = empresa;
	}
	
	public Date getFeciniciovigencia() {
		return feciniciovigencia;
	}

	public void setFeciniciovigencia(Date feciniciovigencia) {
		this.feciniciovigencia = feciniciovigencia;
	}

	public Date getFecfinvigencia() {
		return fecfinvigencia;
	}

	public void setFecfinvigencia(Date fecfinvigencia) {
		this.fecfinvigencia = fecfinvigencia;
	}

	public List<ConfRestricaoTramo> getLsConfRestricaoTramo() {

			if (this.lsConfRestricaoTramo != null) {
				List<ConfRestricaoTramo> lsTemp = new ArrayList<ConfRestricaoTramo>();
				for (ConfRestricaoTramo cre : this.lsConfRestricaoTramo) {
					if (cre.getActivo() == Boolean.TRUE) {
						lsTemp.add(cre);
					}
				}
				lsConfRestricaoTramo = lsTemp;
				return lsConfRestricaoTramo;
			}

			return null;
		
	}

	public void setLsConfRestricaoTramo(List<ConfRestricaoTramo> lsConfRestricaoTramo) {
		this.lsConfRestricaoTramo = lsConfRestricaoTramo;
	}
	

	public Boolean getIndRestricaoDinamica() {
		return indRestricaoDinamica;
	}

	public void setIndRestricaoDinamica(Boolean indRestricaoDinamica) {
		this.indRestricaoDinamica = indRestricaoDinamica;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((confRestricaoCanalVentaId == null) ? 0 : confRestricaoCanalVentaId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ConfRestricaoCanalVenta other = (ConfRestricaoCanalVenta) obj;
		if (confRestricaoCanalVentaId == null) {
			if (other.confRestricaoCanalVentaId != null)
				return false;
		} else if (!confRestricaoCanalVentaId.equals(other.confRestricaoCanalVentaId))
			return false;
		return true;
	}

	public ConfRestricaoCanalVenta getNewConfRestricaoCanalVenta(ConfRestricaoCanalVenta oldConfRestricaoCanalVenta) {
		ConfRestricaoCanalVenta newConfRestricaoCanalVenda = new ConfRestricaoCanalVenta();
		newConfRestricaoCanalVenda.setActivo(oldConfRestricaoCanalVenta.getActivo());
		newConfRestricaoCanalVenda.setCorridaId(oldConfRestricaoCanalVenta.getCorridaId());
		newConfRestricaoCanalVenda.setDescConfRestricaoCanalVenta(oldConfRestricaoCanalVenta.getDescConfRestricaoCanalVenta());
		newConfRestricaoCanalVenda.setDestino(oldConfRestricaoCanalVenta.getDestino());
		newConfRestricaoCanalVenda.setDomingo(oldConfRestricaoCanalVenta.getDomingo());
		newConfRestricaoCanalVenda.setEmpresa(oldConfRestricaoCanalVenta.getEmpresa());
		newConfRestricaoCanalVenda.setFecCorrida(oldConfRestricaoCanalVenta.getFecCorrida());
		newConfRestricaoCanalVenda.setFecfinvigencia(oldConfRestricaoCanalVenta.getFecfinvigencia());
		newConfRestricaoCanalVenda.setFeciniciovigencia(oldConfRestricaoCanalVenta.getFeciniciovigencia());
		newConfRestricaoCanalVenda.setFecmodif(new Date());
		newConfRestricaoCanalVenda.setIndexibeconsultavendaweb(oldConfRestricaoCanalVenta.getIndexibeconsultavendaweb());
		newConfRestricaoCanalVenda.setIndexibecorridabloq(oldConfRestricaoCanalVenta.getIndexibecorridabloq());
		newConfRestricaoCanalVenda.setLsConfRestricaoExcecao(oldConfRestricaoCanalVenta.getLsConfRestricaoExcecao());
		newConfRestricaoCanalVenda.setLsConfRestricaoPtovta(oldConfRestricaoCanalVenta.getLsConfRestricaoPtovta());
		newConfRestricaoCanalVenda.setLsConfRestricaoTramo(oldConfRestricaoCanalVenta.getLsConfRestricaoTramo());
		newConfRestricaoCanalVenda.setOrigem(oldConfRestricaoCanalVenta.getOrigem());
		newConfRestricaoCanalVenda.setQuarta(oldConfRestricaoCanalVenta.getQuarta());
		newConfRestricaoCanalVenda.setQuinta(oldConfRestricaoCanalVenta.getQuinta());
		newConfRestricaoCanalVenda.setRuta(oldConfRestricaoCanalVenta.getRuta());
		newConfRestricaoCanalVenda.setSabado(oldConfRestricaoCanalVenta.getSabado());
		newConfRestricaoCanalVenda.setSegunda(oldConfRestricaoCanalVenta.getSegunda());
		newConfRestricaoCanalVenda.setSexta(oldConfRestricaoCanalVenta.getSexta());
		newConfRestricaoCanalVenda.setTempoPermitir(oldConfRestricaoCanalVenta.getTempoPermitir());
		newConfRestricaoCanalVenda.setTerca(oldConfRestricaoCanalVenta.getTerca());
		newConfRestricaoCanalVenda.setTipoPuntoVenta(oldConfRestricaoCanalVenta.getTipoPuntoVenta());
		newConfRestricaoCanalVenda.setUsuarioId(oldConfRestricaoCanalVenta.getUsuarioId());
		newConfRestricaoCanalVenda.setLsConfRestricaoOrgaoConcedente(oldConfRestricaoCanalVenta.getLsConfRestricaoOrgaoConcedente());
		newConfRestricaoCanalVenda.setLsConfRestricaoRutas(oldConfRestricaoCanalVenta.getLsConfRestricaoRutas());
		newConfRestricaoCanalVenda.setLsConfRestricaoTramoOC(oldConfRestricaoCanalVenta.getLsConfRestricaoTramoOC());
		
		return newConfRestricaoCanalVenda;
	}

	@Override
	public void clonar() throws CloneNotSupportedException {
		
		confRestricaoCanalVentaClone = new ConfRestricaoCanalVenta();
		confRestricaoCanalVentaClone = (ConfRestricaoCanalVenta) this.clone();
		
		
		if(this.getLsConfRestricaoTramo() != null) {
			List<ConfRestricaoTramo> lsClones = new ArrayList<ConfRestricaoTramo>();
			for (ConfRestricaoTramo confRestricaoTramo : this.getLsConfRestricaoTramo()) {
				if(BooleanUtils.isTrue(confRestricaoTramo.getActivo())) {
					confRestricaoTramo.clonar();
					lsClones.add(confRestricaoTramo.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoTramo(lsClones);
		}
		
		if(this.getLsConfRestricaoExcecao() != null) {
			List<ConfRestricaoExcecao> lsClones = new ArrayList<ConfRestricaoExcecao>();
			for (ConfRestricaoExcecao confRestricaoExcecao : this.getLsConfRestricaoExcecao()) {
				if(BooleanUtils.isTrue(confRestricaoExcecao.getActivo())) {
					confRestricaoExcecao.clonar();
					lsClones.add(confRestricaoExcecao.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoExcecao(lsClones);
		}
		
		if(this.getLsConfRestricaoOrgaoConcedente()!= null) {
			List<ConfRestricaoOrgaoConcedente> lsClones = new ArrayList<ConfRestricaoOrgaoConcedente>();
			for (ConfRestricaoOrgaoConcedente confRestricaoOrgaoConcedente : this.getLsConfRestricaoOrgaoConcedente()) {
				if(BooleanUtils.isTrue(confRestricaoOrgaoConcedente.getActivo())) {
					confRestricaoOrgaoConcedente.clonar();
					lsClones.add(confRestricaoOrgaoConcedente.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoOrgaoConcedente(lsClones);
		}
		if(this.getLsConfRestricaoPtovta()!= null) {
			List<ConfRestricaoPtovta> lsClones = new ArrayList<ConfRestricaoPtovta>();
			for (ConfRestricaoPtovta confRestricaoPtovta : this.getLsConfRestricaoPtovta()) {
				if(BooleanUtils.isTrue(confRestricaoPtovta.getActivo())) {
					confRestricaoPtovta.clonar();
					lsClones.add(confRestricaoPtovta.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoPtovta(lsClones);
		}
		
		if(this.getLsConfRestricaoRutas()!= null) {
			List<ConfRestricaoRutas> lsClones = new ArrayList<ConfRestricaoRutas>();
			for (ConfRestricaoRutas confRestricaoRutas : this.getLsConfRestricaoRutas()) {
				if(BooleanUtils.isTrue(confRestricaoRutas.getActivo())) {
					confRestricaoRutas.clonar();
					lsClones.add(confRestricaoRutas.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoRutas(lsClones);
		}
		
		if(this.getLsConfRestricaoTramoOC()!= null) {
			List<ConfRestricaoTramoOC> lsClones = new ArrayList<ConfRestricaoTramoOC>();
			for (ConfRestricaoTramoOC confRestricaoTramoOC : this.getLsConfRestricaoTramoOC()) {
				if(BooleanUtils.isTrue(confRestricaoTramoOC.getActivo())) {
					confRestricaoTramoOC.clonar();
					lsClones.add(confRestricaoTramoOC.getCloneObject());
				}
			}
			confRestricaoCanalVentaClone.setLsConfRestricaoTramoOC(lsClones);
		}
	}

	@Override
	public ConfRestricaoCanalVenta getCloneObject() throws CloneNotSupportedException {
		return confRestricaoCanalVentaClone;
	}

	@Override
	public String getTextoInclusaoExclusao() {
		return String.format("ID [%s]", getConfRestricaoCanalVentaId());
	}

}
