[ 0 => [ [ 'income' => 2000, 'rate' => 0, 'constant' => 0 ], [ 'income' => 5000, 'rate' => 2.20, 'constant' => 0 ], [ 'income' => 10000, 'rate' => 3.90, 'constant' => 66 ], [ 'income' => 20000, 'rate' => 4.80, 'constant' => 261 ], [ 'income' => 25000, 'rate' => 5.20, 'constant' => 741 ], [ 'income' => 60000, 'rate' => 5.55, 'constant' => 1001 ], [ 'income' => 60000, 'rate' => 6.60, 'constant' => 2943.50 ], ], ], 20100101 => [ 0 => [ [ 'income' => 2000, 'rate' => 0, 'constant' => 0 ], [ 'income' => 5000, 'rate' => 2.20, 'constant' => 0 ], [ 'income' => 10000, 'rate' => 3.90, 'constant' => 66 ], [ 'income' => 20000, 'rate' => 4.80, 'constant' => 261 ], [ 'income' => 25000, 'rate' => 5.20, 'constant' => 741 ], [ 'income' => 60000, 'rate' => 5.55, 'constant' => 1001 ], [ 'income' => 60000, 'rate' => 6.95, 'constant' => 2943.50 ], ], ], 20060101 => [ 0 => [ [ 'income' => 2000, 'rate' => 0, 'constant' => 0 ], [ 'income' => 5000, 'rate' => 2.20, 'constant' => 0 ], [ 'income' => 10000, 'rate' => 3.90, 'constant' => 66 ], [ 'income' => 20000, 'rate' => 4.80, 'constant' => 261 ], [ 'income' => 25000, 'rate' => 5.20, 'constant' => 741 ], [ 'income' => 60000, 'rate' => 5.55, 'constant' => 1001 ], [ 'income' => 60000, 'rate' => 5.95, 'constant' => 2943.50 ], ], ], ]; var $state_options = [ 20060101 => [ 'standard_deduction' => [ 10 => 3250, 20 => 6500, 30 => 3250, ], 'allowance' => 110, ], ]; var $state_ui_options = [ 20060101 => [ 'wage_base' => 16500, 'new_employer_rate' => 1.8 ], ]; 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; } if ( isset( $retarr['standard_deduction'][$this->getStateFilingStatus()] ) ) { $deduction = $retarr['standard_deduction'][$this->getStateFilingStatus()]; } else { $deduction = $retarr['standard_deduction'][10]; //Single } Debug::text( 'Standard Deduction: ' . $deduction, __FILE__, __LINE__, __METHOD__, 10 ); return $deduction; } 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 ); $prev_income = $this->getData()->getStateRatePreviousIncome( $annual_income ); $state_constant = $this->getData()->getStateConstant( $annual_income ); //$retval = bcadd( bcmul( bcsub( $annual_income, $state_rate_income ), $rate ), $state_constant ); $retval = bcadd( bcmul( bcsub( $annual_income, $prev_income ), $rate ), $state_constant ); } $retval = bcsub( $retval, $this->getStateAllowanceAmount() ); if ( $retval < 0 ) { $retval = 0; } Debug::text( 'State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } } ?>