Gnucash Business: Proposal: handling multiple tax accounts

Derek Atkins warlord@MIT.EDU
13 Jun 2002 10:25:03 -0400


I'm working on handling multiple tax accounts for business items.
My current plan is as follows:

1) Defining Tax Tables

Users define a set of Tax Tables.  Each tax table is a list of
Tax Table Entries.  Each Tax Table Entry is a tuple of:

        Account, Tax Type (value or percent), and Number

For example, one could define a Tax Table "MA Sales Tax" that
contains a single TTEntry:

        liabilities:tax:ma-sales, %, 5

For an airline-like system, one could envision a different Tax Table:

        liabilities:fuel-surcharge, $, 20
        liabilities:pax-fee, $, 1.50
        liabilities:tax:fed, %, 1.75
        liabilities:tax:state, %, 2.75

(These numbers aren't real, just for examples).

2) Using Tax Tables

When users are entering invoice items, the plan is to change the
current interface to provide a checkbox for 'is this item taxable?'
and a combobox to choose a tax table to apply to the item.  Each
customer can be assigned a default tax-table, which will over-ride a
global tax-table choice.  These choices will be automatically applied
in the register as you enter items.

The point of this multi-tier default system is to give as much
flexibility as possible.  One can envision taxing different customers
on different tables, and one can evision taxing different _items_ on
different tables, too.  Similarly, a simple checkbox for taxability is
a quick way to define an item as "non-taxable".

3) Open Issues

I still have a few open issues with this plan:

  a) Where to store tax tables?  My first thought was to store them in
     the book kvp, but I'm also thinking that they could be in their
     own database.  I don't expect a lot of them, but having GUIDs for
     reference might not be a bad idea.

  b) How do you reference tax tables for "posted" entries?  Let's say
     that I create an invoice that references a tax table and post the
     invoice.  Two years later the tax rates change (so I change the
     tax table accordingly).  A year after that I want to go back and
     re-print the invoice.  If the invoice only references the
     tax-table, then the reprint is going to use the _new_ tax rates
     instead of the tax rates used when the invoice was posted.  In
     other words, the new invoice will not match the original.  There
     are a few possibilities:

     - Tax Tables are immutable.  Once you create one, you cannot
       change or destroy it.  All you can do is mark is "obsolete" (at
       which point it will no longer appear in the lists).

     - Tax Tables are mutable until they are "used" (at which point
       they become immutable).  You can change a Tax Table as much as
       you want until it is actually referenced in a posted invoice,
       at which point it becomes immutable.  I think this might be too
       confusing for a user.

     - Tax Tables are mutable, however when you post an invoice the
       Tax Table is copied locally into entry and used from there in
       the future.  This requires a lot of extra copying of data into
       each invoice entry.

     - Tax Tables are mutable, however when you post an invoice the
       Tax Table code creates an internal, immutable copy that is
       linked to the mutable tax table in question.  All posted
       entries are changed to reference the now-immutable copy of the
       tax-table, so down the road you will have the exact table used
       when the invoice was posted.  Multiple entries can all point to
       the same (immutable) tax-table.  If at a later date you change
       the mutable tax-table, it breaks the link to the immutable
       version and future "posts" will run through the copy-on-write
       process again.


Any comments or suggestions would be appreciated.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available