Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(provider, analyser): support jd new bill format, Set plusaccount to methodaccount for refund records in jd bills #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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银行配置文件示例
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该是「京东」,而不是「BMO」?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改;

</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
Loading