/*
 * 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 java.sql.Types;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;

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

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

    @Column(name = "data_venda", type = Types.DATE, isNotNull = true, label = "Data Venda", tableDisplay = true)
    private java.sql.Date dataVenda;

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

    @Column(name = "valor_total", type = Types.DECIMAL, isNotNull = true, label = "Valor Total", tableDisplay = true)
    private java.math.BigDecimal valorTotal;

    @Column(name = "numero_parcelas", type = Types.INTEGER, isNotNull = true, label = "Total de Parcelas")
    private Integer numeroParcelas;

    @Column(name = "data_aviso_1", type = Types.DATE, label = "Data Aviso 1")
    private java.sql.Date dataAviso1;

    @Column(name = "data_aviso_2", type = Types.DATE, label = "Data Aviso 2")
    private java.sql.Date dataAviso2;

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

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

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

    public java.sql.Date getDataVenda() {
        return this.dataVenda;
    }

    public void setDataVenda(java.sql.Date dataVenda) {
        this.dataVenda = dataVenda;
    }

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

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

    public java.math.BigDecimal getValorTotal() {
        return this.valorTotal;
    }

    public void setValorTotal(java.math.BigDecimal valorTotal) {
        this.valorTotal = valorTotal;
    }

    public Integer getNumeroParcelas() {
        return this.numeroParcelas;
    }

    public void setNumeroParcelas(Integer numeroParcelas) {
        this.numeroParcelas = numeroParcelas;
    }

    public java.sql.Date getDataAviso1() {
        return this.dataAviso1;
    }

    public void setDataAviso1(java.sql.Date dataAviso1) {
        this.dataAviso1 = dataAviso1;
    }

    public java.sql.Date getDataAviso2() {
        return this.dataAviso2;
    }

    public void setDataAviso2(java.sql.Date dataAviso2) {
        this.dataAviso2 = dataAviso2;
    }

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

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

    @Override
    public String toString() {
        SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
        NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("pt", "BR"));
        return df.format(dataVenda) + " - " + nf.format(valorTotal);
    }
}
