package com.uas.platform.b2b.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Where;

/**
 * 买家应付（卖家应收）对账单
 * */
@Entity
@Table(name="purc$apcheck")
@Where(clause = "pa_checkstatus = '已确认'")
public class PurchaseApCheckDone implements Serializable {

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pa_id")
	private Long id;
	
	/**
	 * 对账起始日期
	 */	
	@Column(name = "pa_begindate")
	private Date beginDate;

	/**
	 * 对账截止日期
	 */		
	@Column(name = "pa_enddate")
	private Date endDate;
	
	/**
	 * 录单日期
	 */	
	@Column(name = "pa_recorddate")
	private Date recordDate;
	
	/**
	 * 录单人
	 */	
	@Column(name = "pa_recorder")
	private String recorder;
	
	/**
	 * 应收日期
	 */	
	@Column(name = "pa_apdate")
	private Date apDate;
	
	/**
	 * 对账状态
	 */	
	@Column(name = "pa_checkstatus")
	private String checkStatus;
	
	/**
	 * 备注
	 */	
	@Column(name = "pa_remark")
	private String remark;
	
	/**
	 * 提交日期
	 */	
	@Column(name = "pa_commitdate")
	private Date commitDate;
	
	/**
	 * 作废日期
	 */	
	@Column(name = "pa_resdate")
	private Date resDate;
	
	/**
	 * 作废人
	 */	
	@Column(name = "pa_resman")
	private String resMan;
	
	/**
	 * 上传状态
	 */	
	@Column(name = "pa_status")
	private Short status;
	
	/**
	 * 对账总额
	 */	
	@Column(name = "pa_checkamount")
	private Double checkAmount;
	
	/**
	 * 币别
	 */	
	@Column(name = "pa_currency")
	private String currency;
	
	/**
	 *汇率
	 */	
	@Column(name = "pa_taxrate")
	private Double taxrate;
	
	/**
	 *汇率
	 */	
	@Column(name = "pa_rate")
	private Double rate;
	
	/**
	 *收款方式
	 */	
	@Column(name = "pa_payments")
	private String payments;
	
	/**
	 * 客户UU
	 */	
	@Column(name = "pa_custuu")
	private Long custUu;
	
	/**
	 * 客户名称
	 */	
	@Column(name = "pa_custname")
	private String custName;
	
	/**
	 *客户名称
	 */	
	@Column(name = "pa_enuu")
	private Long enUu;
	
	/**
	 *单据编号
	 */	
	@Column(name = "pa_code")
	private String code;
	
	/**
	 * 客户回复原因
	 */	
	@Column(name = "pa_custreply")
	private String custreply;
	
	/**
	 * 打印次数
	 */
	@Column(name = "pa_print")
	private Short print;
	
	/**
	 * 对账单明细行
	 */
	@OneToMany(mappedBy = "apCheck", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("number")
	private Set<PurchaseApCheckItem> items;
	
	public String getCustreply() {
		return custreply;
	}

	public void setCustreply(String custreply) {
		this.custreply = custreply;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public String getRecorder() {
		return recorder;
	}

	public void setRecorder(String recorder) {
		this.recorder = recorder;
	}

	public Date getApDate() {
		return apDate;
	}

	public void setApDate(Date apDate) {
		this.apDate = apDate;
	}

	public String getCheckStatus() {
		return checkStatus;
	}

	public void setCheckStatus(String checkStatus) {
		this.checkStatus = checkStatus;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getCommitDate() {
		return commitDate;
	}

	public void setCommitDate(Date commitDate) {
		this.commitDate = commitDate;
	}

	public Date getResDate() {
		return resDate;
	}

	public void setResDate(Date resDate) {
		this.resDate = resDate;
	}

	public String getResMan() {
		return resMan;
	}

	public void setResMan(String resMan) {
		this.resMan = resMan;
	}

	public Short getStatus() {
		return status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	public Double getCheckAmount() {
		return checkAmount;
	}

	public void setCheckAmount(Double checkAmount) {
		this.checkAmount = checkAmount;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public Double getTaxrate() {
		return taxrate;
	}

	public void setTaxrate(Double taxrate) {
		this.taxrate = taxrate;
	}

	public String getPayments() {
		return payments;
	}

	public void setPayments(String payments) {
		this.payments = payments;
	}

	public Long getCustUu() {
		return custUu;
	}

	public void setCustUu(Long custUu) {
		this.custUu = custUu;
	}

	public String getCustName() {
		return custName;
	}

	public void setCustName(String custName) {
		this.custName = custName;
	}

	public Long getEnUu() {
		return enUu;
	}

	public void setEnUu(Long enUu) {
		this.enUu = enUu;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Set<PurchaseApCheckItem> getItems() {
		return items;
	}

	public void setItems(Set<PurchaseApCheckItem> items) {
		this.items = items;
	}

	public Double getRate() {
		return rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

	public Short getPrint() {
		return print;
	}

	public void setPrint(Short print) {
		this.print = print;
	}
	
	
}
