[ 10 => [ [ 'income' => 6600, 'rate' => 0, 'constant' => 0 ], [ 'income' => 8200, 'rate' => 1.0, 'constant' => 0 ], [ 'income' => 11000, 'rate' => 2.0, 'constant' => 0 ], [ 'income' => 14700, 'rate' => 3.0, 'constant' => 0 ], [ 'income' => 21100, 'rate' => 4.0, 'constant' => 0 ], [ 'income' => 39800, 'rate' => 5.0, 'constant' => 0 ], [ 'income' => 39800, 'rate' => 5.0, 'constant' => 0 ], ], 20 => [ [ 'income' => 13200, 'rate' => 0, 'constant' => 0 ], [ 'income' => 16400, 'rate' => 1.0, 'constant' => 0 ], [ 'income' => 22000, 'rate' => 2.0, 'constant' => 0 ], [ 'income' => 29400, 'rate' => 3.0, 'constant' => 0 ], [ 'income' => 42200, 'rate' => 4.0, 'constant' => 0 ], [ 'income' => 79600, 'rate' => 5.0, 'constant' => 0 ], [ 'income' => 79600, 'rate' => 5.0, 'constant' => 0 ], ], ], 20070101 => [ 10 => [ [ 'income' => 2630, 'rate' => 0, 'constant' => 0 ], [ 'income' => 3630, 'rate' => 2.3, 'constant' => 0 ], [ 'income' => 4630, 'rate' => 3.1, 'constant' => 23 ], [ 'income' => 5630, 'rate' => 4.0, 'constant' => 54 ], [ 'income' => 6630, 'rate' => 4.9, 'constant' => 94 ], [ 'income' => 8130, 'rate' => 5.7, 'constant' => 143 ], [ 'income' => 8130, 'rate' => 6.5, 'constant' => 229 ], ], 20 => [ [ 'income' => 2630, 'rate' => 0, 'constant' => 0 ], [ 'income' => 4630, 'rate' => 2.3, 'constant' => 0 ], [ 'income' => 6630, 'rate' => 3.1, 'constant' => 46 ], [ 'income' => 8630, 'rate' => 4.0, 'constant' => 108 ], [ 'income' => 10630, 'rate' => 4.9, 'constant' => 188 ], [ 'income' => 13630, 'rate' => 5.7, 'constant' => 286 ], [ 'income' => 13630, 'rate' => 6.5, 'constant' => 457 ], ], ], 20060101 => [ 10 => [ [ 'income' => 2300, 'rate' => 0, 'constant' => 0 ], [ 'income' => 3163, 'rate' => 2.3, 'constant' => 0 ], [ 'income' => 4026, 'rate' => 3.1, 'constant' => 20 ], [ 'income' => 4888, 'rate' => 4.0, 'constant' => 47 ], [ 'income' => 5750, 'rate' => 4.9, 'constant' => 81 ], [ 'income' => 6613, 'rate' => 5.7, 'constant' => 123 ], [ 'income' => 6613, 'rate' => 6.5, 'constant' => 172 ], ], 20 => [ [ 'income' => 2300, 'rate' => 0, 'constant' => 0 ], [ 'income' => 4026, 'rate' => 2.3, 'constant' => 0 ], [ 'income' => 5750, 'rate' => 3.1, 'constant' => 40 ], [ 'income' => 7476, 'rate' => 4.0, 'constant' => 93 ], [ 'income' => 9200, 'rate' => 4.9, 'constant' => 162 ], [ 'income' => 10926, 'rate' => 5.7, 'constant' => 246 ], [ 'income' => 10926, 'rate' => 6.5, 'constant' => 344 ], ], ], ]; var $state_options = [ 20220501 => [ //01-May-2022 'rate' => 4.85, //Percent 'allowance' => 0, 'base_allowance' => [ 10 => 390, 20 => 780, ], 'allowance_reduction' => [ 10 => 7774, 20 => 15548, ], 'allowance_reduction_rate' => 1.3, //Percent ], 20180101 => [ 'rate' => 4.95, //Percent 'allowance' => 0, 'base_allowance' => [ 10 => 360, 20 => 720, ], 'allowance_reduction' => [ 10 => 7128, 20 => 14256, ], 'allowance_reduction_rate' => 1.3, //Percent ], 20080101 => [ //Completely new formula after this date. 'rate' => 5.0, //Percent 'allowance' => 125, 'base_allowance' => [ 10 => 250, 20 => 375, ], 'allowance_reduction' => [ 10 => 12000, 20 => 18000, ], 'allowance_reduction_rate' => 1.3, //Percent ], ]; var $state_ui_options = [ 20220101 => [ 'wage_base' => 41600, 'new_employer_rate' => null ], //New employer rate varies 20210101 => [ 'wage_base' => 38900, 'new_employer_rate' => null ], 20200101 => [ 'wage_base' => 36600, 'new_employer_rate' => null ], 20190101 => [ 'wage_base' => 35300, 'new_employer_rate' => null ], ]; function getStateAnnualTaxableIncome() { $income = $this->getAnnualTaxableIncome(); Debug::text( 'State Annual Taxable Income: ' . $income, __FILE__, __LINE__, __METHOD__, 10 ); return $income; } function getStateAllowanceAmount() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $allowance_amount = $retarr['allowance']; $retval = bcadd( bcmul( $this->getStateAllowance(), $allowance_amount ), $this->getStateBaseAllowanceAmount() ); Debug::text( 'State Allowance Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function getStateBaseAllowanceAmount() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $retval = 0; if ( isset( $retarr['base_allowance'][$this->getStateFilingStatus()] ) ) { $retval = $retarr['base_allowance'][$this->getStateFilingStatus()]; } Debug::text( 'State Base Allowance Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function getStateAllowanceReductionAmount() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $allowance_reduction_amount = 0; if ( isset( $retarr['allowance_reduction'][$this->getStateFilingStatus()] ) ) { $allowance_reduction_amount = $retarr['allowance_reduction'][$this->getStateFilingStatus()]; } $adjusted_taxable_income = bcsub( $this->getStateAnnualTaxableIncome(), $allowance_reduction_amount ); if ( $adjusted_taxable_income > 0 ) { $allowance_reduction_rate = $retarr['allowance_reduction_rate']; $retval = bcmul( $adjusted_taxable_income, bcdiv( $allowance_reduction_rate, 100 ) ); } else { $retval = 0; } Debug::text( 'State Allowance Reduction Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function _getStateTaxPayable() { $annual_income = $this->getStateAnnualTaxableIncome(); $retval = 0; if ( $annual_income > 0 ) { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $gross_tax = bcmul( $annual_income, bcdiv( $retarr['rate'], 100 ) ); $allowance_amount = bcsub( $this->getStateAllowanceAmount(), $this->getStateAllowanceReductionAmount() ); if ( $allowance_amount < 0 ) { $allowance_amount = 0; } $retval = bcsub( $gross_tax, $allowance_amount ); } if ( $retval < 0 ) { $retval = 0; } Debug::text( 'State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } } ?>