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

关于 There is a mole, The tx is canceled. #44

Open
qninth opened this issue Dec 23, 2021 · 14 comments
Open

关于 There is a mole, The tx is canceled. #44

qninth opened this issue Dec 23, 2021 · 14 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@qninth
Copy link

qninth commented Dec 23, 2021

我在使用支付宝导入时,我参考这篇教程:

通常交易的directives是txn 但是因为这个是beancount里最常见的记录,因此允许用户省略 通常 * 表示交易数据无误,而!表示交易数据可能有错。

但是我观察到,即使是交易关闭的记录Flag仍然是 ”*“,请问是否可以在 There is a mole, The tx is canceled. 的过程中,把对应的记录设置为 ”!“ 呢?

@Triple-Z
Copy link
Member

/cc @gaocegege

@gaocegege gaocegege added the question Further information is requested label Dec 24, 2021
@gaocegege
Copy link
Member

SGTM, I think it is a great enhancement.

@Triple-Z
Copy link
Member

Triple-Z commented Dec 24, 2021

在支付宝的账单中,似乎当存在“交易关闭”的交易时,会同时有一笔对应“退款”的交易?

如果总是对应的话,是否不需要人工再次确认呢?

例子见此:

2021-06-01 * "dettol滴露官方旗舰店" "【直接下单付款】滴露消毒液1.2L*2家用杀菌消毒水衣物地板宠物"
Expenses:Groceries 109.90 CNY
Assets:Bank:CN:CMB-9876:Savings -109.90 CNY
category: "日用百货"
merchantId: "ABC9876"
method: "招商银行(9876)"
orderId: "123456"
payTime: "2021-06-01 00:10:22 +0800 CST"
source: "支付宝"
status: "交易关闭"
txType: "支出"
2021-06-01 * "dettol滴露官方旗舰店" "退款-【直接下单付款】滴露消毒液1.2L*2家用杀菌消毒水衣物地板宠物"
Assets:Bank:CN:CMB-9876:Savings 109.90 CNY
Expenses:Groceries -109.90 CNY
category: "退款"
merchantId: "ABC9876"
method: "招商银行(9876)"
orderId: "123456"
payTime: "2021-06-01 00:13:56 +0800 CST"
source: "支付宝"
status: "退款成功"
txType: "其他"

@CyrivlClth
Copy link

@Triple-Z 我确认了一下,并不是所有的交易关闭都有一个退款对应

@Triple-Z Triple-Z added enhancement New feature or request and removed question Further information is requested labels Feb 9, 2022
@shuxiao9058
Copy link
Contributor

另外,退款和支付可以Link起来。

@Triple-Z
Copy link
Member

另外,退款和支付可以Link起来。

好主意,但实现起来可能有点难度

@shuxiao9058
Copy link
Contributor

是有些困难,昨天尝试弄了下,发现微信商家帐单退款和支付没有关联性(微信自己的帐单可以关联,比如转帐对方完全退还的)。

@gaocegege gaocegege added the help wanted Extra attention is needed label Apr 17, 2022
@RangerNJU
Copy link

考虑到收入和退款可以一一对应,而交易关闭的时候实际上账目没有发生任何变化。是不是应该在“交易关闭”的情况下,在生成的部分直接加上注释或者不生成对应记录呢?

@Triple-Z
Copy link
Member

Triple-Z commented Oct 8, 2022

@RangerNJU #44 (comment)

应该是不一定对应的。

@tzwm
Copy link

tzwm commented Nov 14, 2022

@Triple-Z 我确认了一下,并不是所有的交易关闭都有一个退款对应

记录一下相关发现,我看淘宝订单如果是没付款的订单就只有 交易关闭 一笔记录,且这笔记录没有 method。如果是付款但又退款的订单就有两笔记录,正向和逆向各一笔,其中有一笔是 交易关闭,有 method 且两笔记录可以靠 merchantId 关联。

未付款的例子:

2022-10-25 * "德佑**店" "德佑乳霜柔纸巾婴儿保湿纸巾宝宝专用超柔抽纸新生儿云柔巾鼻子纸 等多件"
	category: "日用百货"
	merchantId: "T200P297334609308154xxxx"
	orderId: "202210252200119456143951xxxx"
	payTime: "2022-10-25 00:08:02 +0800 CST"
	source: "支付宝"
	status: "交易关闭"
	txType: "其他"
	Expenses:Grocery 24.90 CNY
	Assets:FIXME -24.90 CNY

付款又退款的例子:

2022-10-16 * "85度C(上海金杨店)" "85度C上海金杨店"
	category: "餐饮美食"
	merchantId: "20221016SH1020202808083409665"
	method: "中国银行信用卡(xxxx)"
	orderId: "2022101622001494561400498252"
	payTime: "2022-10-16 08:34:10 +0800 CST"
	source: "支付宝"
	status: "交易关闭"
	txType: "支出"
	Expenses:Food 60.00 CNY
	Liabilities:CreditCard:BOC:xxxx -60.00 CNY

2022-10-16 * "85度C(上海金杨店)" "退款-85度C上海金杨店"
	category: "退款"
	merchantId: "20221016SH1020202808083409665"
	method: "中国银行信用卡(xxxx)"
	orderId: "2022101622001494561400498252_21867563192813354361"
	payTime: "2022-10-16 08:34:40 +0800 CST"
	source: "支付宝"
	status: "退款成功"
	txType: "其他"
	Liabilities:CreditCard:BOC:xxxx 60.00 CNY
	Expenses:Food -60.00 CNY

@Triple-Z
Copy link
Member

如果是付款但又退款的订单就有两笔记录,正向和逆向各一笔,其中有一笔是 交易关闭,有 method 且两笔记录可以靠 merchantId 关联。

可惜的是 merchantedId 是商户的 ID,对于订单来说并不具有唯一性 🤣

@tzwm
Copy link

tzwm commented Nov 15, 2022

如果是付款但又退款的订单就有两笔记录,正向和逆向各一笔,其中有一笔是 交易关闭,有 method 且两笔记录可以靠 merchantId 关联。

可惜的是 merchantedId 是商户的 ID,对于订单来说并不具有唯一性 🤣

哦对,看的应该是 orderId 🙈。看了下支付宝的淘宝和线下订单,退款的 orderId 是在付款 orderId 基础上再拼接的一个,比如 2022101622001494561400498252_21867563192813354361

@wych42
Copy link
Contributor

wych42 commented Jan 27, 2023

如果是付款但又退款的订单就有两笔记录,正向和逆向各一笔,其中有一笔是 交易关闭,有 method 且两笔记录可以靠 merchantId 关联。

可惜的是 merchantedId 是商户的 ID,对于订单来说并不具有唯一性 🤣

哦对,看的应该是 orderId 🙈。看了下支付宝的淘宝和线下订单,退款的 orderId 是在付款 orderId 基础上再拼接的一个,比如 2022101622001494561400498252_21867563192813354361

付款但又退款的订单不一定是两笔记录,如果是多件商品合并付款(一个订单),这个订单全部退款时,可能会产生多笔退款交易。

@aur3l14no
Copy link
Contributor

付款但又退款的订单不一定是两笔记录,如果是多件商品合并付款(一个订单),这个订单全部退款时,可能会产生多笔退款交易。

可以给个例子吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants