I've been playing around with ledger again for doing payroll.  My
payroll ledger file looks like this:

--
; Process with `ledger3 -f payroll.ledger -V bal`
; display money in this format
D $1,000.00

; payroll taxes as given by http://www.ssa.gov/pubs/10003.html
; codes from: http://en.wikipedia.org/wiki/Payroll_tax#United_States

= /Employees:.*:Payroll$/
 EFTPS:FICA:$account:Employee  0.042
 EFTPS:FICA:$account:Company  0.062
 EFTPS:MED:$account:Employee  0.0145
 EFTPS:MED:$account:Company  0.0145
 $account:Taxes:FICA  -0.042
 $account:Taxes:MED  -0.0145
 Company:Taxes:EFTPS  -0.0765
 AZDOR:Withholding:$account  0.051 ; Withholding of 5.1%, per AZ State Form A-4
 $account:Taxes:AZDOR  -0.051

; Hourly pay rates for employees
P 2010/01/01 EMP1 $15

; Payroll for 2011-09-17
2011-09-17 JohnDoe Payroll ending 9/17
  Company:Labor:JohnDoe  20 EMP1
  Employees:JohnDoe:Payroll
--

The above is all fine and correct (for the most part - I'm not taking
into account the "don't deduct FICA/MED" when total wages exceed a
certain amount rule), and lets me enter working hours directly and
automatically perform

The problem comes in when calculating US federal tax withholding.
These are done in a programmatic method, with different amounts
depending on the total amount of taxes - see this form:
http://www.irs.gov/pub/irs-pdf/n1036.pdf

Basically, there are rules like:

 if the Wages are below amount X, then withholding = 0
 if Wages are between X and Y, then withholding is (Wages - X) * Percentage1
 if Wages are between Y and Z, then withholding is (Wages - Y) *
Percentage2 + AmountA

and so on. For right now, I'm manually calculating these amounts out
and entering them into ledger, which is annoying.

>From what I can tell, there's no way to have several automated
transactions that only happen when an amount is within a certain
range, is there?   Would this feature be useful to others?

Any ideas?   I'm thinking of making a script that does the math, then
creates new ledger entries in the file that reflect the rules, but I'd
love to avoid doing so.

Thanks,
Zack

Reply via email to