From 77b028baf4dcef72506e3544fc43b679d60b6c7a Mon Sep 17 00:00:00 2001 From: zwyyy Date: Sat, 14 Dec 2024 23:50:50 +0800 Subject: [PATCH 1/4] fix(provider, analyser): support jd new bill format, Set `plusaccount` to `methodaccount` for refund records in jd bills --- pkg/analyser/jd/jd.go | 3 +++ pkg/provider/jd/jd.go | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pkg/analyser/jd/jd.go b/pkg/analyser/jd/jd.go index 32ad4ec..cb2ba80 100644 --- a/pkg/analyser/jd/jd.go +++ b/pkg/analyser/jd/jd.go @@ -128,5 +128,8 @@ func (a JD) GetAccountsAndTags(o *ir.Order, cfg *config.Config, target, provider strings.HasPrefix(o.Item, "解冻-")) { ignore = true } + if o.TypeOriginal == "不计收支" && (strings.HasPrefix(o.Item, "退款-")) { + return ignore, resPlus, resMinus, extraAccounts, tags + } return ignore, resMinus, resPlus, extraAccounts, tags } diff --git a/pkg/provider/jd/jd.go b/pkg/provider/jd/jd.go index e525d7c..ead327f 100644 --- a/pkg/provider/jd/jd.go +++ b/pkg/provider/jd/jd.go @@ -20,6 +20,7 @@ import ( "fmt" "io" "log" + "regexp" "strconv" "strings" "time" @@ -129,17 +130,17 @@ func (c *JD) translateLine(row []string) error { if err != nil { return err } - bill.Category = row[1] - bill.PeerType = row[2] - bill.ItemName = row[3] + bill.Category = row[7] + bill.PeerType = row[1] + bill.ItemName = row[2] - bill.Type = c.translateType(row[4]) - bill.Money, err = c.translateValue(row[5]) + bill.Type = c.translateType(row[6]) + bill.Money, err = c.translateValue(row[3]) if err != nil { return err } - bill.Method = row[6] - bill.Status = row[7] + bill.Method = row[4] + bill.Status = row[5] bill.DealNo = row[8] bill.MerchantId = row[9] bill.Notes = row[10] @@ -187,6 +188,12 @@ func (c *JD) convertToIRType(s Type) ir.Type { } func (c *JD) translateValue(s string) (int64, error) { + + re := regexp.MustCompile(`\(已退款[0-9]+(\.[0-9]+)?\)|\(已全额退款\)$`) + + // 检查金额是否以 '(已全额退款)' 或者 '(已退款xx.xx)' 结尾 + // 如果是,去掉后缀 + s = re.ReplaceAllString(s, "") s = strings.ReplaceAll(s, ".", "") return strconv.ParseInt(s, 10, 64) } From 46fde3880d6b8c13b2bffc2e2ac667e6d569fa40 Mon Sep 17 00:00:00 2001 From: zwyyy Date: Thu, 19 Dec 2024 10:23:32 +0800 Subject: [PATCH 2/4] fix(doc): add jd support in doc. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e692d7d..3f60705 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ - 中国工商银行 - Toronto-Dominion Bank - Bank of Montreal +- 京东 目前记账语言支持: @@ -908,6 +909,8 @@ jd: 2. 特殊情况:`交易说明`(即`item`匹配的字段)的前缀为`冻结-`或`解冻-`时为`不计收支`的特殊情况。`冻结-`情形下, `收/付款方式`为支出账户; `解冻-`情形下 `收/付款方式`为收入账户但是金额为 0。目前所有和`冻结` , `解冻` 相关的交易会被忽略。 +3. 对于京东账单中的退款记录,`plusAccount` 为 `methodAccount`,`minusAccount` 为 `targetAccount`,即退款的资金原路返回。 + `targetAccount` 与 `methodAccount` 的增减账户关系如下表: | 收/支 | minusAccount | plusAccount | @@ -915,6 +918,7 @@ jd: | 收入 | targetAccount | methodAccount | | 支出 | methodAccount | targetAccount | | 不计收支 | methodAccount | targetAccount | +| 不计收支(退款)| targetAccount | methodAccount | ## Special Thanks From 749296126aabf288f886987b511b95d977e90740 Mon Sep 17 00:00:00 2001 From: zwyyy Date: Wed, 1 Jan 2025 12:14:14 +0800 Subject: [PATCH 3/4] test(jd): Update JD test cases and docs for new bill format 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. --- README.md | 17 + example/jd/config.yaml | 62 +++- example/jd/example-jd-output.beancount | 423 +++++++++++++++++-------- example/jd/example-jd-records.csv | 77 +++-- 4 files changed, 409 insertions(+), 170 deletions(-) diff --git a/README.md b/README.md index 3f60705..218aba2 100644 --- a/README.md +++ b/README.md @@ -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 #### 支付宝 @@ -871,6 +881,11 @@ BMO账单中的记账金额中存在收入/支出之分,通过这个机制就 ### 京东 +
+ + BMO银行配置文件示例 + + ```yaml defaultMinusAccount: Assets:FIXME defaultPlusAccount: Expenses:FIXME @@ -901,6 +916,8 @@ jd: methodAccount: Assets:EPay:JD ``` +

+ 京东账单的格式总体上和[支付宝](#支付宝-3)类似。 京东账单在交易类别为`不计收支`时,账户的处理分为两种情况: diff --git a/example/jd/config.yaml b/example/jd/config.yaml index 8588007..aafaee9 100644 --- a/example/jd/config.yaml +++ b/example/jd/config.yaml @@ -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: 白条,还款 @@ -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 \ No newline at end of file diff --git a/example/jd/example-jd-output.beancount b/example/jd/example-jd-output.beancount index 4dc9034..c5c56f8 100644 --- a/example/jd/example-jd-output.beancount +++ b/example/jd/example-jd-output.beancount @@ -1,167 +1,340 @@ -option "title" "测试" +option "title" "jd" option "operating_currency" "CNY" 1970-01-01 open Assets:EPay:JD 1970-01-01 open Assets:FIXME -1970-01-01 open Assets:Food +1970-01-01 open Assets:JD:Balance +1970-01-01 open Expenses:Clothes +1970-01-01 open Expenses:Electronics 1970-01-01 open Expenses:FIXME -1970-01-01 open Expenses:Food +1970-01-01 open Expenses:Food:Snacks +1970-01-01 open Expenses:Groceries +1970-01-01 open Expenses:Hospital:Medicine 1970-01-01 open Expenses:MakeUp 1970-01-01 open Expenses:Prpaid +1970-01-01 open Expenses:Reside:Express +1970-01-01 open Expenses:Sports 1970-01-01 open Income:PnL:JD +1970-01-01 open Income:Rebate 1970-01-01 open Liabilities:Baitiao +1970-01-01 open Liabilities:CC:BCM:0354 +1970-01-01 open Liabilities:CC:BoC:1341 +1970-01-01 open Liabilities:CC:BoC:1875 +1970-01-01 open Liabilities:CC:BoNB:2189 +1970-01-01 open Liabilities:CC:CMB:0924 +1970-01-01 open Liabilities:CC:CMBC:0073 +1970-01-01 open Liabilities:CC:CMBC:5559 +1970-01-01 open Liabilities:JD:Baitiao -2021-11-17 * "京东金融" "京东小金库-转入" - category: "小金库" - merchantId: "100000000000000000000027" - method: "银行卡" - orderId: "2000000000000079" - payTime: "2021-11-17 23:06:50 +0800 CST" - source: "京东金融" +2024-12-05 * "京东平台商户" "奥科美(AOKO)U.2硬盘底座NVMe协议U2固态硬盘盒企业级u.2转USB3.2硬盘转接器 2.5/3.5英寸SATA机械硬盘通用 U3S" + category: "电脑办公" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-05 22:49:55 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Electronics 235.61 CNY + Liabilities:CC:BoC:1341 -235.61 CNY + +2024-12-09 * "京东平台商户" "京东京造山地自行车越客MX1成人学生山地车禧玛诺21速黑色(身高160-180) 等多件" + category: "运动户外" + merchantId: "1000345234234223" + method: "交通银行信用卡(0354)" + orderId: "100000011234" + payTime: "2024-12-09 23:22:23 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Sports 657.21 CNY + Liabilities:CC:BCM:0354 -657.21 CNY + +2024-12-10 * "京东平台商户" "海康威视(HIKVISION)64GB USB3.2U盘大容量 S303金属银色 读速150MB/s 高速移动u盘 华为小米电脑商务办公学习通用优盘" + category: "电脑办公" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-10 18:37:24 +0800 CST" + source: "京东平台商户" status: "交易成功" + type: "支出" + Expenses:Electronics 20.61 CNY + Liabilities:CC:BoC:1341 -20.61 CNY + +2024-12-10 * "京东平台商户" "李宁(LI-NING)羽毛球手胶 防滑耐磨光面薄款吸汗带 网球鱼竿耐用柄皮缠绕带 吸汗手胶GP3000黄色(60条装) 等多件" + category: "运动户外" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-10 23:40:50 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Sports 416.87 CNY + Liabilities:CC:BoC:1341 -416.87 CNY + +2024-12-10 * "京东平台商户" "退款-李宁(LI-NING)羽毛球手胶 防滑耐磨光面薄款吸汗带 网球鱼竿耐用柄皮缠绕带 吸汗手胶GP3000黄色(60条装)" + category: "网购" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-10 23:41:30 +0800 CST" + source: "京东平台商户" + status: "退款成功" type: "不计收支" - Assets:EPay:JD 2990.13 CNY - Assets:FIXME -2990.13 CNY + Liabilities:CC:BoC:1341 233.45 CNY + Income:Rebate -233.45 CNY -2021-12-11 * "亲密卡" "亲密卡" - category: "线下消费" - merchantId: "160000000000000000000006" - method: "京东白条" - payTime: "2021-12-11 23:51:52 +0800 CST" - source: "亲密卡" +2024-12-11 * "京东平台商户" "退款-奥科美(AOKO)U.2硬盘底座NVMe协议U2固态硬盘盒企业级u.2转USB3.2硬盘转接器 2.5/3.5英寸SATA机械硬盘通用 U3S" + category: "网购" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-11 10:38:58 +0800 CST" + source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Liabilities:CC:BoC:1341 235.50 CNY + Income:Rebate -235.50 CNY + +2024-12-14 * "京东物流" "京东物流" + category: "收发快递" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "JDX100000011234" + payTime: "2024-12-14 20:59:42 +0800 CST" + source: "京东物流" status: "交易成功" type: "支出" - Expenses:Prpaid 238.18 CNY - Liabilities:Baitiao -238.18 CNY + Expenses:Reside:Express 10.85 CNY + Liabilities:CC:BoC:1341 -10.85 CNY -2021-12-12 * "亲密卡" "亲密卡" - category: "线下消费" - merchantId: "100000000000000000000045" - method: "京东白条" - payTime: "2021-12-12 19:06:00 +0800 CST" - source: "亲密卡" +2024-12-16 * "京东物流" "京东物流" + category: "收发快递" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "JDX100000011234" + payTime: "2024-12-16 21:42:33 +0800 CST" + source: "京东物流" status: "交易成功" type: "支出" - Expenses:Prpaid 53.00 CNY - Liabilities:Baitiao -53.00 CNY + Expenses:Reside:Express 40.00 CNY + Liabilities:CC:BoC:1341 -40.00 CNY -2021-12-15 * "京东金融" "白条主动还款" - category: "白条" - merchantId: "107500000000000000000058" - method: "小金库零用钱" - orderId: "2000000000000000000" - payTime: "2021-12-15 12:09:23 +0800 CST" - source: "京东金融" +2024-12-18 * "京东平台商户" "云南正宗大果王青皮大丑橘当季新鲜柑橘大果无籽孕妇喜爱酸甜 5斤 70mm以上" + category: "食品酒饮" + merchantId: "1000345234234223" + method: "微信-招商银行信用卡" + orderId: "100000011234" + payTime: "2024-12-18 21:32:13 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Food:Snacks 14.99 CNY + Assets:FIXME -14.99 CNY + +2024-12-19 * "京东物流" "京东外部商户" + category: "收发快递" + merchantId: "1000345234234223" + method: "钱包余额" + orderId: "JDX100000011234" + payTime: "2024-12-19 18:10:42 +0800 CST" + source: "京东物流" + status: "交易成功" + type: "支出" + Expenses:Reside:Express 13.00 CNY + Assets:JD:Balance -13.00 CNY + +2024-12-21 * "京东平台商户" "志高(CHIGO)热水袋暖水袋 充电暖手宝暖宝宝 智能防爆 双插手亲肤绒 天空青蓝" + category: "先享后付" + merchantId: "1000345234234223" + method: "先享后付" + orderId: "100000011234" + payTime: "2024-12-21 13:40:59 +0800 CST" + source: "京东平台商户" status: "交易成功" type: "不计收支" - Liabilities:Baitiao 1125.43 CNY - Assets:EPay:JD -1125.43 CNY + Expenses:FIXME 35.61 CNY + Assets:FIXME -35.61 CNY + +2024-12-21 * "京东平台商户" "京东京造暖星智能双人电热毯 自动断电双温双控定时除螨电褥子1.5x1.8m" + category: "其他网购" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-21 21:02:03 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Groceries 68.19 CNY + Liabilities:CC:BoC:1875 -68.19 CNY -2021-12-15 * "京东平台商户" "退款-freeplus洁面乳150ml" +2024-12-24 * "京东平台商户" "拓路者(Pioneer Camp)男裤子秋冬季舒适透气徒步裤男士加绒防水户外长裤冬季保暖软壳裤 丛林绿 XL 等多件" + category: "服饰内衣 运动户外" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-24 22:33:07 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "不计收支" + Expenses:Clothes 468.32 CNY + Liabilities:CC:BoC:1875 -468.32 CNY + +2024-12-24 * "京东平台商户" "退款-拓路者(Pioneer Camp)男裤子秋冬季舒适透气徒步裤男士加绒防水户外长裤冬季保暖软壳裤 丛林绿 XL等多件" category: "网购" - merchantId: "2000000000000000954" - method: "京东白条" - orderId: "88438843884" - payTime: "2021-12-15 18:35:00 +0800 CST" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-24 22:33:54 +0800 CST" + source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Liabilities:CC:BoC:1875 397.84 CNY + Income:Rebate -397.84 CNY + +2024-12-24 * "京东平台商户" "退款-痞帅翻领青年男士高品质夹克休闲百搭男款工装外套2024潮流上衣 灰色 XL" + category: "网购" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-24 22:34:05 +0800 CST" + source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Liabilities:CC:BoC:1875 70.48 CNY + Income:Rebate -70.48 CNY + +2024-12-24 * "京东平台商户" "拓路者(Pioneer Camp)藏狼软壳裤男秋冬户外登山裤防风男士休闲长裤子冬季加绒保暖直筒 灰色 XL 等多件" + category: "服饰内衣 运动户外" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-24 22:43:08 +0800 CST" source: "京东平台商户" status: "交易成功" - type: "收入" - Liabilities:Baitiao 112.98 CNY - Assets:FIXME -112.98 CNY + type: "支出" + Expenses:Clothes 448.32 CNY + Liabilities:CC:BoC:1875 -448.32 CNY -2021-12-15 * "京东平台商户" "退款-freeplus洁面乳150ml" +2024-12-24 * "京东平台商户" "退款-痞帅翻领青年男士高品质夹克休闲百搭男款工装外套2024潮流上衣 灰色 XL" category: "网购" - merchantId: "2000000000000000000" - method: "京东白条" - orderId: "88438843884" - payTime: "2021-12-15 19:29:00 +0800 CST" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-24 22:43:31 +0800 CST" source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Liabilities:CC:BoC:1875 70.48 CNY + Income:Rebate -70.48 CNY + +2024-12-24 * "一号店" "一号店消费" + category: "1号店" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-24 23:19:44 +0800 CST" + source: "一号店" status: "交易成功" - type: "收入" - Liabilities:Baitiao 1.00 CNY - Assets:FIXME -1.00 CNY + type: "支出" + Expenses:Groceries 119.66 CNY + Liabilities:CC:BoC:1341 -119.66 CNY -2021-12-15 * "Food" "Food" - category: "食品酒饮" - merchantId: "110000000000000000000000" - method: "京东白条" - orderId: "200000000014" - payTime: "2021-12-15 19:35:14 +0800 CST" - source: "Food" +2024-12-26 * "京东平台商户" "京东京造【抑菌袜】5双新疆棉秋冬加厚吸汗男休闲袜男商务袜中筒袜透气" + category: "服饰内衣" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-26 18:03:01 +0800 CST" + source: "京东平台商户" status: "交易成功" type: "支出" - Expenses:FIXME 79.88 CNY - Liabilities:Baitiao -79.88 CNY + Expenses:Clothes 19.72 CNY + Liabilities:CC:BoC:1341 -19.72 CNY + +2024-12-26 * "京鲜生" "京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果" + category: "先享后付" + merchantId: "1000345234234223" + method: "先享后付" + orderId: "100000011234" + payTime: "2024-12-26 22:35:50 +0800 CST" + source: "京鲜生" + status: "交易成功" + type: "不计收支" + Expenses:FIXME 0.00 CNY + Assets:FIXME -0.00 CNY -2021-12-16 * "京东平台商户" "退款-freeplus洁面乳150ml" +2024-12-26 * "京东平台商户" "退款-京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果" category: "网购" - merchantId: "1000000000000000000" - method: "京东白条" - orderId: "88438843884" - payTime: "2021-12-16 08:22:00 +0800 CST" + merchantId: "1000345234234223" + method: "先享后付" + orderId: "100000011234" + payTime: "2024-12-26 22:36:09 +0800 CST" source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Assets:FIXME 0.00 CNY + Income:Rebate -0.00 CNY + +2024-12-26 * "京鲜生" "京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果" + category: "食品酒饮" + merchantId: "1000345234234223" + method: "中国银行信用卡(1341)" + orderId: "100000011234" + payTime: "2024-12-26 22:36:40 +0800 CST" + source: "京鲜生" status: "交易成功" - type: "收入" - Liabilities:Baitiao 1.00 CNY - Assets:FIXME -1.00 CNY + type: "支出" + Expenses:Food:Snacks 9.80 CNY + Liabilities:CC:BoC:1341 -9.80 CNY -2021-12-18 * "京东平台商户" "freeplus洁面乳150ml" - category: "美妆个护" - merchantId: "100000000000000000000002" - method: "京东白条" - orderId: "88438843884" - payTime: "2021-12-18 19:45:25 +0800 CST" - source: "京东平台商户" +2024-12-28 * "JEEP" "JEEP SPIRIT吉普卫衣男韩版圆领宽松男士卫衣百搭长袖打底衫 深蓝加绒 XL 等多件" + category: "食品酒饮 服饰内衣" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-28 13:27:56 +0800 CST" + source: "JEEP" status: "交易成功" type: "支出" - Expenses:MakeUp 223.99 CNY - Liabilities:Baitiao -223.99 CNY + Expenses:Clothes 131.77 CNY + Liabilities:CC:BoC:1875 -131.77 CNY -2021-12-23 * "Members" "Members Mark 泰国进口 椰子水 1L*6支 椰子汁饮料" +2024-12-28 * "京东平台商户" "退款-JEEP SPIRIT吉普卫衣男韩版圆领宽松男士卫衣百搭长袖打底衫 深蓝加绒 XL" + category: "网购" + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-28 13:28:32 +0800 CST" + source: "京东平台商户" + status: "退款成功" + type: "不计收支" + Liabilities:CC:BoC:1875 89.84 CNY + Income:Rebate -89.84 CNY + +2024-12-30 * "京东平台商户" "利园潮汕正宗手打牛肉丸火锅丸子牛筋丸火锅丸料烧烤麻辣烫关东煮丸子 潮汕牛筋丸 250g 等多件" category: "食品酒饮" - merchantId: "110000000000000000000044" - method: "京东白条" - orderId: "234906303557" - payTime: "2021-12-23 12:04:37 +0800 CST" - source: "Members" - status: "交易成功" - type: "支出" - Expenses:Food 91.42 CNY - Liabilities:Baitiao -91.42 CNY - -2021-12-28 * "京东小金库" "京东小金库收益" - category: "小金库" - merchantId: "29999999999999999992" - method: "小金库零用钱" - orderId: "20000000000000000002" - payTime: "2021-12-28 12:14:38 +0800 CST" - source: "京东小金库" - status: "交易成功" - type: "收入" - Assets:EPay:JD 0.01 CNY - Income:PnL:JD -0.01 CNY - -2021-12-29 * "京东小金库" "京东小金库收益" - category: "小金库" - merchantId: "20000000000000000002" - method: "小金库零用钱" - orderId: "20000000000000000022" - payTime: "2021-12-29 06:37:20 +0800 CST" - source: "京东小金库" - status: "交易成功" - type: "收入" - Assets:EPay:JD 0.01 CNY - Income:PnL:JD -0.01 CNY - -2023-12-08 * "京东云余额充值预付款网银账户" "PLUS京典年卡(先享后付)" - category: "其他" - merchantId: "700000000000000" - method: "京东白条" - orderId: "700000000000008" - payTime: "2023-12-08 00:14:40 +0800 CST" - source: "京东云余额充值预付款网银账户" - status: "交易成功" - type: "支出" - Expenses:FIXME 99.00 CNY - Liabilities:Baitiao -99.00 CNY + merchantId: "1000345234234223" + method: "中国银行信用卡(1875)" + orderId: "100000011234" + payTime: "2024-12-30 10:40:22 +0800 CST" + source: "京东平台商户" + status: "交易成功" + type: "支出" + Expenses:Food:Snacks 60.90 CNY + Liabilities:CC:BoC:1875 -60.90 CNY + +2024-12-30 * "京东物流" "京东外部商户" + category: "收发快递" + merchantId: "1000345234234223" + method: "钱包余额" + orderId: "JDX100000011234" + payTime: "2024-12-30 17:16:02 +0800 CST" + source: "京东物流" + status: "交易成功" + type: "支出" + Expenses:Reside:Express 10.20 CNY + Assets:JD:Balance -10.20 CNY diff --git a/example/jd/example-jd-records.csv b/example/jd/example-jd-records.csv index 80dd315..ad384ac 100644 --- a/example/jd/example-jd-records.csv +++ b/example/jd/example-jd-records.csv @@ -1,37 +1,48 @@ -导出信息: -京东账号名:jd_whatthefuck -起始时间:2021-01-01 终止时间:2021-12-30 +导出信息: +京东账号名:jd_55370d18d5bb4 +申请时间:2025-01-01 11:32:42 +日期区间:2024-12-01 至 2024-12-31 导出交易类型:全部 -导出时间:2023-03-03 23:33:33 -共:212笔记录 -收入:31笔,15595.04元 -支出:154笔,60735.99元 -不计收支:27笔,69300.12元 +导出交易场景:全部 +共:26笔记录 +收入:0笔,0.00元 +支出:16笔(含4笔部分退款),1648.43元 +不计收支:10笔,1097.59元 -特别提示: -1.本明细与实际交易结果不符时,以实际交易情况为准; -2.京东快捷支付等非余额支付方式可能既产生京东交易也同步产生银行交易,因此请勿使用本回单进行重复记账; -3.明细如经任何涂改、编造,均立即失去效力; -4.部分账单如:个人资金互转等不计入为收入或者支出,记为不计收支类; -5.因统计逻辑不同,明细金额直接累加后,可能会和下方统计金额不一致,请以实际交易金额为准; -6.禁止将本回单用于非法用途; -7.本明细仅展示当前账单中的交易,不包括已删除的记录; +特别提示 +1.本明细为每笔订单支付的明细,不包括已删除的记录;如需计算白条相关费用明细,请访问“白条-查账还款”进行查看; +2.个人资金互转、全额退款等记为【不计收支】类,部分退款的支出金额为剔除退款后的支付金额; +3.因系统原因或通讯故障等偶发因素导致本明细与实际交易结果不符时,以实际交易情况为准; +4.因统计逻辑不同,明细金额直接累加后,可能会和上方统计金额不一致,请以实际交易金额为准; +5.京东快捷支付等非余额支付方式可能既产生京东交易也同步产生银行交易,因此请勿使用本回单进行重复记账; +6.明细如经任何涂改、编造,均立即失去效力; +7.禁止将本回单用于非法用途; 8.本明细仅供个人对账使用。 -电子回单客户 -交易时间,交易分类,商户名称,交易说明,收/支,金额,收/付款方式,交易状态,交易订单号,商家订单号,备注 -2023-12-08 00:15:08 ,其他,京东云余额充值预付款网银账户,解冻-PLUS京典年卡(先享后付),不计收支,0.00,京东白条,交易成功,700000000000000_1 ,700000000000000_1 , -2023-12-08 00:14:40 ,其他,京东云余额充值预付款网银账户,PLUS京典年卡(先享后付),支出,99.00,京东白条,交易成功,700000000000008 ,700000000000000 , -2022-12-04 23:29:31 ,其他,null,冻结-PLUS京典年卡(先享后付),不计收支,99.00,京东白条,交易成功,700000000000007 ,700000000000007 , -2021-12-29 06:37:20 ,小金库,京东小金库,京东小金库收益,收入,0.01,小金库零用钱,交易成功,20000000000000000022 ,20000000000000000002 , -2021-12-28 12:14:38 ,小金库,京东小金库,京东小金库收益,收入,0.01,小金库零用钱,交易成功,20000000000000000002 ,29999999999999999992 , -2021-12-23 12:04:37 ,食品酒饮,京东平台商户,Members Mark 泰国进口 椰子水 1L*6支 椰子汁饮料,支出,91.42,京东白条,交易成功,234906303557 ,110000000000000000000044 , -2021-12-18 19:45:25 ,美妆个护,京东平台商户,freeplus洁面乳150ml,支出,223.99,京东白条,交易成功,88438843884 ,100000000000000000000002 , -2021-12-16 08:22:00 ,网购,京东平台商户,退款-freeplus洁面乳150ml,收入,1.00,京东白条,交易成功,88438843884 ,1000000000000000000 , -2021-12-12 19:06:00 ,线下消费,京东平台商户,亲密卡,支出,53.00,京东白条,交易成功, ,100000000000000000000045 , -2021-12-15 12:09:23 ,白条,京东金融,白条主动还款,不计收支,1125.43,小金库零用钱,交易成功,2000000000000000000 ,107500000000000000000058 , -2021-12-11 23:51:52 ,线下消费,京东平台商户,亲密卡,支出,238.18,京东白条,交易成功, ,160000000000000000000006 , -2021-12-15 19:35:14 ,食品酒饮,京东平台商户,Food,支出,79.88,京东白条,交易成功,200000000014 ,110000000000000000000000 , -2021-12-15 19:29:00 ,网购,京东平台商户,退款-freeplus洁面乳150ml,收入,1.00,京东白条,交易成功,88438843884 ,2000000000000000000 , -2021-12-15 18:35:00 ,网购,京东平台商户,退款-freeplus洁面乳150ml,收入,112.98,京东白条,交易成功,88438843884 ,2000000000000000954 , -2021-11-17 23:06:50 ,小金库,京东金融,京东小金库-转入,不计收支,2990.13,银行卡,交易成功,2000000000000079 ,100000000000000000000027 , \ No newline at end of file +交易时间,商户名称,交易说明,金额,收/付款方式,交易状态,收/支,交易分类,交易订单号,商家订单号,备注 +2024-12-30 17:16:02 ,京东物流,京东外部商户,10.20,钱包余额,交易成功,支出,收发快递,JDX100000011234 ,1000345234234223 , , +2024-12-30 10:40:22 ,京东平台商户,利园潮汕正宗手打牛肉丸火锅丸子牛筋丸火锅丸料烧烤麻辣烫关东煮丸子 潮汕牛筋丸 250g 等多件,60.90,中国银行信用卡(1875),交易成功,支出,食品酒饮,100000011234 ,1000345234234223 , , +2024-12-28 13:28:32 ,京东平台商户,退款-JEEP SPIRIT吉普卫衣男韩版圆领宽松男士卫衣百搭长袖打底衫 深蓝加绒 XL,89.84,中国银行信用卡(1875),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-28 13:27:56 ,京东平台商户,JEEP SPIRIT吉普卫衣男韩版圆领宽松男士卫衣百搭长袖打底衫 深蓝加绒 XL 等多件,131.77(已退款89.84),中国银行信用卡(1875),交易成功,支出,食品酒饮 服饰内衣,100000011234 ,1000345234234223 , , +2024-12-26 22:36:40 ,京东平台商户,京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果,9.80,中国银行信用卡(1341),交易成功,支出,食品酒饮,100000011234 ,1000345234234223 , , +2024-12-26 22:36:09 ,京东平台商户,退款-京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果,0.00,先享后付,退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-26 22:35:50 ,京东平台商户,京鲜生 红肉蜜柚 2粒 单果1.5-2.5斤 生鲜水果,0.00,先享后付,交易成功,不计收支,先享后付,100000011234 ,1000345234234223 , , +2024-12-26 18:03:01 ,京东平台商户,京东京造【抑菌袜】5双新疆棉秋冬加厚吸汗男休闲袜男商务袜中筒袜透气,19.72,中国银行信用卡(1341),交易成功,支出,服饰内衣,100000011234 ,1000345234234223 , , +2024-12-24 23:19:44 ,一号店,一号店消费,119.66,中国银行信用卡(1341),交易成功,支出,1号店,100000011234 ,1000345234234223 , , +2024-12-24 22:43:31 ,京东平台商户,退款-痞帅翻领青年男士高品质夹克休闲百搭男款工装外套2024潮流上衣 灰色 XL,70.48,中国银行信用卡(1875),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-24 22:43:08 ,京东平台商户,拓路者(Pioneer Camp)藏狼软壳裤男秋冬户外登山裤防风男士休闲长裤子冬季加绒保暖直筒 灰色 XL 等多件,448.32(已退款70.48),中国银行信用卡(1875),交易成功,支出,服饰内衣 运动户外,100000011234 ,1000345234234223 , , +2024-12-24 22:34:05 ,京东平台商户,退款-痞帅翻领青年男士高品质夹克休闲百搭男款工装外套2024潮流上衣 灰色 XL,70.48,中国银行信用卡(1875),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-24 22:33:54 ,京东平台商户,退款-拓路者(Pioneer Camp)男裤子秋冬季舒适透气徒步裤男士加绒防水户外长裤冬季保暖软壳裤 丛林绿 XL等多件,397.84,中国银行信用卡(1875),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-24 22:33:07 ,京东平台商户,拓路者(Pioneer Camp)男裤子秋冬季舒适透气徒步裤男士加绒防水户外长裤冬季保暖软壳裤 丛林绿 XL 等多件,468.32(已全额退款),中国银行信用卡(1875),交易成功,不计收支,服饰内衣 运动户外,100000011234 ,1000345234234223 , , +2024-12-21 21:02:03 ,京东平台商户,京东京造暖星智能双人电热毯 自动断电双温双控定时除螨电褥子1.5x1.8m,68.19,中国银行信用卡(1875),交易成功,支出,其他网购,100000011234 ,1000345234234223 , , +2024-12-21 13:40:59 ,京东平台商户,志高(CHIGO)热水袋暖水袋 充电暖手宝暖宝宝 智能防爆 双插手亲肤绒 天空青蓝,35.61,先享后付,交易成功,不计收支,先享后付,100000011234 ,1000345234234223 , , +2024-12-19 18:10:42 ,京东物流,京东外部商户,13.00,钱包余额,交易成功,支出,收发快递,JDX100000011234 ,1000345234234223 , , +2024-12-18 21:32:13 ,京东平台商户,云南正宗大果王青皮大丑橘当季新鲜柑橘大果无籽孕妇喜爱酸甜 5斤 70mm以上,14.99,微信-招商银行信用卡,交易成功,支出,食品酒饮,100000011234 ,1000345234234223 , , +2024-12-16 21:42:33 ,京东物流,京东物流,40.00,中国银行信用卡(1341),交易成功,支出,收发快递,JDX100000011234 ,1000345234234223 , , +2024-12-14 20:59:42 ,京东物流,京东物流,10.85,中国银行信用卡(1341),交易成功,支出,收发快递,JDX100000011234 ,1000345234234223 , , +2024-12-11 10:38:58 ,京东平台商户,退款-奥科美(AOKO)U.2硬盘底座NVMe协议U2固态硬盘盒企业级u.2转USB3.2硬盘转接器 2.5/3.5英寸SATA机械硬盘通用 U3S,235.50,中国银行信用卡(1341),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-10 23:41:30 ,京东平台商户,退款-李宁(LI-NING)羽毛球手胶 防滑耐磨光面薄款吸汗带 网球鱼竿耐用柄皮缠绕带 吸汗手胶GP3000黄色(60条装),233.45,中国银行信用卡(1341),退款成功,不计收支,网购,100000011234 ,1000345234234223 , , +2024-12-10 23:40:50 ,京东平台商户,李宁(LI-NING)羽毛球手胶 防滑耐磨光面薄款吸汗带 网球鱼竿耐用柄皮缠绕带 吸汗手胶GP3000黄色(60条装) 等多件,416.87(已退款233.45),中国银行信用卡(1341),交易成功,支出,运动户外,100000011234 ,1000345234234223 , , +2024-12-10 18:37:24 ,京东平台商户,海康威视(HIKVISION)64GB USB3.2U盘大容量 S303金属银色 读速150MB/s 高速移动u盘 华为小米电脑商务办公学习通用优盘,20.61,中国银行信用卡(1341),交易成功,支出,电脑办公,100000011234 ,1000345234234223 , , +2024-12-09 23:22:23 ,京东平台商户,京东京造山地自行车越客MX1成人学生山地车禧玛诺21速黑色(身高160-180) 等多件,657.21,交通银行信用卡(0354),交易成功,支出,运动户外,100000011234 ,1000345234234223 , , +2024-12-05 22:49:55 ,京东平台商户,奥科美(AOKO)U.2硬盘底座NVMe协议U2固态硬盘盒企业级u.2转USB3.2硬盘转接器 2.5/3.5英寸SATA机械硬盘通用 U3S,235.61(已退款235.50),中国银行信用卡(1341),交易成功,支出,电脑办公,100000011234 ,1000345234234223 , , From 4442525b7945e019a872538801dbb60639b8e16a Mon Sep 17 00:00:00 2001 From: zwyyy Date: Wed, 1 Jan 2025 13:48:40 +0800 Subject: [PATCH 4/4] fix(readme): typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 218aba2..10b458e 100644 --- a/README.md +++ b/README.md @@ -883,7 +883,7 @@ BMO账单中的记账金额中存在收入/支出之分,通过这个机制就
- BMO银行配置文件示例 + 京东配置文件示例 ```yaml