/*
 * 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.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
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.TCUSTPEOPLEEXPENSES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeopleexpenses.findAll", query = "SELECT t FROM Tcustpeopleexpenses t"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByPersoncode", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.tcustpeopleexpensesPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByDateto", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.tcustpeopleexpensesPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByExpensesequence", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.tcustpeopleexpensesPK.expensesequence = :expensesequence"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByDatefrom", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByRecordversion", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByAmount", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.amount = :amount"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByIsfixvalue", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.isfixvalue = :isfixvalue"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByVerifiedamount", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.verifiedamount = :verifiedamount"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByIngressusercode", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeopleexpenses.findByModifyusercode", query = "SELECT t FROM Tcustpeopleexpenses t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeopleexpenses implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeopleexpensesPK tcustpeopleexpensesPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "AMOUNT")
    private BigDecimal amount;
    @Column(name = "ISFIXVALUE")
    private String isfixvalue;
    @Column(name = "VERIFIEDAMOUNT")
    private BigDecimal verifiedamount;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "EXPENSESCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "EXPENSESCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;

    public Tcustpeopleexpenses() {
    }

    public Tcustpeopleexpenses(TcustpeopleexpensesPK tcustpeopleexpensesPK) {
        this.tcustpeopleexpensesPK = tcustpeopleexpensesPK;
    }

    public Tcustpeopleexpenses(long personcode, Date dateto, short expensesequence) {
        this.tcustpeopleexpensesPK = new TcustpeopleexpensesPK(personcode, dateto, expensesequence);
    }

    public TcustpeopleexpensesPK getTcustpeopleexpensesPK() {
        return tcustpeopleexpensesPK;
    }

    public void setTcustpeopleexpensesPK(TcustpeopleexpensesPK tcustpeopleexpensesPK) {
        this.tcustpeopleexpensesPK = tcustpeopleexpensesPK;
    }

    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 BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getIsfixvalue() {
        return isfixvalue;
    }

    public void setIsfixvalue(String isfixvalue) {
        this.isfixvalue = isfixvalue;
    }

    public BigDecimal getVerifiedamount() {
        return verifiedamount;
    }

    public void setVerifiedamount(BigDecimal verifiedamount) {
        this.verifiedamount = verifiedamount;
    }

    public String getIngressusercode() {
        return ingressusercode;
    }

    public void setIngressusercode(String ingressusercode) {
        this.ingressusercode = ingressusercode;
    }

    public String getModifyusercode() {
        return modifyusercode;
    }

    public void setModifyusercode(String modifyusercode) {
        this.modifyusercode = modifyusercode;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    public Tgenecurrency getCurrencycode() {
        return currencycode;
    }

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

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

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