package com.dxhy.jxpt.baseService.util;

/**
 * @ClassName FpzlChangeUtil
 * @Description 发票种类转换类
 * @Author wangruwei
 * @Date 2024/5/9 14:42
 * @Version 1.0
 */
public class FpzlChangeUtil {

    /**
    * @Description 从开放平台查验接口 返回的 种类代码 转换为 进项里使用的票种代码
    * @param fpzl   票种代码
    * @param xdpbz  数电票标志  1是  0否
    * @Return java.lang.String
    * @Author wangruwei
    * @Date 2024/5/9 14:44
    **/
    public static String getInvoiceTypeKfptToJxpt(String fpzl,String xdpbz){
        String invoiceType = fpzl;
        if("01".equals(fpzl)&&!"1".equals(xdpbz)){
            invoiceType = "01";
        }
        if("01".equals(fpzl)&&"1".equals(xdpbz)){
            invoiceType = "185";
        }
        if("04".equals(fpzl)&&!"1".equals(xdpbz)){
            invoiceType = "04";
        }
        if("04".equals(fpzl)&&"1".equals(xdpbz)){
            invoiceType = "186";
        }
        if("21".equals(fpzl)){
            invoiceType = "31";
        }
        if("22".equals(fpzl)){
            invoiceType = "32";
        }
        if("61".equals(fpzl)){
            invoiceType = "161";
        }
        if("83".equals(fpzl)){
            invoiceType = "283";
        }
        return invoiceType;
    }
}
