postings with just a balance assertion but no amount should work [$10 awarded] #157

Closed
simonmichael opened this Issue Jan 12, 2014 · 8 comments

Projects

None yet

3 participants

@simonmichael
Owner
simonmichael commented Jan 12, 2014 edited

Ledger allows assertions to be made without writing the amount explicitly before the =, eg:

  acct        = 1

but hledger requires the amount, which can be tedious:

  acct     0 = 1


The $10 bounty on this issue has been claimed at Bountysource.

@simonmichael simonmichael added the journal label May 5, 2014
@simonmichael simonmichael added this to the 1.0 milestone Sep 2, 2015
@simonmichael
Owner

I have some work in progress for this. It's rather tricky to implement generally, eg if you want to allow for out of order transactions and postings with arbitrary posting dates. (Inferring amounts from assertions requires knowing the account balance at this point in time, which requires that all previous transactions and any previously-dated postings or transactions we've not yet parsed have been fully inferred.. which might require inferring asserted amounts for postings on other accounts, starting a whole new round of processing which might eg involve the transaction we already trying to balance and seems potentially unsolvable in some cases..)

@simonmichael simonmichael modified the milestone: post 1.0 Oct 31, 2016
@ony
Collaborator
ony commented Dec 4, 2016

I don't think you need to have all previously-dated postings fully inferred. Actual numbers only required when you make a report.
Back in past I considered Journal to be a Monoid that can be combined. I.e. Transaction can be wrapped as a Journal and be combined with other one to form a new value. Journal in one of aggregated form/projection represents a changes in balances of multiple accounts. Part of accounts will get their values independently from input balances and thus may be calculated during mappend of Journal's.
I.e. in balance reports some accounts will have exact values, some may be represented as an offsets and all others will be unknown (equivalent of zero offset but without any associated transaction).

P.S. I do actively use approach with balance reset. Though there is only one use case that have no work around.
When I track my budget I often do it not so precisely. Periodically I simply check balance for cash or write down bank account balance notification. To do that I use something like this:

2016/12/04
    Assets:Cash:Wallet  =$40
    Equity:Unbalanced

If Equity:Unbalanced is pretty high that means that I need to change my behavior to write down my expenses more precisely to be able to understand them. But sometimes I may find out where did my money gone. And I simply put transaction in the middle of journal.


2016/12/01
    Assets:Cash:Wallet  -$120
    Expenses:Clothes

2016/12/04 balance reset
    Assets:Cash:Wallet  =$40
    Equity:Unbalanced

That's pretty useful that I don't need to change "balance reset" transaction up to the moment when it isn't required anymore. I.e. when I figure out all my expenses that resulted in particular balance ledger reports about transaction with no balancing.

In past I used GNU Cash but I really missed this functionality that times. Now when ledger gets not so much attention and often gives me segfaults I want to switch to hledger. Unfortunately this feature is missing here.

@simonmichael
Owner

That's exactly my use case too. (I use expenses:misc instead of equity:unbalanced.) Being forced to write and update the posting amount is slightly tedious, though it has the benefit of explicitness - you can see exactly what happened as you read the journal.

What you said above was interesting, but I don't quite see how it simplifies the problem. Don't our balance assertions require a fully specified absolute balance, by definition ?

@simonmichael simonmichael referenced this issue in bountysource/core Dec 4, 2016
Closed

issue not updated when bounty added #1067

@simonmichael simonmichael changed the title from postings with just a balance assertion but no amount should work to postings with just a balance assertion but no amount should work [$10] Dec 4, 2016
@simonmichael simonmichael added the bounty label Dec 4, 2016
@johannesgerer
Contributor

This is fixed by #438 ;-)

@simonmichael
Owner

I forgot there was a bounty on this (because of #427). @johannesgerer, don't forget to mark it complete so I can pay. :-)

@johannesgerer
Contributor

@simonmichael Where?
I am donating this back to hledger. Keep up the good work!!!

@simonmichael
Owner

I think you should see a button at https://www.bountysource.com/issues/5973215-postings-with-just-a-balance-assertion-but-no-amount-should-work?utm_campaign=plugin&utm_content=tracker%2F536505&utm_medium=issues&utm_source=github

I'm able to fund some bounties from donations now, which is cool. Thanks for yours! I think BountySource will let you donate it after you claim it.

@simonmichael
Owner

Oh I probably have to close this too. Done.

@simonmichael simonmichael changed the title from postings with just a balance assertion but no amount should work [$10] to postings with just a balance assertion but no amount should work [$10 awarded] Dec 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment