Adding a Payroll calculator

Jay Scherrer jay at scherrer.com
Tue Nov 1 02:20:30 EST 2005


On Mon, 2005-10-31 at 10:16 -0800, Andrew Sackville-West wrote:
> IMHO, based on the broad requirements of many jurisdictions in the 
> gnucash user base, the more generic the solution the better. I
> suppose 
> that at some point it becomes no easier than using a spreadsheet, but 
> bypasses the importing requirements of that solution.
> 
> In my past  thoughts on this, it seemed reasonable to come up with a 
> handful of different classes of payroll items with all the numbers
> (tax 
> percentages, wage bases, etc) applied directly by the user. Ummm..
> sort 
> of like setting up tax tables. Create a table, assign a name and a 
> variety of features for that particular instance and save it. Then
> apply 
> the appropriate items to each employee as they are created/edited. Is 
> this what you are getting at?  Each employee record would point to
> its 
> payroll record and have any number of fields for various requirements 
> (wage, taxes, deductions, etc). Some of the fields could have a
> prompt 
> flag that would prompt the user for this information at the time
> payroll 
> is executed. Obvious one would be hours worked, but other could be 
> "reported tips" or "reimbursements". IIRC I had narrowed this down to 
> just a handle of classes to get most thigns to work. (My knowledge of 
> gnucash code is -> 0 and my coding is rusty -> infinity so my
> vocabulary 
> above is probably wrong ;) ).
> 
> When you process the payroll, at the point that you execute the
> payroll, 
> the pertinent information is calculated and then stored in the
> payroll 
> transaction (probably in the memo and description fields).
> 
> Am I following you correctly? are we talking about the same thing?
> 
> A
Right on target. I my self don't know yet how GnuCash stores the
information into each account. But it would be nice if there was a form
to fill out while performing payroll that resembled a time clock or
pay-stub format (Once hours were entered all the calculations are
preformed).
Of course the other options would include strait salaries and
commissions. But these would be definable at the time of employee
Creation/Hire.

There are two major occurrences of payroll calculation. 
1: performing the actual paycheck calculation.
2: Then reporting the totals for the quarterly tax return. 

Payroll taxes could be members of the Tax class and still be different
from regular sales and income taxes. However Payroll taxes for the us
will be accounted on a quarterly basis with the IRS form 941. 
I myself am very rusty on c but here's a shot. And I haven't the
experience with any GUI's except Perl::Tk and html.

I have used Derek Atkins's _gncEmployee class as a template for this
Example: 

struct _gncTax 
{
  char *          id; 
  char *          taxName;   /* Medicare, SSI, Sales,..etc */
  char *          taxType;   /* Payroll, Payroll, Sales  */
  char *          taxCatagory;/* Employee, Salary, Sale */
  gnc_numeric     taxRate;   /* .0145, .062, .893 */
  gnc_numeric     taxFrequency; /* hourly, monthly, unit */ 
  gnc_commodity * currency;     
  gboolean        active;
  char *          language;
  Account *       tax_acc;     
};


Jay Scherrer



More information about the gnucash-devel mailing list