>>PHP

compute Function

Returns the tax amount for the requested tax, passing all parameter information in a single call.

Syntax

value = compute($taxname, $earnings, $ytdarnings, $filingstatus, $exemptions, $stateexemptions, $payperiods, $paydate, $misc, $aux, $ytdtax)

Part
Description
valueA numeric result
$taxnameA string naming the specific tax from the table to be computed. For a list of valid tax names, see the taxList function.
$earningsEarnings for the current pay period.
$ytdarningsYear-to-date earnings prior to the current period.
$filingstatusNumeric value representing the employee's $filingstatus
$exemptionsFederal exemptions claimed on the employee's W-4.
$stateexemptionsState exemptions claimed by the employee.
$payperiodsNumber representing the total number of pay periods in a year.
$paydateA Date object representing the check date.
$miscA numerica value required by some formulas. The application database should associate one $misc value for each withheld tax for each employee. When this field is required, the tax object will have specific instructions in the $miscellaneous_instructions field.
$auxA numerica value required by some formulas. The application database should associate one $aux value for each withheld tax for each employee. When this field is required, the tax object will have specific instructions in the $auxiliary_instructions field.
$ytdtaxYear-to-date tax amount withheld for the tax prior to the current period.

Remarks

This function returns a numeric value representing the calculated tax to be withheld or paid by the employer.

See Also: Tax