package com.uas.platform.b2b.erp.model;

import com.uas.platform.b2b.model.SaleQuotationItem;
import com.uas.platform.core.model.Constant;

/**
 * 主动报价单的采纳结果
 * 
 * @author yingp
 * 
 */
public class QuotationDecide {

	private String qu_code;
	private Short qd_detno;
	private Long b2b_qd_id;
	private Short qd_agreed;

	public String getQu_code() {
		return qu_code;
	}

	public void setQu_code(String qu_code) {
		this.qu_code = qu_code;
	}

	public Short getQd_detno() {
		return qd_detno;
	}

	public void setQd_detno(Short qd_detno) {
		this.qd_detno = qd_detno;
	}

	public Long getB2b_qd_id() {
		return b2b_qd_id;
	}

	public void setB2b_qd_id(Long b2b_qd_id) {
		this.b2b_qd_id = b2b_qd_id;
	}

	public Short getQd_agreed() {
		return qd_agreed == null ? Constant.NO : (short) Math.abs(qd_agreed);
	}

	public void setQd_agreed(Short qd_agreed) {
		this.qd_agreed = qd_agreed;
	}

	/**
	 * 转为卖家ERP的主动报价的采纳结果
	 * 
	 * @param item
	 */
	public QuotationDecide(SaleQuotationItem item) {
		this.b2b_qd_id = item.getId();
		this.qd_agreed = item.getAgreed();
		this.qu_code = item.getQuotation().getCode();
		this.qd_detno = item.getNumber();
	}

}
