[ 'rate' => 3.23, 'allowance' => 1000, //Deduction Constant Table A for 1 allowance * 12 months. 'dependant_allowance' => 1500, //Deduction Constant Table B for 1 allowance * 12 months. ], 20150101 => [ 'rate' => 3.3, 'allowance' => 1000, 'dependant_allowance' => 1500, ], 20060101 => [ 'rate' => 3.4, 'allowance' => 1000, 'dependant_allowance' => 1500, ], ]; var $state_ui_options = [ 20060101 => [ 'wage_base' => 9500, 'new_employer_rate' => 2.5 ], ]; function getStateAnnualTaxableIncome() { $annual_income = $this->getAnnualTaxableIncome(); $state_allowance = $this->getStateAllowanceAmount(); $state_dependant_allowance = $this->getStateDependantAllowanceAmount(); $income = bcsub( bcsub( $annual_income, $state_allowance ), $state_dependant_allowance ); 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_arr = $retarr['allowance']; $retval = bcmul( (float)$this->getUserValue1(), $allowance_arr ); Debug::text( 'State Allowance Amount: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } function getStateDependantAllowanceAmount() { $retarr = $this->getDataFromRateArray( $this->getDate(), $this->state_options ); if ( $retarr == false ) { return false; } $allowance_arr = $retarr['dependant_allowance']; $retval = bcmul( (float)$this->getUserValue2(), $allowance_arr ); Debug::text( 'State Dependant Allowance 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; } $rate = bcdiv( $retarr['rate'], 100 ); $retval = bcmul( $annual_income, $rate ); } if ( $retval < 0 ) { $retval = 0; } Debug::text( 'State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10 ); return $retval; } } ?>