TRAVERSE Global v11.1
Formulas
Use the Formulas function to set up and maintain the formulas you use to calculate deductions, withholdings, employer costs, and user-defined deductions.
Note: Open Systems, Inc. provides regular federal and state tax updates to its resellers and end-users who are current on the Continuous Enhancement Subscription program as they become available. See your local reseller for more information.
Refer to the Writing Formulas for information on formula variables, operations, and functions.
- Click the New button, on the toolbar, to open a blank formula record.
- Enter a new formula ID in the Formula ID field. If you are entering a new formula ID, the Copy From field is available.
The following formats should be used when adding a new formula ID:
- Federal: FED__XXX
XXX refers to the tax type. For example, for federal withholding you would have FED__FWH.
- State: PXX__YYY
XX refers to the state code and YYY refers to the tax type. For example, for Minnesota state withholding you would have PMN__SWH.
- Local: PXXYYZZZ
XX refers to the state code, YY refers to an abbreviation to the local tax authority and ZZZ refers to the type of tax. For example, for New York, Yonkers local withholding you would have PNYYOLWH.
- Federal: FED__XXX
- Enter a Description for the formula.
- Enter or select a payroll Year to apply the formula to.
- Select the Table ID to use with the formula. To set up table IDs, use the Formula Tables function.
- Enter the formula detail in the Formula field. Refer to Writing Formulas for syntax rules.
Formula detail
Within the formula box that is displayed when the combo box arrow is clicked, you can return commands and variables into the formula being generated by double-clicking on the selection you want brought into the formula.
When variables and factors are used, the values must be enclosed within double quotes (“ “) within the parentheses.
Click on the Check Syntax button when finished entering the formula to see if you have the syntax for the formula correct.
- Enter factors for the formula in the Factor 1 thru Factor 6 fields, if applicable. Formula factors are variables used to change the base rate in a formula without changing the formula.
- Click the Save button, on the toolbar, to save the new formula record.
- Select a formula to edit from the Formula ID field.
- Edit the fields as necessary.
- Click the Save button, on the toolbar, to save any changes made to the formula.
- Select a formula to delete from the Formula ID field.
- Click the Delete button, on the toolbar, to delete the selected formula.
- Click Yes at the "Are you sure you want to delete selected record(s)?" prompt.
To retrieve a value to put into the formula you must use tax methods to tell the formula what value you want to retrieve. Commands are used along with the variables to set the values to bring into the formulas. The most commonly used commands are f.GetNumericVariable and f.SetNumericVariable. You will see commands used in many of the sections following this section.
The tax methods are grouped in the formula box by the heading #tax methods.
Following are a few sample scripts for calculating custom deductions or withholdings. Scripts are based on IronPython (Python) scripting language.
Sample 401K matching amount calculation. FC1 = percentage of the matching amount entered for the formula or individual employee.
L1 = f.GetNumericVariable(VariableName.ADJEARN) * f.GetNumericVariable(VariableName.FC1) * 0.01 |
Sample garnishment calculation. FC1 and FC2 values can be set for formula or per employee.
L1 = f.GetNumericVariable("GRANDTOTGROSS") -f.GetNumericVariable("FEDWITH") - f.GetNumericVariable("STATEWITH") - f.GetNumericVariable("LOCALWITH") L2 = L1 * f.GetNumericVariable("FC1") if (L1 > f.GetNumericVariable("FC2")): L3 = L2 else: L3 = f.GetNumericVariable("FC2") L4 = L1 - L3 if (L4 < f.GetNumericVariable("FC2")): L5 = 0 else: L5 = L4 f.SetNumericVariable("CALCVALUE", L5) |
Compare with 10.5 formula:
L001 [GRANDTOTGROSS]-[FEDWITH]-[STATEWITH]-[LOCALWITH] L002 [LI001]*[FC1] L003 IIF (([LI001]>[FC2]),([LI002]),([FC2])) L004 [LI001]-[LI003] L005 IIF (([LI004] < [FC2]), (0), ([LI004])) |
Sample workers comp calculation. FC1 and FC2 values can be set for formula or per employee.
L1 = f.GetNumericVariable("HOURS") * f.GetNumericVariable("FC1") * f.GetNumericVariable("FC2") * 0.01 if (f.GetNumericVariable("HOURS")==0): L2 = f.GetNumericVariable("ADJEARN") * f.GetNumericVariable("FC2") * 0.01 else: L2 = L1 f.SetNumericVariable("CALCVALUE", L2) |
Sample SUI Adjustment. TableValue function looks up values from tax tables.
y1 = f.TableValue(1, 1) y2 = f.TableValue(1, 2) y3 = f.GetNumericVariable(VariableName.TAXEARN) + f.GetNumericVariable(VariableName.YTDEARNINGS) y4 = min(y2, y3) y5 = y4 - f.GetNumericVariable(VariableName.ADJSUIEARN) y6 = y5 * y1 * 0.01 y7 = y6 - f.GetNumericVariable(VariableName.YTDWITHHOLDINGS) - f.GetNumericVariable(VariableName.ADJSUIWITH) y8 = min(f.GetNumericVariable(VariableName.TAXEARN), y7) y9 = max(0, y8) f.SetNumericVariable("CALCVALUE", y9) |
- Select the print preview button () to preview the list of formulas.
- The preview report screen appears.
- Select the print button ( ) in the toolbar to print your list.