Code generation for GnuCash payroll witholding
Michael D. Crawford
crawford at goingware.com
Tue May 24 22:20:46 EDT 2005
I posted the following to payswell-devel earlier today. I thought you'd
be interested too. You can follow along by reading the archives if you
don't want to subscribe. There's just a delay of several hours before
new posts show up:
http://sourceforge.net/mailarchive/forum.php?forum_id=45168
http://www.payswell.org/
In response to suggestions that we write Guile scripts to enable
witholding in GnuCash, I said:
I think the reason that GnuCash doesn't already support payroll taxes is
not the dificulty of writing the code, but capturing logic from the
plethora of payroll tables published by all the world's national, state
and provincial governments. Canada's formulas alone take up eighty-seven
pages. In the US, there is the federal government, fifty states that
often do things quite differently from each other, and all the
territories like Puerto Rico, not to mention Washington D.C. If all
these tax tables were printed in hardcopy, you could kill a man with
their weight!
But I think that working it out in a visual way with spreadsheets is a
good way to approach the problem of distilling all this complexity into
black-and-white business logic. And then, guess what I realized you
could do, if all the spreadsheets were constructed in a uniform way:
OpenOffice documents are really just zipped XML files. The XML DTD, or
maybe there is a schema, is documented. Once we had all the spreadsheets
worked out, someone could write a code generator in Perl, Python, Scheme
or whatever was convenient, and GENERATE Guile code directly from the
spreadsheet XML for GnuCash to use!
The beauty of this, you see, is that I expect that by the time we have
global coverage, most of the spreadsheets won't have been written by
programmers like you and I, but by regular office workers, people who
don't know any more about computers than what Microsoft Office enables
them to do. But by writing such a code generator, we would have
transformed these people into computer programmers! Imagine the potential!
Intrepidly,
Mike
--
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com
crawford at goingware.com
Tilting at Windmills for a Better Tomorrow.
"I give you this one rule of conduct. Do what you will, but speak
out always. Be shunned, be hated, be ridiculed, be scared,
be in doubt, but don't be gagged."
-- John J. Chapman, "Make a Bonfire of Your Reputations"
http://www.goingware.com/reputation/
More information about the gnucash-user
mailing list