package com.uas.platform.b2b.model;

/**
 * 这个模型 记录出入库来源单信息
 * 
 * @author aof
 * @time 创建时间：2016年5月26日
 */
public class SourceForApcheck {

	private Long sourceid;
	private String sourcetable;
	private Double newYCheckQty;

	public SourceForApcheck(PurchaseApCheckItem item) {
		super();
		this.sourceid = item.getSourceId();
		this.sourcetable = item.getSourceTable();
		if (item.getOldYCheckQty() == null) {
			this.newYCheckQty = item.getCheckQty();
		} else {
			this.newYCheckQty = item.getCheckQty() + item.getOldYCheckQty();
		}

	}

	public Long getSourceid() {
		return sourceid;
	}

	public void setSourceid(Long sourceid) {
		this.sourceid = sourceid;
	}

	public String getSourcetable() {
		return sourcetable;
	}

	public void setSourcetable(String sourcetable) {
		this.sourcetable = sourcetable;
	}

	public Double getNewYCheckQty() {
		return newYCheckQty;
	}

	public void setNewYCheckQty(Double newYCheckQty) {
		this.newYCheckQty = newYCheckQty;
	}

	public boolean hasInfo() {
		if (this.getNewYCheckQty() != null && this.getSourceid() != null && this.getSourcetable() != null) {
			return true;
		}
		return false;
	}

	@Override
	public String toString() {
		return "SourceForApcheck [sourceId=" + sourceid + ", sourceTable=" + sourcetable + ", newYCheckQty=" + newYCheckQty + "]";
	}

}
