I'd like to use Ledger to track the finances of a two-person household, 
recording transactions to both aggregate household accounts and individual 
ownership stakes.

Two questions:

   - Is there a preferred way to do this?
   - Supposing I do this using tags to identify "shadow accounts," how 
   would you recommend processing shadow account tags?

By "shadow account," I mean a pair of non-real accounts that is established 
for each real account, corresponding to the ownership stakes of the two 
people in the household. The shadow accounts have the property that the sum 
of the postings to each pair of shadow accounts equals the total posting to 
the corresponding real account.

To illustrate, suppose a household that consists of two people: APL and NPL.

   - APL works at the local metropolitan transportation authority
   - NPL works at a glass factory
   - APL and NPL share an apartment, a checking account, and a credit card

We want to track APL & NPL's total household earnings and expenses as well 
as their individual ownership stakes in their assets and liabilities. We 
can do this with shadow accounts implemented with virtual postings. Here's 
an example journal file for APL & NPL:

2017-01-06 (#1) MTA
    Assets:Cash:Checking                    $1000.00
    Income:Salary
    [APL:Assets:Cash:Checking]              $1000.00
    [APL:Income:Salary]                    $-1000.00
    [NPL:Assets:Cash:Checking]                 $0.00
    [NPL:Income:Salary]                        $0.00

2017-01-10 (#2) Landlord
    Expenses:Rent                            $960.00
    Assets:Cash:Checking
    [APL:Expenses:Rent]                      $480.00
    [APL:Assets:Cash:Checking]              $-480.00
    [NPL:Expenses:Rent]                      $480.00
    [NPL:Assets:Cash:Checking]              $-480.00

2017-01-13 (#3) Glass Factory
    Assets:Cash:Checking                    $1200.00
    Income:Salary
    [APL:Assets:Cash:Checking]                 $0.00
    [APL:Income:Salary]                        $0.00
    [NPL:Assets:Cash:Checking]              $1200.00
    [NPL:Income:Salary]                    $-1200.00

2017-01-15 (#4) Pacific Gas & Electric
    Expenses:Utilities                        $85.00
    Liabilities:Credit:Visa
    [APL:Expenses:Utilities]                  $42.50
    [APL:Liabilities:Credit:Visa]            $-42.50
    [NPL:Expenses:Utilities]                  $42.50
    [NPL:Liabilities:Credit:Visa]            $-42.50


To clarify each transaction:

   1. APL earns $1,000 from the MTA and deposits his earnings to the 
   couple's checking account
   2. APL & NPL contribute equally to their rent payment of $960
   3. NPL earns $1,200 from the glass factory and deposits her earnings to 
   the couple's checking account
   4. APL & NPL pay their gas bill of $85 with their credit card, each 
   recording equal contributions

The journal gives us APL & NPL's household balance sheet:

$ ledger bal --real

            $1240.00  Assets:Cash:Checking

            $1045.00  Expenses

             $960.00    Rent

              $85.00    Utilities

           $-2200.00  Income:Salary

             $-85.00  Liabilities:Credit:Visa

--------------------

                   0

Using shadow accounts allows us to view APL's and NPL's individual 
ownership stakes in each of their accounts.

$ ledger bal ^APL

                   0  APL

             $520.00    Assets:Cash:Checking

             $522.50    Expenses

             $480.00      Rent

              $42.50      Utilities

           $-1000.00    Income:Salary

             $-42.50    Liabilities:Credit:Visa

--------------------

                   0

$ ledger bal NPL

                   0  NPL

             $720.00    Assets:Cash:Checking

             $522.50    Expenses

             $480.00      Rent

              $42.50      Utilities

           $-1200.00    Income:Salary

             $-42.50    Liabilities:Credit:Visa

--------------------

                   0

Note that adding APL and NPL's balance sheets yields the household balance 
sheet.

The reason for the second of my original two questions (i.e., how do you 
process shadow account tags?) is that recording shadow accounts with 
virtual postings in every transaction is a tedious process, and I'd like 
instead to use tag-value pairs to record shadow account information. 
Instead of recording the journal entries listed above, I'd like to record 
the following, where the value of the *Shadow* tag holds the ownership 
weights necessary to derive the shadow account postings:

2017-01-06 (#1) MTA
    ; Shadow: APL 100/NPL 0
    Assets:Cash:Checking                    $1000.00
    Income:Salary

2017-01-10 (#2) Landlord
    ; Shadow: APL 50/NPL 50
    Expenses:Rent                           $960.00
    Assets:Cash:Checking

2017-01-13 (#3) Glass Factory
    ; Shadow: APL 0/NPL 100
    Assets:Cash:Checking                    $1200.00
    Income:Salary

2017-01-15 (#4) Pacific Gas & Electric
    ; Shadow: APL 50/NPL 50
    Expenses:Utilities                        $85.00
    Liabilities:Credit:Visa


The result is an informationally equivalent journal file with two postings 
per transaction instead of six.

Elaborating on my original questions:

   - Is there a better (and more widely accepted) way to do this?
   - If not, how would you recommend processing the Shadow tags?

Being new to Ledger, my first thought to processing Shadow tags is to write 
a Python script that generates a "cooked" journal file that includes the 
shadow account virtual postings based on the Shadow tag-value pairs; Ledger 
could then read the cooked journal instead. Alternatively, maybe there's 
some facility in Ledger itself that could achieve this.

APL


-- 

--- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to