diff --git a/example/wechat/example-wechat-output.beancount b/example/wechat/example-wechat-output.beancount index 97c9281..b5ab792 100644 --- a/example/wechat/example-wechat-output.beancount +++ b/example/wechat/example-wechat-output.beancount @@ -264,3 +264,15 @@ option "operating_currency" "CNY" Expenses:Wechat:Sponsor 36.99 CNY Assets:Digital:Wechat:Cash -36.99 CNY +2023-06-23 * "赞赏作者的收款_20230623" "/" + merchantId: "10101008588132306239222222222222" + method: "/" + orderId: "180000737623062310106004541373333333333333333" + payTime: "2023-06-23 11:01:51 +0800 CST" + source: "微信支付" + status: "已到账" + txType: "其他" + type: "收入" + Assets:Digital:Wechat:Cash 5.00 CNY + Income:Wechat:RedPacket -5.00 CNY + diff --git a/example/wechat/example-wechat-output.ledger b/example/wechat/example-wechat-output.ledger index a83d449..ae7126c 100644 --- a/example/wechat/example-wechat-output.ledger +++ b/example/wechat/example-wechat-output.ledger @@ -263,3 +263,15 @@ Expenses:Wechat:Sponsor 36.99 CNY Assets:Digital:Wechat:Cash - 36.99 CNY +2023/06/23 * 赞赏作者的收款_20230623 - / + ; merchantId: "10101008588132306239222222222222" + ; method: "/" + ; orderId: "180000737623062310106004541373333333333333333" + ; payTime: "2023-06-23 11:01:51 +0800 CST" + ; source: "微信支付" + ; status: "已到账" + ; txType: "其他" + ; type: "收入" + Assets:Digital:Wechat:Cash 5.00 CNY + Income:Wechat:RedPacket - 5.00 CNY + diff --git a/example/wechat/example-wechat-records.csv b/example/wechat/example-wechat-records.csv index 82eb505..3317256 100644 --- a/example/wechat/example-wechat-records.csv +++ b/example/wechat/example-wechat-records.csv @@ -36,3 +36,4 @@ 2021-07-18 10:48:09,商户消费,打开拼多多,点击底部"多多视频","/",收入,¥0.07,/,充值成功,160572459521071810106004542906137497131422937 ,10101265586742107189275763431048 ,"/" 2022-07-18 10:48:09,商户消费,测试时间戳,点击底部"多多视频","/",收入,¥0.07,/,充值成功,160572459521071810106004542906137497131422938 ,10101265586742107189275763431049 ,"/" 2022-09-24 02:24:20,赞赏码,YingDev,"/",支出,¥36.99,零钱,朋友已收钱,100010810122092400064222561891707533 ,1000108101202209241820542253348 ,"/" +2023-06-23 11:01:51,其他,赞赏作者的收款_20230623,"/",收入,¥5.00,/,已到账,180000737623062310106004541373333333333333333 ,10101008588132306239222222222222 ,"赞赏作者的收款_20230623" diff --git a/pkg/provider/wechat/types.go b/pkg/provider/wechat/types.go index f936eb6..25dea23 100644 --- a/pkg/provider/wechat/types.go +++ b/pkg/provider/wechat/types.go @@ -67,5 +67,6 @@ const ( TxTypeCash2Others TxType = "零钱通转出" TxTypeFamilyCard TxType = "亲属卡交易" TxTypeSponsorCode TxType = "赞赏码" + TxTypeOther TxType = "其他" TxTypeUnknown TxType = "Unknown" ) diff --git a/pkg/provider/wechat/util.go b/pkg/provider/wechat/util.go index ade62cb..52ba952 100644 --- a/pkg/provider/wechat/util.go +++ b/pkg/provider/wechat/util.go @@ -50,6 +50,8 @@ func getTxType(tt string) TxType { return TxTypeFamilyCard } else if strings.Contains(tt, string(TxTypeSponsorCode)) { return TxTypeSponsorCode + } else if strings.Contains(tt, string(TxTypeOther)){ + return TxTypeOther } else { return TxTypeUnknown }