package com.uas.platform.b2b.model;

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

/**
 * ...
 */
@Entity
@Table(name = "purc$apbillout")
public class PurchaseApBillOut implements Serializable {

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

	/**
	 * ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pabo_id")
	private Long id;

	/**
	 * 税金合计
	 */
	@Column(name = "pabo_taxsum")
	private Double taxSum;

	/**
	 * 税金差异
	 */
	@Column(name = "pabo_differ")
	private Double differ;

	/**
	 * 对账起始日期
	 */
	@Column(name = "pabo_begindate")
	private Date beginDate;

	/**
	 * 对账截止日期
	 */
	@Column(name = "pabo_enddate")
	private Date endDate;

	/**
	 * 录单日期
	 */
	@Column(name = "pabo_recorddate")
	private Date recordDate;

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


	/**
	 * 开票状态
	 */
	@Column(name = "pabo_checkstatus")
	private String checkStatus;

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

	/**
	 * 提交日期
	 */
	@Column(name = "pabo_auditdate")
	private Date auditDate;

	/**
	 * 作废日期
	 */
	@Column(name = "pabo_resdate")
	private Date resDate;

	/**
	 * 作废人
	 */
	@Column(name = "pabo_resman")
	private String resMan;

	/**
	 * 状态
	 */
	@Column(name = "pabo_status")
	private Short status;

	/**
	 * 开票金额
	 */
	@Column(name = "pabo_amount")
	private Double amount;

	/**
	 * 已付款金额
	 */
	@Column(name = "pabo_payamount")
	private Double payAmount;

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

	/**
	 * 汇率
	 */
	@Column(name = "pabo_rate")
	private Double rate;

	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pabo_custuu", insertable = false, updatable = false)
	private PurchaseApBillOutInfo customerApBillOutInfo;

	/**
	 * 客户UU
	 */
	@Column(name = "pabo_custuu")
	private Long custUu;

	/**
	 * 客户名称
	 */
	@Column(name = "pabo_custname")
	private String custName;

	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pabo_enuu", insertable = false, updatable = false)
	private PurchaseApBillOutInfo apBillOutInfo;

	/**
	 * 本企业UU
	 */
	@Column(name = "pabo_enuu")
	private Long enUu;

	/**
	 * 单据编号
	 */
	@Column(name = "pabo_code")
	private String code;

	/**
	 * 打印次数
	 */
	@Column(name = "pabo_print")
	private Short print;

	/**
	 * 开票单明细行
	 */
	@OneToMany(mappedBy = "apBillOut", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
			CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("number")
	private Set<PurchaseApBillOutItem> items;


	//以下为开票接口返回信息

	/**
	 * 返回信息
	 */
	@Column(name = "pabo_retmsg")
	private String retmsg;

	/**
	 * 开具的金额
	 */
	@Column(name = "pabo_infoamount")
	private Double infoAmount;

	/**
	 * 开具的税额
	 */
	@Column(name = "pabo_infotaxamount")
	private Double infoTaxAmount;

	/**
	 * 开票日期(格式:yyyy-mm-dd)
	 */
	@Column(name = "pabo_infodate")
	private String infoDate;

	/**
	 * 开具的发票代码
	 */
	@Column(name = "pabo_infotypecode")
	private String infoTypeCode;

	/**
	 * 开具的发票号码
	 */
	@Column(name = "pabo_infonumber")
	private String infoNumber;

	/**
	 * 上一张发票代码
	 */
	@Column(name = "pabo_hisinfotypecode")
	private String hisInfoTypeCode;

	/**
	 * 上一张发票号码
	 */
	@Column(name = "pabo_hisinfonumber")
	private String hisInfoNumber;

	/**
	 * 上一张发票种类
	 */
	@Column(name = "pabo_hisinfokind")
	private String hisInfoKind;

	/**
	 * 清单标志 0：非清单发票 1：清单发票
	 */
	@Column(name = "pabo_listflag")
	private Integer listFlag;

	/**
	 * 销方税号
	 */
	@Column(name = "pabo_nsrsbh")
	private String nsrsbh;

	/**
	 * 开票服务器号
	 */
	@Column(name = "pabo_kpfwqh")
	private String kpfwqh;

	/**
	 * 开票点号
	 */
	@Column(name = "pabo_kpdh")
	private String kpdh;

	//票加加字段

	/**
	 * 请求流水号
	 * @return
	 */
	@Column(name = "request_code")
	private String requestCode;

	/**
	 * 是否允许重开  0允许，1不允许
	 * @return
	 */
	@Column(name = "reissue")
	private String reissue;

	public Long getId() {
		return id;
	}

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

	public Double getTaxSum() {
		return taxSum;
	}

	public void setTaxSum(Double taxSum) {
		this.taxSum = taxSum;
	}

	public Double getDiffer() {
		return differ;
	}

	public void setDiffer(Double differ) {
		this.differ = differ;
	}

	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 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 getAuditDate() {
		return auditDate;
	}

	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}

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

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

	public Double getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(Double payAmount) {
		this.payAmount = payAmount;
	}

	public String getCurrency() {
		return currency;
	}

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

	public Double getRate() {
		return rate;
	}

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

	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 Short getPrint() {
		return print;
	}

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

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

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

	public PurchaseApBillOutInfo getCustomerApBillOutInfo() {
		return customerApBillOutInfo;
	}

	public void setCustomerApBillOutInfo(PurchaseApBillOutInfo customerApBillOutInfo) {
		this.customerApBillOutInfo = customerApBillOutInfo;
	}

	public PurchaseApBillOutInfo getApBillOutInfo() {
		return apBillOutInfo;
	}

	public void setApBillOutInfo(PurchaseApBillOutInfo apBillOutInfo) {
		this.apBillOutInfo = apBillOutInfo;
	}

	public String getRetmsg() {
		return retmsg;
	}

	public void setRetmsg(String retmsg) {
		this.retmsg = retmsg;
	}

	public Double getInfoAmount() {
		return infoAmount;
	}

	public void setInfoAmount(Double infoAmount) {
		this.infoAmount = infoAmount;
	}

	public Double getInfoTaxAmount() {
		return infoTaxAmount;
	}

	public void setInfoTaxAmount(Double infoTaxAmount) {
		this.infoTaxAmount = infoTaxAmount;
	}

	public String getInfoDate() {
		return infoDate;
	}

	public void setInfoDate(String infoDate) {
		this.infoDate = infoDate;
	}

	public String getInfoTypeCode() {
		return infoTypeCode;
	}

	public void setInfoTypeCode(String infoTypeCode) {
		this.infoTypeCode = infoTypeCode;
	}

	public String getInfoNumber() {
		return infoNumber;
	}

	public void setInfoNumber(String infoNumber) {
		this.infoNumber = infoNumber;
	}

	public String getHisInfoTypeCode() {
		return hisInfoTypeCode;
	}

	public void setHisInfoTypeCode(String hisInfoTypeCode) {
		this.hisInfoTypeCode = hisInfoTypeCode;
	}

	public String getHisInfoNumber() {
		return hisInfoNumber;
	}

	public void setHisInfoNumber(String hisInfoNumber) {
		this.hisInfoNumber = hisInfoNumber;
	}

	public String getHisInfoKind() {
		return hisInfoKind;
	}

	public void setHisInfoKind(String hisInfoKind) {
		this.hisInfoKind = hisInfoKind;
	}

	public Integer getListFlag() {
		return listFlag;
	}

	public void setListFlag(Integer listFlag) {
		this.listFlag = listFlag;
	}

	public String getNsrsbh() {
		return nsrsbh;
	}

	public void setNsrsbh(String nsrsbh) {
		this.nsrsbh = nsrsbh;
	}

	public String getKpfwqh() {
		return kpfwqh;
	}

	public void setKpfwqh(String kpfwqh) {
		this.kpfwqh = kpfwqh;
	}

	public String getKpdh() {
		return kpdh;
	}

	public void setKpdh(String kpdh) {
		this.kpdh = kpdh;
	}

	public String getRequestCode() {
		return requestCode;
	}

	public void setRequestCode(String requestCode) {
		this.requestCode = requestCode;
	}

	public String getReissue() {
		return reissue;
	}

	public void setReissue(String reissue) {
		this.reissue = reissue;
	}
}
