clear
cd $FXBIN
echo 
echo "    PAYROLL TAX UPDATE"
echo "    __________________"
echo 
echo 
echo "Enter the 2-digit year for which you want to load tax tables (q=quit)"
read taxyear 
if  test $taxyear = "q"; then
   exit
fi

echo
echo "Enter 2 character State code (ca=California, ct=Connecticut, q=quit)"
read statecode 
if  test $statecode = "q"; then
   exit
fi
echo 
echo

fed_sql=pyfe$taxyear.sql
state_sql=pyst$taxyear$statecode.sql

#special updates
if test $taxyear = "02"; then
   fxsql pyupd02.sql > junk
   if test $? -ne 0; then
      echo "!!!!  W2 update failed - CALL FOR SUPPORT !!!!" 
   fi
fi

# FEDERAL TAX TABLE UPDATE
echo
if test -f $fed_sql; then
    fxsql $fed_sql > junk
    if test $? -eq 0; then
       echo "20$taxyear Federal tax table update completed successfully !" 
    else
       echo "!!!!  20$taxyear Federal tax table update failed - CALL FOR SUPPORT !!!!" 
       fi
else
    echo "20$taxyear federal tax table has not been installed on your computer - CALL FOR SUPPORT !!!"
fi


# STATE TAX TABLE UPDATE
echo
if test -f $state_sql; then
    fxsql $state_sql > junk
    if test $? -eq 0; then
       echo "20$taxyear $statecode state tax table update completed successfully !" 
    else
       echo " !!!!  20$taxyear State tax table update failed - CALL FOR SUPPORT !!!!" 
       fi
else
    echo "20$taxyear $statecode state tax table has not been installed on your computer."
    echo "If your state has payroll taxes you will need to manually add them"
    echo "in the payroll module. Please call support if you need help."
fi

echo 
echo 
echo Press any key to return to the menu
read answer
