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] add `ledger` compiler support for `htsec` provider #96

Closed ramsayleung closed 1 year ago

ramsayleung commented 1 year ago

Description

目前 double-entry-generator 只支持 beancount 后端,增加对 ledger 后端的支持. 针对不同的 provider, 后端需要有对应的输出模板,已有的输出模板包括:

本次PR 增加 海通买入模板, 海通卖出模板 的支持

Modification

概括:

  1. compiler/ledger package 增加htsec的支持
  2. test 目录增加 htsec-ledger 相关test script
  3. example 目录增加 htsec-ledger 相关的生成文件.
  4. Makefile 增加新的 test target
  5. huobi 相关的example 和 template, 去掉商品名称的双引号, ledger 支持中文和空格,不需要加双引号表示字符串

Motivation and Context

92

Dependencies

None

Type of change

Please delete options that are not relevant.

How has this been tested?

新增一个 end-to-end 测试脚本, 测试 htsec-ledger 后端生成功能:

对生成的 ledger 文件进行语法与格式校验:

make test: all tests pass