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

一个月出现复数次汇率变化后报错:账目不匹配 #82

Closed
mikumiku52099 opened this issue Jul 7, 2024 · 4 comments
Closed

Comments

@mikumiku52099
Copy link

基本报错信息:
/data/beancount/364dcf1d38a5de6a98030f449d62a129b298d81d/month/2024-06.bean:307: No position matches "Posting(account='Liabilities:Life:中国银行信用卡', units=3.19 USD, cost=CostSpec(number_per=Decimal('7.2789'), number_total=None, currency='CNY', date=None, label=None, merge=False), price=None, flag=None, meta={'filename': '/data/beancount/364dcf1d38a5de6a98030f449d62a129b298d81d/month/2024-06.bean', 'lineno': 310})" against balance (-3.19 USD {7.242 CNY, 2024-06-02})

经查询后发现,在6月出现两次外币交易,两次外币交易的汇率不一致,分别为7.2789和7.242,但是我一旦修改汇率,整月的汇率都会统一,从而导致 No position matches 错误

请问该如何解决报错?

@BaoXuebin
Copy link
Owner

2024-07-01 * "" "汇率验证1"
 Assets:Flow:Cash:现金 -2.00 USD {7.2789 CNY}
 Expenses:Life:Food:Fruit:水果 14.56 CNY


2024-07-08 * "" "汇率验证2"
 Assets:Flow:Cash:现金 -2.00 USD
 Expenses:Life:Food:Coffee:咖啡 2.00 CNY

你可以查看下账本的源文件,是类似这种吗,这个看上去应该是记录的时候,没有识别到 USD 的汇率信息。

你可以手动尝试修改为:

2024-07-08 * "" "汇率验证2"
 Assets:Flow:Cash:现金 -2.00 USD {7.242 CNY}
 Expenses:Life:Food:Coffee:咖啡

@mikumiku52099
Copy link
Author

mikumiku52099 commented Jul 8, 2024

2
这是两次账目的情况。
这是报错的账目,应该是没有您说的那个情况。

@BaoXuebin
Copy link
Owner

这个可能是你相关的外币账户 Liabilities:Life:中国银行信用卡 或者 Expenses:Life:Subscribe:境外订阅、购物 设置了 FIFO 的换算方式。

image

删除这个 "FIFO" 试试

https://beancount.github.io/docs//how_inventories_work.html#fifo-and-lifo-booking

@mikumiku52099
Copy link
Author

您好,我删除了FIFO后依然出现报错
/data/beancount/364dcf1d38a5de6a98030f449d62a129b298d81d/month/2024-06.bean:327: No position matches "Posting(account='Liabilities:Life:中国银行信用卡', units=3.19 USD, cost=CostSpec(number_per=Decimal('7.2789'), number_total=None, currency='CNY', date=None, label=None, merge=False), price=None, flag=None, meta={'filename': '/data/beancount/364dcf1d38a5de6a98030f449d62a129b298d81d/month/2024-06.bean', 'lineno': 330})" against balance (-3.19 USD {7.2425 CNY, 2024-06-02})

2024-06-20 * "还信用卡"
Assets:Flow:美元 3.19 USD {7.2789 CNY}
Assets:Flow:中国银行 -23.22 CNY
Liabilities:Life:中国银行信用卡 3.19 USD {7.2789 CNY}
Assets:Flow:美元 -3.19 USD {7.2789 CNY}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants