[ 0 => [ //They changed the brackets again to almost be like a tax table. Just using every $1000 over 84500. [ 'income' => 5099, 'rate' => 0.0, 'constant' => 0 ], [ 'income' => 10299, 'rate' => 2.0, 'constant' => 101.98 ], [ 'income' => 14699, 'rate' => 3.0, 'constant' => 204.97 ], [ 'income' => 24299, 'rate' => 3.4, 'constant' => 263.77 ], [ 'income' => 87000, 'rate' => 4.9, 'constant' => 628.25 ], [ 'income' => 87100, 'rate' => 4.9, 'constant' => 627.20 ], [ 'income' => 87200, 'rate' => 4.9, 'constant' => 617.20 ], [ 'income' => 87300, 'rate' => 4.9, 'constant' => 607.20 ], [ 'income' => 87400, 'rate' => 4.9, 'constant' => 597.20 ], [ 'income' => 87600, 'rate' => 4.9, 'constant' => 587.20 ], [ 'income' => 87700, 'rate' => 4.9, 'constant' => 577.20 ], [ 'income' => 87800, 'rate' => 4.9, 'constant' => 567.20 ], [ 'income' => 87900, 'rate' => 4.9, 'constant' => 557.20 ], [ 'income' => 88000, 'rate' => 4.9, 'constant' => 547.20 ], [ 'income' => 88100, 'rate' => 4.9, 'constant' => 537.20 ], [ 'income' => 88200, 'rate' => 4.9, 'constant' => 527.20 ], [ 'income' => 88300, 'rate' => 4.9, 'constant' => 517.20 ], [ 'income' => 88400, 'rate' => 4.9, 'constant' => 507.20 ], [ 'income' => 88500, 'rate' => 4.9, 'constant' => 497.20 ], [ 'income' => 88600, 'rate' => 4.9, 'constant' => 487.20 ], [ 'income' => 88700, 'rate' => 4.9, 'constant' => 477.20 ], [ 'income' => 88800, 'rate' => 4.9, 'constant' => 467.20 ], [ 'income' => 88900, 'rate' => 4.9, 'constant' => 457.20 ], [ 'income' => 89000, 'rate' => 4.9, 'constant' => 447.20 ], [ 'income' => 89100, 'rate' => 4.9, 'constant' => 437.20 ], [ 'income' => 89200, 'rate' => 4.9, 'constant' => 427.20 ], [ 'income' => 89300, 'rate' => 4.9, 'constant' => 417.20 ], [ 'income' => 89400, 'rate' => 4.9, 'constant' => 407.20 ], [ 'income' => 89500, 'rate' => 4.9, 'constant' => 397.20 ], [ 'income' => 89600, 'rate' => 4.9, 'constant' => 387.20 ], [ 'income' => 89700, 'rate' => 4.9, 'constant' => 377.20 ], [ 'income' => 89800, 'rate' => 4.9, 'constant' => 367.20 ], [ 'income' => 89900, 'rate' => 4.9, 'constant' => 357.20 ], [ 'income' => 90000, 'rate' => 4.9, 'constant' => 347.20 ], [ 'income' => 90100, 'rate' => 4.9, 'constant' => 337.20 ], [ 'income' => 90200, 'rate' => 4.9, 'constant' => 327.20 ], [ 'income' => 90300, 'rate' => 4.9, 'constant' => 317.20 ], [ 'income' => 90400, 'rate' => 4.9, 'constant' => 307.20 ], [ 'income' => 90500, 'rate' => 4.9, 'constant' => 297.20 ], [ 'income' => 90600, 'rate' => 4.9, 'constant' => 287.20 ], [ 'income' => 90700, 'rate' => 4.9, 'constant' => 277.20 ], [ 'income' => 90800, 'rate' => 4.9, 'constant' => 267.20 ], [ 'income' => 90900, 'rate' => 4.9, 'constant' => 257.20 ], [ 'income' => 91100, 'rate' => 4.9, 'constant' => 247.20 ], [ 'income' => 91200, 'rate' => 4.9, 'constant' => 237.20 ], [ 'income' => 91300, 'rate' => 4.9, 'constant' => 227.20 ], [ 'income' => 91400, 'rate' => 4.9, 'constant' => 217.20 ], [ 'income' => 91500, 'rate' => 4.9, 'constant' => 207.20 ], [ 'income' => 91600, 'rate' => 4.9, 'constant' => 197.20 ], [ 'income' => 91700, 'rate' => 4.9, 'constant' => 187.20 ], [ 'income' => 91800, 'rate' => 4.9, 'constant' => 177.20 ], [ 'income' => 91800, 'rate' => 4.9, 'constant' => 167.20 ], ], ], 20220101 => [ 0 => [ //They changed the brackets again to almost be like a tax table. Just using every $1000 over 84500. [ 'income' => 4999, 'rate' => 0.0, 'constant' => 0 ], [ 'income' => 9999, 'rate' => 2.0, 'constant' => 99.98 ], [ 'income' => 14299, 'rate' => 3.0, 'constant' => 199.97 ], [ 'income' => 23599, 'rate' => 3.4, 'constant' => 257.17 ], [ 'income' => 39699, 'rate' => 5.0, 'constant' => 634.75 ], [ 'income' => 84500, 'rate' => 5.5, 'constant' => 833.25 ], [ 'income' => 85000, 'rate' => 5.5, 'constant' => 783.50 ], [ 'income' => 86000, 'rate' => 5.5, 'constant' => 683.50 ], [ 'income' => 87000, 'rate' => 5.5, 'constant' => 583.50 ], [ 'income' => 88000, 'rate' => 5.5, 'constant' => 483.50 ], [ 'income' => 89000, 'rate' => 5.5, 'constant' => 383.50 ], [ 'income' => 90000, 'rate' => 5.5, 'constant' => 283.50 ], [ 'income' => 90600, 'rate' => 5.5, 'constant' => 213.50 ], ], ], 20210101 => [ 0 => [ [ 'income' => 4699, 'rate' => 0.0, 'constant' => 0 ], [ 'income' => 9199, 'rate' => 2.0, 'constant' => 93.98 ], [ 'income' => 13899, 'rate' => 3.0, 'constant' => 185.97 ], [ 'income' => 22899, 'rate' => 3.4, 'constant' => 241.57 ], [ 'income' => 38499, 'rate' => 5.0, 'constant' => 427.71 ], [ 'income' => 82000, 'rate' => 5.9, 'constant' => 774.20 ], [ 'income' => 83000, 'rate' => 5.9, 'constant' => 681.70 ], [ 'income' => 84000, 'rate' => 5.9, 'constant' => 581.70 ], [ 'income' => 85300, 'rate' => 5.9, 'constant' => 481.70 ], [ 'income' => 86400, 'rate' => 5.9, 'constant' => 381.70 ], [ 'income' => 87500, 'rate' => 5.9, 'constant' => 281.70 ], [ 'income' => 87500, 'rate' => 5.9, 'constant' => 241.70 ], ], ], 20200301 => [ 0 => [ [ 'income' => 4599, 'rate' => 0.0, 'constant' => 0 ], [ 'income' => 9099, 'rate' => 2.0, 'constant' => 91.98 ], [ 'income' => 13699, 'rate' => 3.0, 'constant' => 182.97 ], [ 'income' => 22599, 'rate' => 3.4, 'constant' => 237.77 ], [ 'income' => 37899, 'rate' => 5.0, 'constant' => 421.46 ], [ 'income' => 80800, 'rate' => 5.9, 'constant' => 762.55 ], [ 'income' => 81800, 'rate' => 6.6, 'constant' => 1243.40 ], [ 'income' => 82800, 'rate' => 6.6, 'constant' => 1143.40 ], [ 'income' => 84100, 'rate' => 6.6, 'constant' => 1043.40 ], [ 'income' => 85200, 'rate' => 6.6, 'constant' => 943.40 ], [ 'income' => 86200, 'rate' => 6.6, 'constant' => 843.40 ], [ 'income' => 86200, 'rate' => 6.6, 'constant' => 803.40 ], ], ], 20150101 => [ 0 => [ [ 'income' => 4300, 'rate' => 0.9, 'constant' => 0 ], [ 'income' => 8400, 'rate' => 2.4, 'constant' => 38.70 ], [ 'income' => 12600, 'rate' => 3.4, 'constant' => 137.10 ], [ 'income' => 21000, 'rate' => 4.4, 'constant' => 279.90 ], [ 'income' => 35100, 'rate' => 5.90, 'constant' => 649.50 ], [ 'income' => 35100, 'rate' => 6.90, 'constant' => 1481.40 ], ], ], 20060101 => [ 0 => [ [ 'income' => 3000, 'rate' => 1.0, 'constant' => 0 ], [ 'income' => 6000, 'rate' => 2.5, 'constant' => 30 ], [ 'income' => 9000, 'rate' => 3.5, 'constant' => 105 ], [ 'income' => 15000, 'rate' => 4.5, 'constant' => 210 ], [ 'income' => 25000, 'rate' => 6.0, 'constant' => 480 ], [ 'income' => 25000, 'rate' => 7.0, 'constant' => 1080 ], ], ], ]; var $state_options = [ 20221001 => [ //01-Oct-22 'standard_deduction' => 2270, 'allowance' => 29, ], //20220101 - No Change 20210101 => [ 'standard_deduction' => 2200, 'allowance' => 29, ], 20150101 => [ 'standard_deduction' => 2200, 'allowance' => 26, ], 20060101 => [ 'standard_deduction' => 2000, 'allowance' => 20, ], ]; var $state_ui_options = [ 20220101 => [ 'wage_base' => 10000, 'new_employer_rate' => 3.1 ], 20210101 => [ 'wage_base' => 10000, 'new_employer_rate' => 3.1 ], 20200101 => [ 'wage_base' => 7000, 'new_employer_rate' => 3.1 ], 20190101 => [ 'wage_base' => 10000, 'new_employer_rate' => 3.1 ], ]; function getStateAnnualTaxableIncome() { $annual_income = $this->getAnnualTaxableIncome(); $standard_deduction = $this->getStateStandardDeduction(); $income = bcsub( $annual_income, $standard_deduction ); Debug::text( 'State Annual Taxable Income: ' . $income, __FILE__, __LINE__, __METHOD__, 10 ); return $income; } function getStateStandardDeduction() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $retval = $retarr['standard_deduction']; Debug::text( 'State Allowance Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function getStateAllowanceAmount() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $allowance_arr = $retarr['allowance']; $retval = bcmul( $this->getStateAllowance(), $allowance_arr ); Debug::text( 'State Allowance Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function _getStateTaxPayable() { $annual_income = $this->getStateAnnualTaxableIncome(); $retval = 0; if ( $annual_income > 0 ) { $rate = $this->getData()->getStateRate( $annual_income ); $state_constant = $this->getData()->getStateConstant( $annual_income ); $prev_income = $this->getData()->getStateRatePreviousIncome( $annual_income ); //Switch to using actual government formula with minus rather than addition so we don't have to calculate the brackets manually. if ( $this->getDate() >= 20200301 ) { $retval = bcsub( bcmul( $annual_income, $rate ), $state_constant ); } else { $retval = bcadd( bcmul( bcsub( $annual_income, $prev_income ), $rate ), $state_constant ); } } Debug::text( 'State Annual Tax Payable before allowance: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); $retval = bcsub( $retval, $this->getStateAllowanceAmount() ); if ( $retval < 0 ) { $retval = 0; } Debug::text( 'State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } } ?>