package com.dev.swms.server.model.base;

import com.dev.energy.server.model.Entity;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

public class BillType extends Entity {
	/** 货主 */
	private Structure company;
	/** 单据类型编码 */
	private String code;
	/** 单据类型名称 */
	private String name;
	/** 描述 */
	private String description;
	/** 收发类型（收货、发货、移位） */
	private String type;
	/** 是否有效 */
	private boolean disabled = false;	
	/** 编码前缀 */
	private String prefix;
	/** 编码位数 */
	private int numberCount;
	/** 是否按日期产生流水号 */
	private boolean beUseDate = false;
	/** 日期格式 */
	private String dateFormatString;
	/** 分隔符 */
	private String cutString;
	

	public boolean isBeUseDate() {
		return beUseDate;
	}

	public void setBeUseDate(boolean beUseDate) {
		this.beUseDate = beUseDate;
	}

	public String getCutString() {
		return cutString;
	}

	public void setCutString(String cutString) {
		this.cutString = cutString;
	}

	public String getDateFormatString() {
		return dateFormatString;
	}

	public void setDateFormatString(String dateFormatString) {
		this.dateFormatString = dateFormatString;
	}

	public int getNumberCount() {
		return numberCount;
	}

	public void setNumberCount(int numberCount) {
		this.numberCount = numberCount;
	}

	public String getPrefix() {
		return prefix;
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	protected BillType(){
		
	}
	
	public int hashCode() {
		return new HashCodeBuilder().append(code).append(company).toHashCode();
	}

	public boolean equals(final Object other) {
		if (!(other instanceof BillType))
			return false;
		BillType castOther = (BillType) other;
		return new EqualsBuilder().append(code, castOther.getCode())
		.append(company, castOther.getCompany()).isEquals();
	}


	public Structure getCompany() {
		return company;
	}
	public void setCompany(Structure company) {
		this.company = company;
	}
	public boolean isDisabled() {
		return disabled;
	}
	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}

}
