package cn.superdesk.uniorder.service.invoice.supplier.impl;


import cn.superdesk.uniorder.dto.vo.invoice.supplier.InvoiceApplySupplierDetailDimGoodsItemVo;

public class InvoiceApplySupplierExportExcelFocusScoreDimGoodsStatic {


    public static String fetchGroupKeyById(InvoiceApplySupplierDetailDimGoodsItemVo invoiceApplyExportExcelForceScore) {
        return invoiceApplyExportExcelForceScore.getInvoiceApplyId() +
                "_" + invoiceApplyExportExcelForceScore.getAccountingOrderId() +
                "_" + invoiceApplyExportExcelForceScore.getUnifiedOrderGoodsId();
    }

    /**
     * 当前用的分组合并规则
     *
     * @param invoiceApplyExportExcelForceScore
     * @return
     */
    public static String fetchGroupKeyByName(InvoiceApplySupplierDetailDimGoodsItemVo invoiceApplyExportExcelForceScore) {
        return invoiceApplyExportExcelForceScore.getInvoiceApplySn() + // 开票申请编号
                "_" + invoiceApplyExportExcelForceScore.getAccountingOrderSn() + // 对账单编号

//                【【结算中心-正式环境】供应商结算-发票登记管理-SIA2022041455323904-商品名称不同-变更成可以合并】
//                https://www.tapd.cn/33003868/bugtrace/bugs/view?bug_id=1133003868001004893
//                mark by linjinyu at 20220507
//                李立权邮件[Re: 回复：侨城汇结算中心一键分票合并规则调整说明]:送平
//                  供应商结算的一键分票合并规则，一并去掉“第三方商品名称【20220505去掉此判断，由于目前正负单商品名称可能存在不一致导致数据无法合并】”，此修改内容在v2.2积分结算纸质专用发票版本发布时一并修改。
//                "_" + invoiceApplyExportExcelForceScore.getGoodsName() + // 商品名称 (第三方系统 商品名称)



                "_" + invoiceApplyExportExcelForceScore.getGoodsId() + // 商品Id (第三方系统 商品Id)
                "_" + invoiceApplyExportExcelForceScore.getCostPrice() + // 商品成本价
                "_" + invoiceApplyExportExcelForceScore.getMerchTaxRate() + // 商品税率
                "_" + invoiceApplyExportExcelForceScore.getMerchTaxCode();  // 商品税务编码
    }


    // mark by linjinyu 20201109 https://www.tapd.cn/33003868/prong/stories/view/1133003868001001019?url_cache_key=722526bfe72624f3973e0d0955c03a7f&action_entry_type=story_tree_list
    public static String[] fieldHeadMode1Static = {
            "销售单据编号",
            "对账单编号",
            "订单编号",
            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",
            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "金额",
            "商户税率",
            "折扣金额",
            "供应商"
    };

    // 附件2:企业对账-开票格式.xls
    public static String[] fieldValueMode1Static = {
            "invoiceApplySn", // 销售单据编号
            "accountingOrderSn", // 对账单编号
            "orderSn", // 订单编号
            "purchaserCompanyName", // 购方名称
            "purchaserTaxpayersIDCode", // 购方税号
            "purchaserAddressPhone", // 购方地址电话
            "purchaserBankAccountNumber", // 购方银行账号
            "remark", // 备注
            "merchTaxCode", // 税收编码
            "goodsName", // 货物名称
            "selfOption", // 规格
            "unit", // 计量单位
            "quantity", // 数量
            "costPrice", // 销售单价
            "goodsCostAmount", // 金额
            "merchTaxRate", // 商户税率
            "", // 折扣金额
            "saleName" // 供应商
    };


    // mark by linjinyu 20201109 https://www.tapd.cn/33003868/prong/stories/view/1133003868001001019?url_cache_key=722526bfe72624f3973e0d0955c03a7f&action_entry_type=story_tree_list
    public static String[] fieldHeadMode2Static = {
            "销售单据编号",
            "对账单编号",
            "订单编号",
            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",
            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "金额",

            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"
    };

    public static String[] fieldValueMode2Static = {
            "invoiceApplySn", // 销售单据编号
            "accountingOrderSn", // 对账单编号
            "orderSn", // 订单编号
            "purchaserCompanyName", // 购方名称
            "purchaserTaxpayersIDCode", // 购方税号
            "purchaserAddressPhone", // 购方地址电话
            "purchaserBankAccountNumber", // 购方银行账号
            "remark", // 备注
            "merchTaxCode", // 税收编码
            "goodsName", // 货物名称
            "selfOption", // 规格
            "unit", // 计量单位
            "quantity", // 数量
            "costPrice", // 销售单价
            "goodsCostAmount", // 金额

            "merchTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号 税务分类版本 base_info_encrypted_version_number
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"
    };

    /****************************************** 甲方要求减几个字段 mark by linjinyu at 20210317 start ******************************************/

    public static String[] fieldHeadMode2StaticMerge = {
            "销售单据编号",
            "对账单编号",
            "订单编号",
            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",
            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "金额",

            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"
    };

    public static String[] fieldValueMode2StaticMerge = {
            "invoiceApplySn",
            "accountingOrderSn",
            "orderSn",
            "purchaserCompanyName",
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone",
            "purchaserBankAccountNumber",
            "remark",
            "merchTaxCode",
            "goodsName",
            "selfOption",
            "unit",
            "quantity",
            "costPrice",
            "goodsCostAmount",

            "merchTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"
    };


    public static String[] fieldHeadMode3Static = {
            "销售单据编号",
            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",
            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "金额",
            "商户税率",
            "折扣金额",
            "供应商"
    };

    public static String[] fieldValueMode3Static = {
            "invoiceApplySn", // "销售单据编号",
            "purchaserCompanyName", // 购方名称
            "purchaserTaxpayersIDCode", // 购方税号
            "purchaserAddressPhone", // 购方地址电话
            "purchaserBankAccountNumber", // 购方银行账号
            "remark", // 备注
            "merchTaxCode", // 税收编码
            "goodsName", // 货物名称
            "selfOption", // 规格
            "unit", // 计量单位
            "quantity", // 数量
            "costPrice", // 销售单价
            "goodsCostAmount", // 金额
            "merchTaxRate", // 商户税率
            "", // 折扣金额
            "saleName" // 供应商
    };


//销售单据号:取当前Excel所属开票申请的开票申请编号;
//购方名称:取当前Excel所属开票申请在一键分票时所选购方名称的内容,其内容来源于"结算中心-收款方发票管理";
//购买税号:取当前Excel所属开票申请在一键分票时所选购方纳税人识别号的内容;
//购买地址电话:取当前Excel所属开票申请在一键分票时所选购方地址及电话的内容,注:地址和电话中间以空格隔开,若无地址或无电话,其该地址/电话内容为空;
//购方银行账号:取当前Excel所属开票申请在一键分票时所选购方银行及账号的内容,注:银行和账号中间以空格隔开,若无银行或无账号,其该银行/账号内容为空;
//备注:为空导出;
//税收编码:取该商品的税务分类编码;
//货物名称:取该商品的商品名称内容;
//规格:取该商品的商品规格内容;
//计量单位:取该商品的单位内容,若无内容即导出时默认为"项";
//数量:取该商品的销售数量,可为负数;
//销售单价:该商品的销售成本单价,保留小数点两位;
//金额:取该商品的成本总价=该商品销售成本单价*数量,保留小数点两位,可为负数;
//税率:取该商品的税率,例如:0.09 | 0.13
//编码版本号:目前统一默认为"33.0";
//享受优惠政策:默认为"0";
//发票种类:取该开票申请的发票种类名称内容;
//收款人&复核人:为空导出;
//购方企业类型:默认为"01";
//含税标志:默认为"含税";
//供应商:取该开票申请所属的供应商名称内容;

    public static String[] fieldHeadMode3StaticMerge = {
            "销售单据编号",
            "购方名称",
            "购方税号",
            "购方地址电话",
            "购方银行账号",
            "备注",
            "税收编码",
            "货物名称",
            "规格",
            "计量单位",
            "数量",
            "销售单价",
            "金额",

            /****************************************** 侨城汇需求 20210922 start ******************************************/

            "税率",
            "编码版本号",
            "享受优惠政策",
            "发票种类",
            "收款人",
            "复核人",
            "购方企业类型填写\n" +
                    "\"01\"或\"04\"\n" +
                    "01:企业\n" +
                    "04:个人及非企业性机构", // 01:企业;04:个人及非企业性机构
            "含税标识填写\n" +
                    "\"含税\"或\"不含税\"", // 含税;不含税
            "供应商"
            /****************************************** 侨城汇需求 20210922 start ******************************************/
    };

    public static String[] fieldValueMode3StaticMerge = {
            "invoiceApplySn",
            "purchaserCompanyName",
            "purchaserTaxpayersIDCode",
            "purchaserAddressPhone",
            "purchaserBankAccountNumber",
            "remark",
            "merchTaxCode",
            "goodsName",
            "selfOption",
            "unit",
            "quantity",
            "costPrice", // 差异
            "goodsCostAmount", // 差异
            "merchTaxRate",
            "encryptedVersionNumber", // 编码版本号 加密版本号
            "flagTaxIncentives", // 享受优惠政策
            "invoiceTypeName",// 发票种类
            "personNameCashier", // 收款人
            "personNameReview", // 复核人
            "purchaserCompanyType", // 购方企业类型:01-企业;04-个人及非企业性机构
            "flagTaxIncluded", // 含税标识:含税;不含税
            "saleName"
    };
}
