/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTCOMPANYFINANCIAL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustcompanyfinancial.findAll", query = "SELECT t FROM Tcustcompanyfinancial t"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByPersoncode", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.tcustcompanyfinancialPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByDateto", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.tcustcompanyfinancialPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByDatefrom", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByRecordversion", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByIngressuser", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByModifyuser", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.modifyuser = :modifyuser"),
    @NamedQuery(name = "Tcustcompanyfinancial.findBySituationdate", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.situationdate = :situationdate"),
    @NamedQuery(name = "Tcustcompanyfinancial.findBySalesamount", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.salesamount = :salesamount"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByCurrentassets", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.currentassets = :currentassets"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByFixedassets", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.fixedassets = :fixedassets"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByTotalassets", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.totalassets = :totalassets"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByWorkingcapital", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.workingcapital = :workingcapital"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByNetincome", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.netincome = :netincome"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByCurrentliabilities", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.currentliabilities = :currentliabilities"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByPatrimony", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.patrimony = :patrimony"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByCash", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.cash = :cash"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByInventory", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.inventory = :inventory"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByLongtermdebt", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.longtermdebt = :longtermdebt"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByGrossreceipts", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.grossreceipts = :grossreceipts"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByInterestopaid", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.interestopaid = :interestopaid"),
    @NamedQuery(name = "Tcustcompanyfinancial.findByRetainedearnings", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.retainedearnings = :retainedearnings"),
    @NamedQuery(name = "Tcustcompanyfinancial.findBySalesexpense", query = "SELECT t FROM Tcustcompanyfinancial t WHERE t.salesexpense = :salesexpense")})
public class Tcustcompanyfinancial implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustcompanyfinancialPK tcustcompanyfinancialPK;
    @Basic(optional = false)
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @Column(name = "SITUATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date situationdate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "SALESAMOUNT")
    private BigDecimal salesamount;
    @Column(name = "CURRENTASSETS")
    private BigDecimal currentassets;
    @Column(name = "FIXEDASSETS")
    private BigDecimal fixedassets;
    @Column(name = "TOTALASSETS")
    private BigDecimal totalassets;
    @Column(name = "WORKINGCAPITAL")
    private BigDecimal workingcapital;
    @Column(name = "NETINCOME")
    private BigDecimal netincome;
    @Column(name = "CURRENTLIABILITIES")
    private BigDecimal currentliabilities;
    @Column(name = "PATRIMONY")
    private BigDecimal patrimony;
    @Column(name = "CASH")
    private BigDecimal cash;
    @Column(name = "INVENTORY")
    private BigDecimal inventory;
    @Column(name = "LONGTERMDEBT")
    private BigDecimal longtermdebt;
    @Column(name = "GROSSRECEIPTS")
    private BigDecimal grossreceipts;
    @Column(name = "INTERESTOPAID")
    private BigDecimal interestopaid;
    @Column(name = "RETAINEDEARNINGS")
    private BigDecimal retainedearnings;
    @Column(name = "SALESEXPENSE")
    private BigDecimal salesexpense;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;

    public Tcustcompanyfinancial() {
    }

    public Tcustcompanyfinancial(TcustcompanyfinancialPK tcustcompanyfinancialPK) {
        this.tcustcompanyfinancialPK = tcustcompanyfinancialPK;
    }

    public Tcustcompanyfinancial(TcustcompanyfinancialPK tcustcompanyfinancialPK, Date datefrom) {
        this.tcustcompanyfinancialPK = tcustcompanyfinancialPK;
        this.datefrom = datefrom;
    }

    public Tcustcompanyfinancial(long personcode, Date dateto) {
        this.tcustcompanyfinancialPK = new TcustcompanyfinancialPK(personcode, dateto);
    }

    public TcustcompanyfinancialPK getTcustcompanyfinancialPK() {
        return tcustcompanyfinancialPK;
    }

    public void setTcustcompanyfinancialPK(TcustcompanyfinancialPK tcustcompanyfinancialPK) {
        this.tcustcompanyfinancialPK = tcustcompanyfinancialPK;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public String getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(String ingressuser) {
        this.ingressuser = ingressuser;
    }

    public String getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(String modifyuser) {
        this.modifyuser = modifyuser;
    }

    public Date getSituationdate() {
        return situationdate;
    }

    public void setSituationdate(Date situationdate) {
        this.situationdate = situationdate;
    }

    public BigDecimal getSalesamount() {
        return salesamount;
    }

    public void setSalesamount(BigDecimal salesamount) {
        this.salesamount = salesamount;
    }

    public BigDecimal getCurrentassets() {
        return currentassets;
    }

    public void setCurrentassets(BigDecimal currentassets) {
        this.currentassets = currentassets;
    }

    public BigDecimal getFixedassets() {
        return fixedassets;
    }

    public void setFixedassets(BigDecimal fixedassets) {
        this.fixedassets = fixedassets;
    }

    public BigDecimal getTotalassets() {
        return totalassets;
    }

    public void setTotalassets(BigDecimal totalassets) {
        this.totalassets = totalassets;
    }

    public BigDecimal getWorkingcapital() {
        return workingcapital;
    }

    public void setWorkingcapital(BigDecimal workingcapital) {
        this.workingcapital = workingcapital;
    }

    public BigDecimal getNetincome() {
        return netincome;
    }

    public void setNetincome(BigDecimal netincome) {
        this.netincome = netincome;
    }

    public BigDecimal getCurrentliabilities() {
        return currentliabilities;
    }

    public void setCurrentliabilities(BigDecimal currentliabilities) {
        this.currentliabilities = currentliabilities;
    }

    public BigDecimal getPatrimony() {
        return patrimony;
    }

    public void setPatrimony(BigDecimal patrimony) {
        this.patrimony = patrimony;
    }

    public BigDecimal getCash() {
        return cash;
    }

    public void setCash(BigDecimal cash) {
        this.cash = cash;
    }

    public BigDecimal getInventory() {
        return inventory;
    }

    public void setInventory(BigDecimal inventory) {
        this.inventory = inventory;
    }

    public BigDecimal getLongtermdebt() {
        return longtermdebt;
    }

    public void setLongtermdebt(BigDecimal longtermdebt) {
        this.longtermdebt = longtermdebt;
    }

    public BigDecimal getGrossreceipts() {
        return grossreceipts;
    }

    public void setGrossreceipts(BigDecimal grossreceipts) {
        this.grossreceipts = grossreceipts;
    }

    public BigDecimal getInterestopaid() {
        return interestopaid;
    }

    public void setInterestopaid(BigDecimal interestopaid) {
        this.interestopaid = interestopaid;
    }

    public BigDecimal getRetainedearnings() {
        return retainedearnings;
    }

    public void setRetainedearnings(BigDecimal retainedearnings) {
        this.retainedearnings = retainedearnings;
    }

    public BigDecimal getSalesexpense() {
        return salesexpense;
    }

    public void setSalesexpense(BigDecimal salesexpense) {
        this.salesexpense = salesexpense;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

    public void setTcustperson(Tcustperson tcustperson) {
        this.tcustperson = tcustperson;
    }

    public Tgenecurrency getCurrencycode() {
        return currencycode;
    }

    public void setCurrencycode(Tgenecurrency currencycode) {
        this.currencycode = currencycode;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tcustcompanyfinancialPK != null ? tcustcompanyfinancialPK.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 Tcustcompanyfinancial)) {
            return false;
        }
        Tcustcompanyfinancial other = (Tcustcompanyfinancial) object;
        if ((this.tcustcompanyfinancialPK == null && other.tcustcompanyfinancialPK != null) || (this.tcustcompanyfinancialPK != null && !this.tcustcompanyfinancialPK.equals(other.tcustcompanyfinancialPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tcustcompanyfinancial[ tcustcompanyfinancialPK=" + tcustcompanyfinancialPK + " ]";
    }
    
}
