Re: Help with adjustment transaction

2024-05-18 Thread Alan Schmitt
On 2024-05-17 23:40, "Robin H. Johnson"  writes:

> TL;DR: you insert balance assertions when you know the balance based on
> some source of truth.

Thank you, this is very useful to know.

Alan

-- 

--- 
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/m2r0dzv0t4.fsf%40petitepomme.net.


signature.asc
Description: PGP signature


Re: Help with adjustment transaction

2024-05-17 Thread Alan Schmitt
Hello,

On 2024-05-16 22:57, "Robin H. Johnson"  writes:

> Our bank statements give us the opening and closing balances for each
> statement, and I enter those as an assertion of the balance.
>
> If I have an error somewhere before that, such as a missing transaction,
> or a typo; the assertion flags that something is wrong.
>
> If your bank statements provide a known balance after each transaction,
> you can enter that:
>
> 2009/04/30 * Interest Earned: AccountName
> Assets:Bank:AccountName   $ 16.14 = $ 19,016.25
> Income:Interest:AccountName
>
> If your bank statements provide an opening or closing balance to the 
> statement,
> you can use that:
>
> 2023/06/30 * Balance Assertion: AccountName
> Assets:Bank:AccountName   $  0.00 = $ 52,289.96

This looks very useful, but I have trouble understanding how it works
with past transactions that are not yet reconciled (i.e., not part of
the balance, yet present and before in the file). Are these transactions
ignored? If so, the balance will break once they are reconciled in the
future, won’t it?

Best,

Alan

-- 

--- 
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/m2ikzdx7bv.fsf%40mac-03220211.irisa.fr.


signature.asc
Description: PGP signature


Re: Search/filter for payee or description

2023-08-27 Thread Alan
https://ledger-cli.org/doc/ledger3.html#Controlling-the-Accounts-and-Payees

On Sunday, August 27, 2023 at 10:35:57 AM UTC-7 Grzegorz Lippe wrote:

> How can I search or limit the output of a balance or register command  to 
> a specific payee?
>
>
>

-- 

--- 
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/3fd73670-b7ef-40da-b03a-bcb025722fa6n%40googlegroups.com.


Re: squash weekly totals across sub-accounts?

2022-11-10 Thread Alan
Thank you for your quick reply; and I apologize for asking nearly the same 
question I previously asked 
<https://groups.google.com/g/ledger-cli/c/s6hKviGYvqA/m/2zZ7iFvvG1gJ> (more 
than 10 years ago!). (That's why I quickly tried to remove my OP from 
yesterday.)

For my purposes here, "-n" works well enough. And, from Martin's response, 
I agree that #1901 looks like an even better soluion in general. So I'm all 
set for now.

But just so as I'm not leaving you hanging, here's a simple example:

2022/9/1   Safeway
Expenses:Food:Groceries   $10.00
Assets:Cash

2022/9/15  KFC
Expenses:Food:Chicken   $5.00
Assets:Cash

2022/9/21   Another
Expenses:Food   $1.23
Assets:Cash

The sum that I want for the monthly total is $16.23. But if I type `ledger 
-M --depth 2 reg expenses.food` I get $1.23.

On Wednesday, November 9, 2022 at 5:39:34 PM UTC-8 jwie...@gmail.com wrote:

> >>>>> "A" == Alan  writes:
>
> A> I have some of my Expense accounts organized hierarchically. For 
> example,
> A> rather than simply "Expenses:Food" I have a few accounts, such as:
>
> A> Expenses:Food:Groceries
> A> Expenses:Food:Chicken
> A> Expenses:Food: ... (a few others)
>
> A> But now I would like to get a weekly or monthly subtotal (using `-W` or
> A> `-M`), summed across all Food categories. If I just query `reg
> A> Expenses:Food` then of course as a regular expression that matches all 
> of
> A> the sub-categories individually. If I add `--depth 2` then it ignores 
> all
> A> the subcategories, reporting only the cases where the ledger has just
> A> "Expenses:Food" exactly.
>
> Actually, `--depth 2` should be exactly what you need, according to the 
> --help
> description:
>
> Limit the depth of displayed accounts in balance and register reports. Any
> accounts of greater depth are folded into their parent at the specified
> level. For example with --depth 2 the account
> Expenses:Entertainment:Dining would be folded into Expenses:Entertainment
> for display. Importantly, this is a display predicate, which means it only
> affects display, not the total calculations.
>
> I'm rather surprised if it is truncating the totals as you describe. Can 
> you
> reproduce the issue in a small test case?
>
> 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/968bcdfe-d295-4e08-9ab4-b5cdb1c23d35n%40googlegroups.com.


squash weekly totals across sub-accounts?

2022-11-09 Thread Alan
I have some of my Expense accounts organized hierarchically. For example, 
rather than simply "Expenses:Food" I have a few accounts, such as:

   - Expenses:Food:Groceries
   - Expenses:Food:Chicken
   - Expenses:Food: ... (a few others)

But now I would like to get a weekly or monthly subtotal (using `-W` or 
`-M`), summed across *all* Food categories. If I just query `reg 
Expenses:Food` then of course as a regular expression that matches all of 
the sub-categories individually. If I add `--depth 2` then it *ignores* all 
the subcategories, reporting only the cases where the ledger has just 
"Expenses:Food" exactly.

Can this be done?

-- 

--- 
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/c7e19a9c-2864-45f4-9ad1-fb7fce3e2361n%40googlegroups.com.


Sample ledger file with all emacs faces

2022-09-08 Thread alan . schmitt
Hello,

Is there a sample ledger file that leverages all the faces used in emacs
for ledger-mode? It would be used to test the colors of a theme and
tweak them if necessary.

Best,

Alan

-- 

--- 
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/877d2dgr36.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: Ledger-mode reconcile: space bar not working

2022-08-30 Thread Alan
Take a look at this , and see the 
section on "Making the most of RET and SPC" (easy) or "Overriding and 
intercept keymaps".

On Monday, May 23, 2022 at 2:48:25 PM UTC-7 Pete Kelly wrote:

> Somewhat solved. The spacebar was bound to an evil mode command to move 
> forward one character. I switched from Emacs mode to evil mode with CTRL-Z 
> and now the spacebar is bound correctly to 'ledger-reconcile-toggle.'
>
> Should I put something in my .emacs to disable evil mode in the 
> ledger-mode reconcile buffer? What's the right way to do it?
>
> Thank you,
> Pete
>
> On Monday, May 23, 2022 at 2:35:54 PM UTC-4 Pete Kelly wrote:
>
>> My first time trying to reconcile an account using ledger-mode. I put the 
>> cursor on the account to be reconciled, for example,
>>
>> 2022-01-01 Stop & Shop
>>  Expenses:Groceries   $50
>>  Assets:Checking <--- CURSOR ON THIS LINE
>>
>> then start reconciliation with C-c C-r. The account 'Assets:Checking' is 
>> displayed in the minibuffer, I press Enter. The Reconcile buffer appears. I 
>> enter the target balance and the cursor appears at the top of the Reconcile 
>> buffer When I move the cursor to a transaction and press the space bar to 
>> clear it, nothing happens, except that the cursor moves to the right one 
>> space.
>>
>> My Emacs version is 27.2 on MacOS High Sierra
>>
>> Probably just a beginner mistake on my part, but I can't solve it.
>>
>> Thank you for any help,
>> Pete
>>
>

-- 

--- 
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/4e13bade-5ff4-4b93-b5d5-b7e7292b19e8n%40googlegroups.com.


Re: Are you using bracketed dates in comments ?

2022-05-23 Thread Alan
Ah! The exercise of trying to put together an example made me realize my 
mistake.

Referring to the "Bountiful Blessings" example in the Effective Dates manual 
<https://www.ledger-cli.org/3.0/doc/ledger3.html#Effective-Dates>, if you 
say `ledger --effective register Groceries` you get the proper effective 
dates. If you instead say `ledger --effective register Checking` you would 
get just the one date, 2008/10/16, which makes sense now that I think about 
it. But I was somehow expecting/hoping that it would show separate lines in 
the Checking register, with the same effective dates from the Expenses 
lines.

On Monday, May 23, 2022 at 4:49:11 PM UTC-7 Martin Michlmayr wrote:

> Yes, please post an example. Maybe you're not using them correctly.
>
> * Alan  [2022-05-23 16:41]:
> > I use bracketed dates. However, recently I've been having some trouble 
> > getting them to work.
> > 
> > I thought they were working before, although I can't be sure I remember 
> > exactly. They're supposed to be used if you give the "--effective" 
> > command-line flag, right?
> > 
> > On Friday, May 18, 2018 at 10:59:00 AM UTC-7 Simon Michael (sm) wrote:
> > 
> > >
> > > > On May 17, 2018, at 10:38 PM, John Wiegley  
> wrote:
> > > > Brackets came first, yes, by several years. I still use them, 
> though, 
> > > because
> > > > they're quick and convenient.
> > >
> > > Good! I've been remembering correctly. Agreed, they are slightly 
> quicker 
> > > and more convenient than writing the tag/metadata syntax. I find 
> myself 
> > > starting to use them.
> > 
> > -- 
> > 
> > --- 
> > 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.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ledger-cli/63559a15-c59e-4792-a3bf-6ee48afca9bfn%40googlegroups.com
> .
>
>
> -- 
> 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/e165b9cf-b4fb-42ac-bee1-a82e2fb91d5dn%40googlegroups.com.


Re: Are you using bracketed dates in comments ?

2022-05-23 Thread Alan
I use bracketed dates. However, recently I've been having some trouble 
getting them to work.

I thought they were working before, although I can't be sure I remember 
exactly. They're supposed to be used if you give the "--effective" 
command-line flag, right?

On Friday, May 18, 2018 at 10:59:00 AM UTC-7 Simon Michael (sm) wrote:

>
> > On May 17, 2018, at 10:38 PM, John Wiegley  wrote:
> > Brackets came first, yes, by several years. I still use them, though, 
> because
> > they're quick and convenient.
>
> Good! I've been remembering correctly. Agreed, they are slightly quicker 
> and more convenient than writing the tag/metadata syntax. I find myself 
> starting to use them.

-- 

--- 
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/63559a15-c59e-4792-a3bf-6ee48afca9bfn%40googlegroups.com.


Re: get a number/amount only from `ledger balance ...`

2022-02-15 Thread Alan
You can say "%(clear_commodity(amount))"

On Sunday, February 6, 2022 at 4:29:24 PM UTC-8 Martin Michlmayr wrote:

> * Sim Tov  [2022-02-06 12:43]:
> > I would like to use the output of `ledger balance ...` in a bash script. 
> I 
> > want to get a number/amount only, without all the strings around it... 
> is 
> > there a command line option to get amount only (even without 
> > commodity/currency sign)?
>
> This gets you the amount (with the commodity):
>
> ledger bal assets:cash --balance-format "%(amount)"
>
> I'm not sure if you can get just the number, but you can just run this
> command through sed or perl to remove the commodity.
>
> -- 
> 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/0a0ae737-d2ce-45d5-9bfe-d549f80098f4n%40googlegroups.com.


Re: currency trading accounts

2022-02-13 Thread Alan Schmitt

> I hope that helps.

It does, thank you very much.

Alan

-- 

--- 
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/87fsol991q.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: currency trading accounts

2022-02-13 Thread Alan Schmitt
Hello,

Would you also recommend this method to track investments, such as
stocks?

Best regards,

Alan Schmitt

-- 

--- 
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/87wnhyu4qc.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: range error compiler warnings on ARM, comparing char to -1

2021-09-13 Thread Alan
(I added a note to this bug 
<https://github.com/ledger/ledger/issues/2058#issuecomment-918627625> to 
indicate that it does lead to incorrect/garbage error reporting in some 
cases.)

On Wednesday, August 18, 2021 at 12:18:13 PM UTC-7 Alan Bram wrote:

>  I believe it is safe to ignore (meaning, I believe it does not lead to 
> incorrect calculations in Ledger), 
>

-- 

--- 
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/82df7231-5dbe-44e4-9cf8-7f6b4bc66fbfn%40googlegroups.com.


Re: range error compiler warnings on ARM, comparing char to -1

2021-08-31 Thread Alan
PR in https://github.com/ledger/ledger/pull/2059

On Tuesday, August 31, 2021 at 2:18:06 PM UTC-7 Alan wrote:

> Will do.
>
> On Monday, August 23, 2021 at 1:28:46 AM UTC-7 Martin Michlmayr wrote:
>
>> Alan, it would be great if you could submit a pull request through 
>> GitHub. 
>>
>> * Alan Bram  [2021-08-18 12:18]: 
>> > Sorry for the late reply: this was languishing in my "spam" category, 
>> which 
>> > I unfortunately do not look at often enough. 
>> > 
>> > Yes, this occurs on ARM, as I mentioned. I believe it is safe to ignore 
>> > (meaning, I believe it does not lead to incorrect calculations in 
>> Ledger), 
>> > but IMHO it should definitely be cleaned up. I offered to fix it, but 
>> > received no response. 
>> > 
>> > On Mon, Jul 19, 2021 at 4:21 PM Norman Baatz  
>> wrote: 
>> > 
>> > > I’m getting this too. Is this an issue when running Ledger on ARM? 
>> > > 
>> > > On Wednesday, October 14, 2020 at 11:44:25 PM UTC+2 Alan wrote: 
>> > > 
>> > >> I tried compiling Ledger on an ARM processor, where the bare `char` 
>> type 
>> > >> defaults to unsigned. I got warnings at a handful of lines in a 
>> couple of 
>> > >> source files: 
>> > >> 
>> > >> - query.cc 
>> > >> - times.cc 
>> > >> - token.cc 
>> > >> 
>> > >> "warning: comparison is always false due to limited range of data 
>> type 
>> > >> [-Wtype-limits]" 
>> > >> 
>> > >> The bug is fairly obvious, and I would be happy to contribute a 
>> clean-up 
>> > >> fix. But I wanted to ask first whether it would be welcome, because 
>> I 
>> > >> assume I couldn't possibly be the first person to have encountered 
>> this. 
>> > >> 
>> > >> Actually most, if not all, of the code isn't even really in play, 
>> IINM: 
>> > >> it's dead/unreachable and/or redundant/irrelevant. So my proposed 
>> fix would 
>> > >> be to just excise it. 
>> > >> 
>> > >> Or am I missing something? 
>> > >> 
>> > > -- 
>> > > 
>> > > --- 
>> > > 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/bd8v3wiU6oo/unsubscribe. 
>>
>> > > To unsubscribe from this group and all its topics, send an email to 
>> > > ledger-cli+...@googlegroups.com. 
>> > > To view this discussion on the web visit 
>> > > 
>> https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com
>>  
>> > > <
>> https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com?utm_medium=email_source=footer>
>>  
>>
>> > > . 
>> > > 
>> > 
>> > -- 
>> > 
>> > --- 
>> > 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. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ledger-cli/CACHqOS8xmnFyaa8h3OAEFnEbCP9BxDw98EuqEzzmTY9gsHzuMQ%40mail.gmail.com.
>>  
>>
>>
>> -- 
>> 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/18c99d82-cc8f-4533-b395-aa46e4975dffn%40googlegroups.com.


Re: range error compiler warnings on ARM, comparing char to -1

2021-08-18 Thread Alan Bram
Sorry for the late reply: this was languishing in my "spam" category, which
I unfortunately do not look at often enough.

Yes, this occurs on ARM, as I mentioned. I believe it is safe to ignore
(meaning, I believe it does not lead to incorrect calculations in Ledger),
but IMHO it should definitely be cleaned up. I offered to fix it, but
received no response.

On Mon, Jul 19, 2021 at 4:21 PM Norman Baatz  wrote:

> I’m getting this too. Is this an issue when running Ledger on ARM?
>
> On Wednesday, October 14, 2020 at 11:44:25 PM UTC+2 Alan wrote:
>
>> I tried compiling Ledger on an ARM processor, where the bare `char` type
>> defaults to unsigned. I got warnings at a handful of lines in a couple of
>> source files:
>>
>>- query.cc
>>- times.cc
>>- token.cc
>>
>> "warning: comparison is always false due to limited range of data type
>> [-Wtype-limits]"
>>
>> The bug is fairly obvious, and I would be happy to contribute a clean-up
>> fix. But I wanted to ask first whether it would be welcome, because I
>> assume I couldn't possibly be the first person to have encountered this.
>>
>> Actually most, if not all, of the code isn't even really in play, IINM:
>> it's dead/unreachable and/or redundant/irrelevant. So my proposed fix would
>> be to just excise it.
>>
>> Or am I missing something?
>>
> --
>
> ---
> 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/bd8v3wiU6oo/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com
> <https://groups.google.com/d/msgid/ledger-cli/3adce81c-454d-4279-a9e2-4851cd38ccd8n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 

--- 
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/CACHqOS8xmnFyaa8h3OAEFnEbCP9BxDw98EuqEzzmTY9gsHzuMQ%40mail.gmail.com.


Re: Tracking housing/mortgage

2021-02-19 Thread Alan Schmitt
On 2021-02-19 22:20, Yuri Khan  writes:

> On Fri, 19 Feb 2021 at 20:40, Alex Branham  wrote:
>
>> Thanks for the responses! So it sounds like your monthly payments look 
>> something like:
>>
>> 2021-03-06 foo
>> liabilities:mortgage:principal  $ -X
>> expenses:interest   $ -X
>> assets:checking
>
> Negative values in the first two postings would mean money flows into
> your checking account. Mortgage doesn’t usually work like this.

Oops, of course, I replied too fast. Every sign is switched for me too.

Alan

-- 

--- 
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/871rdbrk7y.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: Tracking housing/mortgage

2021-02-19 Thread Alan Schmitt
On 2021-02-19 16:04, Ismael Bouya  writes:

> One possible solution to that is to "tag" the said expenses (with a
> :MyHouse: for instance), so that you can track them and add them to the
> "house value" if one day you sell it back.

I "solved" this by not tracking the value of the house I bought (nor
clothes, or other things).

Best,

Alan

-- 

--- 
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/874ki7rk9s.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: Tracking housing/mortgage

2021-02-19 Thread Alan Schmitt
Hello,

On 2021-02-19 08:40, Alex Branham  writes:

> Thanks for the responses! So it sounds like your monthly payments look
> something like:
>
> 2021-03-06 foo
> liabilities:mortgage:principal  $ -X
> expenses:interest $ -X
> assets:checking

Yes, this is something like that (except I use expenses:house:interest).

> I'm having trouble figuring out what the initial house purchase entry
> should look like, though. Did you create something like an "assets:house"
> account with 1 house in it? Or did you balance against "equity:house" or
> something else?

I simply used "expenses:house:principal".

Best,

Alan

-- 

--- 
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/877dn3rkcp.fsf%40m4x.org.


signature.asc
Description: PGP signature


Re: Tracking housing/mortgage

2021-02-07 Thread Alan Schmitt
On 2021-02-06 23:31, Yuri Khan  writes:

> On Sat, 6 Feb 2021 at 22:46, alex.b...@gmail.com  
> wrote:
>
>> How do people track their housing/mortgage/interest in ledger? Do you 
>> recommend just a simple "Expense:Mortgage" account or a more micro level 
>> with e.g. "Expenses:Interest:Mortgage" and "Equity:House" for the 
>> interest/principle?
>>
>> Any and all thoughts/tips/tricks welcome, thanks!
>
> I did pretty much that. The principal is a Liabilities subaccount though.

I do the same thing: I have a Liabilities account were the loan was
initially deposited (which balanced getting the cash in my account) and
an interest Expenses account. Each monthly payment is dispatched between
the two, slowly decreasing the Liabilities that remain.

Best,

Alan

-- 

--- 
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/87wnvjovjs.fsf%40m4x.org.


signature.asc
Description: PGP signature


filter based on related (other "side")?

2021-01-25 Thread Alan
Is there some way to select entries by matching each "side" of the 
transaction?

For example, list expenditures to "Expenses:Food" but not all of them; only 
the ones that were charged against "Liabilities:Credit Card."

I tried `ledger reg exp.*food and liab.*credit.card` but that turns up 
nothing.

My workaround is to display "--related" and then pipe it to grep; but 
sometimes that's not quite perfect.

-- 

--- 
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/63d1d992-31fb-42d9-bcbe-7548fba3c0f9n%40googlegroups.com.


range error compiler warnings on ARM, comparing char to -1

2020-10-14 Thread Alan
I tried compiling Ledger on an ARM processor, where the bare `char` type 
defaults to unsigned. I got warnings at a handful of lines in a couple of 
source files:

   - query.cc
   - times.cc
   - token.cc

"warning: comparison is always false due to limited range of data type 
[-Wtype-limits]"

The bug is fairly obvious, and I would be happy to contribute a clean-up 
fix. But I wanted to ask first whether it would be welcome, because I 
assume I couldn't possibly be the first person to have encountered this.

Actually most, if not all, of the code isn't even really in play, IINM: 
it's dead/unreachable and/or redundant/irrelevant. So my proposed fix would 
be to just excise it.

Or am I missing something?

-- 

--- 
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/85edba1a-50e5-4001-92ba-eead452a3297n%40googlegroups.com.


Re: Forecasting beginning in the future

2020-09-13 Thread Alan Bram
Here's a demo of what I mean. Reading from "sample.dat" produces no output;
compare to "another.dat." (Data files attached.)

% ledger --version
Ledger 3.2.1-20200518, the command-line accounting tool

Copyright (c) 2003-2019, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.
% ledger -f sample.dat --forecast "d<[2022]" reg cash
% ledger -f another.dat --forecast "d<[2022]" reg cash
2020/10/01 Forecast transactionAssets:Cash
   $-500.00 $-500.00
2020/11/01 Forecast transactionAssets:Cash
   $-500.00$-1000.00
2020/12/01 Forecast transactionAssets:Cash
   $-500.00$-1500.00
2021/01/01 Forecast transactionAssets:Cash
   $-500.00$-2000.00
2021/02/01 Forecast transactionAssets:Cash
   $-500.00$-2500.00
2021/03/01 Forecast transactionAssets:Cash
   $-500.00$-3000.00
2021/04/01 Forecast transactionAssets:Cash
   $-500.00$-3500.00
%

On Sun, Sep 13, 2020 at 5:53 PM John Wiegley  wrote:

> >>>>> "A" == Alan   writes:
>
> A> Is it correct to glean from this that it doesn't work to give a "from"
> date
> A> in a periodic transaction? I was trying to do so, but I was not able to
> A> make it work.
>
> I would definitely expect periodic transactions to accept date ranges.
>
> https://www.ledger-cli.org/3.0/doc/ledger3.html#Period-Expressions
>
> 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/CACHqOS-GF3TWi8_6LefO0sQqK_39BpWxgqf%3D1mTambzmfcGc2Q%40mail.gmail.com.


sample.dat
Description: Binary data


another.dat
Description: Binary data


Re: Forecasting beginning in the future

2020-09-13 Thread Alan
Is it correct to glean from this that it doesn't work to give a "from" date 
in a periodic transaction? I was trying to do so, but I was not able to 
make it work.

On Tuesday, December 15, 2015 at 3:50:35 PM UTC-8 John Wiegley wrote:

> > Phil Gee  writes:
>
> > As far as I understand --forecast, I should see the expected development 
> of
> > my checkings account when I send the command ledger -f
> > Budget2016_ledger.txt - -forecast "d<[2017]" reg assets:checking. 
> However,
> > if I do that, I only get
>
> > 16-Dec-01 Forecast transaction Assets:Checking €1460.00 €22711.00
>
> > So, all the Expenses from the second, third, sixth and seventh paragraph 
> are
> > neglected. How can I fix this?
>
> You'll need to include expenses in the report, for them to be factored into
> the forecast.
>
> -- 
> John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
> http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
>

-- 

--- 
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/1594d1b2-a3cd-4e1d-8eda-0883289dd842n%40googlegroups.com.


Re: Auto-complete of accounts in emacs ledger-mode

2019-06-13 Thread Alan Schmitt

Hello,

On 2019-06-13 11:13, Eric S Fraga  writes:


On Wednesday, 12 Jun 2019 at 21:15, Alexandre Rademaker wrote:
The auto-complete with tab of accounts stop works on my emacs ! 
Any idea?


You haven't given any details so it's difficult to diagnose.

First thing: what have you changed in your environment since it 
last

worked, including any new packages in Emacs?

Secondly, what is they key you use to complete account names 
actually
bound to in the ledger buffer?  E.g.  if it's the TAB key, type 
C-h k
TAB to see what Emacs thinks should happen when you hit that 
key.


The completion system recently changed, which caused many things 
to

break:
https://github.com/ledger/ledger-mode/pull/174

Best,

Alan

--

--- 
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/87pnnhbjja.fsf%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: exporting to tabular format

2019-03-08 Thread Alan Schmitt

On 2019-03-07 15:05, Fergus Cameron  writes:

For the raw data there is an actual 'csv' command.  You can use 
the
various filters with it, I understand.  And there's a 
'csv-format'

switch too.  I don't use it but it's in the docs.


Thanks, I've tried the csv command and it seems it exports enough
information to build something on top of it. I'll have to do some
programming though.

Best,

Alan

--

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


signature.asc
Description: PGP signature


Re: exporting to tabular format

2019-03-08 Thread Alan Schmitt

Hello,

On 2019-03-07 13:51, o1bigtenor  writes:


Might be easier if you gave her a list of commands for ledger.
She can look for herself and you don't have to do the extra 
'fun'.


This would be a solution, but I'll be grim for a second. I want a 
way
for her to be able to continue balancing her finances when I pass 
away
(no indication it's soon, I'm just planning ahead). So I need 
something

that she can edit too.

Best,

Alan

--

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


signature.asc
Description: PGP signature


Re: exporting to tabular format

2019-03-06 Thread Alan Schmitt

On 2019-03-07 00:07, Fergus Cameron  writes:

if you consider CSV a tabular format, it can.  you can post 
process it
from there ... although, one would need to understand the final 
result
to make that a sane suggestion since ledger can generally 
produce the

answers you need directly.


CSV would be fine. How do I do that?

My motivation is that my wife does not use ledger and she wants to 
use a

spreadsheet to look at our family expenses.

Best,

Alan

--

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


signature.asc
Description: PGP signature


Re: exporting to tabular format

2019-03-06 Thread Alan Schmitt

On 2019-03-06 13:04, Craig Earls  writes:


Not built in to ledger.


Thanks. Are there scripting bridges to ledger that I could use for 
this?


Alan

--

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


signature.asc
Description: PGP signature


exporting to tabular format

2019-03-05 Thread Alan Schmitt

Hello,

Is there a way to export a ledger file to tabular format? Ideally, 
one
would have one columns per account/asset and one line per 
transaction.


Thanks,

Alan

--

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


signature.asc
Description: PGP signature


Re: Ledger API for a custom reports generator in C++

2019-01-05 Thread Alan
Another option might be to process the XML with a proper XSLT utility 
(e.g., XMLStarlet), if the Perl script is awkward.

On Tuesday, December 18, 2018 at 1:05:16 AM UTC-8, Ivanov Dmitry wrote:
>
> I need to create custom reports from my ledger files: Excel format, 
> certain processing of raw data. With SQL it could be easy: just write your 
> query and you'll get the data. But with ledger I have to process the 
> records one by one.
>
> Currently I', using the following method: I generate XML file with 
> transactions using ledger then process it with a Perl script.
>
> Maybe, I can use ledger library directly and write a C++ program? Ledger 
> functions will process the files and I will use it's data structures. 
>
> Is there any documentation with samples of using ledger API and data 
> structures?
>

-- 

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


Re: ledger.el *very* slow to load account names

2018-04-13 Thread Alan Schmitt
Hello Clément,

On 2018-04-12 22:52, Clément Pit-Claudel <cpitclau...@gmail.com> writes:

> Can you try adding the following to your .emacs?
>
> (package-initialize)
> (require 'ledger-mode)
>
> (defun ledger-accounts-deduplicate-sorted (l)
>   "Remove duplicates from a sorted list of strings L."
>   (let ((current l))
> (while (consp current)
>   (if (string= (car current) (cadr current))
>   (setcdr current (cddr current))
> (pop current)))
> l))
>
> (defun ledger-accounts-list-in-buffer ()
>   "Return a list of all known account names in the current buffer as strings.
> Considers both accounts listed in postings and those declared with 
> \"account\" directives."
>   (save-excursion
> (goto-char (point-min))
> (let (results)
>   (while (re-search-forward ledger-account-name-or-directive-regex nil t)
> (setq results (cons (match-string-no-properties 2) results)))
>   (ledger-accounts-deduplicate-sorted
>(sort results #'ledger-string-greaterp)
>
> This patches ledger-accounts-list-in-buffer to use a linear-time
> deduplication (rather than quadratic).

Thanks a lot! Completion is now as fast as before.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-03: 409.46, 2017-03: 407.18

-- 

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


signature.asc
Description: PGP signature


Re: ledger.el *very* slow to load account names

2018-04-09 Thread Alan Schmitt
Hello,

On 2018-04-07 14:30, John Rakestraw <john.a.rakest...@gmail.com> writes:

> - I tab to autocomplete an account name. For example, if I type "Expe" and 
> then hit tab, it takes literally 10 seconds to complete to "Expenses:".

I have observed the same thing. It changed suddenly from being
instantaneous to taking a long time a couple months ago.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-02: 408.35, 2017-02: 406.42

-- 

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


signature.asc
Description: PGP signature


Re: how to strip dollar sign in reports

2018-02-17 Thread Alan Bram
Thanks, John! I appreciate it!

On Fri, Feb 16, 2018 at 11:04 PM, John Wiegley <jwieg...@gmail.com> wrote:

> >>>>> "AB" == Alan Bram <sf.fly...@gmail.com> writes:
>
> AB> Using "to_int" does indeed remove the dollar sign, but it also of
> AB> course truncates the part after the decimal point (the cents). I
> AB> guess the following works:
>
> AB> -F 'whatever ... %(0.01 * t)\n' -t 'to_int(100 * a)'
>
> AB> but seems pretty clumsy. I don't see a "to_float" or anything like
> that.
> AB> Is there another way that I'm still missing?
>
> I just committed to the 'next' branch a 'clear_commodity' function for you.
> The functionality was always there, it just wasn't exposed in the value
> expression language.
>
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: how to strip dollar sign in reports

2018-02-16 Thread Alan Bram
Thanks so much for the super-quick reply, John!

Using "to_int" does indeed remove the dollar sign, but it also of course
truncates the part after the decimal point (the cents). I guess the
following works:

-F 'whatever ... %(0.01 * t)\n' -t 'to_int(100 * a)'

but seems pretty clumsy. I don't see a "to_float" or anything like that. Is
there another way that I'm still missing?

On Fri, Feb 16, 2018 at 4:37 PM, John Wiegley <jwieg...@gmail.com> wrote:

> >>>>> "A" == Alan  <sf.fly...@gmail.com> writes:
>
> A> Long ago, in version 2, I used to be able to say something like ... -t
> A> 'S(a)'
>
> A> in order to have amounts appear without dollar signs in report output.
> But
> A> now with version 3 that doesn't seem to work.
>
> A> What's the new way to ask for the amounts as plain, unadorned
> A> numbers?
>
> I think it's "to_int" these days...
>
> 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.
For more options, visit https://groups.google.com/d/optout.


how to strip dollar sign in reports

2018-02-16 Thread Alan
Long ago, in version 2, I used to be able to say something like ...

-t 'S(a)'


in order to have amounts appear without dollar signs in report output. But 
now with version 3 that doesn't seem to work.

What's the new way to ask for the amounts as plain, unadorned numbers?

-- 

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


Re: How many Emacs, Vim, Sublime, Atom.io users here?

2017-02-23 Thread Alan Schmitt
Hello,

On 2017-02-22 10:05, James <kunal...@gmail.com> writes:

> Do you ever get tired of the ctrl and alt keys?
> I notice from some of the documentations, there is lots of ctrl and alts .
>
> Also if it is not too rude to ask, what is your primary input device
> (ie keyboard and machine type? )
>
> I am asking the above because typing a lot might increase the chances
> of RSI(this is from what I read, not sure how true it is)

I use spacemacs in evil mode, so I use the ctrl key very little.

For the particular case of ledger, the default binding for adding a
transaction is ",a", and the default binding for reconciliation is ",r".
(These are the ones I use the most). I had to create spacemacsy bindings
in reconciliation mode, this is how I did it:

#+BEGIN_SRC emacs-lisp
(spacemacs/set-leader-keys-for-major-mode 'ledger-reconcile-mode
   "c" 'ledger-reconcile-toggle
   "g" 'ledger-reconcile-refresh
   "q" 'ledger-reconcile-quit)
#+END_SRC

As for input device, I have a Truly Ergonomic keyboard at my desk.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-01: 406.13, 2016-01: 402.52

-- 

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


signature.asc
Description: PGP signature


Re: How many Emacs, Vim, Sublime, Atom.io users here?

2017-02-22 Thread Alan Schmitt
On 2017-02-21 11:00, James <kunal...@gmail.com> writes:

> I just want to conduct a quick survey here. Could everyone here advise
> which is their preferred text editor for ledger input?

Emacs with ledger-mode, and org-mode for generating reports
(http://alan.petitepomme.net/tips/ledger_and_org.html). It works really
fast: I input everything by hand from the receipts, and it never takes
me more than 30 minutes each week.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2017-01: 406.13, 2016-01: 402.52

-- 

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


signature.asc
Description: PGP signature


Re: Feature idea: custom named reports!

2016-08-03 Thread Alan Schmitt
Hello Alexandre,

On 2016-08-01 13:35, Alexandre Rademaker <aradema...@gmail.com> writes:

> Can you guys share examples of org-Babel and Python scripts ?!

I do all my reporting from an org file, using org-babel. I wrote some
convenience functions for that which I describe here
http://alan.petitepomme.net/tips/ledger_and_org.html

For very simple reports, I have code blocks like this:
#+begin_src sh :results raw drawer
ledger -f ~/Documents/Org/mescomptes.ledger reg '^Liabilities:Missions' | tail 
-n 20
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2015-06: 402.80, 2016-06: 406.81

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-28 Thread Alan Schmitt
On 2016-02-29 02:35, Craig Earls <ender...@gmail.com> writes:

> I pushed this change. I was able to test on emacs and aquamacs. I don't have 
> the
> time to get spacemacs up and running right now.

I just gave it a try and it works great. Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-28 Thread Alan Schmitt
Hello,

On 2016-02-22 10:14, Alan Schmitt <alan.schm...@polytechnique.org> writes:

> When font-lock is enabled, changing the face using set-text-properties
> does nothing because font-lock immediately overrides this face. The way
> to change the face in that case is to set `font-lock-face' instead of
> `face'. So I think the fix is to globally replace face by font-lock-face
> in ledger-reconcile.el.

What can I do to help move this forward? Would a pull-request on
https://github.com/ledger/ledger be the way to go?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-22 Thread Alan Schmitt
Hello,

On 2016-02-20 20:39, Alan Schmitt <alan.schm...@polytechnique.org> writes:

> I don't really know where to look next…

I asked for help on the emacs-devel mailing list, and I think I now
understand what happens.

When font-lock is enabled, changing the face using set-text-properties
does nothing because font-lock immediately overrides this face. The way
to change the face in that case is to set `font-lock-face' instead of
`face'. So I think the fix is to globally replace face by font-lock-face
in ledger-reconcile.el.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-20 Thread Alan Schmitt
On 2016-02-20 20:09, Craig Earls <ender...@gmail.com> writes:

> Jit-lock-mode is t in the reconcile buffer for performance. I had a complaint
> long ago from someone with thousands of unckered transaction that reconcile 
> was
> too slow. 

I just tried this with emacs -Q:

(add-to-list 'load-path "~/.config/emacs.d/elpa/ledger-mode-20160111.1834")

(load-file 
"~/.config/emacs.d/elpa/ledger-mode-20160111.1834/ledger-mode-autoloads.el")

I load a ledger file, I enter reconciliation, I do a `describe-variable'
on `jit-lock-mode', and I get nil.

I also tried going from `jit-lock-mode' nil to t in my vanilla emacs,
and it *does not* break reconciliation and face changing. I also see
that in that case I do not get the `fontified' text property.

To summarize:
- here, jit-lock-mode is nil by default in the reconcile buffer
- when it's nil at start faces are applied
- turning it to t does not break anything: faces are applied when
toggling transactions
- in spacemacs, it's t at start and faces are not applied
- turning it to nil allows faces to be applied when toggling transactions

I don't really know where to look next…

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-20 Thread Alan Schmitt
Hello,

On 2016-02-20 17:12, Alexander Baier <alexander.ba...@mailbox.org> writes:

> On topic: I ran into the same problem, if you need anyone to test
> something, I can help.

I'm trying to debug it, and it seems the problem is in
`ledger-reconcile-format-posting': if I run it with edebug, I see that
the call to `set-text-properties' happens, but after it the text has the
`where' property but it does not have the `face' property. I tried it in
a vanilla emacs and I see that the face is present as a text property.
Another difference is the spacemacs version has a `fontified' text
property (even before applying the new properties) set to t; I do not
see this in the vanilla version.

Looking a little bit deeper, it seems that this is related to
`jit-lock-mode', and I see that in my vanilla emacs it is not set for
the reconcile buffer, whereas it is set in spacemacs. I tested this
further, and I see that colorization comes back if I set jit-lock-mode
to nil in that buffer (I need to toggle a transaction to see the face
change).

So the next question is: why is jit-lock-mode set to t in the reconcile
buffer? I'm going to try to figure it out, but if it rings a bell for
someone, please let me know.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: reconcile ledger mode problem: no colors

2016-02-14 Thread Alan Schmitt
On 2016-02-14 19:42, Craig Earls <ender...@gmail.com> writes:

> I had never heard of spacemacs before. I looked at it and it seems about as
> blasphemous an editor as could be constructed!

;)

> I will see if I can get it running and take a look.

The simplest is this way:
- temporarily move your .emacs.d in some safe place
- clone the repo
- launch emacs, let it download its packages
- upon relaunch, edit the .spacemacs file, search for
dotspacemacs-configuration-layers and add "finance" to the list of
layers (this is the one including ledger).

If it matters, here is my local configuration:


  (setq ledger-default-date-format "%Y-%m-%d")
  (setq ledger-reconcile-default-commodity "€")
  (setq ledger-schedule-file "~/Documents/Org/mescomptes-schedule.ledger")
  (setq ledger-schedule-look-forward 31)
  (setq ledger-use-iso-dates t)
  (setq ledger-narrow-on-reconcile nil)

  (spacemacs/set-leader-keys-for-major-mode 'ledger-reconcile-mode
"c" 'ledger-reconcile-toggle
"g" 'ledger-reconcile-refresh
"q" 'ledger-reconcile-quit)

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52

-- 

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


signature.asc
Description: PGP signature


Re: Interesting uses of Ledger

2015-11-20 Thread Alan Schmitt
Hello,

On 2015-11-20 05:13, Chris Bennett <ch...@ceegeebee.com> writes:

> Hi all,
>
> I've started a new thread related to Andrew Maffei's query about using
> Ledger for recording scientific data (to avoid derailing that thread).
>
> But I've always wanted to see what others are doing with Ledger that
> is not your standard bookkeeping/accounting.
>
>   John Wiegley wrote:
>   "since Ledger isn't really about accounting, after all. :)"
>
> Personally I use Ledger for:

I've never thought of using Ledger for anything but my personal
finances, and I find the idea fascinating. Out of curiosity, do you have
on file for each domain you track using Ledger?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated November 9, 2015, Mauna Loa Obs.): 399.06 ppm

-- 

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


signature.asc
Description: PGP signature


Re: how to install 3.1 from source on MacOS?

2015-08-31 Thread Alan Schmitt
On 2015-08-31 00:22, Richard Cobbe <co...@ccs.neu.edu> writes:

> Forgive some extremely basic questions, but what do I need to do to build
> a reasonably stable version of Ledger 3.1 from source on MacOS 10.10?

I install it using homebrew, and it works flawlessly.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 28, 2015, Mauna Loa Obs.):
378.79 ppm

-- 

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


signature.asc
Description: PGP signature


Re: Show your favorite Ledger reports!

2015-08-28 Thread Alan Schmitt
On 2015-08-27 16:58, David Glasser glas...@davidglasser.net writes:

 How do your buckets interact with the actual location of the funds? Ie, when
 you say that your income goes to the unallocated bucket, does it not also go
 to the actual bank account it is in? Are you using virtual accounts or tags or
 something?

This is my setup (which is copied from many sources):

--8---cut here---start-8---
= expr (date=[2014] and account =~ /^Expenses:/)
Bucket:$account   -1
Total Buckets  1

= expr (date=[2014] and account =~ /^Income:/)
Bucket:Unallocated:EUR-1
Total Buckets  1
--8---cut here---end---8---

So when I enter some expense transaction, it gets:
- added to the expense account explicitly
- removed from the bank account explicitly
- removed from the expense bucket by the rule above
- added to “Total Buckets” to keep things equal to 0 by the rule

When I enter some income, it gets:
- removed from the income bucket explicitly
- added to the bank account explicitly
- added to the unallocated bucket by the rule
- removed from “Total Buckets” by the rule

The budget transaction moves money from the unallocated bucket to the
expense buckets.

So I track my money in three places (I don’t count the “Total Bucket”):
- bank accounts, that show where the money is
- expense and income accounts, which show the collated expenses and
income
- expense buckets and the unallocated bucket (as well as some savings
bucket) that show what the money is meant for

Is it clearer?

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 17, 2015, Mauna Loa Obs.):
398.19 ppm

-- 

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


signature.asc
Description: PGP signature


Re: Show your favorite Ledger reports!

2015-08-28 Thread Alan Schmitt
On 2015-08-28 17:08, David Glasser glas...@davidglasser.net writes:

 Ah great. And how do you generate the list of rows in your table (ie, ensure
 you aren't forgetting some important buckets)? Just make sure to only use a
 consistent and fixed set of top level expense categories?

It’s manual, as I seldom change them now. I do have reports like this:

#+begin_src sh :results raw drawer
ledger -f ~/Documents/Org/mescomptes.ledger balance '^Bucket'
#+end_src

that list all the buckets, and I can see if some of them just go in
negative.

And to make sure I did not mess anything, I have this sanity check:

#+begin_src sh :results raw drawer
ledger -f ~/Documents/Org/mescomptes.ledger balance '^Total' | tail -n 1
ledger -f ~/Documents/Org/mescomptes.ledger balance '^Assets' '^Liabilities' | 
tail -n 1
ledger -f ~/Documents/Org/mescomptes.ledger balance '^Bucket' | tail -n 1
ledger -f ~/Documents/Org/mescomptes.ledger balance '^Income' '^Expenses' 
'^Equity' | tail -n 1
#+end_src

The four lines returned should be equal, up to their sign.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 17, 2015, Mauna Loa Obs.):
398.19 ppm

-- 

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


signature.asc
Description: PGP signature


Re: Show your favorite Ledger reports!

2015-08-27 Thread Alan Schmitt
On 2015-08-14 04:06, Simon Michael si...@joyful.com writes:

 On 7/11/15 9:16 AM, Lifepillar wrote:
 Hi,
 I am sure all of you have some carefully crafted Ledger commands
 up your sleeves, which generate reports you especially like.
 Why not share them in this thread, for the benefit of the newbies
 and the not-so-newbies?
 
 Two reports I like are the cash flow:
 
 ledger bal --collapse --dc --related --real --effective \
 -p 'this month' Cash
 
 (of course you may use other accounts), and this one for sorted
 monthly expenses:
 
 ledger reg --period-sort '(-amount)' --real --effective \
--monthly -p 'this month' Expenses
 
 What are your favorite ones?

 I liked this message a lot - I've had it starred for a month now. :) And
 I'm sorry to see no replies. Why is that ?

I was not sure the following would apply, but just in case … I wrote
a small page about how I use orgmode with ledger to build org tables to
track budgets and expenses:
http://alan.petitepomme.net/tips/ledger_and_org.html

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Last week athmospheric CO₂ average (Updated August 17, 2015, Mauna Loa Obs.):
398.19 ppm

-- 

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


signature.asc
Description: PGP signature


Re: Correct Path to Ledger Source Code on a OS X Apple Machine using Homebrew

2015-05-16 Thread Alan Schmitt
On 2015-05-14 17:44, Kev Lau superinterstel...@gmail.com writes:

 i dont see anything wrong with my path:-

 (autoload ’ledger-mode ledger-mode A major mode for Ledger t)
 (add-to-list ’load-path
 (expand-file-name (/usr/local/share/emacs/site-lisp/))
 (add-to-list ’auto-mode-alist ’(\\.ledger$ . ledger-mode))

These quotes seem wrong, you should use ' not ’.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: Correct Path to Ledger Source Code on a OS X Apple Machine using Homebrew

2015-05-14 Thread Alan Schmitt
On 2015-05-13 22:09, Kev Lau superinterstel...@gmail.com writes:

 Hi,
 I am running ledger on my Apple OS X. I used homebrew for in the installation
 of ledger and am not sure what is the correct path to the ledger source .

 Trying to get it to work with emacs.

I have this in my init.el:

#+begin_src emacs-lisp
;; *** Homebrew

(add-to-list 'load-path /usr/local/share/emacs/site-lisp)

;; *** Ledger

(add-to-list 'auto-mode-alist '(\\.ledger . ledger-mode))
(setq ledger-default-date-format %Y-%m-%d)
(setq ledger-reconcile-default-commodity €)
#+end_src

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: currency issue when reconciling an account in ledger mode

2015-02-19 Thread Alan Schmitt
On 2015-02-17 13:41, thierry th...@free.fr writes:

 I have the following line in my .emacs. Does it helps?

 (setq ledger-reconcile-default-commodity €)

It does, thanks a lot!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


currency issue when reconciling an account in ledger mode

2015-02-17 Thread Alan Schmitt
Hello,

Until recently, when I started reconciling, the default currency to
enter the target amount was correctly set to €. It now is systematically
set to ¬. This is not too problematic in most cases, as I only need to
enter the extra € symbol, but there was a point where I could not to it:
the cleared balance was ¬ 0, and trying to enter any amount in € would
result in an error about currency inconsistency.

Has there been a change in the last few month regarding reconciling
currency?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: Cannot get ledger-mode to run properly

2015-01-11 Thread Alan Schmitt
On 2015-01-10 05:12, Phil Gee philipp.gi...@googlemail.com writes:

 Hello, 

 I am fairly new to ledger and emacs. Ok, to be more precise I
 currently give emacs a second chance by using it for ledger. The
 latter one works perfectly fine as command line tool in any folder, ie
 ledger is to be found in the $PATH-variable. However, if I try to run
 ledger-mode in emacs (obviously after setting it up in .emacs as
 described in the manual) I get the error message  after trying to
 generate a balance record:

 Command: ledger -f /Users/phil/ledger/test/input/demo.ledger bal
 ===

 /bin/bash: ledger: command not found

I never know which path I need to set, but there are two places
possible. Here is what I have in my configuration file:

#+begin_src emacs-lisp
(setenv PATH (concat /Users/schmitta/bin:/usr/local/bin:
   /Users/schmitta/.cabal/bin:
   /usr/local/MacGPG2/bin:
   (getenv PATH)))
(push /Users/schmitta/bin exec-path)
(push /usr/local/bin exec-path)
(push /usr/local/MacGPG2/bin exec-path)
(push /Users/schmitta/.cabal/bin exec-path)
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: Need help with installing ledger on OSX Yosemite

2014-12-09 Thread Alan Schmitt
On 2014-12-08 19:49, Kev Lau superinterstel...@gmail.com writes:

 Hi,

 Its my first time installing ledger on an OSX system. Could someone
 provide me some input on how to install, step by step instructions of
 installing Ledger on OS X (Yosemite)
 Really appreciate if someone could help advise on this or provide a
 link for this.

I recommend using homebrew. You install it following the instructions as
described in http://brew.sh then you can just do:
brew install ledger

 ***Also I have heard emacs are better way of making entries on ledger,
 could someone confirm this?

I don't know if it's better, as it's the only way I use it, but it works
great.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


(ledger-mode) reconcile unusable when pop-up-frames is t

2014-11-30 Thread Alan Schmitt
Hello,

I've set `pop-up-frames' to t and I find that reconciling using
ledger-mode is very difficult to use. The problem is that each time the
point moves in the reconcile frame, the corresponding transaction is
shown in the ledger buffer (which is great) but that buffer is now
focused. Could it be possible to leave the focus in the reconcile frame?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: (ledger-mode) reconcile unusable when pop-up-frames is t

2014-11-30 Thread Alan Schmitt
On 2014-11-30 11:58, Craig Earls ender...@gmail.com writes:

 Alan, what version of emacs are you using? I set pop-up-frames t on
 Aquamacs and I still get the renconcile buffer in the same frame as
 the ledger file.

I'm using this emacs https://github.com/railwaycat/emacs-mac-port but
I can reproduce the issue with the GNU emacs from
http://emacsformacosx.com.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: ledger-mode upcoming transactions improvements

2014-11-27 Thread Alan Schmitt
On 2014-11-26 16:12, Craig Earls ender...@gmail.com writes:

 I don't know if anyone is using the upcoming transactions feature of
 ledger-mode.

I do.

 If you do, I have just finished completing the date interpreter. You
 can now specify things like:

Great! This will help me replace lines like this:

[2016-01-05 2016-02-05 2016-03-05 2016-04-05 2016-05-05 2016-06-05 2016-07-05 
2016-08-05 2016-09-05 2016-10-05 2016-11-05] …

Please let us know when you've released it.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

-- 

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


signature.asc
Description: PGP signature


Re: ledger-mode support for other accounting backends?

2014-09-15 Thread Alan Schmitt
On 2014-09-14 10:23, Craig Earls ender...@gmail.com writes:

 I really have no idea how many people use ledger-mode.  I estimate 3.

I heavily rely on ledger-mode to enter and reconcile my personal
finances.

 Is there any interest in ledger-mode handling other backends like
 hledger or bean count.  I admit I have not used anything other than
 ledger3.

As my needs are fairly simple (envelope-based accounting), I have not
felt the need to look at other backends.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


ledger-mode and after-save-hook

2014-07-29 Thread Alan Schmitt
Hello,

I was editing an html file, and after saving it I got the following
backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp (sgml-xml-mode 
XHTML HTML))
  ledger-report-redo()
  run-hooks(after-save-hook)
  basic-save-buffer()
  save-buffer(1)
  call-interactively(save-buffer nil nil)

The problem seems to come from this line of `ledger-report-redo'

  (string= mode-name Ledger)

Here is the documentation for mode-name in this folder:

  mode-name is a variable defined in `C source code'.
  Its value is (sgml-xml-mode XHTML HTML)
  Local in buffer index.html; global value is 0
  
Automatically becomes buffer-local when set.
This variable may be risky if used as a file-local variable.
  
  Documentation:
  Pretty name of current buffer's major mode.
  Usually a string, but can use any of the constructs for `mode-line-format',
  which see.
  Format with `format-mode-line' to produce a string value.

I thus propose to change the line above to

  (string= (format-mode-line 'mode-name) Ledger)

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpCeeUvYqxGa.pgp
Description: PGP signature


Re: Getting started with budgets in ledger and org-mode

2014-07-21 Thread Alan Schmitt
On 2014-07-20 16:17, Gmail wtmon...@gmail.com writes:

 Alan,

 Thanks for sharing this. I ran across your example when I was
 searching the list but it was a bit beyond me since I hadn't a working
 version of Erik's example at the time. But yours intrigues me. As I
 read this, it appears that you keep all your ledger data in a separate
 file, mescomptes.ledger, is that correct?

Yes, I'm entering transactions and reconciling accounts using
ledger-mode only. The org-mode part is for reporting and dealing with
the budget.

 Am I also correct in thinking that all of the code blocks you shared
 are run from within the same org file?

Yes, but the one I only use is the table (the other code blocks are
there to support it). My workflow usually is (I do this once a week):
- enter the transactions by hand (I like doing it that way as it gives
  me a good sense of how I spend money, tab completion of accounts
  works great for that);
- reconcile with my bank account (the ledger-mode reconcile view is
  most useful for this);
- evaluate the formulas in the big table of my org file and look at
  how much I have left to spend for each envelope.

At the beginning of each month, I may tweak a little the budget, then
I run the last bit of code that generates a ledger transaction from
Unallocated to the Expense envelopes. I copy and paste this
transaction in my ledger file. (Usually I also copy and paste the
scheduled transactions for the coming month, but this is irrelevant to
the org setup.)

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgptVx8qKMoh0.pgp
Description: PGP signature


Re: Getting started with budgets in ledger and org-mode

2014-07-20 Thread Alan Schmitt
On 2014-07-20 03:31, Will Monroe wtmon...@gmail.com writes:

 Thanks, Erik. I guess the basic concepts of double-entry accounting have
 not sunk in very deeply yet ; ) I added assets as you suggested and it
 balanced just fine.

 Also, I appreciate your advice regarding ledger's built in budgeting
 features. I too prefer envelope budgeting and would like to implement
 something like it in my use of org-mode and ledger. I'll try to study
 your example and see if I can't make it work.

I've been using a system very close to the one Erik describes for about
six months now, and it works great. My tweaks are mostly on the org
side, to get a table summarizing what remains in the envelopes, how much
was spent in the current and in the previous month, and average
spending. This is described here:
http://permalink.gmane.org/gmane.comp.finance.ledger.general/5673

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgp_Wv7xK8JNp.pgp
Description: PGP signature


[SOLVED] Re: emacs ledger-mode reconcile issues

2014-07-16 Thread Alan Schmitt
For the record, the problem was from a different emacs package. I'm
using the writegood package and it interferes with the faces in the
reconcile window, which was the source of the bug. Turning off the
writegood mode solved the issue.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgp1mI1k1wVnf.pgp
Description: PGP signature


emacs ledger-mode reconcile issues

2014-07-13 Thread Alan Schmitt
Hello,

I recently upgraded ledger-mode, and as I'm doing my weekly
reconciliation of accounts I'm noticing two regressions:
- the reconcile buffer no longer has syntax highlighting, so tentatively
reconciled transactions (when hitting space) look the same than the
other ones (everything is black and white);
- when I finish reconciling (C-c C-c), the reconciled transaction stay
with the '!' status and are not set to the '*' status.

I checked and 'ledger-reconcile-toggle-to-pending' is still set to 't'
(I did not change it).

(A little later ...) After reading the code, I see that the
reconcile-finish is based on the faces in the reconcile buffer, so
I assume these bugs are related: the 'pending' face is not set, so the
cleared face is not set. I tried debugging the 'ledger-reconcile-toggle'
function but I don't understand why the face is not set. The
'add-text-property' code is called, but if I evaluate
(get-text-property (point) 'face) on the line I get 'nil'.

Thanks a lot,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpIgHU5lkTlD.pgp
Description: PGP signature


ledger-mode There are no uncleared entries for ...

2014-06-29 Thread Alan Schmitt
Hello,

Since a recent update to ledger-mode, I'm getting There are no
uncleared entries for ... when I try to reconcile any account, even
when they have uncleared entries.

Is this a known bug?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


pgpeM_tx1wlaU.pgp
Description: PGP signature


Re: ISO Date Format on Entries

2014-04-22 Thread Alan Schmitt
On 2014-04-22 11:18, Esben Stien b...@esben-stien.name writes:

 I have: 

 --input-date-format %Y-%m-%d
 --date-format %Y-%m-%d

 ..in my ~/.ledgerrc file.

 When I do C-c C-a RET to add an entry, it works fine and I get this:

 2014-04-22

 , but if I enter a different date at the end, f.ex 21, I get: 

 2014/04/21

 ..so it doesn't respect the --date-format if I change the date.

I have customized `ledger-use-iso-dates' here. Maybe you could give it
a try?

Alan

-- 

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


Re: [O] Weaving a budget with Org ledger

2014-04-18 Thread Alan Schmitt
 with the
many questions I had when I was writing this. I'll gladly take any
suggestion for improving all this.

Best,

Alan

-- 

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


How do I compute the monthly average of expenses for a given period?

2014-04-12 Thread Alan Schmitt
Hello,

I'm trying to compute the monthly average of my expenses since I've
started using ledger. I must be doing something wrong because the
results I get are very different from the one I compute manually.

According to the manual, to get a yearly average, I need to run

ledger -p this year --monthly --average balance ^expenses

Since I started using ledger at the beginning of March, and I don't want
to take the current month into account, here is what I tried:

ledger -f ~/Documents/Org/mescomptes.ledger -p 'from 2014-03-01 to this month' 
--average --monthly bal ^expenses

Unfortunately, it seems to return not the monthly average, but a mix of
monthly average and the transaction average (sum of every transaction
divided by the number of transactions).

Digging a little deeper, I notice that

ledger -f ~/Documents/Org/mescomptes.ledger -p 'from 2014-03-01 to today' 
--monthly bal ^expenses

and

ledger -f ~/Documents/Org/mescomptes.ledger -p 'from 2014-03-01 to today' bal 
^expenses

return the same thing, as if the --monthly option was not taken into account.

Am I doing something wrong?

Thanks,

Alan

-- 

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


[Solved] Re: How do I put spaces on the command line for an account name?

2014-04-01 Thread Alan Schmitt
Hello,

After digging a little bit more into this, I finally realized the
problem was elsewhere: I'm using a script to call ledger (to set the
-f option), and it seems the problem comes from the escaping when
calling the script. Everything works when I directly call ledger.

I'm very sorry for the noise.

Best,

Alan

-- 

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


How do I put spaces on the command line for an account name?

2014-03-30 Thread Alan Schmitt
Hello,

I have an account named Bucket:Expenses:Tel Portable. I'm trying to
get a register of all the transactions involving this account, but
I don't know how to write the command line invocation to this end. If
I do

ledger reg '^Bucket:Expenses:Tel Portable'

then I get transactions matching 'Bucket:Expenses:Tel' or 'Portable'.
I tried adding some '\' before the space, but then I'm getting errors of
the form Incomplete escape sequence found..

How can I require spaces in an account name on the command line?

Thanks,

Alan

-- 

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


Re: A few questions about ledger-mode and reconciliation

2014-03-17 Thread Alan Schmitt
Craig Earls ender...@gmail.com writes:

 Ahh...using 'a' from the reconcile windows puts you into the mini
 buffer!  Add the date the payee and the amount and it will match to
 something similar in the main file.

I see, I did not know I could put additional information when inputting
the date in the mini-buffer.

I have a small issue with it: when I use additional information, the
dates are not formatted correctly (they use '/' instead of '-'). I have
customized 'ledger-use-iso-dates' to 't' and set
'ledger-default-date-format' to %Y-%m-%d (there is no customize
interface for the latter by the way). Looking a bit at the code, I see
that adding a transaction this way calls the 'xact' command of ledger.
However I don't see how to add an option (such as -y %Y-%m-%d) to
the call to the binary. I ended up using the .ledgerrc init file to
get the correct format.

It would also be quite useful to have an optional additional parameter
when adding the transaction, positioned to the account being reconciled.
This way one would be able to omit it and the transaction's account
would be correctly set (when playing with it, I had a couple cases
where a transaction matched, but with an account different from the one
being reconciled, so the added transaction would not appear in the
narrowed buffer). Unfortunately I don't know enough emacs-lisp to add an
optional argument to a function called through call-interactively.

Thanks,

Alan

-- 

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


Re: A few questions about ledger-mode and reconciliation

2014-03-16 Thread Alan Schmitt
Craig Earls ender...@gmail.com writes:

 If you put point inside an account, it will be suggested as the
 account to reconcile.

Ah, good to know, thanks.

 With respect to the problem you reported, did you add a transaction
 that had a posting to the account your were reconciling?  I do that
 pretty frequently and haven;t had that problem.

I'm not sure to understand what you mean by that had a posting. I was
reconciling a statement from by bank account, and there was
a transaction there that was not in ledger. I hit 'a', entered a date,
but I did not see anything change in the window containing the ledger
file.

When I stop the reconcile process ('q'), I can see in the (no longer
narrowed) ledger window the date that was entered, ready for
a transaction to be completed (as if I had done a C-c C-a).

Note that I'm using the default for Ledger Narrow on Reconcile, which
is 't', so it seems that only transactions for the account being
reconciled are being shown.

 Oh, and emacs version please.

GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, Carbon Version 1.6.0 AppKit
1265) of 2014-01-16 on top-wifi.irisa.fr

Thanks,

Alan

-- 

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


Re: Is there an official ledger 3.0 release?

2014-03-13 Thread Alan Schmitt
Peter Gallagher pwgallag...@gmail.com writes:

 I'm a naïve user of Ledger so really dependent on the Homebrew recipe.
 Thank you so much for maintaining it.

I would like to add my thanks as well: homebrew makes installing ledger
really easy.

Is there a way to install the emacs ledger-mode through the same recipe?
I've been downloading it separately, but if I understood correctly, it's
part of the source, so it could be installed along with the binary.

Thanks again,

Alan

-- 

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


Re: Is there an official ledger 3.0 release?

2014-03-13 Thread Alan Schmitt
Steve Purcell st...@sanityinc.com writes:

 On 13 Mar 2014, at 09:18, Alan Schmitt alan.schm...@polytechnique.org wrote:
 Is there a way to install the emacs ledger-mode through the same recipe?
 I've been downloading it separately, but if I understood correctly, it's
 part of the source, so it could be installed along with the binary.

 If you've got Emacs 24 (which you should!), might I suggest just
 installing ledger-mode using the built-in package manager? There's an
 always-up-to-date snapshot package of ledger-mode available in MELPA:

 http://melpa.milkbox.net/

Yes, this is what I'm doing at the moment.

Thanks,

Alan

-- 

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


Re: Scheduling transactions in ledger-mode

2014-03-13 Thread Alan Schmitt
Alan Schmitt alan.schm...@polytechnique.org writes:

 Hello Craig,

 BTW this is a part of ledger-mode in emacs it is not part of
 ledger-cly  if you are not using emacs  it won't help you.

 Yes, I'm looking at how to do this within emacs.

 Craig Earls ender...@gmail.com writes:

 Here is a sample:

 [*/*/10] (POS) Commissary
 ; :Expected:
 Expenses:Groceries   $300.00
 Assets:VWCU:Joint

 How do I generate a real transaction from this? The doc says Ledger
 mode provides a way to schedule upcoming transaction with a flexible
 scheduler that allows you to specify the transactions in a separate
 ledger file and calculate the upcoming occurences of those transactions.
 You can then copy the transactions into your live data file. but
 I don't know what command to use.

I've figured this out, so here it is if it can help others.

- customize the ledger-schedule-file variable to point to the file where
  you want to put the upcoming transactions (default value is ...)
- create this file, and add a transaction there:
  #+begin_src ledger
[*-*-15]  Test
Expenses:Quotidien10 €
Assets:SG Alan 
  #+end_src
- in your main ledger file, choose menu item Ledger then Show
  Upcoming Transactions, bound to C-c C-u, bound to the function
  ledger-schedule-upcoming. By default it will look at 7 days in the
  past and 14 days in the future to propose transactions (see customize
  group ledger-schedule to change these values)
- copy and paste the transactions you want to your main ledger file

Best,

Alan

-- 

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


Re: Scheduling transactions in ledger-mode

2014-03-13 Thread Alan Schmitt
Craig Earls ender...@gmail.com writes:

 Thanks for the write-up. I am not completely finished with the
 scheduling engine yet. I want to add day names rather than simple dates
 (like every fourth Friday).

Is it possible to have something like every 10th of the month until
such date? If so, I could definitely use it.

 I am also not completely happy with the user interface so suggestions
 for usability would be most welcome.

Two things that would be most useful:
- hide transactions already entered (I see there is a function that
should do that in the future, but whose body is empty at the moment);
- use a key-combination to send the transaction to the main file. This
would require specifying the file to send it to (it could be some
information at the top of the file). Without thinking about it, I hit
C-c C-c on a transaction expecting it to be copied to the main ledger
file.

Having the main ledger file location could also help with tab-completion
of names when creating scheduled transactions, if there was a way to
look up the names there.

Finally, it would be nice to have the syntax highlighting for the date
(right now the square brackets are not highlighted). As a great bonus,
a tool tip displaying the next occurrence(s) of a transaction would be
wonderful.

I guess I'll stop here with the suggestions ;-) Thank you for this
scheduling support, I find it very helpful.

Alan

-- 

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


Re: Is there an official ledger 3.0 release?

2014-03-13 Thread Alan Schmitt
Hi Alexis,

Alexis surryh...@gmail.com writes:

 Hi Alan,
 as a Vim user I have little to no knowledge about Emacs,
 if you tell me which files from the ledger source tree
 need to be installed where I can add that to the formula.

The file could be copied to /usr/local/share/emacs/site-lisp. But I'm
now convinced it should not ...

 Being rather unfamiliar with the Emacs environment,
 I'm uncertain which is the 'proper' way of doing it:
 installing to from source or via MELPA as Steve Purcell mentioned.

Indeed, installing via MELPA is probably better, as it would allow one
to easily upgrade the emacs mode without upgrading the program itself.

Thanks,

Alan

-- 

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


Re: Scheduling transactions in ledger-mode

2014-03-11 Thread Alan Schmitt
Hello Craig,

 BTW this is a part of ledger-mode in emacs it is not part of
 ledger-cly  if you are not using emacs  it won't help you.

Yes, I'm looking at how to do this within emacs.

Craig Earls ender...@gmail.com writes:

 Here is a sample:

 [*/*/10] (POS) Commissary
 ; :Expected:
 Expenses:Groceries   $300.00
 Assets:VWCU:Joint

How do I generate a real transaction from this? The doc says Ledger
mode provides a way to schedule upcoming transaction with a flexible
scheduler that allows you to specify the transactions in a separate
ledger file and calculate the upcoming occurences of those transactions.
You can then copy the transactions into your live data file. but
I don't know what command to use.

I tried to copy and paste your example in ledger-mode, and I don't see
anything in the menu. Is there a default command / keyboard shortcut?

Thanks,

Alan

-- 

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


Scheduling transactions in ledger-mode

2014-03-10 Thread Alan Schmitt
Hello,

I'm migrating my finance tracking from MoneyWell to ledger, and after
reading the documentation on ledger-mode, I still have one question.

According to the documentation
(http://ledger-cli.org/3.0/doc/ledger-mode.html#Scheduling-Transactions),
it is possible to schedule occurrences of repeating transactions in
a separate file using a special format. However there are not many
details in the documentation. Could someone show me how to do it?

Thanks a lot,

Alan

-- 

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


Re: leap day

2012-02-29 Thread Alan
 This is now fixed in 'next'.

Great; it works now. Thanks!


Re: leap day

2012-02-28 Thread Alan Bram
On Tue, Feb 28, 2012 at 6:02 PM, John Wiegley jwieg...@gmail.com wrote:

 Hmm... do you use a 'Y' directive to specify the year?

 It sounds like a bug if I don't accept 2/29 this year.

Yes. Here's the entire input file contents:


Y2008

2/29E-trade Bank
Income:Bank Interest
Assets:Bank:E-trade Bank $10.00


Sorry, I tried to attach it to my original message, but ... I guess
google groups doesn't allow attachments?


Re: periodic reports for expense category groups

2012-01-24 Thread Alan Bram
Thanks, Pete! That's exactly what I was looking for.

Cheers,
 - arb

On Mon, Jan 23, 2012 at 7:50 PM, Peter Keen peter.k...@bugsplat.info wrote:
 You want to use a register report with the -M for monthly and -n for
 'total' options. Like this:

    ledger -Mn -b 2011/01/01 reg expenses


 --Pete

 On Mon, Jan 23, 2012 at 7:27 PM, Alan sf.fly...@gmail.com wrote:
 Hi,

 Is it possible to get a periodic report (e.g., monthly since last year) of
 all expenses, but have just one line per period for all expenses?

 I understand how to get the report for just one expense account. And I see
 that if I query for reg ^exp I get all expense accounts, but reported
 individually. What I would like is a much shorter report: just one total
 expense amount per period.

 Thanks!




periodic reports for expense category groups

2012-01-23 Thread Alan
Hi,

Is it possible to get a periodic report (e.g., monthly since last year) 
of all expenses, but have just one line per period for all expenses?

I understand how to get the report for just one expense account. And I see 
that if I query for reg ^exp I get all expense accounts, but reported 
individually. What I would like is a much shorter report: just one total 
expense amount per period.

Thanks!




Re: A web-based reporting system for Ledger

2012-01-05 Thread Alan Bram
I've had a similar itch, but never got around to doing much about it.
So this is interesting to me.

How long does it take to load a substantial ledger file into Postgres?

On Sat, Dec 31, 2011 at 7:59 PM, Peter Keen peter.k...@gmail.com wrote:

 I've put together a little reporting system for Ledger that I think
 others might find useful. Basically, it watches your ledger file for
 changes and loads it into a PostgreSQL database table. Reports are
 HTML files with embedded ruby templates that contain SQL queries.


format changes?

2011-03-01 Thread Alan Bram
Hi,

I used ledger version 2.3 for a long time, and now I'm trying to use
version 2.6.

Have the format strings changed? I used to be able to say:

  ledger --plot-total-format '%[%m] %(ST)\n' -J reg mortgage

because I want to get the amount without any dollar sign or comma. In fact,
the info manual (still) says that %(ST) is part of the default format.

But now, ledger says While parsing value expression: ... Error:
Unknown identifier 'ST'.

If I use %T instead of %(ST) I get the right value I want, but with
the undesired dollar sign and comma.

Is there some way to get what I want?

(Why am I specifying a non-default format at all? Because I want just the month
part, not the whole date.)

Cheers,
 - arb


Re: A quick poll: XML support

2009-10-30 Thread Alan Bram

Hi,

I use XML output occasionally, so I would need that in order to upgrade.

Thanks!

Cheers,
 - ar