--
---
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.
For more options, visit https://groups.google.com/d/optout.
@Martin: I use virtual accounts sparingly, but there are situations
where they are logically necessary.
Keeping in mind that I am not an
accountant, consider the following example: an employee in the public
sector gets a salary that is taxed in advance.
He may get a monthly
statement with the following information:
Gross income: $5200
Family allowance (tax-exempt): $100
Taxes: $1700
Net income: $3500
The net income is the money that he eventually gets in the bank. He may
keep track of this information as follows:
2013/05/17 * Myself
Assets:Checking:Myself $3500.00
Income:Salary:Family Allowance $-100.00
Income:Salary:Taxable:Net
[Expenses:Taxes:Salary] $1700.00
[Income:Salary:Taxable:Taxes] $-1700.00
Since the employee never really gets the taxed amount, I think that
those are conceptually virtual postings and must be treated as such.
What do you think?
2014-05-07 * "GOOGLE INC PAYROLL" ^google-XXXXXXX Assets:US:MyBank:Checking XXXX.XX USD Income:US:Google:GroupTermLife -XXXX.XX USD Income:US:Google:Salary -XXXX.XX USD Income:US:Google:Deductions:Dental XXXX.XX USD Income:US:Google:Deductions:GroupTermLife XXXX.XX USD Income:US:Google:Deductions:InternetReimbursement -XXXX.XX USD Income:US:Google:Deductions:Medical XXXX.XX USD Income:US:Google:Deductions:TransitPreTax XXXX.XX USD Income:US:Google:Deductions:Vision XXXX.XX USD Expenses:Taxes:US:Google:Tax:Medicare XXXX.XX USD Expenses:Taxes:US:Google:Tax:Federal XXXX.XX USD Expenses:Taxes:US:Google:Tax:City XXXX.XX USD Expenses:Taxes:US:Google:Tax:SDI XXXX.XX USD Expenses:Taxes:US:Google:Tax:State XXXX.XX USD Expenses:Taxes:US:Google:Tax:SocSec XXXX.XX USD Assets:US:Google:Vacation X.XX VACHR Income:US:Google:Vacation -X.XX VACHR
Now, a balance report including virtual postings will show all the
details:
ledger bal myself income taxes
$3500.00 Assets:Checking:Myself
$1700.00 Expenses:Taxes:Salary
$-5200.00 Income:Salary
$-100.00 Family Allowance
$-5100.00 Taxable
$-3400.00 Net
$-1700.00 Taxes
--------------------
0
A balance report without virtual transactions will only show the net
income:
ledger bal myself income taxes --real
$3500.00 Assets:Checking:Myself
$-3500.00 Income:Salary
$-100.00 Family Allowance
$-3400.00 Taxable:Net
--------------------
0
Enjoy,
Life
* Martin Blais <bl...@furius.ca> [2014-05-17 13:52]:
> - Your non-taxable allowance can be tracked in a separate contra income> account (that is, one with a positive amount). That's what I do for some ofI don't think the allowance is a deduction. If I understood
> my deductions.
correctly, the $5200 income consists of $5100 (taxable) salary and
$100 (exempt) allowance.
So:
should be:
> 2013/05/16 * Myself
> Income:Employer:Salary -5200.00 USD
> Income:Employer:Deductions:FamilyAllowance 100.00 USD
Income:Employer:Salary -5100.00 USD
Income:Employer:Allowance:Family -100.00 USD
> Assets:Bank:Checking 3500.00 USDCorrect. But I think Lifepillar showed that using virtual accounts is
> Expenses:Taxes:Salary 1700.00 USD
>
> Your "net" income is simply the balance of the Income:Employer:Salary
> account - Expenses:Taxes:* accounts. You can write a query to calculate it.
much more elegant. You can simply use --real and get the net figure.
Without using virtual accounts, you have to run a long "bal" command,
especially if there are many different expenses accounts (tax might be
split into income tax, social security, etc).
> Here's how I actually do this (from my Ledger, removed numbers, kept theFWIW, I use something very similar.
> signs):
I don't know you call this a deduction. Wouldn't
> 2014-05-07 * "GOOGLE INC PAYROLL" ^google-XXXXXXX
> Assets:US:MyBank:Checking XXXX.XX USD
> Income:US:Google:GroupTermLife -XXXX.XX USD
> Income:US:Google:Salary -XXXX.XX USD
> Income:US:Google:Deductions:Dental XXXX.XX USD
> Income:US:Google:Deductions:GroupTermLife XXXX.XX USD
> Income:US:Google:Deductions:InternetReimbursement -XXXX.XX USD
Income:US:Google:Allowance:InternetReimbursement
be a better name?
Are you should these shouldn't be Expense accounts? e.g.
> Income:US:Google:Deductions:Medical XXXX.XX USD
> Income:US:Google:Deductions:TransitPreTax XXXX.XX USD
> Income:US:Google:Deductions:Vision XXXX.XX USD
Expenses:Health:Insurance
Is this to track vacation days?
> Assets:US:Google:Vacation X.XX VACHR
> Income:US:Google:Vacation -X.XX VACHR
> Auxiliary note: One might argue that the tax withheld sitting at theI find it hard to make that argument. (You know, death and taxes... ;)
> government in an account with your name on it is an "Asset" account (one
> like that for each tax year), and that the expense only gets incurred at
> the time you make your tax filing for that year (e.g. the following April)
This is exactly what I do. If you have to pay additional tax, you
> I prefer to account for taxes as an Expense, so that throughout the
> year my income statement includes a good approximation of what my
> tax expenses will turn out to be for that year (which is exactly
> what source withholding is supposed to be), and at the time of
> filing I make an adjustment on that same expenses account when I
> compute the exact amount.
just book another expense If you're lucky enough to get a refund, you
reduce the expense. The only downside with this is that a large
refund (or payment) will mess up the overall expenses for that month
(e.g. you might have negative expenses in a month because your refund
was so high). If you did accrual accounting properly, you'd probably
have to split it up or at least assign it to the correct year (refund
in April is really for the previous year); I don't do this 100%
correctly in my personal finance (so far).
I'd use tags.
> I'm starting to think that I should start creating a distinct expense
> account for each tax year, because that's how both the Canadian and US
> governments handle it: amounts that you post get booked to a particular
> year
Moreover, these virtual accounts work here in this specific case, but what if they're needed somewhere else in the ledger to solve some other problem? Can you have multiple sets of them or is there a single meaning for "--real"? How is a tax expense not "real"? What does this mean? The reason I tend to kick back about this feature is that it has happened to me at least ten times over the time I was learning how to do this that I would trip up because I did not know how to book my transactions right and ended up using virtual postings as a crutch whereas I should have been forced to get more creative and figure it out. Eventually I managed to get rid of all of them without loss of information. I plan to document all these as examples at some point, I think a lot of examples would be useful to someone learning the DE method. That's why I feel quite strongly that in most cases the problem needs not break out of the DE model; I'm sure there are *some* cases where they are needed, but I just don't have those use cases myself and I don't see good use cases I couldn't convert. It would be useful to build a list of real-world use cases of virtual postings and see if they can all be solved without or not - make a compelling argument about the need for virtual postings.
On Sat, May 17, 2014 at 7:06 PM, Martin Michlmayr <t...@cyrius.com> wrote:
> Income:US:Google:Deductions:Medical XXXX.XX USDAre you should these shouldn't be Expense accounts? e.g.
> Income:US:Google:Deductions:TransitPreTax XXXX.XX USD
> Income:US:Google:Deductions:Vision XXXX.XX USD
Expenses:Health:Insurance... and Dental.Hmmm that's a good point, I'll review this indeed...It does bother me that those have generally positives amounts, and points to your comment likely being right.I'll see why they call these deductions.
2014-05-09 * "GOOGLE INC PAYROLL / GOOGLE INC PAYROLL" ^google-XXXXXXX Assets:US:TD:Checking XXXX.XX USD Income:US:Google:GroupTermLife -XXXX.XX USD Income:US:Google:Salary -XXXX.XX USD Expenses:Health:Dental:Insurance:Google XXXX.XX USD Expenses:Health:Life:GroupTermLife:Google XXXX.XX USD Expenses:Communications:Internet:Reimbursement:Google -XXXX.XX USD Expenses:Health:Medical:Insurance:Google XXXX.XX USD Expenses:Transportation:PublicTrans:TransitPreTax XXXX.XX USD Expenses:Health:Vision:Insurance:Google XXXX.XX USD Expenses:Taxes:US:TY2014:Medicare:Google XXXX.XX USD Expenses:Taxes:US:TY2014:Federal:Google XXXX.XX USD Expenses:Taxes:US:TY2014:City:Google XXXX.XX USD Expenses:Taxes:US:TY2014:SDI:Google XXXX.XX USD Expenses:Taxes:US:TY2014:State:Google XXXX.XX USD Expenses:Taxes:US:TY2014:SocSec:Google XXXX.XX USD Assets:US:Google:Vacation X.XX VACHR Income:US:Google:Vacation -X.XX VACHR
It does not look as "regular" but it is more correct. All my health expenses are now grouped together under Expenses:Health:*, which integrates both my health insurance costs and the amounts I pay out-of-pocket (e.g., copays, deductibles, drugs/pharmacy). I don't know why I hadn't done this before, this is so much better. Note that the internet reimbursement is booked by the payroll company as a negative deduction so I'm choosing to book it as reducing my ISP internet expense as well... I could have chosen to view it as an income account but I prefer not to, because it always just reduces the expense.
Also, booking the tax accounts this way matches more clearly how one organizes accounts to obtain a "taxes paid / total income" ratio for that year. I can just sum up Expenses:Taxes:US:TY2014;* to find out how much in taxes was paid *for that year*. (For those who might be unclear about why this is needed, 2014 taxation year expenses may be incurred in 2015, first at the date of filing taxes, and later on if/when I receive an adjustment/correction from the government for that year, so it's impossible to use the transaction dates for this purpose. Corrections may appear years after filing too. Note that all tax communications tend to have a taxation year attached to them, so it's easy to book the amount in the right year.)This is an example where the "close" directive comes in handy: after filing taxes and receiving confirmation from the government, I can just choose to mark the accounts for that taxation year as closed, and they will not show up in the reports for years beyond the close date.Now the truly, wonderfully great thing is how much *power* we have using our little text files. It's exhilarating. I can write a little script that renames my accounts automatically - I use xx-rename - look at it in visual diff, run bean-web on it, look at the reports, decide if I like it or not, revert and retry if I screwed up until I get it right. If I don't like it, "hg revert" and I'm back where I was. If I like it, "hg commit" and move on. Global renames, even of transactions far in the past, are not a problem. Text file power! The knowledge you acquire while learning how to do your bookkeeping right impacts your entire past transaction history, you can fix everything. Knowing that I will never lose any of this data to a software update or a company going EOL'ing their product and that I am able to completely reshape my history in the best way possible is something I could never give up now. Try doing that in any of the bookkeeping software that provide GUI interfaces.
> I'm starting to think that I should start creating a distinct expenseI'd use tags.
> account for each tax year, because that's how both the Canadian and US
> governments handle it: amounts that you post get booked to a particular
> year
That would work too, but perhaps would be more annoying.In solving many of these problems I have found that tags will often be used as a subaccount would, so for at least some uses they're equivalent. A similar remark can be made about payees: a payee could often be replaced by a subaccount if the transactions for that payee always book to the same account, e.g. Expenses:Internet with payee "Time Warner" or Expenses:Internet:TimeWarner. I have been pondering adding an option to automatically convert one into the other at runtime if this occurs; I could automatically detect when a consistent payee always occurs to the same account.Thanks for your thoughtful comments,
> > > It would be useful to build a list of real-world use cases of virtual > > postings and see if they can all be solved without or not - make a > > compelling argument about the need for virtual postings. > > I'd be interested to know your solution to the following problems, which were > the reason virtual postings were created in the first place. > > Problem The First > > I was a treasurer for my local religious community. We had 3 physical bank > accounts, and 5 virtual "community accounts". The physical accounts kept the > actual money, and represented our relationship with the outside world; the > virtual accounts indicated how that money had been allotted, and represented > our relationship with the community. The banks only cared about the real > accounts, and the community only cared about the virtual accounts. > > To prevent ridiculous amounts of double-booking, I invented virtual postings > so that money deposited by a transaction could immediately go to "two places > at once": both to the physical bank(s), and to the community fund(s). By > reporting with --real I saw only the world's view, and by reporting without > --real I saw the whole picture. There is a crucial question to ask here, which divides this problem into two cases: "Are the virtual accounts straddling real accounts?" In other words, are each of the 5 virtual account's postings fully contained within the real accounts? If not, this is easily solved using subaccounts. Like this, for example: Assets:Real:Account1 Assets:Real:Account1:Community1 Assets:Real:Account1:Community2 Assets:Real:Account2 Assets:Real:Account3 Assets:Real:Account3:Community3 Assets:Real:Account3:Community4 This gives you three real accounts: Assets:Real:Account1 Assets:Real:Account2 Assets:Real:Account3 And five community accounts: Assets:Real:Account1:Community1 Assets:Real:Account1:Community2 Assets:Real:Account2 Assets:Real:Account3:Community3 Assets:Real:Account3:Community4 By looking at reports for 'Assets:Real:Account1', you are looking at the register of all real transactions. In practice, transfers between the community accounts there in will be few and easy to ignore when looking at the register. This _does_ hinge on the capability to display a register of transactions for a parent account that includes all of the postings of child accounts. (This is how Beancount renders a journal of transactions for a parent account by default.) If the community accounts straddle the real accounts, you just filter by the CommunityX bit. Imagine for a moment the worse case, that all real accounts have all community subaccounts (in practice this rarely occurs, BTW, real-world structure is always more constrained than this deliberately chosen "full-product of dimensions" example): Assets:Real:Account1:Community1 Assets:Real:Account1:Community2 Assets:Real:Account1:Community3 Assets:Real:Account1:Community4 Assets:Real:Account1:Community5 Assets:Real:Account2:Community1 Assets:Real:Account2:Community2 Assets:Real:Account2:Community3 Assets:Real:Account2:Community4 Assets:Real:Account2:Community5 Assets:Real:Account3:Community1 Assets:Real:Account3:Community2 Assets:Real:Account3:Community3 Assets:Real:Account3:Community4 Assets:Real:Account3:Community5 You can filter by just looking at the Community1 accounts: Assets:Real:Account1:Community1 Assets:Real:Account2:Community1 Assets:Real:Account3:Community1 Looking at the balance sheet / income statement / journals for this subset of postings will give you all the reports you need for project Community1. This is a common case: Imagine you and your wife/life partner are both working professionals and share a joint account for convenience of making common expenses (e.g. you're going to a restaurant together and one of you pays but you want to generally split the expense, you also use those joint funds to pay for individual expenses, etc.). You want to account for each other's contributions separately. You would get a real bank account and create two subaccounts in it: Assets:US:Bank:Joint:Husband Assets:US:Bank:Joint:Wife 'Assets:US:Bank:Joint' is the real underlying bank account. An expense paid from that debit card would be booked like this: 2014-05-19 * "Dinner together at favourite sushi place" Expenses:Restaurant 101.20 USD Assets:US:Bank:Joint:Husband -65.00 USD ; A bit extra for sake box Assets:US:Bank:Joint:Wife I've been using this for real and has worked for me so far. No virtual accounts. (digression not about virtual postings but answers auxiliary questions about them) Now this points to a more general idea that I've been pondering for a while: these "accounts" can often be seen as a set of flat dimensions, the fact that they have a hierarchy can get in the way. I tend to have accounts that look like this: TYPE:COUNTRY:INSTITUTION:ACCOUNT:SUBACCOUNT like this, for example: Assets:US:HSBC:Checking Assets:CA:RBC:Savings For these four dimensions, I actually like having most accounts (Assets, Liabilities and Income) specify them in this order. This does not always make sense though, especially for expense accounts; for those you wouldn't really want to have a COUNTRY dimension at the root. You want the general category only, so I'll have, for example: Expenses:Food:Restaurant Expenses:Food:Grocery but sometimes the dimensions get inverted too, like in my recent change about how to track taxation: Expenses:Taxes:US:TY2014:Google:Federal Expenses:Taxes:US:TY2014:Google:StateNY Expenses:Taxes:US:TY2014:Google:CityNYC ...
Here the "institution" is Google, and shows deeper in the hierarchy.
Finally, you often do want to have multiple types for the same or similar accounts, for instance, to track gains and dividends income from a particular investment account, you want a mirror of most of the dimensions except for the assets bit: Assets:US:ETrade:IRA -> Income:US:ETrade:IRA For instance: Assets:US:ETrade:IRA:Cash Income:US:ETrade:IRA:Dividends You see what I'm getting at... these components really operate more like a database table with values possibly NULL, e.g., type country institution account category -------- -------- ------------ --------- ----------- Assets US HSBC Checking NULL Assets CA RBC Savings NULL Assets US ETrade IRA Cash Income US ETrade IRA Dividends Expenses NULL NULL Food Restaurant Expenses NULL NULL Food Grocery
Having to order your account components in a hierarchy forces you to
decide how you want to report on them, a strict order of grouping from
top to bottom.
So I've been thinking about an experiment to rename all accounts according to dimensions, where the ordering of the components would not matter. These two would point to the same bucket, for example (changing the syntax slightly), Expenses|Taxes|US|TY2014|Google|Federal Expenses|US|Google|Taxes|TY2014|StateNY You could then display reports (again, the usual reports, balance sheet, income statement, journals) for "the subset of all transactions which has one posting in an account in <set>" where <set> is defined by values on a list of dimensions, a bit like a WHERE clause would do. Now, now, now... this would be a bit radical, now wouldn't it? Many of these accounts do point to real accounts whose postings have to be booked exactly, and I'm a bit worried about the looseness that this could introduce. One and only one account name for a particular account is a nice property to have. So what can we do to select across many dimensions while still keeping hierarchical account names? The first thing I did in Beancount is to create views for all unique account component names. For example, if the following account exists: Assets:US:ETrade:IRA You will see four "view" links at the root of the Beancount web page: Assets US ETrade IRA Clicking on the link selects all the transactions with a posting with an account where that component appears. (Views provide access to all the reports filtered by a subset of transactions.) You can click your way to any journal or report for that subset of transactions. This exists in HEAD today. You can draw all the reports where a particular component appears, e.g., "Google", as in "Income:US:Google:Salary" and "Expenses:Taxes:US:TY2014:Google:Federal". But this does not define "dimensions." It would be nice to group values for these components by what kind of thing they are, e.g., a bank, an instution, a country, a tax year, etc, without regard for their location in the account name. A further experiment will consist in the following: again assuming unique "account component names" (which is not much of a constraint to require, BTW, at least not in my account names), allow the user to define dimensions by declaring a list of component names that form this dimension. Here's how this would look, with the previous examples (new syntax): dimension employer Google,Autodesk,Apple dimension bank HSBC,RBC,ETrade dimension country US,CA,AU dimension taxyear TY2014,TY2013,TY2012,TY2011,TY2010 dimension type Assets,Liabilities,Equity,Income,Expenses (implicit?) You could then say something like "show me trial balance for all transactions with posting accounts where bank is not NULL group by bank" and you would obtain mini-hierarchies for each group of accounts (by bank, across all other dimensions). (With the state of my current system, I could probably code this as a prototype in a single day.) Addtionally, accounts have currency constraints and a history of postings which define a set o currencies used in them. More selection can be done with this (e.g., show me all transactions with postings that credit/debit CAD units). IMHO, all you're trying to do with these virtual accounts is aggregate with one less dimension, you want to remove the real account and group by community project. My claim is that there are ways to do that without giving up o the elegant balancing rules of the DE system. -------------------------------------------------------------------------------- > Problem The Second > > Another religious duty I compute is effectively tithing (we call it > Huqúqu'lláh, and it's computed differently, but that's another story). In > order to compute the tithe owed, I accrue 19% of every deposit to a virtual > account, and then subtract from that account 19% of every needful expenditure. > The total remaining at the end of the year is what I owe in tithe. > > This tithing account is not a real account, as it exists in no financial > institution; but it is real enough as a personal duty. By using virtual > account, I can track this "side-band" Liability, and then pay it off from an > assets account when the time comes. If I report with --real I will simply see > how much I've paid to this Liability; and if I report without --real I see how > much Huqúqu'lláh is presently owed. If you have a single employer/source of income to pay the tithe on, or a single place where the income gets deposited, it's not much of a problem: just a create a subaccount for it. Let's look at it from the POV of the deposit account: Assets:US:BofA:Checking Assets:US:BofA:Checking:Tithe 2014-05-19 * "Booking tithe" Assets:US:BofA:Checking -300 USD Assets:US:BofA:Checking:Tithe 300 USD This again depends on the ability to render a journal that includes all subaccount postings. You can easily visually ignore these transactions in your Ledger, presumably you'll be doing it monthly or at the most weekly. When you transfer the money out for the donation, do it from the Title subaccount, e.g. 2014-05-19 * "Fulfilling my obligation" Assets:US:BofA:Checking:Tithe -1200 USD Expenses:Title The problem is that if you have multiple accounts to compute the tithe for, you can repeat this pattern, e.g. Assets:US:BofA:Checking ; Employer deposits Assets:US:BofA:Checking:Tithe Assets:US:Lulu:Cash ; Book royalties Assets:US:Lulu:Cash:Tithe Assets:US:WellsFargo:Checking ; Contract revenue deposits Assets:US:WellsFargo:Checking:Tithe This is the same problem and solution as before: you want to select all transactions with subaccount "Tithe" in them and produce various reports on this subset. Just select those transactions, you don't need virtual accounts. > Those are the only things I've actually used virtual accounts for, and was the > reason I added them. I've tried other schemes, like double-booking, but they > became unwieldy enough that I had to give up on them. I have a feeling > tagging might lead to a similar measure of complexity. The point is, is has > to be simple enough that I can keep up with it regularly, and yet rich enough > is expressivity that I'm able to solve the whole problem. Virtual accounts > ended up fitting this bill for me perfectly in these two cases. To me, tagging is just another mechanism to select a subset of transactions. Tagging is most useful when the list of transactions do not share something else in common, like an account, or expenses related to a project. A good example is a trip whose expenses are varied and from which the assets used are numerous, e.g. various credit cards, cash, debit accounts, maybe from various people. Tags are perfect to marking all those transactions as belonging to the same set. The executive summary: I think you can do everything by finding a way to select a relevant subset of transactions from non-virtual accounts.
2014-05-19 * "Booking tithe"
Assets:US:BofA:Checking -300 USD
Assets:US:BofA:Checking:Tithe 300 USD
Now you're creating an account that doesn't exist, which I don't find
ideal.
On May 19, 2014, at 5:04 PM, Martin Michlmayr <t...@cyrius.com> wrote:2014-05-19 * "Booking tithe"
Assets:US:BofA:Checking -300 USD
Assets:US:BofA:Checking:Tithe 300 USD
Now you're creating an account that doesn't exist, which I don't find
ideal.The real problem is that you’ve created an artificial dependency between Tithe and your Checking account. The good thing about an accounting system is that you can treat your finances as one big pot of money, and Expenses:Groceries doesn’t care which account you use to pay for it.Another way to think about this case is that you have a liability, because you owe tithe. But you also have the money still, which is an asset.2014-05-19 * "Booking tithe"
Assets:Tithe 300 USD
Liabilities:Tithe -300 USD2014-05-20 * “Paying tithe”Expenses:Tithe 300 USDAssets:Tithe -300 USDLiabilities:Tithe 300 USDAssets:Checking -300 USDMichlmayr would complain that Assets:Tithe isn’t actually an account, but neither are your Expenses, so I’m okay with that.
Blais would probably use Virtual:Tithe instead, as would I, as a way to distinguish between “real” assets and “pretend” assets.
Although I would argue you do have a very real $300 set aside, it just doesn’t happen to live in an account. You could also just use an unbalanced virtual account for Liabilities:Tithe, but then you have to stop and think about what the difference between --real and --virtual is, whereas in this case, it is clear what you mean by “what is my balance excluding Assets:Tithe?"
Of course a real accountant would just do this: (accrual based accounting)2014-05-19 * "Booking tithe”
Expenses:Tithe 300 USD
Liabilities:Tithe -300 USD2014-05-20 * “Paying tithe”Liabilities:Tithe 300 USDAssets:Checking -300 USDBut this records the expense on a different day than when you actually paid it. That would be a problem if, for example, you live in the US and wanted to claim a tax deduction for the tithe, in which case you must claim the deduction for the year the tithe was actually paid (cash based accounting).
* Martin Blais <bl...@furius.ca> [2014-05-19 15:42]:
> If not, this is easily solved using subaccounts.I must say I'm with John on this: virtual accounts are a much more
elegant solution in this case than what you propose.
I'm not sure if there's a way to achieve what John wants with tags. I
chatted with Bradley Kuhn earlier today about Conservancy's use of
ledger and it seems he (mostly) manages without virtual accounts, but
I'm not 100% yet how things work there.
Just as an aside, if you're married and it's a joint account, there is
> This is a common case: Imagine you and your wife/life partner are both working
> professionals and share a joint account for convenience of making common
> expenses (e.g. you're going to a restaurant together and one of you pays but
> you want to generally split the expense, you also use those joint funds to pay
> for individual expenses, etc.). You want to account for each other's
> contributions separately. You would get a real bank account and create two
> subaccounts in it:
>
> Assets:US:Bank:Joint:Husband
> Assets:US:Bank:Joint:Wife
no "this is mine", "this is his/hers". I know you're fond of
subaccounts, but I don't think this is a particularly good example.
> I tend to have accounts that look like this:One thing I noticed in your examples is that you really like
>
> TYPE:COUNTRY:INSTITUTION:ACCOUNT:SUBACCOUNT
subaccounts. I'm not very fond of them...
> Expenses:Taxes:US:TY2014:Google:Federal... I don't see the advantage of putting your employer's name there.
> Expenses:Taxes:US:TY2014:Google:StateNY
> Expenses:Taxes:US:TY2014:Google:CityNYC
If you really want that info, I'd just use a tag. Same for the tax
year.
I guess it's just a matter of taste, but your account names seem
unwieldy to me.
Use tags? Note that in ledger, tags can have values, e.g.
> So what can we do to select across many dimensions while still keeping
> hierarchical account names?
; foo: bar
Now you're creating an account that doesn't exist, which I don't find
> 2014-05-19 * "Booking tithe"
> Assets:US:BofA:Checking -300 USD
> Assets:US:BofA:Checking:Tithe 300 USD
ideal.
... I don't see the advantage of putting your employer's name there.
> Expenses:Taxes:US:TY2014:Google:Federal
> Expenses:Taxes:US:TY2014:Google:StateNY
> Expenses:Taxes:US:TY2014:Google:CityNYC
If you really want that info, I'd just use a tag. Same for the tax
year.Tags are less flexible, though I think this may be a difference between how Beancount and Ledger do reporting.
I guess it's just a matter of taste, but your account names seem
unwieldy to me.
Use tags? Note that in ledger, tags can have values, e.g.
> So what can we do to select across many dimensions while still keeping
> hierarchical account names?
; foo: bar
Now you're creating an account that doesn't exist, which I don't find
> 2014-05-19 * "Booking tithe"
> Assets:US:BofA:Checking -300 USD
> Assets:US:BofA:Checking:Tithe 300 USD
ideal.
On Sat, May 17, 2014 at 11:37:01PM -0400, Martin Blais wrote:Very much agreed. Although that comes at the price of either
> Now the truly, wonderfully great thing is how much *power* we have
> using our little text files. It's exhilarating. I can write a little
> script that renames my accounts automatically - I use xx-rename - look
> at it in visual diff, run bean-web on it, look at the reports, decide
> if I like it or not, revert and retry if I screwed up until I get it
> right.
sacrificing the correct surface syntax (e.g. right indentation,
alignment, etc.), or of writing quite complex text patching scripts.
In particular, I'm personally annoyed that when I batchly update ledger
files to rename accounts, transaction amounts easily become unaligned.
So, before (git) committing I go through them with ledger-mode and C-c
C-q them to fix alignment. I've written Python code to emit properly
aligned transactions when generating transaction templates from my bank
statements, but I haven't gone as far as doing that around plain old
sed.
Do your scripts take care of that too?
Do we need a ledger-sed or something of the sort? Or maybe something
simpler, such as a ledger-indent?
On Tue, May 20, 2014 at 12:15 AM, Martin Blais <bl...@furius.ca> wrote:
> Expenses:Taxes:US:TY2014:Google:Federal
> Expenses:Taxes:US:TY2014:Google:StateNY
> Expenses:Taxes:US:TY2014:Google:CityNYC
> Expenses:Taxes:US:TY2014:Federal:Google
> Expenses:Taxes:US:TY2014:StateNY:Google
> Expenses:Taxes:US:TY2014:CityNYC:Google
... I don't see the advantage of putting your employer's name there.
If you really want that info, I'd just use a tag. Same for the tax
year.Tags are less flexible, though I think this may be a difference between how Beancount and Ledger do reporting.(more...)Another thing I forgot to mention is that tags have proved to be awfully easy to forget to insert. It's happened to me many times I've gone back in a file and just noticed a missing tag for an old transaction. By having it baked in the account name, it forces me to put it in the right place.The reason I want my employer name in this account name is to have a counter that produces the same numbers as on my W2 at the end of the year, thought it they were tagged, and I'd have an easy way to restrict transactions to only those tagged by this account, I could produce the number like that. I suppose it's similar... a tag applies to the entire transaction, however; a component in an account name only applies to its posting. In this case it would work out fine with tags IMO.
option "operating_currency" "RMB" 2014-01-01 open Assets:Merchants:C5231 2014-01-01 open Income:Salary 2014-01-01 open Expenses:Food:Restaurant 2014-01-01 open Assets:Cash ;; Amount of receipts I was promised I could gather for payment. 2014-01-01 open Assets:Receipts:Allowable RECEIPTS ;; Amount of receipts I accumulated in envelope, pending to be ;; submitted to Tax Dodgers Inc. 2014-01-01 open Assets:Receipts:Pending RECEIPTS ;; Amount of cash receipts already submitted to Tax Dodgers, waiting ;; to be received in cash. 2014-01-01 open Assets:Receipts:Receivable RMB 2014-04-12 * "Payment of salary" Assets:Merchants:C5231 7000 RMB ; regular salary part Assets:Receipts:Allowable 3000 RECEIPTS Income:Salary ;; Then I go to dinner and get a receipt. I store this in an envelope.
2014-04-13 * "Ito-Yokado" Expenses:Food:Restaurant 143.10 RMB Assets:Cash Assets:Receipts:Allowable -143.10 RECEIPTS Assets:Receipts:Pending 143.10 RECEIPTS ;; Some more expensive dinner. More receipts. 2014-04-14 * "Tiandi Yijia" Expenses:Food:Restaurant 1777.80 RMB Assets:Cash Assets:Receipts:Allowable -1777.80 RECEIPTS Assets:Receipts:Pending 1777.80 RECEIPTS ;; After a few weeks I have 1920.90 RMB in my virtual receipt account, and ;; I hand them in (but they haven't paid me the reimbursement yet): 2014-05-04 * "Submit my receipts to Tax Dodgers, Inc" Assets:Receipts:Pending -1920.90 RECEIPTS @ 1 RMB Assets:Receipts:Receivable ;; Later on they pay you some of that receivable: 2014-05-10 * "Incomplete payment for submitted receipts" Assets:Receipts:Receivable -1500 RMB Assets:Merchants:C5231
2014-04-14 * "Tiandi Yijia" #REIMBURSE Expenses:Food:Restaurant 1777.80 RMB Assets:Cash
2014-04-14 * "Tiandi Yijia" #REIMBURSE Expenses:Food:Restaurant 1777.80 RMB Assets:Cash Assets:Receipts:Allowable -1777.80 RECEIPTS Assets:Receipts:Pending 1777.80 RECEIPTS
On 16.05.14,22:06, John Wiegley wrote:
> >>>>> Jostein Berntsen <jbe...@broadpark.no> writes:
>
> > Is there a reason for this?
>
> This sounds rather odd, and may be a bug.
>
> John
>
> > Example data:
>
> > 2014/03/05 * Opening Balance
> > Assets:Project:Budget 1000000,00 NOK
>
> > Equity:Opening Balance
>
> > = /TeamDev/
> > (Assets:Project:Budget) (1000,00 NOK * amount)
>
> > Example command and output:
>
> > ledger reg -s budget
> > While handling posting from
> > "/home/jostein/Documents/Finans/ledger/project.dat", line 16:
> >> (Assets:Project:Budget) (1000,00 NOK * amount)
> > Error: 'equity' cannot accept virtual and non-virtual postings to the same
> > account
>
For some reason these commands gives the right output:
ledger bal budget
ledger reg budget
But these give the error above:
ledger reg -s budget
ledger reg -M budget
My intention is to add hours like in the entry below to the Budget account
and calculated into a total cost in NOK. How is the best way to do this?
2014/04/17 Resource 1 - Week 16, 2014 Book
; Week16: 2014
; Resource1: John James
; TeamDev: Workshop and plannning
Allocation:Resources:TeamDev -15 H
Assets:Project:Budget
Jostein
On Tue, May 20, 2014 at 6:06 AM, Stefano Zacchiroli <za...@upsilon.cc> wrote:
On Sat, May 17, 2014 at 11:37:01PM -0400, Martin Blais wrote:In particular, I'm personally annoyed that when I batchly update ledger
files to rename accounts, transaction amounts easily become unaligned.
So, before (git) committing I go through them with ledger-mode and C-c
C-q them to fix alignment. I've written Python code to emit properly
aligned transactions when generating transaction templates from my bank
statements, but I haven't gone as far as doing that around plain old
sed.
Do your scripts take care of that too?Not yet but it has been annoying me too.Do we need a ledger-sed or something of the sort? Or maybe something
simpler, such as a ledger-indent?I need one. I'll write one. This is an easy thing to do... I'll align on the first currency to the position of the longest account + a few chars.
[ sorry for catching up with such an old thread only now ]
On Wed, May 21, 2014 at 08:08:37AM -0700, Simon Michael wrote:
> On 5/17/14 11:50 PM, Martin Blais wrote:
> >I wonder if a more general rule-of-thumb can be inferred here: "if you
> >can make do with subaccounts, you should always favor that over tags or
> >other mechanisms." Not sure if always true? But surely something to
> >think about.
>
> That has always been my default stance.
>
> I'm only half way through this thread, but it contains a wealth of
> information. We need a curator of useful mail list knowledge.
I'm always struggling between tags and (sub-)accounts, and I'd love to
be able to apply such a general rule.
The main problem with (sub-)accounts, though, is that if you want to use
--strict (which is a good general sanity rule), you have to declare all
of them. And that quickly becomes painful.
On Fri, Jul 04, 2014 at 11:52:49AM -0400, Martin Blais wrote:Does Beancount and/or Ledger have any explicit way of closing an
> I don't feel that pain at all. One creates new accounts only rarely,
> adding new declarations is a very minor annoyance, and it provides the
> system with useful information to help it tell you when you make
> mistakes. Closing accounts also provides useful information for
> reporting purposes, i.e., an account closed before the reporting
> period should not have to appear in a report.
account? In Ledger-cli-land, I'm aware of the 'account' directive, that
pre-declares an account, but I can't find anything in the manual about
explicitly closing an account.
> FWIW, Beancount is always strict (there is no strict vs. non-strictI like that!
> option and I like it like that).
It would be useful to build a list of real-world use cases of virtual postings and see if they can all be solved without or not - make a compelling argument about the need for virtual postings.