Skip to content

Commit

Permalink
test(jd): Update JD test cases and docs for new bill format
Browse files Browse the repository at this point in the history
Modified JD test cases to align with the new bill format. Updated the
corresponding config.yaml file and supplemented the documentation to
reflect these changes.
  • Loading branch information
zwyyy456 committed Jan 1, 2025
1 parent 46fde38 commit 7492961
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 170 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ double-entry-generator translate \
./example/bmo/credit/example-bmo-records.csv
```

#### 京东

```bash
double-entry-generator translate \
--config ./example/jd/config.yaml \
--provider jd \
--output ./example/jd/example-jd-output.beancount \
./example/jd/example-jd-records.csv
```

### Ledger

#### 支付宝
Expand Down Expand Up @@ -871,6 +881,11 @@ BMO账单中的记账金额中存在收入/支出之分,通过这个机制就

### 京东

<details>
<summary>
BMO银行配置文件示例
</summary>

```yaml
defaultMinusAccount: Assets:FIXME
defaultPlusAccount: Expenses:FIXME
Expand Down Expand Up @@ -901,6 +916,8 @@ jd:
methodAccount: Assets:EPay:JD
```

</details></br>

京东账单的格式总体上和[支付宝](#支付宝-3)类似。

京东账单在交易类别为`不计收支`时,账户的处理分为两种情况:
Expand Down
62 changes: 50 additions & 12 deletions example/jd/config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
defaultMinusAccount: Assets:FIXME
defaultPlusAccount: Expenses:FIXME
defaultCurrency: CNY
title: 测试
title: jd
jd:
rules:
- method: 京东白条
methodAccount: Liabilities:Baitiao
- method: 小金库零用钱
methodAccount: Assets:EPay:JD
- item: 椰子
targetAccount: Expenses:Food
- item: 京东小金库-转入
peer: 京东金融
targetAccount: Assets:EPay:JD
- item: 椰子,红薯,膳,食用油,挂面,食盐 # 交易说明
sep: ","
targetAccount: Expenses:Food:Snacks
- category: 美妆个护
targetAccount: Expenses:MakeUp
- item: "食品酒饮"
targetAccount: Assets:Food
- category: 食品酒饮
fullMatch: true
targetAccount: Expenses:Food:Snacks
- category: 医疗保健
targetAccount: Expenses:Hospital:Medicine
- category: 数码电器,电脑办公,手机通讯
sep: ","
targetAccount: Expenses:Electronics
- category: 日用百货,清洁纸品,生活服务,家居家装,其他网购,1号店
sep: ","
targetAccount: Expenses:Groceries
- category: 运动户外
targetAccount: Expenses:Sports
- category: 鞋服箱包,服饰内衣
targetAccount: Expenses:Clothes
- category: 收发快递
targetAccount: Expenses:Reside:Express
- item: 转入
type: 收入
targetAccount: Income:Rebate


- peer: 亲密卡
targetAccount: Expenses:Prpaid
- item: 白条,还款
Expand All @@ -25,3 +39,27 @@ jd:
fullMatch: true
targetAccount: Income:PnL:JD
methodAccount: Assets:EPay:JD

- method: 京东白条
methodAccount: Liabilities:JD:Baitiao
- method: 小金库零用钱
methodAccount: Assets:EPay:JD
- method: 钱包余额
methodAccount: Assets:JD:Balance
- method: (0354)
methodAccount: Liabilities:CC:BCM:0354
- method: (1341)
methodAccount: Liabilities:CC:BoC:1341
- method: (1875)
methodAccount: Liabilities:CC:BoC:1875
- method: (2189)
methodAccount: Liabilities:CC:BoNB:2189
- method: (0924)
methodAccount: Liabilities:CC:CMB:0924
- method: (0073)
methodAccount: Liabilities:CC:CMBC:0073
- method: (5559)
methodAccount: Liabilities:CC:CMBC:5559
- category: 网购
type: 不计收支
targetAccount: Income:Rebate
Loading

0 comments on commit 7492961

Please sign in to comment.