Re: Two questions about budgeting

2023-01-25 Thread Ihor Radchenko
Marcin Borkowski  writes:

>> I see. Why don't just use daily budget then?
>> The daily budget gets applied progressively, and I know how much I can
>> spend each day.
>
> That's what I wanted to do.  But since the daily budget apparently does
> not kick in on days when I spent nothing on e.g. food, this is of little
> use for me...  If my daily budget is 20 PLN and I spend nothing on
> a particular day, I expect to be "allowed" to spend 40 PLN on the next
> day.

Sorry, I think you missed my first reply.

Try

~ Daily from 2022
Expenses:Food  30.00 PLN
Assets

2022-01-02 Groceries
Expenses:Food  20.00 PLN
Assets:Cash

2022-01-03 C.S.Lewis "That hideous strength"
Expenses:Books 45.00 PLN
Assets:Cash

2022-01-03 Groceries
Expenses:Food  100.00 PLN
Assets:Cash


> ledger reg -f /tmp/test.dat ^expenses -b 2022-01-01 -e 2022-01-04 -y %Y-%m-%d 
> --invert --budget
2022-01-01 Budget transactionExpenses:Food  
30.00 PLN30.00 PLN
2022-01-02 Budget transactionExpenses:Food  
30.00 PLN60.00 PLN
2022-01-02 Groceries Expenses:Food  
   -20.00 PLN40.00 PLN
2022-01-03 Budget transactionExpenses:Food  
30.00 PLN70.00 PLN
2022-01-03 Groceries Expenses:Food  
  -100.00 PLN   -30.00 PLN

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87wn59kerr.fsf%40localhost.


Re: Two questions about budgeting

2023-01-25 Thread Marcin Borkowski


On 2023-01-25, at 21:14, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>>> But isn't it already the case? The balance with budget already provides
>>> this info.
>>
>> What it doesn't do (or at least I can't do it) is to tell me that
>> (sticking to the example above) my food budget /for Jan 25/ is ~484 PLN,
>> so if I already spent 480 PLN, I'm good.  Ledger can only tell me that
>> I can still spend 120 PLN /until the end of the month/, which is the
>> same mathematically -- but doing these calculations in your head is not
>> always easy.
>
> I see. Why don't just use daily budget then?
> The daily budget gets applied progressively, and I know how much I can
> spend each day.

That's what I wanted to do.  But since the daily budget apparently does
not kick in on days when I spent nothing on e.g. food, this is of little
use for me...  If my daily budget is 20 PLN and I spend nothing on
a particular day, I expect to be "allowed" to spend 40 PLN on the next
day.

Best,

-- 
Marcin Borkowski
http://mbork.pl

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87cz71onpl.fsf%40mbork.pl.


Re: Assertion failure in unistring

2023-01-25 Thread Martin Michlmayr
* John Wiegley  [2023-01-25 14:10]:
> TO> Hello! I've been hitting an assertion when experimenting with register
> TO> formats: $ ledger --file finance.dat reg -F '%12(total)' Error: Assertion
> TO> failed in "/build/ledger-SR1_DQ/ledger-3.1.3/src/unistring.h", line
> TO> 72:ledger::unistring::unistring(const string&): len < 1024
> 
> Hi Tavis, the example data in your message doesn't abort on my machine. Do you
> have a reproducible example I could use for debugging?

Did you run the command he mentioned:
ledger --file finance.dat reg -F '%12(total)'

It fails for me with ledger from Git:

Error: Assertion failed in "ledger/src/unistring.h", line 
72:ledger::unistring::unistring(const string&): len < 1024

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/Y9HYdj2r4Z99IErh%40jirafa.cyrius.com.


Re: Two questions about budgeting

2023-01-25 Thread Ihor Radchenko
Marcin Borkowski  writes:

>... Still, it looks like
> there's a bug with ~Daily~ periodic transactions: if I have a ~Daily~
> ~Food~ expense of 30 PLN, it is only counted towards my budget on days
> an actual ~Food~ expense was made.

I think that ~ Daily alone is ambiguous. When should it start? Infinite
years back? You need to specify at least "from" in addition. Otherwise,
what ledger does kind of makes sense - budget only when you actually
spend. Anything else would be insane.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87sffylp2u.fsf%40localhost.


Re: Two questions about budgeting

2023-01-25 Thread Ihor Radchenko
Marcin Borkowski  writes:

>> I think that ~ Daily alone is ambiguous. When should it start? Infinite
>> years back? You need to specify at least "from" in addition. Otherwise,
>> what ledger does kind of makes sense - budget only when you actually
>> spend. Anything else would be insane.
>
> Well, yes and no -- I took care to supply `--begin` in my Ledger
> invocation.

> By the way, is there a way to supply a starting date /in the Ledger file
> itself/?

I meant

~ Daily from 2023/01/01
Expenses:Food  ...
Assets:Checking

Not sure about global "from".

> Also, daily budget makes /a lot/ of practical sense.  If my monthly food
> budget is, say, 600 PLN, it's Jan 25 and I've spent 480 PLN on food,
> I can't immediately tell if I'm overspending or not.  For the record,
> I wrote myself a very simple web app which gets data from Ledger and
> displays my spending this month against budget computed /for today/ (so
> in the above case it would tell me that I'm ahead of my budget).

Yup, I totally agree that it is useful. I have such thing too :)
https://github.com/yantar92/emacs-config/blob/master/system-config.org#continuous-monitoring-of-budget
Displayed right at my status bar.

> It
> would be cool if Ledger could provide such information, too...

But isn't it already the case? The balance with budget already provides
this info.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/878rhqlcmd.fsf%40localhost.


Re: How to compute average monthly expenses?

2023-01-25 Thread Ihor Radchenko
Marcin Borkowski  writes:

>> Average just takes the number of entries in a group, and divides the total by
>> the count. Here's the implementation:

What about the last time group where the expenses may not yet represent
the value at the end of the month?

P.S. I am wondering why I am only seeing Marcin's emails.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/878rhs7486.fsf%40localhost.


Re: Two questions about budgeting

2023-01-25 Thread Ihor Radchenko
Marcin Borkowski  writes:

>> But isn't it already the case? The balance with budget already provides
>> this info.
>
> What it doesn't do (or at least I can't do it) is to tell me that
> (sticking to the example above) my food budget /for Jan 25/ is ~484 PLN,
> so if I already spent 480 PLN, I'm good.  Ledger can only tell me that
> I can still spend 120 PLN /until the end of the month/, which is the
> same mathematically -- but doing these calculations in your head is not
> always easy.

I see. Why don't just use daily budget then?
The daily budget gets applied progressively, and I know how much I can
spend each day.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87zga6jrr9.fsf%40localhost.


Re: Assertion failure in unistring

2023-01-25 Thread John Wiegley
> "TO" == Tavis Ormandy  writes:

TO> Hello! I've been hitting an assertion when experimenting with register
TO> formats: $ ledger --file finance.dat reg -F '%12(total)' Error: Assertion
TO> failed in "/build/ledger-SR1_DQ/ledger-3.1.3/src/unistring.h", line
TO> 72:ledger::unistring::unistring(const string&): len < 1024

Hi Tavis, the example data in your message doesn't abort on my machine. Do you
have a reproducible example I could use for debugging?

John

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/m2fsbyclkc.fsf%40Vulcan.attlocal.net.


Re: Two questions about budgeting

2023-01-25 Thread Marcin Borkowski


On 2023-01-25, at 18:58, Ihor Radchenko  wrote:

> I meant
>
> ~ Daily from 2023/01/01
> Expenses:Food  ...
> Assets:Checking
>
> Not sure about global "from".

Ah, I see.

>> Also, daily budget makes /a lot/ of practical sense.  If my monthly food
>> budget is, say, 600 PLN, it's Jan 25 and I've spent 480 PLN on food,
>> I can't immediately tell if I'm overspending or not.  For the record,
>> I wrote myself a very simple web app which gets data from Ledger and
>> displays my spending this month against budget computed /for today/ (so
>> in the above case it would tell me that I'm ahead of my budget).
>
> Yup, I totally agree that it is useful. I have such thing too :)
> https://github.com/yantar92/emacs-config/blob/master/system-config.org#continuous-monitoring-of-budget
> Displayed right at my status bar.
>
>> It
>> would be cool if Ledger could provide such information, too...
>
> But isn't it already the case? The balance with budget already provides
> this info.

What it doesn't do (or at least I can't do it) is to tell me that
(sticking to the example above) my food budget /for Jan 25/ is ~484 PLN,
so if I already spent 480 PLN, I'm good.  Ledger can only tell me that
I can still spend 120 PLN /until the end of the month/, which is the
same mathematically -- but doing these calculations in your head is not
always easy.

Best,

-- 
Marcin Borkowski
http://mbork.pl

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87h6weo0jw.fsf%40mbork.pl.


Re: Two questions about budgeting

2023-01-25 Thread Marcin Borkowski


On 2023-01-25, at 14:29, Ihor Radchenko  wrote:

> Marcin Borkowski  writes:
>
>>... Still, it looks like
>> there's a bug with ~Daily~ periodic transactions: if I have a ~Daily~
>> ~Food~ expense of 30 PLN, it is only counted towards my budget on days
>> an actual ~Food~ expense was made.
>
> I think that ~ Daily alone is ambiguous. When should it start? Infinite
> years back? You need to specify at least "from" in addition. Otherwise,
> what ledger does kind of makes sense - budget only when you actually
> spend. Anything else would be insane.

Well, yes and no -- I took care to supply `--begin` in my Ledger
invocation.

By the way, is there a way to supply a starting date /in the Ledger file
itself/?

Also, daily budget makes /a lot/ of practical sense.  If my monthly food
budget is, say, 600 PLN, it's Jan 25 and I've spent 480 PLN on food,
I can't immediately tell if I'm overspending or not.  For the record,
I wrote myself a very simple web app which gets data from Ledger and
displays my spending this month against budget computed /for today/ (so
in the above case it would tell me that I'm ahead of my budget).  It
would be cool if Ledger could provide such information, too...

Best,

-- 
Marcin Borkowski
http://mbork.pl

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87ilguo6gy.fsf%40mbork.pl.