export type InvoiceDetail = Partial<{
  title: string; //发票类型
  code: string; //发票代码
  number: string; //发票号码
  openTime: string; //开票日期

  checkNumber: string; //校验码
  buyerTitle: string; //购买方抬头
  buyerCode: string; //购买方纳税人识别号
  buyerAddr: string; //购买方地址
  buyerMobile: string; //购买方联系方式
  buyerBank: string; //购买方银行
  buyerBankNo: string; //购买方账号

  sellerTitle: string; //销售方抬头
  sellerCode: string; //销售方纳税人识别号
  sellerAddr: string; //销售方地址
  sellerMobile: string; //销售方联系方式
  sellerBank: string; //销售方银行
  sellerBankNo: string; //销售方账号

  //发票商品列表
  goodList: string;

  //列表下的属性
  listInfo: {
    name: string; //名称
    spec: string; //规格
    unit: string; //单位
    num: string; //数量
    goodPrice: string; //单价
    totalPrice: string; //总价
    taxRate: string; //税率
    tax: string; //税额
  };

  amountTax: string; //总税额
  amountPrice: string; //总金额

  TotalIncludingTax_C: string; //价税合计 大写
  TotalIncludingTax_L: string; //价税合计 小写

  payee: string; //收款人
  reviewer: string; //复核人
  drawer: string; //开票人
  seller: string; //销售方
  remarks: string; //备注
}>;

//销售发票配置
const SALE: InvoiceDetail = {
  title: "",
  code: "",
  number: "",
  openTime: "",
  checkNumber: "",

  buyerTitle: "",
  buyerCode: "",
  buyerAddr: "",
  buyerMobile: "",
  buyerBank: "",
  buyerBankNo: "",

  sellerTitle: "",
  sellerCode: "",
  sellerAddr: "",
  sellerMobile: "",
  sellerBank: "",
  sellerBankNo: "",

  goodList: "",
  listInfo: {
    name: "",
    spec: "",
    unit: "",
    num: "",
    goodPrice: "",
    totalPrice: "",
    taxRate: "",
    tax: ""
  },

  amountTax: "",
  amountPrice: "",

  TotalIncludingTax_C: "",
  TotalIncludingTax_L: "",

  payee: "",
  reviewer: "",
  drawer: "",
  seller: "",
  remarks: ""
};

//采购发票配置
const PURCHASE: InvoiceDetail = {
  title: "",
  code: "",
  number: "",
  openTime: "",
  checkNumber: "",

  buyerTitle: "",
  buyerCode: "",
  buyerAddr: "",
  buyerMobile: "",
  buyerBank: "",
  buyerBankNo: "",

  sellerTitle: "",
  sellerCode: "",
  sellerAddr: "",
  sellerMobile: "",
  sellerBank: "",
  sellerBankNo: "",

  goodList: "",
  listInfo: {
    name: "",
    spec: "",
    unit: "",
    num: "",
    goodPrice: "",
    totalPrice: "",
    taxRate: "",
    tax: ""
  },

  amountTax: "",
  amountPrice: "",

  TotalIncludingTax_C: "",
  TotalIncludingTax_L: "",

  payee: "",
  reviewer: "",
  drawer: "",
  seller: "",
  remarks: ""
};

export const RESPONSE_MAP = {
  sale: SALE,
  purchase: PURCHASE
};
