package com.fdkankan.common.constant;

/**
 * 是否已开票
 */
public enum InvoiceRegisterStatus {

    NO(0, "未开票"),
    YES(1, "已开票");

    private Integer code;
    private String message;

    private InvoiceRegisterStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return code;
    }

    public String message() {
        return message;
    }

    public static InvoiceRegisterStatus get(Integer code){
        InvoiceRegisterStatus[] values = InvoiceRegisterStatus.values();
        Integer enumValue = null;
        for(InvoiceRegisterStatus eachValue : values){
            enumValue = eachValue.code();
            if(enumValue.equals(code)){
                return eachValue;
            }
        }
        return null;
    }

}
