On Mon, Jun 23, 2014 at 4:08 PM, thierry <[email protected]> wrote: > > On Monday, June 23, 2014 6:42:19 PM UTC+2, Martin Blais wrote: >> >> >> Just to be clear, it also makes sense to do this in Beancount: >> >> 2014-06-20 balance Assets:Some:Account 413.43 USD >> 2014-06-20 balance Assets:Some:Account 201.24 CAD >> >> I too have been wondering if a check on the totality of an inventory >> might be useful. >> Something like this: >> >> 2014-06-20 balance* Assets:Some:Account 413.43 USD, 201.24 CAD >> >> whereby if there are any other commodities in this account at that time >> (e.g., EUR) this would raise an error. >> > > Semantically speaking, I would argue that this is two different things: > - balance assertions, are from my point of view, to assert that balance is > correct, I mean the *amount* > - checking that EUR is not used, is from my point of view a different > thing, and would be better achieved with a directive like "account > Assets:Some:Account commodity USD" and "account Assets:Some:Account > commodity CAD", those two statements would tell that no other > *commodity/currency* is allowed in that account. >
That's a good point. This is already in Beancount BTW, as part of the "open" directive, you can optionally add a list of commodities to restrict to, e.g. 2010-01-01 open Assets:Some:Account USD,CAD (The "USD,CAD" bit is optional.) With this restriction, any transaction posting a change to this account in a commodity that is not USD nor CAD will trigger an error. -- --- 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.
