Withholding32 User Manual


Latest Version: December 19, 2019

Table of Contents

  • About Withholding32
    Withholding 32 allows calculation of Federal, State and Local Payroll Withholding. It also calculates FICA and Medicare Payroll Withholding. It is provided as both a 32bit and 64bit Windows DLL and as a Linux Shared Object file.
    Hint: On the Withholding32 webpage go to the tab Samples for actual code!
    The code snippets used throughout this manual are not complete executable programs, but are used only to illustrate particular items. The Withholding32 website has complete packages which can be downloaded.
  • Using Withholding32
    • Visual Basic
      In Visual Basic you have to declare each of the Withholding32 functions. Here is an example
      Declare Function WH32_Calc Lib "wh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC) As Long

      command will be (from wh32.h)
      WH32_COMMAND_FEDERAL_ONLY
      WH32_COMMAND_FEDERAL_AND_STATE
      WH32_COMMAND_FEDERAL_EMPLOYER_FICA_MEDICARE
      WH32_COMMAND_GROSSUP_REGULAR
      WH32_COMMAND_GROSSUP_SUPPLEMENTAL
      There are a number of other functions you will use. These will be detailed in this manual. Notice the library name "wh32.dll". For this declaration to work the 32bit Withholding32 Library would have to be placed in the same folder as your apps executable.

      You will also have to setup various structures used by the Withholding32 program. Here is an exmaple
      Type MDATE
      month As Long
      day As Long
      year As Long
      End Type
    • Visual C++ Dynamic Loading
      With Dynamic Loading you explicitly load the dll at runtime using the LoadLibrary function. Here is an example of what you would do.
      INSTANCE hGetProcIDDLL =LoadLibrary(TEXT("wh32.dll"));
      DWORD dw=GetLastError();

      FARPROC lpfnGetProcessID3 = GetProcAddress(HMODULE (hGetProcIDDLL),"WH32_Get_Prompt");
      typedef long(__stdcall * pICFUNC3)(WITHHOLDING_TAXBODY_INFO *wt,char * c);
      pICFUNC3 WH32_Get_Prompt;
      WH32_Get_Prompt=pICFUNC3(lpfnGetProcessID3);
      dw=GetLastError();
    • Visual C++ StaticLoading
      With Static Loading you link your program with the .lib file we provide and then the DLL functions will be loaded automatically at run time. With this method you must modify your build procedure with these two steps.
      1)  In your Projects "Properties/Linker/General/Additional Library Directores" add an entry to point to the location of wh32.lib
      2)  In your Projects "Properties/Linker/Input/Additional Dependencies" add the name wh32.lib
      You can then call the DLL functions without the LoadLibrary function call.
    • Visual C#
      (Thanks to John M for this C# info
      Created an app in Visual Studio:

      using System; using System.Runtime.InteropServices;

      namespace PlaygroundNET
      {
      class Program
      {
      static void Main(string[] args)
      {
      GetWH32Version();
      Console.ReadKey();
      }
      [DllImport("wh32.dll")] private static extern double WH32_Table_Version();
      public static void GetWH32Version()
      {
      double Version = WH32_Table_Version();
      Console.WriteLine("Tax Table version is {0}", Version.ToString());
      }
      }
      }

      I have the DLL as an embedded resource with the Copy To Output Directory set to Copy Always.
      You can then call the DLL functions without the LoadLibrary function call.
  • Data Structures
    We supply a header file (wh32.h) which provides all data structures required for using C++ to call our functions. Always go to the wh32.h included with the distribution package for the required structures.

    However, if you are using Visual Basic you will have to convert the wh32.h structures to the corresponding Visual Basic structures. We show several here in their original "C" version and the converted Visual Basic version.
    /* C structure MDATE*/
    struct MDATE{
    long month;
    long day;
    long year;
    };

    ' Corresponding Visual Basic Structure
    Structure MDATE
    Dim month As Long
    Dim day As Long
    Dim year As Long
    End Structure


    /* C structure used in Federal Withholding Calculations */
    struct FEDERAL_WITHHOLDING_STRUC{
    long struct_size;
    long dummy;
    long federal_error;
    long federal_exemptions;
    MDATE federal_table_date;
    long federal_table;
    long federal_period;
    double federal_taxable_pay;
    double federal_additional_withholding;
    MDATE table_used;
    double federal_withhold_amount;
    long fica_error;
    long fica_exempt;
    double federal_ficamedicare_pay;
    double previous_fica_wages_this_year;
    double fica_withhold_amount;
    long medicare_error;
    long medicare_exempt;
    double previous_medicare_wages_this_year;
    double medicare_withhold_amount;
    double supplemental_amount;
    double ytd_supplemental_amount;
    long supplemental_calc_type; long supplemental_tax_type;
    double supplemental_tax;
    long withhold_exempt;
    };

    ' Corresponding Visual Basic Structure
    Structure FEDERAL_WITHHOLDING_STRUC
    Dim struct_size As Long
    Dim dummy As Long
    Dim federal_error As Long
    Dim federal_exemptions As Long
    Dim federal_table_date As MDATE
    Dim federal_table As Long
    Dim federal_period As Long
    Dim federal_taxable_pay As Double
    Dim federal_additional_withholding As Double
    Dim table_used As MDATE
    Dim federal_withhold_amount As Double
    Dim fica_error As Long
    Dim fica_exempt As Long
    Dim federal_ficamedicare_pay As Double
    Dim previous_fica_wages_this_year As Double
    Dim fica_withhold_amount As Double
    Dim medicare_error As Long
    Dim medicare_exempt As Long
    Dim previous_medicare_wages_this_year As Double
    Dim medicare_withhold_amount As Double
    Dim supplemental_amount As Double
    Dim ytd_supplemental_amount AS Double
    Dim supplemental_calc_type As Long
    Dim supplemental_tax_type As Long
    Dim supplemental_tax As Double
    Dim withhold_exempt as Long
    End Structure


    Other structures referenced in this manual can be found in the included file wh32.h

    Note that some structure have an element 'struct_size'. It is required that you fill this in before calling any function which used the structure. The length you put in tells the function which version of the structure you are using.

    In Visual Basic you might do this: wh.struct_size = Len(wh)

    In C++ you might do this: fedwh.struct_size=sizeof(FEDERAL_WITHHOLDING_STRUC);
  • Public Functions
    What follows is a list of prototypes for all public functions in the Withholding32 DLL. The Prototype shown is for "C++".
    • WH32_Version
      Returns the DLL software version.

      C Prototype
      extern "C" double WINAPI WH32_Version(void);
      Visual Basic declaration
      Declare Function WH32_Version Lib "wh32.dll" () As Double
    • WH32_Table_Version
      Returns the tax table version. This will change with every new release.

      C Prototype
      extern "C" double WINAPI WH32_Table_Version(void);
      Visual Basic declaration
      Declare Function WH32_Table_Version Lib "wh32.dll" () As Double
    • WH32_Calc
      Calculates Federal and State withholding.

      C Prototype
      extern "C" long WINAPI WH32_Calc(long command,struct FEDERAL_WITHHOLDING_STRUC *wh,struct STATE_WITHHOLDING_STRUC *stwh);
      Visual Basic declaration
      Declare Function WH32_Calc Lib "libwh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC) As Long

      Command for this and other CALC functions will be (from wh32.h)
      WH32_COMMAND_FEDERAL_ONLY
      WH32_COMMAND_FEDERAL_AND_STATE
      WH32_COMMAND_FEDERAL_EMPLOYER_FICA_MEDICARE
      WH32_COMMAND_GROSSUP_REGULAR
      WH32_COMMAND_GROSSUP_SUPPLEMENTAL

    • WH32_Calc_Local
      Calculates Federal, State, and Local withholding.

      C Prototype
      extern "C" long WINAPI WH32_Calc_Local(long command,struct FEDERAL_WITHHOLDING_STRUC *wh,struct STATE_WITHHOLDING_STRUC *stwh,struct LOCAL_WITHHOLDING_STRUC *localwh);
      Visual Basic declaration
      Declare Function WH32_Calc_Local Lib "libwh32.dll" (ByVal command As Long, ByRef wh As FEDERAL_WITHHOLDING_STRUC, ByRef stwh As STATE_WITHHOLDING_STRUC, ByRef ctwh As LOCAL_WITHHOLDING_STRUC) As Long
    • SDI_Calc
      Returns State disability insurance deduction

      C Prototype
      extern "C" long WINAPI SDI_CAlc(struct SDI_WITHHOLDING_STRUC *sdi);
    • FUTA_Calc
      Returns Federal unemployment insurance deduction

      C Prototype
      extern "C" long WINAPI FUTA_CAlc(struct FUTA_WITHHOLDING_STRUC *futa);
    • SUI_Calc
      Returns State unemployment insurance deduction

      C Prototype
      extern "C" long WINAPI SUI_CAlc(struct ETT_WITHHOLDING_STRUC *sui);
    • ETT_Calc
      Returns California ETT

      C Prototype
      extern "C" long WINAPI ETT_CAlc(struct ETT_WITHHOLDING_STRUC *ett);
    • TT_Calc
      Returns Oregon Transportaton Taxes

      C Prototype
      extern "C" long WINAPI TT_CAlc(struct TT_WITHHOLDING_STRUC *tt);
    • FAMLEAVE_Calc
      Returns Family Leave Tax

      C Prototype
      extern "C" long WINAPI FAMLEAVE_CAlc(struct FAMLEAVE_WITHHOLDING_STRUC *famleave);
    • WH32_Get_Prompt
      Returns information (e.g. names) of local taxing bodies. The structure WITHHOLDING_TAXBODY_INFO is defined in wh32.h

      C Prototype
      extern "C" long WINAPI WH32_Get_Prompt(struct WITHHOLDING_TAXBODY_INFO *wt,char * buffer);
      Visual Basic declaration
      Declare Function WH32_Get_Prompt Lib "libwh32.dll" (ByRef id As WITHHOLDING_TAXBODY_ID, ByVal ss As String) As Long
    • WH32_Canada_Calc
      Calculates Canada Federal and Provincial withholding as-well-as ccp and ei withholding amounts. (Currently does not work for Quebec)

      C Prototype
      extern "C" long WH32_Canada_Calc(long command,struct CANADA_FEDERAL_WITHHOLDING_STRUC *wh, CANADA_PROVINCIAL_WITHHOLDING_STRUC *whp);
    • WH32_Canada_Get_CC
      Returns Canada claim code amounts for Federal and Provincial
      C Prototype
      extern "C" long WH32_Canada_Get_CC(long command,struct CANADA_CLAIM_CODE_STRUC *ccs);
  • Federal Withholding Calculations
    All elements of the structure FEDERAL_WITHHOLDING_STRUC must be initialized to 0's or a valid value by the application before calling any of the calculation functions. Here are specific instructions for initializing the FEDERAL_WITHHOLDING_STRUC. Items not listed here are returned by the calculation function – but should be initialized to 0 by application.
    Returned by function
    ElementSourceDescription
    struct_size Your Application
    dummy Not Used
    federal_error function returns this
    federal_exemptions W4 Any integer value
    federal_table_date Your Application This date is used to pick table for all tax (state and local too) calculations
    federal_table W4 From wh32.h one of
    FEDERAL_STATUS_SINGLE
    FEDERAL_STATUS_MARRIED
    FEDERAL_STATUS_MARRIED_WITHHOLD_AS_SINGLE
    federal_period W4 Any Long Integer Value
    federal_taxable_pay Your application Double value (you subtract non-taxable pay)
    federal_additional_withholding W4
    table_used
    federal_withhold_amount Returned by function Pay Period Federal Withholding (not including supplemental)
    fica_error Returned by function Any error in Social Security calculation (see wh32.h for list)
    fica_exempt Your application From wh32.h, Social Security option
    FEDERAL_FICA_ELIGIBLE
    or FEDERAL_FICA_EXEMPT
    federal_ficamedicare_pay Your application Taxable amount for Social Security and Medicare
    previous_fica_wages_this_year Your application Pevious Social Security wages not including this paycheck
    fica_withhold_amount Returned by function Social Security withholding for this pay period
    medicare_error Returned by function Any error in Medicare calculation (see wh32.h for list)
    previous_medicare_wages_this_year your application Not including this pay period
    medicare_withhold_amount Returned by function Pay period medicare withholding
    supplemental_amount your application Taxable supplemental amount
    ytd_supplemental_amount your application
    supplemental_calc_type your application From wh32.h,
    FEDERAL_SUPPLEMENTAL_FLAT_CALCULATION or FEDERAL_SUPPLEMENTAL_ADD_TO_SALARY
    supplemental_tax Returned by function Pay Period supplemental withholding
    withhold_exempt your application From wh32.h
    FEDERAL_WITHHOLD_ELIGIBLE
    or FEDERAL_WITHHOLD_EXEMPT
    You can perform regular and supplemental calculations at the same time.

    Note: FICA and Medicare tax will automatically be calculated for supplemental income. Care must be taken in the case where pretax retirement is greater than regular pay and less than supplemental payment. In this situation FICA and Medicare could be calculated incorrectly. The safest thing to do in this situation is to calculate FICA/Medicare in a separate call the the engine and then perform the regular calculation but using the FICA/Medicare amount returned in the first calculation.

    Sample Code Snippet
    /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    long l;
    double fedwh;
    /* various inits of wh go here */
    l=WH32_Calc(0,whpt,stwhpt); // command=0
    fedwh=wh.federal_withhold_amount;


  • State Withholding Calculations
    You calculate Federal AND State withholding using the WH32_Calc function. Besides passing the Federal withholding information you must fill out the STATE_WITHHOLDING_STRUCT to pass state information. This section describes on a state-by-state basis how to fill out the state withholding structure.

    Only the portions of the state structure germain to a particular state are shown. Not shown are structure elements you fill in for all states.  These are:
    struct_size
    state_taxable_pay
    state_period
    supplemental_amount
    ytd_supplemental_amount


    Sample Code Snippet
    /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    long l;
    double fedwh;
    double statewh;
    stwh.state_number=WH32_ALABAMA; /* various inits of wh go here */
    l=WH32_Calc(0,whpt,stwhpt); // command=0
    fedwh=wh.federal_withhold_amount;
    statewh=stwh.state_withhold_amount;


    • Alabama
      Element Source Description
      state_number your application from wh32.h
      WH32_ALABAMA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      alabama_dependents W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY

    • Sample Code Snippet
      /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
      struct FEDERAL_WITHHOLDING_STRUC wh;
      struct STATE_WITHHOLDING_STRUC stwh;
      struct LOCAL_WITHHOLDING_STRUC lwh;
      struct FEDERAL_WITHHOLDING_STRUC *whpt;
      struct STATE_WITHHOLDING_STRUC *stwhpt;
      struct LOCAL_WITHHOLDING_STRUC *lwhpt;
      whpt=&wh;
      stwhpt=&stwh;
      long l;
      double fedwh;
      double statewh;
      /* various inits of wh go here */
      /* we show state specific ones only here.*/
      stwh.state_number=WH32_ALABAMA;
      stwh.state_table=STATE_STATUS_MARRIED;
      stwh.state_allowances=2;
      stwh.alabama_dependents=1;
      stwh.state_additional_withholding=0;
      stwh.supplemental_calc_type=STATE_SUPPLEMENTAL_FLAT_CALCULATION;
      l=WH32_Calc(0,whpt,stwhpt); // command=0
      fedwh=wh.federal_withhold_amount;
      statewh=stwh.state_withhold_amount;


    • Arizona
      Element Source Description
      state_number your application from wh32.h
      WH32_ARIZONA
      arizona_withhold_percentage W4
      state_additional_withholding W4
    • Arkansas
      Element Source Description
      state_number your application from wh32.h
      WH32_ARKANSAS
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
    • California
      Element Source Description
      state_number your application from wh32.h
      WH32_CALIFORNIA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      california_estimated_deductions W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
      supplemental_tax_type Your application STATE_SUPPLEMENTAL_CA_BONUS_STOCK
      STATE_SUPPLEMENTAL_CA_OTHER
    • Colorado
      Element Source Description
      state_number your application from wh32.h
      WH32_COLORADO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Connecticut
      Element Source Description
      state_number your application from wh32.h
      WH32_CONNECTICUT
      connecticut_filing_status W4 Ascii value for 'A', 'B', 'C', 'D', 'F'
      connecticut_reductional_amount W4 Double value
      state_additional_withholding W4
    • District of Columbia
      Element Source Description
      state_number your application from wh32.h
      WH32_DISTRICTOFCOLUMBIA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
    • Delaware
      Element Source Description
      state_number your application from wh32.h
      WH32_DELAWARE
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      state_allowances W4
      state_additional_withholding W4
    • Georgia
      Element Source Description
      state_number your application from wh32.h
      WH32_GEORGIA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED_ONE_WORKING
      STATE_STATUS_MARRIED_BOTH_WORKING
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIEDSEPARATE
      STATE_STATUS_MARRIED_BOTH_WORKING_LO
      state_allowances W4
      georgia_dependents W4
      state_additional_withholding W4
    • Hawaii
      Element Source Description
      state_number your application from wh32.h
      WH32_HAWAII
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
    • Idaho
      Element Source Description
      state_number your application from wh32.h
      WH32_IDAHO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances For 2018 this is number elegible for child tax credit on Federal W-4 Line 5.
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Illinois
      Element Source Description
      state_number your application from wh32.h
      WH32_ILLINOIS
      state_allowances W4
      illinois_additional_allowances W4
      state_additional_withholding W4
    • Indiana
      Element Source Description
      state_number your application from wh32.h
      WH32_INDIANA
      state_allowances W4
      indiana_dependents W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Iowa
      Element Source Description
      state_number your application from wh32.h
      WH32_IOWA
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Kansas
      Element Source Description
      state_number your application from wh32.h
      WH32_KANSAS
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Kentucky
      Element Source Description
      state_number your application from wh32.h
      WH32_KENTUCKY
      state_additional_withholding W4
    • Louisiana
      Element Source Description
      state_number your application from wh32.h
      WH32_LOUISIANA
      state_allowances W4
      louisiana_dependents W4
      state_additional_withholding W4
    • Maine
      Element Source Description
      state_number your application from wh32.h
      WH32_MAINE
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Maryland
      Element Source Description
      state_number your application from wh32.h
      WH32_MARYLAND
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Massachusetts
      Element Source Description
      state_number your application from wh32.h
      WH32_MASSACHUSETTS
      state_allowances W4
      massachusetts_blind W4
      special_)field_1 W4 0 = use per pay period maximum fica deduction(default)
      2 = use cummulative fica payments for maximum fica deduction
      previous_fica_wages If special_field_1 equals 2 then uses this field to calculate maximum fica deduction
      massachusetts_spouse_blind 0 = no Spouse blind exemptions
      1 = Spouse blind exemptions
      massachusetts_student 0 = no Student exemptions
      1 = Student exemptions
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Michigan
      Element Source Description
      state_number your application from wh32.h
      WH32_MICHIGAN
      state_allowances W4
      michigan_special_exemptions W4
      michigan_claim_as_dependent W4
      state_additional_withholding W4
    • Minnesota
      Element Source Description
      state_number your application from wh32.h
      WH32_MINNESOTA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Mississippi
      Element Source Description
      state_number your application from wh32.h
      WH32_MISSISSIPPI
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_BOTH_WORKING
      mississippi_exemption_amount W4 Any Double Value
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Missouri
      Element Source Description
      state_number your application from wh32.h
      WH32_MISSOURI
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_BOTH_WORKING
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Montana
      Element Source Description
      state_number your application from wh32.h
      WH32_MONTANA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_ONE_WORKING
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Nebraska
      Element Source Description
      state_number your application from wh32.h
      WH32_NEBRASKA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_SURVIVINGSPOUSE
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • New Jersey
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWJERSEY
      state_table W4 from wh32.h; ASCII value
      State Table A = 0x41
      State Table B = 0x42
      State Table C = 0x43
      State Table D = 0x44
      State Table E = 0x45
      newjersey_table W4 Function uses this if element 'state_table' is blank
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_FILING_SINGLE
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      alabama_dependents W4
      state_additional_withholding W4
    • New Mexico
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWMEXICO
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      alabama_dependents W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • New York
      Element Source Description
      state_number your application from wh32.h
      WH32_NEWYORK
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • North Carolina
      Element Source Description
      state_number your application from wh32.h
      WH32_NORTHCAROLINA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_QUALIFYINGWIDOWER
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • North Dakota
      Element Source Description
      state_number your application from wh32.h
      WH32_NORTHDAKOTA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4 0 means no personal exemptions, 1 means yes to a personal exemption
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Ohio
      Element Source Description
      state_number your application from wh32.h
      WH32_Ohio
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Oklahoma
      Element Source Description
      state_number your application from wh32.h
      WH32_OKLAHOMA
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      STATE_STATUS_MARRIED_BOTH_WORKING
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Oregon
      Element Source Description
      state_number your application from wh32.h
      WH32_OREGON
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_MARRIED_FILING_SINGLE
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Pennsylvania
      Element Source Description
      state_number your application from wh32.h
      WH32_PENNSYLVANIA
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Puerto Rico
      Element Source Description
      state_number your application from wh32.h
      WH32_PUERTORICO
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Rhode Island
      Element Source Description
      state_number your application from wh32.h
      WH32_RHODEISLAND
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • South Carolina
      Element Source Description
      state_number your application from wh32.h
      WH32_SOUTHCAROLINA
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Utah
      Element Source Description
      state_number your application from wh32.h
      WH32_UTAH
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances
      Only Used Before May 1, 2018
      W4
      state_additional_withholding W4
    • Vermont
      Element Source Description
      state_number your application from wh32.h
      WH32_VERMONT
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Virginia
      Element Source Description
      state_number your application from wh32.h
      WH32_VIRGINIA
      state_allowances W4
      special_field_1 W4 Number of over age 64 or blind allowances
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Virgin Islands
      Element Source Description
      state_number your application from wh32.h
      WH32_VIRGINISLANDS
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      STATE_STATUS_HEADOFHOUSEHOLD
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • West Virginia
      Element Source Description
      state_number your application from wh32.h
      WH32_WESTVIRGINIA
      state_allowances W4
      state_special_1 W4 0=Withhold at Low Rate
      1=Withhold at Regular Rate
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
    • Wisconsin
      Element Source Description
      state_number your application from wh32.h
      WH32_WISCONSIN
      state_table W4 from wh32.h
      STATE_STATUS_SINGLE
      STATE_STATUS_MARRIED
      state_allowances W4
      state_additional_withholding W4
      supplemental_calc_type Your application STATE_SUPPLEMENTAL_FLAT_CALCULATION
      STATE_SUPPLEMENTAL_ADD_TO_SALARY
  • Local Withholding Calculations
    The following local taxes are supported
    Alabama Occupational Tax
    Colorado City OCP
    Delaware Wilmington Tax
    Indiana County
    Kentucky County, School, Local Taxes
    Maryland County
    Michigan City
    Missouri City
    New York City
    Ohio School District and Municipal Taxes
    Pennsylvania Municipality and School District
    Generic percentage
    Generic Occupational Privilege Tax
    Steps required to perform local withholding calculations.
    • Use the function call WH32_Get_Prompt to get the local taxing body name AND calculation number
    • Fill out required information in FEDERAL_WITHHOLDING_STRUC
    • Fill out required information in STATE_WITHHOLDING_STRUC
    • Fill out required information in LOCAL_WITHHOLDING_STRUC
    • Make the call to WH32_Calc_Local

    Sample Code Snippet for Alabama
    /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/
    struct FEDERAL_WITHHOLDING_STRUC wh;
    struct STATE_WITHHOLDING_STRUC stwh;
    struct LOCAL_WITHHOLDING_STRUC lwh;
    struct FEDERAL_WITHHOLDING_STRUC *whpt;
    struct STATE_WITHHOLDING_STRUC *stwhpt;
    struct LOCAL_WITHHOLDING_STRUC *lwhpt;
    whpt=&wh;
    stwhpt=&stwh;
    lwhpt=&lwh;
    long l;
    double fedwh;
    double statewh;
    double localwh;
    /* various inits of wh structure go here */
    /* we show state specific ones only here.*/
    stwh.state_number=WH32_ALABAMA;
    stwh.state_table=STATE_STATUS_MARRIED;
    stwh.state_allowances=2;
    stwh.alabama_dependents=1;
    stwh.state_additional_withholding=0;
    stwh.supplemental_calc_type=STATE_SUPPLEMENTAL_FLAT_CALCULATION;
    lwh.id_number=5; /*actual number returned from WH32_Get_Prompt call*/
    l=WH32_Calc_Local(0,whpt,stwhpt,lwhpt); // command=0
    fedwh=wh.federal_withhold_amount;
    statewh=stwh.state_withhold_amount;
    localwh=lwh.withhold_amount;


    If there is more than one local taxing authority you can repeat the above procedure for another taxing district.

    Each state entry below tells what is required in the LOCAL_WITHHOLDING_STRUC. In general you fill out LOCAL_WITHHOLDING_STRUC the same as STATE_WITHHOLDING_STRUC. Differences are shown for each individual state.

    • WH32_Get_Prompt
      A This call exists to allow you to retrieve the name and calculation number (calc_number) of local taxing bodies (Municipal, School or other name). You will use this URL call for 2 reasons
      • Get the names of the local taxing bodies for use in user prompts
      • Get the calculation number (calc_number) of each taxing body to put in the LOCAL_WITHHOLDING_STRUC.

      Your normal use would follow this sequence:
      • Make a call to WH32_Get_Prompt with correct state and muni_type and desired_entry set to 0 in structure WITHHOLDING_TAXBODY_INFO. The Function will return name of first taxing body and, more importantly, the total number of possible names in number_of_entries
      • Now retrieve all names by calling WH32_Get_Prompt with values for desired_entry from 0 to number_of_entries-1 returned in your first call
      • For each name save the name returned and the 'calc_number'. Calc_number will be used in the WH32_Calc call (LOCAL_WITHHOLDING_STRUC member id_number)

      WH32_Get_Prompt Code Snippet
      /*It is assumed that various structures should be completely filled out. We just show significan parts of structure here*/

      Next have function return total number of possible local
      taxing names in parameter number_of_entries;
      */
      wt.desired_entry=0;
      wt.muni_number=0;
      wt.state=WH32_COLORADO;
      ll=WH32_Get_Prompt(&wt,&thename[0]);
      max_entries=wt.number_of_entries;

      /*
      Now get all Colorado local prompts
      */
      for(i=0;i<max_entries;i++){
        wt.desired_entry=i;
        ll=WH32_Get_Prompt(&wt,&thename[0]);
        m_IDC_local_tax.AddString(&thename[0]);
        m_local_tax_ids[i]=wt.calc_number;
      }

      (Because some states have a lengthy list of names you will probably want to save this information locally. You should refresh the information whenever from the WH32_Version changes.)


    • Alabama Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Colorado Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Delaware Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Indiana Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Kentucky Local
      Kentucky has School, City and County withholding. If both the county and city have tax then the city takes precedence and you should not use the county tax. You can get the information needed for each type of tax by using the WH32_Get_Prompt call. Allow the user to select their tax body from these lists. Also prompt them for resident or non-resident. Then call the WH32_Calc_Local function 3 times (for county, city, school).
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      year_to_date your application Year to date taxable pay(not including this pay period)
      muni_type your application KY_LOCAL_SCHOOL, KY_LOCAL_CITY, or KY_LOCAL_COUNTY
    • Maryland Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Michigan Local
      The employer may have to withhold for two taxing bodies if they are a resident of a local taxing body other than the one they work. If so, the withholding amount due to the city of residence is returned in the structure element 'residence_withhold_amount'. Current version does not support less than 100% employment in a locality.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      resident your application Are they a resident of the location where they are working? Options are: LOCAL_NONRESIDENT or LOCAL_RESIDENT
      residence_number your application One of entries returned by function WH32_Get_Prompt
      withhold_amount Returned by function This will be the amount to withhold for the city of employment.
      residence_withhold_amount Returned by function This will be the amount to withhold for city of residence if they live in a different taxing city than the one employed in.
    • Missouri Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • New York Local
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
    • Ohio Local
      Two calculation calls must be made. One for School District tax and one for Municipal tax.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      muni_type your application From wh32.h. Either OH_SCHOOL_DISTRICT_TAX or OH_MUNICIPAL_TAX
    • Pennsylvania Local
      For Pennsylvania you will have to make two calls to the function 'WH32_Calc_Local': once for Municipality and once for School District. Payroll personnel will need to know district number, Whether resident or not and how Occupational Privilege Tax. Valid codes for Municipal/School District id will have to be supplied by payroll personnel. An invalid code will cause the error code 'WH32_LOCAL_NOTABLE' to be returned.
      Element Source Description
      id_number your application One entry returned from WH32_Get_Prompt function
      muni_type your application From wh32.h. PA_LOCAL_MUNICIPAL or PA_LOCAL_SCHOOL
      resident your application From wh32.h.LOCAL_NONRESIDENT or LOCAL_RESIDENT
    • Generic Percentage
      This calculation uses new elements of the 'LOCAL_WITHHOLDING_STRUC'. The operator should be prompted for these new elements. If the 'percent_amount' is non-zero this calculation will takes precendence over any other state local calculation except for generic Occupational Privilege Tax.
      Element Source Description
      percent_amount your application Fixed rate percent multiplied by taxable income. 7% should be sent as 0.07.
      maximum your application Maximum annual local percent withholding tax allowed. Leave zero if none.
      year-to-date your application Year-to-date Local withholding not including current paycheck
      number_of_exemptions your application Number of local personal exemptions used when calculating percent tax
      exemption_amount your application Annual dollar exemption for each personal exemption when calculating percent tax
      fixed_allowance_amount your application Annual dollar value subtracted from taxable income before percent tax calculation.
    • Generic Occupational Privilege Tax
      This calculation uses new elements of the 'LOCAL_WITHHOLDING_STRUC'. This tax is intended for local taxing bodies which have a fixed dollar amount tax, such as an Occupational Privilege Tax. If this field is non-zero it takes precedence over all other local taxes. The operator should be prompted for any Occupational Privilege Tax. and this amount put in the field 'annual_opt'.
      Element Source Description
      annual_opt your application Annual dollar amount of fixed type taxes such as occupational privilege tax.
  • Canadian Withholding Calculations
    To use the Canadian withholding functions you will have to use various structures. These are defined in the file wh32_canada.h supplied with the Withholding32 package.

    The function you will use to calculate Canada Federal and Provincial withholding is WH32_Canada_Calc. You will pass it the structures CANADA_FEDERAL_WITHHOLDING_STRUC and CANADA_PROVINCIAL_WITHHOLDING_STRUC. Next we show what needs to be placed into these structures before making the call.

    Other than common elements (e.g. struct_size, etc) here are the CANADA_FEDERAL_WITHHOLDING_STRUC elements you need to fill in
    Element Source Description
    federal_table_date your application Date you want calculation to be for.
    claim_amount TD1 Long integer value containing number of pay periods per year
    prescribed_zone_deduct TD1 Dollar amount.
    income_less_than_claim TD1 Suggested Prompt: "Is your total income less than claim amount?" In this Long value put a 1( CANADA_INCOME_LESS_THAN_CLAIM) for yes or 0 for no.
    labor_sponsored_corporation_deduction your application Employer will be notified of this amount
    other_federal_credits your application Additional credits such as charitable deduction and medical expenses requested by an employee. Suggested Prompt: "Other Employee authorized credits"
    ccp_eligible_months your application Supplied by employer. Number of months (1 through 12) under ccp.
    current_taxable_bonus your application Gross bonus minus pretax
    previous_taxable_bonus your application Gross amount minus pretax (not including current)
    provincially_registered_LSVCC your application


    CANADA_PROVINCIAL_WITHHOLDING_STRUC
    Element Source Description
    province_id your application from wh32_canada.h
    claim_amount TD1 Total claim amount. Suggested prompt: "TD1 Total Claim Amount"
    prescribed_zone_deduct your application
    labor_sponsored_corporation_deduction your application
    other_provincial_credits your application
    current_taxable_bonus your application
    previous_taxable_bonus your application
    disabled_dependents TD1 (used only by Ontario)
    dependents_under_18 TD1 (used only by Ontario)


    The (optional) WH32_Canada_Get_CC will return Federal and Provincial Claim Codes is useful for TD1 processing.
  • State Disability Insurance Calculations
    The function SDI_Calc returns State Disability Insurance Tax information. SDI is supported for California, Hawaii, New Jersey, New York, Puerto Rico and Rhode Island.


    When calling the function SDI_Calc you will have to pass the structure SDI_WITHHOLDING_STRUC. That structure is defined in the included sdi.h file. Here is how it should be filled out.
    Element Source Description
    sdi_pay your application Pay subject to SDI
    sdi_pay_ytd your application hould be the year-to-date sdi taxable pay not including the current amount. Employee withholding will be returned in 'sdi_amount'
    sdi_employer_rate your application is used to calculate employer contribution if non-zero. At this time this is used only for New Jersey. The rate varies by employer and must be passed to the calculation function. The employer contribution is returned in 'sdi_employer_amount'.
    sdi_employee_rate your application s used only if non-zero. Ordinarily we use the employee contribution rate from our database. You may override this by putting in a rate here (i.e. .005 would be 1/2 of 1%)
    period your application Is used by Hawaii and New York to calculate maximum contribution per pay period. If you do not use the expanded SDI Withholding Structure which includes this field then calculations will be as before.
    famleave_amount returned by function
    special_2 returned by function (employee contribution for Washington as of version 2019.00)
  • Federal Unemployment Calculations
    The function FUTA_Calc returns Federal Unemployment Insurance Tax information.


    When calling the function FUTA_Calc you will have to pass the structure FUTA_WITHHOLDING_STRUC. That structure is defined in the included futa.h file. Here is how it should be filled out.
    Element Source Description
    futa_pay your application Pay subject to FUTA
    futa_pay_ytd your application hould be the year-to-date futa taxable pay not including the current amount.
    futa_employer_rate your application is used to calculate employer contribution if non-zero.
  • State Unemployment Calculations
    The function SUI_Calc returns State Unemployment Insurance Tax information. SUI is supported for all states.


    When calling the function SUI_Calc you will have to pass the structure SUI_WITHHOLDING_STRUC. That structure is defined in the included sui.h file. Shown below are the parts that need to be filled out. As of version 2019.00 the wage base for Rhode Island depends on the employer rate.
    Element Source Description
    sui_pay your application Pay subject to SUI
    sui_pay_ytd your application hould be the year-to-date suta taxable pay not including the current amount.
    sui_employer_rate your application is used to calculate employer contribution if non-zero. The rate varies by employer and must be passed to the calculation function. The employer contribution is returned in 'sui_amount'. A rate of 1% would be passed as .01
    payperiods your application pay periods per year
    sui_ytd your application sui previously withheld this year
    sui_employee_rate your application rate for employee subtracted SUI contribution (1% would be entered as .01)
  • California ETT Calculations
    The function ETT_Calc returns California ETT Employer Tax.


    When calling the function ETT_Calc you will have to pass the structure ETT_WITHHOLDING_STRUC. That structure is defined in the included ett.h file. Here is how it should be filled out.
    Element Source Description
    ett_pay your application Pay subject to ETT
    ett_pay_ytd your application hould be the year-to-date suta taxable pay not including the current amount.
  • Oregon Transportation Tax Calculations
    The function TT_Calc returns Oregon Transportation Taxes. There may be local tax (you provide the rate) and effective July 1, 2018 there is a statewide transit tax with a fixed rate (we provide). The local tax is employer paid (returned in element tt_amount) and the new 2018 tax is employee paid (returned in element tt_ee_amount). See tt.h


    When calling the function TT_Calc you will have to pass the structure TT_WITHHOLDING_STRUC. That structure is defined in the included tt.h file. Here is how it should be filled out.
    Element Source Description
    tt_pay your application Pay subject to ETT
    tt_pay_ytd your application Not used.
    tt_er_rate your application Employer rate ( 1% = .01)
  • Family Leave Calculations
    The function FAMLEAVE_Calc returns Family Leave Tax. (New Jersey and New York(NY starting 2018))


    When calling the function FAMLEAVE_Calc you will have to pass the structure FAMLEAVE_WITHHOLDING_STRUC. That structure is defined in the included famleave.h file. Here is how it should be filled out.
    Element Source Description
    famleave_pay your application Pay subject to family leave
    famleave_pay_ytd your application
    special_1 your application Used for New York until version 2019.12. After this limit is annual instead of per pay period.
  • Workers Compensation Calculations
    The function WORKCOMP_Calc returns Workers Compensation Tax.


    When calling the function WORKCOMP_Calc you will have to pass the structure WORKCOMP_WITHHOLDING_STRUC. That structure is defined in the included workcomp.h file. Here is how it should be filled out.
    Element Source Description
    state your application From wh32.h
    state_info1 your application 0=hourly, 1=salaried
    state_info2 your application Number of previous paychecks this month
    workcomp_pay your application not used
    workcomp_pay_ytd your application Not used.
    workcomp_hours your application hours worked for hourly employees
    workcomp_rate1 your application employee dollar per hour rate
    workcomp_rate2 your application employer dollar per hour rate
    state_data1 your application not used
    state_data2 your application not used
  • Gross-Up Calculations
    Withholding32 contains a 'Gross-Up' option. This allows you to specify a given take-home payment and have Withholding32 calculate the gross pay required to achieve it. This works for both regular and supplemental payments and all Federal, State and Local withholding except for Ohio and Pennsylvania.

    The command word passed to WH32_Calc and WH32_Calc_Local is used to determine the type of gross up calculation performed.

    1) When calling WH32_Calc or WH32_Calc_Local set command = WH32_COMMAND_GROSSUP_REGULAR (defined in wh32.h)

    Set federal_taxable_pay to the desire NET pay. The same field will return the gross pay required to meet your goal. All other members of the various structures passed should be set up as normal.

    For a given desired net paycheck the library will calculate the gross regular pay required to meet this. You may have an additional amount in supplemental but this amount will not be adjusted. The required gross regular pay required to meet your target net pay will be returned in structure element federal_taxable_pay (as well as state/local/fica)

    2) In WH32_Calc or WH32_Calc_Local set command = WH32_COMMAND_GROSSUP_SUPPLEMENTAL (in wh32.h)

    Set supplemental_amount to the desire NET supplemental. The same field will return the gross supplemental required to meet your goal. All other members of the various structures passed should be set up as normal.

    For a desired net supplemental amount, the library will calculate the gross supplemental required to meet this. You may list a regular pay amount also, but the regular pay amount will not be adjusted. The required gross supplemental amount required to meet your target will be returned in supplemental_amount (in fed/state/local)

    It is possible that the library may not be able to arrive at an exact solution.  In this case the appropriate returned fields will be set to the closest possible and the federal structure error member will be set to WH32_GROSSUP_DID_NOT_CONVERGE (100).

    Fed/state/local/fica taxable pay must be the same when you call the function. This new feature does not work for Ohio or Pennsylvania.
  • Error Codes
    Calculation Functions (like WH32_Calc) can return two types of errors. The function itself returns an error and within structures passed to the function will be an error memeber. Errors which can be returned from function are shown here. These can be "or'd" together so more than one flag may be set at a time.
    #define WH32_RETURN_FEDERAL_ERROR 1
    #define WH32_RETURN_FICA_ERROR 2
    #define WH32_RETURN_MEDICARE_ERROR 4
    #define WH32_RETURN_STATE_ERROR 8
    #define WH32_RETURN_COUNTY_ERROR 16
    #define WH32_RETURN_LOCAL_ERROR 16
    #define WH32_RETURN_CITY_ERROR 32
    #define WH32_RETURN_SUPPLEMENTAL_ERROR 64;

    Federal Errors which can be returned from 'error' member of structure. Only one of these will be returned at a time.
    #define WH32_FEDERAL_NOTABLE 1
    #define WH32_FEDERAL_STRUCT_ERROR 2
    #define WH32_FEDERAL_ILLEGAL_PERIOD 3
    #define WH32_GROSSUP_DID_NOT_CONVERGE 100;

    State Errors which can be returned from 'error' member of structure
    #define WH32_STATE_NOTABLE 1
    #define WH32_ARIZONA_ILLEGALPERCENT 2
    #define WH32_STATE_NOSTATE 3
    #define WH32_STATE_STRUCT_ERROR 4

    Local Errors which can be returned from 'error' member of structure
    #define WH32_LOCAL_NOTABLE 1