Closed the-solipsist closed 2 years ago
Sometimes, instead of an incorrect auto-suggested default, instead there is no auto-suggested default.
For instance:
When iadd
detects that the currently entered transaction is an exact part of an older transaction, it keeps suggesting amounts from the older transaction. So in the first example, it could be that there's an older transaction where you also bought food for ₹25 at cafe da costa, but also other stuff for ₹75.
As for the second example, iadd
only suggests an empty amount when the transaction is currently balanced. It checks this via hledgers built-in function isTransactionBalanced
and it seems that the latter considers anything smaller than the display precision to be 0. @simonmichael, should I use something else?
I'm not sure what's going on, but maybe compare with hledger add as a reference ?
I'm not sure what's going on, but maybe compare with hledger add as a reference ?
hledger considers transactions balanced if the difference in amounts is smaller than the display precision. E.g. the following:
2021-12-22 Test
a 0,000000000000000000000000000000000000000000001€
This is inconvenient for iadd
users who want to actually balance the transaction but iadd
thinks it already is.
What exactly is the "display precision"? In a file include
d in my default journal, I have the following directive:
commodity XLM 100,000.0000001
Display precision is the number of decimal places inferred or configured to use for displaying a commodity - 7 for XLM in your example.
@hpdeifel, does the issue arise in hledger add
as well ? I'm assuming not, so maybe you could do whatever it does ?
Tested on hledger-add
, and that works as expected:
Interestingly, unlike hledger-iadd
, hledger-add
suggests the appropriate commodity symbol. So if I press \<tab>, I can auto-fill XLM 0.0000001
and then \<backspace> twice, and change that to XLM 0.0000025
.
Indeed, I'll take a look at hledger add
I've fixed the bug with empty amounts in commit 4eec0f80a510f16dc036b27a60089077909a2fe2.
@the-solipsist Your first point about non-empty but non-balancing amounts should be the intended behavior that I described in https://github.com/hpdeifel/hledger-iadd/issues/63#issuecomment-999714111. Can you confirm that that's actually what you're seeing?
Hi. Yes, I can confirm that it has taken the ₹-100.00
from a previous transaction, and I think this is reasonable behaviour. I'm closing this issue. Thanks for the fix in https://github.com/hpdeifel/hledger-iadd/commit/4eec0f80a510f16dc036b27a60089077909a2fe2.
Sometimes the default auto-suggestion for the remainder amount to balance a transaction is incorrect. I can't see a pattern as to when or why this happens, so can't really reproduce it.
Here's what it looks like:
Notice the
(₹-100.00)
instead of the expected(₹-25.00)