/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.ctecinf.model;

import br.com.ctecinf.orm.Model;
import br.com.ctecinf.orm.Table;
import br.com.ctecinf.orm.Column;
import br.com.ctecinf.text.DateFormatter;
import java.sql.Types;

/**
 *
 * @author Cássio Conceição
 * @since 21/08/2019 17:06:02
 * @version 201908
 * @see http://ctecinf.com.br/
 */
@Table("receita")
public class Receita extends Model {

    @Column(name = "cliente_id", type = Types.INTEGER, isNotNull = true, label = "Cliente", join = Cliente.class)
    private Cliente cliente;

    @Column(name = "data_encomenda", type = Types.DATE, isNotNull = true, label = "Data Encomenda", tableDisplay = true)
    private java.sql.Date dataEncomenda;

    @Column(name = "lente", type = Types.VARCHAR, label = "Lente", tableDisplay = true)
    private String lente;

    @Column(name = "nota_fiscal", type = Types.VARCHAR, label = "Nota Fiscal", tableDisplay = true)
    private String notaFiscal;

    @Column(name = "armacao", type = Types.VARCHAR, label = "Armação")
    private String armacao;

    @Column(name = "longe_direito_esferico", type = Types.DECIMAL, label = "Direito Esf.")
    private java.math.BigDecimal longeDireitoEsferico;

    @Column(name = "longe_direito_cilindrico", type = Types.DECIMAL, label = "Cil.")
    private java.math.BigDecimal longeDireitoCilindrico;

    @Column(name = "longe_direito_eixo", type = Types.INTEGER, label = "Eixo")
    private Integer longeDireitoEixo;

    @Column(name = "longe_esquerdo_esferico", type = Types.DECIMAL, label = "Esquerdo Esf.")
    private java.math.BigDecimal longeEsquerdoEsferico;

    @Column(name = "longe_esquerdo_cilindrico", type = Types.DECIMAL, label = "Cil.")
    private java.math.BigDecimal longeEsquerdoCilindrico;

    @Column(name = "longe_esquerdo_eixo", type = Types.INTEGER, label = "Eixo")
    private Integer longeEsquerdoEixo;

    @Column(name = "perto_direito_esferico", type = Types.DECIMAL, label = "Direito Esf.")
    private java.math.BigDecimal pertoDireitoEsferico;

    @Column(name = "perto_direito_cilindrico", type = Types.DECIMAL, label = "Cil.")
    private java.math.BigDecimal pertoDireitoCilindrico;

    @Column(name = "perto_direito_eixo", type = Types.INTEGER, label = "Eixo")
    private Integer pertoDireitoEixo;

    @Column(name = "perto_esquerdo_esferico", type = Types.DECIMAL, label = "Esquerdo Esf.")
    private java.math.BigDecimal pertoEsquerdoEsferico;

    @Column(name = "perto_esquerdo_cilindrico", type = Types.DECIMAL, label = "Cil.")
    private java.math.BigDecimal pertoEsquerdoCilindrico;

    @Column(name = "perto_esquerdo_eixo", type = Types.INTEGER, label = "Eixo")
    private Integer pertoEsquerdoEixo;

    @Column(name = "dnp", type = Types.VARCHAR, label = "DNP")
    private String dnp;

    @Column(name = "altura", type = Types.VARCHAR, label = "Altura")
    private String altura;

    @Column(name = "adicao", type = Types.VARCHAR, label = "Adição")
    private String adicao;

    @Column(name = "medico", type = Types.VARCHAR, label = "Médico")
    private String medico;

    @Column(name = "valor", type = Types.DECIMAL, label = "Valor")
    private java.math.BigDecimal valor;

    @Column(name = "observacao", type = Types.BLOB, label = "Observação")
    private String observacao;

    @Column(name = "vendedor", type = Types.VARCHAR, label = "Vendedor", defaultValues = {"ANTONIO", "DIEGO", "BRUNO", "JUSSARA", "DANIELA", "KAROL"}, tableDisplay = true)
    private String vendedor;

    public Cliente getCliente() {
        return this.cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    public String getNotaFiscal() {
        return this.notaFiscal;
    }

    public void setNotaFiscal(String notaFiscal) {
        this.notaFiscal = notaFiscal;
    }

    public String getArmacao() {
        return this.armacao;
    }

    public void setArmacao(String armacao) {
        this.armacao = armacao;
    }

    public String getLente() {
        return this.lente;
    }

    public void setLente(String lente) {
        this.lente = lente;
    }

    public java.math.BigDecimal getLongeDireitoEsferico() {
        return this.longeDireitoEsferico;
    }

    public void setLongeDireitoEsferico(java.math.BigDecimal longeDireitoEsferico) {
        this.longeDireitoEsferico = longeDireitoEsferico;
    }

    public java.math.BigDecimal getLongeDireitoCilindrico() {
        return this.longeDireitoCilindrico;
    }

    public void setLongeDireitoCilindrico(java.math.BigDecimal longeDireitoCilindrico) {
        this.longeDireitoCilindrico = longeDireitoCilindrico;
    }

    public Integer getLongeDireitoEixo() {
        return this.longeDireitoEixo;
    }

    public void setLongeDireitoEixo(Integer longeDireitoEixo) {
        this.longeDireitoEixo = longeDireitoEixo;
    }

    public java.math.BigDecimal getLongeEsquerdoEsferico() {
        return this.longeEsquerdoEsferico;
    }

    public void setLongeEsquerdoEsferico(java.math.BigDecimal longeEsquerdoEsferico) {
        this.longeEsquerdoEsferico = longeEsquerdoEsferico;
    }

    public java.math.BigDecimal getLongeEsquerdoCilindrico() {
        return this.longeEsquerdoCilindrico;
    }

    public void setLongeEsquerdoCilindrico(java.math.BigDecimal longeEsquerdoCilindrico) {
        this.longeEsquerdoCilindrico = longeEsquerdoCilindrico;
    }

    public Integer getLongeEsquerdoEixo() {
        return this.longeEsquerdoEixo;
    }

    public void setLongeEsquerdoEixo(Integer longeEsquerdoEixo) {
        this.longeEsquerdoEixo = longeEsquerdoEixo;
    }

    public java.math.BigDecimal getPertoDireitoEsferico() {
        return this.pertoDireitoEsferico;
    }

    public void setPertoDireitoEsferico(java.math.BigDecimal pertoDireitoEsferico) {
        this.pertoDireitoEsferico = pertoDireitoEsferico;
    }

    public java.math.BigDecimal getPertoDireitoCilindrico() {
        return this.pertoDireitoCilindrico;
    }

    public void setPertoDireitoCilindrico(java.math.BigDecimal pertoDireitoCilindrico) {
        this.pertoDireitoCilindrico = pertoDireitoCilindrico;
    }

    public Integer getPertoDireitoEixo() {
        return this.pertoDireitoEixo;
    }

    public void setPertoDireitoEixo(Integer pertoDireitoEixo) {
        this.pertoDireitoEixo = pertoDireitoEixo;
    }

    public java.math.BigDecimal getPertoEsquerdoEsferico() {
        return this.pertoEsquerdoEsferico;
    }

    public void setPertoEsquerdoEsferico(java.math.BigDecimal pertoEsquerdoEsferico) {
        this.pertoEsquerdoEsferico = pertoEsquerdoEsferico;
    }

    public java.math.BigDecimal getPertoEsquerdoCilindrico() {
        return this.pertoEsquerdoCilindrico;
    }

    public void setPertoEsquerdoCilindrico(java.math.BigDecimal pertoEsquerdoCilindrico) {
        this.pertoEsquerdoCilindrico = pertoEsquerdoCilindrico;
    }

    public Integer getPertoEsquerdoEixo() {
        return this.pertoEsquerdoEixo;
    }

    public void setPertoEsquerdoEixo(Integer pertoEsquerdoEixo) {
        this.pertoEsquerdoEixo = pertoEsquerdoEixo;
    }

    public String getDnp() {
        return this.dnp;
    }

    public void setDnp(String dnp) {
        this.dnp = dnp;
    }

    public String getAltura() {
        return this.altura;
    }

    public void setAltura(String altura) {
        this.altura = altura;
    }

    public String getAdicao() {
        return this.adicao;
    }

    public void setAdicao(String adicao) {
        this.adicao = adicao;
    }

    public String getMedico() {
        return this.medico;
    }

    public void setMedico(String medico) {
        this.medico = medico;
    }

    public java.math.BigDecimal getValor() {
        return this.valor;
    }

    public void setValor(java.math.BigDecimal valor) {
        this.valor = valor;
    }

    public java.sql.Date getDataEncomenda() {
        return this.dataEncomenda;
    }

    public void setDataEncomenda(java.sql.Date dataEncomenda) {
        this.dataEncomenda = dataEncomenda;
    }

    public String getObservacao() {
        return this.observacao;
    }

    public void setObservacao(String observacao) {
        this.observacao = observacao;
    }

    public String getVendedor() {
        return this.vendedor;
    }

    public void setVendedor(String vendedor) {
        this.vendedor = vendedor;
    }

    @Override
    public String toString() {

        String dt = null;

        if (dataEncomenda != null) {
            dt = DateFormatter.format().format(dataEncomenda);
        }

        return dt == null ? "Talao [ID = " + getId() + "]" : (cliente != null ? dt + " - " + cliente : dt);
    }
}
