package com.rjconsultores.ventaboletos.entidad;

import java.math.BigDecimal;
import java.util.Date;

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.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@SequenceGenerator(name = "PTOVTACONTA_SEQ", sequenceName = "PTOVTACONTA_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_CONTA")
public class PtovtaContaMD {

	
	@Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTACONTA_SEQ")
    @Column(name = "PTOVTACONTA_ID")
    private Integer ptovtaContaId;
	
	@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
	@ManyToOne
	private Empresa empresaId;
	
	@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
	@ManyToOne
	private PuntoVenta puntoventaId;
	
	@JoinColumn(name = "CONTA_ID", referencedColumnName = "CONTA_ID")
	@ManyToOne
	private ContaMD contaId;
	
	@Column(name = "PERCENTUAL")
	private BigDecimal percentual;
	
	@Column(name = "USUARIO_ID")
	private int usuarioId;
	
	@Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
	
	@Column(name = "ACTIVO")
    private Boolean activo;

	public Integer getPtovtaContaId() {
		return ptovtaContaId;
	}

	public void setPtovtaContaId(Integer ptovtaContaId) {
		this.ptovtaContaId = ptovtaContaId;
	}

	public Empresa getEmpresaId() {
		return empresaId;
	}

	public void setEmpresaId(Empresa empresaId) {
		this.empresaId = empresaId;
	}

	public PuntoVenta getPuntoventaId() {
		return puntoventaId;
	}

	public void setPuntoventaId(PuntoVenta puntoventaId) {
		this.puntoventaId = puntoventaId;
	}

	public ContaMD getContaId() {
		return contaId;
	}

	public void setContaId(ContaMD contaId) {
		this.contaId = contaId;
	}

	public BigDecimal getPercentual() {
		return percentual;
	}

	public void setPercentual(BigDecimal percentual) {
		this.percentual = percentual;
	}

	public int getUsuarioId() {
		return usuarioId;
	}

	public void setUsuarioId(int usuarioId) {
		this.usuarioId = usuarioId;
	}

	public Date getFecmodif() {
		return fecmodif;
	}

	public void setFecmodif(Date fecmodif) {
		this.fecmodif = fecmodif;
	}

	public Boolean getActivo() {
		return activo;
	}

	public void setActivo(Boolean activo) {
		this.activo = activo;
	}

	@Override
	public String toString() {
		return "PtovtaConta [ptovtaContaId=" + ptovtaContaId + ", empresaId=" + empresaId + ", puntoventaId=" + puntoventaId + ", contaId=" + contaId + ", percentual=" + percentual + ", usuarioId=" + usuarioId + ", fecmodif=" + fecmodif + ", activo=" + activo + "]";
	}
	
	
}
