deb-sig / double-entry-generator

Rule-based double-entry bookkeeping importer (from Alipay/WeChat/Huobi etc. to Beancount/Ledger).
https://github.com/deb-sig/double-entry-generator
Apache License 2.0
537 stars 79 forks source link

[feat] 增加对海外银行 bmo provider 的支持 #113

Closed ramsayleung closed 1 year ago

ramsayleung commented 1 year ago

Description

double-entry-generator 增加对海外银行 BMO 的账单支持

BMO

BMO 是加拿大的五大银行之一, 与 TD 齐名, 主要业务在加拿大.

Transaction Statement

Debit

BMO的存储卡账单相当简洁 (简陋), 只有5个字段:

First Bank Card Transaction Type Date Posted Transaction Amount Description
'5678653123124124' CREDIT 20230501 0.01 [DN]ACFS MSP/DIV
'5678653123124124' DEBIT 20230518 -68.32 [CW]TELUS MOB
'5678653123124124' DEBIT 20230523 -50.0 [CW]BC HYDRO
'5678653123124124' DEBIT 20230612 -40.0 [IB] 6088 #3 ROAD
  1. 只有支付日期,没有支付具体时间
  2. 没有交易对手(Peer) 和 商品(Item)字段, 都合并在 Transaction Description, 因此将 Transaction Description 当作 Item 字段, Peer 字段为 TD

    Credit

    信用卡账单更简单,有用的字段只有3个, 通过金额正负来判断交易方向.

Item # Card # Transaction Date Posting Date Transaction Amount Description
1 '5191230567984561' 20230511 20230512 3.27 COSTCO WHOLESALE W54 SURREY BC
2 '5191230567984561' 20230511 20230512 85.06 COSTCO WHOLESALE W54 SURREY BC
3 '5191230567984561' 20230512 20230515 - 6.0 PAYMENT RECEIVED THANK YOU

Modification

  1. example/bmo: 增加bmo 相关的配置, 生成账单
  2. analyser/bmo: analyser 增加 bmo 相关内容
  3. provider/bmo: 增加 bmo provider
  4. test: 增加 bmo 相关test

我尽量提交最少修改的PR, 但是新增一个 workable provider 以及相应 test, example 的改动量着实较大, 见谅见谅

Motivation and Context

112

Dependencies

None

Type of change

Please delete options that are not relevant.

How has this been tested?

Is this change properly documented?

Please make sure you've properly documented the changes you're making.

Don't forget to add an entry to the CHANGELOG/README if necessary (new features, breaking changes, relevant internal improvements).

后续提另外的PR更新README.