package com.uas.platform.b2b.model;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * 买家的不良品出库单
 * 
 * @author suntg
 * 
 */
@Table(name = "purc$badout", indexes = {
		@Index(name = "po_enuu_index", columnList = "po_enuu"),
		@Index(name = "po_venduu_index", columnList = "po_venduu")
})
@Entity
public class PurchaseBadOut implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "po_id")
	private Long id;

	/**
	 * 单号
	 */
	@Column(name = "po_code")
	private String code;

	/**
	 * 日期
	 */
	@Column(name = "po_date")
	private Date date;

	/**
	 * 单据所属企业(买家)UU
	 */
	@Column(name = "po_enuu")
	private Long enUU;

	/**
	 * 送货单号
	 */
	@Column(name = "po_sendcode")
	private String sendCode;

	/**
	 * 付款方式
	 */
	@Column(name = "po_payments")
	private String payments;

	/**
	 * 币别
	 */
	@Column(name = "po_currency")
	private String currency;

	/**
	 * 汇率
	 */
	@Column(name = "po_rate")
	private Float rate;

	/**
	 * 供应商企业UU
	 */
	@Column(name = "po_venduu")
	private Long vendUU;

	/**
	 * 备注
	 */
	@Column(name = "po_remark")
	private String remark;

	/**
	 * 录单人
	 */
	@Column(name = "po_recorder")
	private String recorder;

	/**
	 * （对卖家）传输状态
	 */
	@Column(name = "po_sendstatus")
	private Short sendStatus;

	/**
	 * 应收客户名称
	 */
	@Column(name = "po_receivename")
	private String receiveName;

	/**
	 * 应收客户号
	 */
	@Column(name = "po_receivecode")
	private String receiveCode;

	/**
	 * 验收明细
	 */
	@OneToMany(mappedBy = "badOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
			CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("number")
	private Set<PurchaseBadOutItem> badOutItems;

	/**
	 * 已反过账(1 已反过账, 0|空 未反过账(默认未空))
	 */
	@Column(name = "pa_nonposting")
	private Short nonPosting;

	/**
	 * erpid
	 * 
	 * @return
	 */
	@Column(name = "pa_erpid")
	private Long erpId;

	public Long getId() {
		return id;
	}

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

	public String getCode() {
		return code;
	}

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

	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}

	public String getReceiveCode() {
		return receiveCode;
	}

	public void setReceiveCode(String receiveCode) {
		this.receiveCode = receiveCode;
	}

	public Long getEnUU() {
		return enUU;
	}

	public void setEnUU(Long enUU) {
		this.enUU = enUU;
	}

	public String getPayments() {
		return payments;
	}

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

	public String getSendCode() {
		return sendCode;
	}

	public void setSendCode(String sendCode) {
		this.sendCode = sendCode;
	}

	public String getCurrency() {
		return currency;
	}

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

	public Float getRate() {
		return rate;
	}

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

	public Long getVendUU() {
		return vendUU;
	}

	public void setVendUU(Long vendUU) {
		this.vendUU = vendUU;
	}

	public String getRemark() {
		return remark;
	}

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

	public String getRecorder() {
		return recorder;
	}

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

	public Short getSendStatus() {
		return sendStatus;
	}

	public void setSendStatus(Short sendStatus) {
		this.sendStatus = sendStatus;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Set<PurchaseBadOutItem> getBadOutItems() {
		return badOutItems;
	}

	public void setBadOutItems(Set<PurchaseBadOutItem> badOutItems) {
		this.badOutItems = badOutItems;
	}

	public Short getNonPosting() {
		return nonPosting;
	}

	public void setNonPosting(Short nonPosting) {
		this.nonPosting = nonPosting;
	}

	public Long getErpId() {
		return erpId;
	}

	public void setErpId(Long erpId) {
		this.erpId = erpId;
	}

}
