package com.jianshui.platform.enums;

/**
* @Author: kk
* @Description: 开票类型枚举
*/
public enum InvoiceType {

    SHU_DIAN_ZHUAN_PIAO("1", "数电专票"),
    ZHUAN_PIAO("01", "专票"),
    SHU_DIAN_PU_PIAO("2", "数电普票"),
    JI_DONG_CHE_PIAO("03", "机动车票"),
    ZHENG_ZHI_SHUI_PU_TONG_FA_PIAO("04", "增值税普通发票"),
    DIAN_ZI_ZHUAN_YONG_FA_PIAO("08", "电子专用发票"),
    DIAN_ZI_PU_PIAO("10", "电子普票"),
    JUAN_PIAO("11", "卷票"),
    TONG_XING_FEI_FA_PIAO("14", "通行费发票"),
    ER_SHOU_CHE_PIAO("15", "二手车票"),
    QUAN_DIAN_ZHUAN_PIAO("21", "全电专票"),
    QUAN_DIAN_PU_PIAO("22", "全电普票");


    private String code;
    private String displayName;

    private InvoiceType(String code, String displayName) {
        this.code = code;
        this.displayName = displayName;
    }

    public String getCode() {
        return code;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static InvoiceType fromCode(String code) {
        for (InvoiceType type : InvoiceType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid InvoiceType code: " + code);
    }
    
}
