Refund with exchanges

10 views
Skip to first unread message

Guanpeng Xu

unread,
Mar 31, 2023, 12:08:22 PM3/31/23
to hledger
Hello,

I had an issue entering a refund with exchanges, and I was unsure if this was a bug.

So I had this earlier entry:

2023-03-29 * Midjourney
    expenses:telecommunications        96 USD @@ 659.75 CNY
    liabilities:credit-card:cmb:Apr             -659.75 CNY

But I decided to cancel the subscription and pay for a monthly subscription instead; therefore, I had to add this refund entry:

2023-03-29 * Midjourney Refund
    expenses:telecommunications                 -659.75 CNY
    liabilities:credit-card:cmb:Apr              659.75 CNY

That's because I tried the following one but got an unbalanced transaction error:

2023-03-29 * Midjourney Refund
    expenses:telecommunications      -96 USD @@ -659.75 CNY
    liabilities:credit-card:cmb:Apr              659.75 CNY

Is this an expected behavior?

Best regards,
Guanpeng Xu

Simon Michael

unread,
Mar 31, 2023, 10:49:52 PM3/31/23
to hledger
Hello,

Yes.. if you remove the minus sign from the final transaction's cost, things will work normally.


This can be confusing. It's discussed at https://hledger.org/hledger.html#costs -> "Signed costs and market prices can be confusing...". But should probably be mentioned at https://hledger.org/hledger.html#costs also.


Reply all
Reply to author
Forward
0 new messages