/**
 * @invoice_addr 公司注册地址
 * @invoice_people  法人
 * @invoice_mobile 联系方式
 * @invoice_code 纳税识别号
 * @invoice_bank 开户行
 * @invoice_bankNo 开户账户
 */
export const convertInvoiceTitle = (title: Record<string, string>) => {
    const {
        company_address,
        mobile,
        company_license,
        bank_name,
        bankNo,
        company_name
    } = title;

    return {
        invoice_addr: company_address,
        invoice_mobile: mobile,
        invoice_code: company_license,
        invoice_bank: bank_name,
        invoice_bankNo: bankNo,
        invoice_title: company_name
    };
};

export const convertInvoiceTitleData = (title: Record<string, string>) => {
    const {
        invoice_addr,
        invoice_mobile,
        invoice_code,
        invoice_bank,
        invoice_bankNo,
        invoice_title
    } = title;

    return {
        invoice_code,
        invoice_title,
        addrAndmobile: invoice_addr + " " + invoice_mobile,
        bankAndBankNo: invoice_bank + " " + invoice_bankNo
    };
};

export const invoice_columns = [
    {
        label: "抬头",
        span: 24,
        field: "invoice_title"
    },
    {
        label: "纳税人识别号",
        span: 24,
        field: "invoice_code"
    },
    {
        label: "地址、电话",
        span: 24,
        field: "addrAndmobile"
    },
    {
        label: "开户行及账号",
        span: 24,
        field: "bankAndBankNo"
    }
];
