Skip to content

ComputeTax

A method which returns the tax amount for the requested tax, passing all parameter information in a single call.

Syntax

value = object.ComputeTax(datafilename, selectedtax, earnings, ytdearnings, exemptions, stateexemptions, filingstatus, miscellaneous, auxiliary, supplemental, payperiodsperyear)

object is a TaxControl instance.

Returns a float value.

Parameters

  • datafilename : A string indicating the file name for the tax table data.
  • selectedtax : A string naming the specific tax from the table to be computed.
  • earnings : A float indicating the employee's earnings for this pay period.
  • ytdearnings : A float indicating the employee's year-to-date earnings prior to this pay period.
  • exemptions : A float indicating the employee's federal exemptions.
  • stateexemptions : A float indicating the employee's state exemptions.
  • filingstatus : An integer or FilingStatus constant indicating the employee's tax filing status.
  • miscellaneous : A float value used in some tax formulas.
  • auxiliary : A float value used in some tax formulas.
  • supplemental : A float value which should be non-zero (true) if the current earnings should be considered as supplemental pay, or zero (false) if they should not.
  • payperiodsperyear : A numeric expression which evaluates to the number of pay periods in one year.

Details

This method provides a way to calculate a tax within one method call. This may be useful for circumstances where a “stateless” object is desirable. All values which affect tax computation are included in the method call. This call does not alter any previously set property values.