Scheduled Transactions

138 views
Skip to first unread message

matt.gr...@gmail.com

unread,
Feb 25, 2018, 3:03:39 AM2/25/18
to Ledger
Hello!

I'm trying to test scheduled transactions as shown in the manual: https://www.ledger-cli.org/3.0/doc/ledger-mode.html#Scheduling-Transactions

My test file is attached.

For some reason, it keeps telling me that it has unexpected whitespace at the line below the scheduled transaction's date (currently line 10, but that moves if I move the scheduled transaction around).

I have double, triple, and quadruple checked for any whitespace out of place...
Deleting the square brackets and changing it to a valid date removes the error and the file processes as you would expect.

Googling, I can't seem to find anything about this error, or about scheduled transactions not working for others.

Anyone know what is going on here?

Thanks,
Matt

matt.gr...@gmail.com

unread,
Feb 25, 2018, 3:04:32 AM2/25/18
to Ledger
Forgot to add the file. Here it is.

Matt
TestBudget.txt

Jostein Berntsen

unread,
Feb 25, 2018, 3:19:14 AM2/25/18
to ledge...@googlegroups.com
On 25.02.18,00:04, matt.gr...@gmail.com wrote:
> Forgot to add the file. Here it is.
>
> Matt

It works if you remove the brackets from the date in line 9 and set a
real date like 2018/01/01.


Jostein
> --
>
> ---
> 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+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

> ;ALWAYS IMPORT THE BUDGET FILE IN BEFORE THE TX FILE. THE AUTOMATED STUFF IS RUN BEFORE THE OTHER
> ;FILE IS PROCESSED, SO THE AUTOMATIONS WONT HAPPEN IF YOU GO THE OTHER WAY.
>
> = /^Expenses:/
> * [Budget:$account] -1.0
> * [Assets:Budgeted Money] 1.0
>
> ;Try a scheduled Transaction
> [2018/*/1] BudgetAllocation
> [Budget:Expenses:Food] $100
> [Assets:Budgeted Money]
>
> 2018/01/01 * Opening Balance
> Assets:Fake Account $1000
> Equity:Opening Balance
>
> 2018/01/02 * Fake KFC
> Expenses:Food $50
> Assets:Fake Account
>
> 2018/01/10 * "Fake McDonalds"
> Expenses:Food $10
> Assets:Fake Account
>
> 2018/02/05 * Fake KFC
> Expenses:Food $50
> Assets:Fake Account
>
> 2018/03/10 * Fake KFC
> Expenses:Food $50
> Assets:Fake Account
>

Matt Graham

unread,
Feb 25, 2018, 3:24:34 AM2/25/18
to ledge...@googlegroups.com

Thanks Jostein,

 

What you describe is a normal, one off transaction like some of the others I have in the file.

 

The brackets and wildcard within the date are supposed to create scheduled transactions as described in the ledger manual: https://www.ledger-cli.org/3.0/doc/ledger-mode.html#Scheduling-Transactions

 

As per examples in this section, the dates all start with brackets, I was expecting ledger to interpret [2018/*/01] as ‘1st day of every month in 2018’, and create 12 transactions.

 

Thanks and regards,

Matt

You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/MDntkMrUkc8/unsubscribe.

To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.

Ismael Bouya

unread,
Feb 25, 2018, 3:24:41 AM2/25/18
to ledge...@googlegroups.com
Hey Matt,

I think you missed the "separate" in "that allows you to specify the
transactions in a separate ledger file" ;) your scheduling transactions
should lie in a dedicated file

Kind regards,

--
Ismael
signature.asc

Matt Graham

unread,
Feb 25, 2018, 3:31:51 AM2/25/18
to ledge...@googlegroups.com

Definitely missed that...

So I should crate a file that only has that scheduled transaction in it? Unfortunately this produced the same error (now on line 2)...

 

From re-reading that passage of the manual about 4 times, my understanding is that I should have a file with scheduled transactions in it, and then a different file with my normal transactions (and automated transactions in it). You then use -f twice to specify both files.

 

Is that the correct interpretation?

 

Thanks and regards,

Matt

 

From: Ismael Bouya
Sent: Sunday, 25 February 2018 7:24 PM
To: ledge...@googlegroups.com
Subject: Re: Scheduled Transactions

 

Hey Matt,

--

Ismael Bouya

unread,
Feb 25, 2018, 3:35:52 AM2/25/18
to ledge...@googlegroups.com
(Sun, Feb 25, 2018 at 07:31:46PM +1100) Matt Graham :
> Definitely missed that...
> So I should crate a file that only has that scheduled transaction in it? Unfortunately this produced the same error (now on line 2)...
>
> >From re-reading that passage of the manual about 4 times, my understanding is that I should have a file with scheduled transactions in it, and then a different file with my normal transactions (and automated transactions in it). You then use -f twice to specify both files.
>
> Is that the correct interpretation?

No, you have your regular transactions in the main file, scheduled
transactions in another, and then in emacs (you’re in the ledger-mode
documentation) you need to setup the schedule file:
(setq ledger-schedule-file "~/ledger-scheduled")
and *while editing the main file*, you hit C-c C-u and the scheduled
version will pop with the dates correctly formatted and ready to copy to
the main file.

So the scheduled transaction is handled by emacs and not at all by
ledger.

--
Ismael
signature.asc

Matt Graham

unread,
Feb 25, 2018, 3:38:50 AM2/25/18
to ledge...@googlegroups.com

Thank you! I had completely missed the emacs part. I have been using ledger just in the windows command prompt.

 

Thanks and regards,

Matt

 

From: Ismael Bouya
Sent: Sunday, 25 February 2018 7:35 PM
To: ledge...@googlegroups.com
Subject: Re: Scheduled Transactions

 

(Sun, Feb 25, 2018 at 07:31:46PM +1100) Matt Graham :

--

Jostein Berntsen

unread,
Feb 25, 2018, 7:33:38 AM2/25/18
to ledge...@googlegroups.com
Some more in this in a previous thread:

https://groups.google.com/forum/#!topic/ledger-cli/MZwjYEp2rjU

Jostein
> 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+...@googlegroups.com.

Jostein Berntsen

unread,
Feb 25, 2018, 7:35:36 AM2/25/18
to ledge...@googlegroups.com
On 25.02.18,13:34, Jostein Berntsen wrote:
> Some more in this in a previous thread:
>
> https://groups.google.com/forum/#!topic/ledger-cli/MZwjYEp2rjU
>

This functionality would be useful to have in ledger cli as well.
Reply all
Reply to author
Forward
0 new messages