Adding Payroll

Derek Atkins warlord at MIT.EDU
Tue Nov 8 20:09:43 EST 2005


Quoting Jay Scherrer <jay at scherrer.com>:

> Thanks.
> Then that would makes it a lot easier (Not coming from an xsl
> background). Then if we were to create a class specifically to usform941
> and correlate that with the schema IRS941.xsd it would look like:
>
> struct tax
> {
> int id;
> int TaxYear;
> char TaxType;   /* us Quarterly 941 */
> char Currency;
> int ReleaseDate;
> int NumberOfEmployees;
> double TotalWages;
> double TotalIncomeTaxWithheld;
[snip]
> char FinalReturn;            /* checkbox */
> int DateFinalWagesPaid;
> char SeasonalEmployer;      /* checkBox */
>
> } us941;

This "object" is WAYYYY too hard-coded.  If you want to think about it
this way to see what you need specifically, okay, but the /actual/
objects need to be significantly more abstract and generalized than this.
In other words, the actual data structures we create in C and store in XML
need to be data driven, not hard-coded like this...  Otherwise we can't
apply taxes to new locales that don't fit this model.

What I'd much rather see for an implementation is a list (hash?) of keyed
values, and then a data description that explains how to apply each item.

> The calculations are easily based on total entries of a payroll class.
> How would we put/pull this data in/out from the appropriate gnucash
> account once we have it registered?

This code:

  struct TaxItem {
    gchar *item_name;
    gnc_numeric value;
  };

  this_tax_txn = xaccMallocTxn();
  ...
  for (node=this_tax->tax_items; node; node=node->next) {
     TaxItem* item = node->data;
     apply_tax_item(this_tax_txn, item);
  }
  ...

> There is an "acknowledgementpreliminaryguide.pdf" on the
> http://www.irs.gov/efile/ site. this shows A Preliminary Guide to
> Creating 94x Acknowledgement Files in xml using SPY.
>
> Jay Scherrer

-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 at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list