How to type out a sales slip?

11 views
Skip to first unread message

Johann Klähn

unread,
Nov 26, 2009, 7:40:55 AM11/26/09
to ledge...@googlegroups.com
Hi all,
I'm experimenting with some thorough bookkeeping on my shopping
expenses. I want to keep track both of the amount and weight/content of
what I'm buying. For fruits (or anything with a price in �/kg) this is
kind of straightforward:
Aufwand:Einkauf:Lebensmittel:Obst 1.212kg @ 1,09�
; Kauf: platano americano

But I'm struggling to find a good notation for all those other goods.

Aufwand:Einkauf:Lebensmittel:Getr�nke (1.5l * 6) @@ (0,18� * 6)
; Kauf: agua mineral
; Marke: Eroski
Is what I'm using at this moment. This allows me to copy-and-paste
between different transactions and I only have to change the count in
two places. Something like this would be better:
Aufwand:Einkauf:Lebensmittel:Getr�nke ((1.5l @@ 0,18�) * 6)
; Kauf: agua mineral
; Marke: Eroski
But this fails with the message "Error: Missing ')'", so I assume
nesting of parantheses in this way is not supported at the moment.

Do you have any other idea that allows me to keep all this information
together?

Some of my queries (I have "C 1.00kg = 1000g" at the top of my ledger file):
ledger bal -l 'commodity="g"'
ledger reg '%kauf=muesli' -X g

It also would be very nice for those kind of queries to be supported:
ledger prices 'Lebensmittel:Milch'
ledger prices '%kauf=leche'
This would allow me to distinguish between all those �/kg and �/l
prices, when doing reports.

I'm looking forward to your ideas or questions!

Johann

John Wiegley

unread,
Dec 1, 2009, 3:03:52 AM12/1/09
to ledge...@googlegroups.com
On Nov 26, 2009, at 7:40 AM, Johann Klähn wrote:

> Something like this would be better:
> Aufwand:Einkauf:Lebensmittel:Getränke ((1.5l @@ 0,18€) * 6)
> ; Kauf: agua mineral
> ; Marke: Eroski
> But this fails with the message "Error: Missing ')'", so I assume nesting of parantheses in this way is not supported at the moment.

I believe you could use:

Aufwand:Einkauf:Lebensmittel:Getränke ((1.5l {=0,18€}) * 6)
; Kauf: agua mineral
; Marke: Eroski

The @/@@ operator is for the posting only, and is not actually a part of the amount -- which is why you can't use it in expressions.

As for supporting those queries for prices, I'll look into that.

John

Johann Klähn

unread,
Dec 1, 2009, 8:17:38 AM12/1/09
to ledge...@googlegroups.com
>
> I believe you could use:
>
>   Aufwand:Einkauf:Lebensmittel:Getränke     ((1.5l {=0,18€}) * 6)
>   ; Kauf: agua mineral
>   ; Marke: Eroski
>

Ok, but then 0,18€ has to be the price for 1l. How do I enter the
price for 1.5l? (Which would be more convenient and works with my
clumsy method).

Thanks,
Johann

John Wiegley

unread,
Dec 1, 2009, 2:32:44 PM12/1/09
to ledge...@googlegroups.com
On Dec 1, 2009, at 8:17 AM, Johann Klähn wrote:

> Ok, but then 0,18€ has to be the price for 1l. How do I enter the
> price for 1.5l? (Which would be more convenient and works with my
> clumsy method).

(1l {=0,18€} * 1.5 * 6)?

John

Johann Klähn

unread,
Dec 2, 2009, 7:03:57 AM12/2/09
to ledge...@googlegroups.com
Well, maybe to make this clear:
Just suppose I bought 5 tins with 350g of fish each and paid 1,69€ for
one of them (well. just an example).

Up to this moment, I'll enter it like this:
Aufwand:Bargeld (1,69€ * 5)
Aufwand:Einkauf:Lebensmittel:Fisch (350g * 5) @@ (1,69€ * 5)

The following obviously won't work, because it interprets 1,69€ as the
price for 1g:
Aufwand:Bargeld (1,69€ * 5)
Aufwand:Einkauf:Lebensmittel:Fisch ((350g {=1,69€}) * 5)
==> does not balance

Quick proof with 0,00483 = 1,69/350:
Aufwand:Bargeld (1,69€ * 5)
Aufwand:Einkauf:Lebensmittel:Fisch ((350g {=0,00483€}) * 5)
==> does balance

But what would be the most convenient way to enter the two things I've
got? Something like a simplified version of the first statement.

Thanks,
Johann

John Wiegley

unread,
Dec 2, 2009, 4:16:18 PM12/2/09
to ledge...@googlegroups.com
On Dec 2, 2009, at 7:03 AM, Johann Klähn wrote:

> Up to this moment, I'll enter it like this:
> Aufwand:Bargeld (1,69€ * 5)
> Aufwand:Einkauf:Lebensmittel:Fisch (350g * 5) @@ (1,69€ * 5)

I would just do it this way:

Aufwand:Einkauf:Lebensmittel:Fisch (350g * 5)
Aufwand:Bargeld (-1,69€ * 5)

You rarely need "@@", as Ledger can infer it based on the ordering of the postings.

John

Johann Klähn

unread,
Dec 3, 2009, 7:53:03 AM12/3/09
to ledge...@googlegroups.com
On Wed, Dec 2, 2009 at 10:16 PM, John Wiegley <jwie...@gmail.com> wrote:
> I would just do it this way:
>
>  Aufwand:Einkauf:Lebensmittel:Fisch          (350g * 5)
>  Aufwand:Bargeld                           (-1,69€ * 5)
>
> You rarely need "@@", as Ledger can infer it based on the ordering of the postings.
>

But given a transaction like this, wouldn't I have to double the
"Aufwand:Bargeld" lines for every single transaction?

2009/10/02 * Lidl
; Ort: Bretxa
Aufwand:Bargeld -3,91€
Aufwand:Einkauf:Lebensmittel:Getränke (1l * 3) @@ (0,99€ * 3)
; Kauf: zumo de naranja (con pulpa)
; Marke: Vitafit
Aufwand:Einkauf:Lebensmittel:Milch (1l * 2) @@ (0,47€ * 2)
; Kauf: leche desnatada
; Marke: Finessa

This would turn out like this:

2009/10/02 * Lidl
; Ort: Bretxa
Aufwand:Bargeld (-0,99€ * 3)
Aufwand:Einkauf:Lebensmittel:Getränke (1l * 3)
; Kauf: zumo de naranja (con pulpa)
; Marke: Vitafit
Aufwand:Bargeld (-0,47€ * 2)
Aufwand:Einkauf:Lebensmittel:Milch (1l * 2)
; Kauf: leche desnatada
; Marke: Finessa

Thus I'd still have to edit "* 3" etc. in two places and I loose
the ability to balance against "-3,91€" (the overall amount),
what would have been a good way to check
that I didn't miss out on any items on the sales slip.

Thanks for your suggestions,
Johann

John Wiegley

unread,
Dec 3, 2009, 8:45:20 AM12/3/09
to ledge...@googlegroups.com
On Dec 3, 2009, at 7:53 AM, Johann Klähn wrote:

> But given a transaction like this, wouldn't I have to double the
> "Aufwand:Bargeld" lines for every single transaction?
>
> 2009/10/02 * Lidl
> ; Ort: Bretxa
> Aufwand:Bargeld -3,91€
> Aufwand:Einkauf:Lebensmittel:Getränke (1l * 3) @@ (0,99€ * 3)
> ; Kauf: zumo de naranja (con pulpa)
> ; Marke: Vitafit
> Aufwand:Einkauf:Lebensmittel:Milch (1l * 2) @@ (0,47€ * 2)
> ; Kauf: leche desnatada
> ; Marke: Finessa

Ah yes, in this case you are correct.

Note that the following:

Aufwand:Einkauf:Lebensmittel:Getränke (1l * 3) @@ (0,99€ * 3)

Is the same as saying this:

Aufwand:Einkauf:Lebensmittel:Getränke (1l * 3) @ 0,99€

Since @ specifies the "per unit" price.

John
Reply all
Reply to author
Forward
0 new messages