BaoXuebin / beancount-gs

基于 beancount 提供个人记账财务管理的 RESTful API 服务(包含前端页面)
https://www.yuque.com/chuyi-ble7p/beancount-gs
MIT License
317 stars 42 forks source link

在进行多币种记账时,出现报错无法入账的情况(当月汇率出现变化) #84

Closed mikumiku52099 closed 3 months ago

mikumiku52099 commented 3 months ago

删除了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}

BaoXuebin commented 3 months ago

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

你试试改成这样

2024-06-02 * "" "1"
 Expenses:Life:Subscribe:境外订阅 3.19 USD @ 7.242 CNY
 Liabilities:Life:中国银行信用卡 -3.19 USD @ 7.242 CNY

2024-06-20 * "" "2"
 Liabilities:Life:中国银行信用卡 3.19 USD @ 7.2789 CNY
 Assets:Flow:中国银行 -23.22 CNY
mikumiku52099 commented 3 months ago

/data/beancount/364dcf1d38a5de6a98030f449d62a129b298d81d/month/2024-06.bean:331: 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': 332})" against balance (-3.19 USD {7.2425 CNY, 2024-06-02})

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

然后就变成了这样😂