diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.js" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.js" index 4abbd656..b43f3e25 100644 --- "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.js" +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.js" @@ -154,15 +154,16 @@ const regexMap =[ }, ], [ - /退款金额¥(\d+\.\d{2})\n商品详情商户单号.*?\n商户名称(.*?)\n退款方式退回(.*?)\n到账时间(.*?)$/, + // 退款金额¥166.60\n商品详情美团订单-24052911100400001306304144901069\n商户名称美团\n退款方式退回支付卡(建设银行8254)\n退款原因[2406010080800792069]退交易\n到账时间2024-06-01 20:35:34", + /退款金额¥(\d+\.\d{2})\n商品详情(.*?)\n商户名称(.*?)\n退款方式退回(.*?)\n(退款原因.*?\n)?到账时间(.*?)$/, match => { - const [, money, shopName, accountNameFrom, time] = match; + const [, money,shopItem, shopName, accountNameFrom,, time] = match; return { "money": toFloat(money), "type": BillType.Income, "accountNameFrom": accountNameFrom, "shopName": shopName, //2024-05-25 11:21:52 - "shopItem": 'empty', + "shopItem": shopItem, "time": formatDate(time, 'Y-M-D h:i:s'), "channel": '微信[微信支付-退款]', }; diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.test.js" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.test.js" index b057fd10..1e553867 100644 --- "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.test.js" +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/main.test.js" @@ -405,13 +405,25 @@ test('微信支付退款', () => "money": 10.93, "fee": 0, "shopName": '拼多多平台商户', - "shopItem": '', + "shopItem": '商户单号XP1124052116500189874886000731', "accountNameFrom": '零钱', "accountNameTo": '', "currency": 'CNY', "time": formatDate('2024-05-25 11:21:52', 'Y-M-D h:i:s'), "channel": '微信[微信支付-退款]', }, + { + "type": "Income", + "money": 166.6, + "fee": 0, + "shopName": '美团', + "shopItem": '美团订单-24052911100400001306304144901069', + "accountNameFrom": '支付卡(建设银行8254)', + "accountNameTo": '', + "currency": 'CNY', + "time": formatDate('2024-06-01 20:35:34', 'Y-M-D h:i:s'), + "channel": '微信[微信支付-退款]', + }, ])); test('微信支付亲属卡扣款', () => testAnkio('微信支付亲属卡扣款', [ diff --git "a/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\351\200\200\346\254\2762.txt" "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\351\200\200\346\254\2762.txt" new file mode 100644 index 00000000..2e104f4f --- /dev/null +++ "b/src/rule/com.tencent.mm/app/\345\276\256\344\277\241\346\224\257\344\273\230/tests/\345\276\256\344\277\241\346\224\257\344\273\230\351\200\200\346\254\2762.txt" @@ -0,0 +1,14 @@ + { + "mMap": { + "description": "退款金额¥166.60\n商品详情美团订单-24052911100400001306304144901069\n商户名称美团\n退款方式退回支付卡(建设银行8254)\n退款原因[2406010080800792069]退交易\n到账时间2024-06-01 20:35:34", + "source": "微信支付", + "type": 5, + "appId": "", + "msgId": 99064, + "title": "退款到账通知", + "display_name": "", + "cachedPayTools": "工商银行储蓄卡(4508)", + "cachedPayMoney": "¥19.90", + "cachedPayShop": "付款给迷失(**会)" + } +} diff --git a/src/rule/tests.txt b/src/rule/tests.txt index 2a67f096..2e104f4f 100644 --- a/src/rule/tests.txt +++ b/src/rule/tests.txt @@ -1,14 +1,14 @@ { "mMap": { - "description": "收款金额¥1500.00\n收款店铺jyf\n顾客信息新顾客消费\n备注收款成功,已存入经营账户", + "description": "退款金额¥166.60\n商品详情美团订单-24052911100400001306304144901069\n商户名称美团\n退款方式退回支付卡(建设银行8254)\n退款原因[2406010080800792069]退交易\n到账时间2024-06-01 20:35:34", "source": "微信支付", "type": 5, "appId": "", "msgId": 99064, - "title": "微信支付收款1500.00元(新顾客消费)", - "display_name": "经营收款", - "cachedPayTools": "零钱", - "cachedPayMoney": "¥570.00", - "cachedPayShop": "向李丽丝(**丝)转账" + "title": "退款到账通知", + "display_name": "", + "cachedPayTools": "工商银行储蓄卡(4508)", + "cachedPayMoney": "¥19.90", + "cachedPayShop": "付款给迷失(**会)" } }