compute
A function which returns the tax amount for the requested tax, passing all parameter information in a single call.
value = compute ( $taxname, $earnings, $ytdearnings, $filingstatus, $exemptions, $stateexemptions, $payperiods, $paydate, $misc, $aux, $ytdtax )
- value - A float result.
- $taxname - A string naming the specific tax from the table to be computed.
- $earnings - Gross earnings for the current pay period.
- $ytdearnings - Year-to-date earnings prior to the current pay period.
- $filingstatus - Numeric value representing the employee's filing status for this tax. (see filingstatus)
- $exemptions - Total from Form W-4 Step 3, line 3.
- $stateexemptions - State exemptions claimed by the employee.
- $payperiods - Number representing the total number of pay periods in a year.
- $paydate - A Date object representing the check date. Default is current date.
- $misc - A numeric value required by some formulas. When this field is required, the tax object will have specific instructions in the $miscellaneous_instructions field. (see tax)
- $aux - A numeric value required by some formulas. When this field is required, the tax object will have specific instructions in the $auxiliary_instructions field. (see tax)
- $ytdtax - Year-to-date tax amount withheld for this tax prior to the current period.
Examples
Ohio state tax for a married employee:
Federal is a litte more complicated, because it need most of the parameters. This example assumes the employee has signed a 2020 or later W-4:
For employees who haven’t signed a 2020 or later W-4, use the following: