Hi all,
in a previous thread we have discussed how the notion of "payee" in
Ledger-CLI seems to be ambiguous in the sense that:
- sometimes it refers to the narrative part of a transaction, i.e. to
what appears after the "*" (or equivalent) symbol. I refer to this as
the "narrative is payee" interpretation.
- sometimes it refers to the content of the payee special metadata tag
(interpretation: "special metadata field is payee")
I've experiment with it a bit more, and I've a question about the
specific examples reported below:
------ BEGIN payee.ledger ----------------------------------------------
2014/08/01 * foo quid
Expenses:F 1 EUR
Assets:Checking
2014/08/01 * bar
; payee: foo
Expenses:B 1 EUR
Assets:Checking
2014/08/01 * qux
; payee: baz
Expenses:Q 1 EUR
Assets:Checking
; ------------------------------------------------------------------------------
;
; $ ledger -f payee.ledger reg -l 'payee =~ /quid/'
; 14-Aug-01 foo quid Expenses:F 1 EUR 1 EUR
; Assets:Checking -1 EUR 0
;
; # matches 1st transaction, as expected (interpretation: "narrative is payee")
; ------------------------------------------------------------------------------
; $ ledger -f payee.ledger reg -l 'payee =~ /foo/'
; 14-Aug-01 foo quid Expenses:F 1 EUR 1 EUR
; Assets:Checking -1 EUR 0
; 14-Aug-01 foo Expenses:B 1 EUR 1 EUR
; foo Assets:Checking -1 EUR 0
;
; # matches both 1st (interpretation: "narrative is payee") and 2nd
; # (interpretation: special metadata field is payee) transactions, quite
; # puzzling
; ------------------------------------------------------------------------------
;
; $ ledger -f payee.ledger reg -l 'payee =~ /qux/'
;
; # doesn't match 3rd transaction, whereas it should (at least according to the
; # interpretation "narrative is payee"). Is there any way to match on the
; # "narrative" line when payee is defined as a metadata tag?
; ------------------------------------------------------------------------------
;
; $ ledger -f payee.ledger reg -l 'payee =~ /baz/'
; 14-Aug-01 baz Expenses:Q 1 EUR 1 EUR
; baz Assets:Checking -1 EUR 0
; $
; ------------------------------------------------------------------------------
------ END payee.ledger ----------------------------------------------
It seems that when payee is present as a metadata, it completely
overrides the narrative line as payee. Whereas when it is not present,
the narrative subsumes the role of payee. That might be a fine behavior
to have (or not --- I personally find it quite puzzling), but my
immediate problem is that I haven't found a way to match over the
narrative line when the payee tag is present.
Is there a way to do so that I've overlooked?
More generally, I find these examples quite convincing about the need of
separating more clearly narrative and payee information, and allowing
independent querying over the two fields of a transaction. Is that
something that Ledger developers would be open to consider refactoring
in the query interface? If so, I'll be happy to open a Bugzilla entry
about this.
TIA,
Cheers.
--
Stefano Zacchiroli . . . . . . . [email protected] . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Former Debian Project Leader . . @zack on identi.ca . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »
--
---
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.