On 9/11/14 3:43 AM, Gour wrote:
Hello!
I'm looking whether I can have workaround for missing support of
'--by-payee' option in hledger by having transactions that would work in
both ledger and hledger.
In Gnucash I use(d) the following format for Description field for the
transaction:
milk, sugar, cosmetic (Spar, ČK)
where 'milk, sugar, cosmetic' is list of main items bought in some place
and 'Spar' denotes the name of shop (payee) while 'ČK' is abbreviation
for the city where the shopping was done (naturally, there are same
shops in different cities and that's why I want to record that
information.)
Now I see that in ledger there is option of 'Payee' meta data and the
transaction can be recorded as:
2004/01/19 milk, sugar, cosmetic
Expenses:Food:Groceries $ 44.00 ; Payee: "Kaufland, ČK"
Assets:Checking
and if I use:
ledger register -f sample.dat --by-payee Food
I'll get nice report sorted by payees.
Now, hledger does not have support for '--by-payee', so I tried to mimic
it by using 'Payee:' tag.
Hi Gour, some notes re your hledger tag questions.
Now, I do not know how to handle hledger's tag like Payee: "Kaufland,
ČK",
I didn't either. Currently it's not possible, because hledger ends a tag
value if it sees a comma. The quotes don't help (that would be a nice
enhancement). I've made this clearer at http://hledger.org/manual#tags .
Secondly, I'm seeing trouble matching on non-ascii characters. So eg
tag:Payee=K matches, but tag:Payee=Č doesn't, even with a locale
configured (I used LANG=en_US.utf-8). This should be working, see if you
can reproduce and if so maybe open a bug.
so I simplified it to: Payee:Kaufland, but the command:
hledger register -f sample.dat "Payee:Kaufland" Food
lists all the Food's transactions and not *just* the one done in
"Kaufland".
Seems to be working for me:
$ hledger -f t.j print
2004/01/19 milk, sugar, cosmetic
Expenses:Food:Groceries $ 44.00 ; Payee: "Kaufland, ČK"
Assets:Checking $ -44.00
2004/01/19 another
Expenses:Food:Groceries $ 44.00 ; Payee: other
Assets:Checking $ -44.00
$ hledger -f t.j reg Food tag:Payee
2004/01/19 milk, sugar, cosm.. Ex:Food:Groceries $ 44.00 $ 44.00
2004/01/19 another Ex:Food:Groceries $ 44.00 $ 88.00
$ hledger -f t.j reg Food tag:Payee=Kaufland
2004/01/19 milk, sugar, cosm.. Ex:Food:Groceries $ 44.00 $ 44.00
Another problem is that having the tag
Payee:Kaufland
creates the problem for ledger:
ledger register -f sample.dat --by-payee Food
hledger ignores leading/trailing space in the tag value, so it's fine to
put a space after :.
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.