package com.jianshui.common.enums;

public enum InvoiceType {

    /*
     * 数电专用发票
     */
    INVOICE_TYPE_001("81","001"),

    /*
     * 数电普通发票
     */
    INVOICE_TYPE_002("82","002"),

    /*
     * 增值税专用发票
     */
    INVOICE_TYPE_004("s","004"),

    /*
     * 增值税普通发票
     */
    INVOICE_TYPE_007("c","007"),

    /*
     * 增值税电子普通发票
     */
    INVOICE_TYPE_026("p","026"),

    /*
     * 增值税电子专用发票
     */
    INVOICE_TYPE_028("b","028");


    private String orginCode;

    private String eleCode;
    InvoiceType(String orginCode,String eleCode){
        this.orginCode = orginCode;
        this.eleCode = eleCode;
    }

    public static String getEleCode(String orginCode){

        for (InvoiceType value : InvoiceType.values()) {

            if(value.orginCode.equals(orginCode)){
                return value.eleCode;
            }
        }


        return orginCode;
    }

}
