-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add New Mexico Taxes * Fix state income withholding
- Loading branch information
Showing
25 changed files
with
425 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/Countries/US/NewMexico/NewMexicoIncome/NewMexicoIncome.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\NewMexico\NewMexicoIncome; | ||
|
||
use Appleton\Taxes\Classes\BaseStateIncome; | ||
use Appleton\Taxes\Classes\Payroll; | ||
use Appleton\Taxes\Models\Countries\US\NewMexico\NewMexicoIncomeTaxInformation; | ||
|
||
abstract class NewMexicoIncome extends BaseStateIncome | ||
{ | ||
const FILING_SINGLE = 0; | ||
const FILING_WIDOW = 1; | ||
const FILING_HEAD_OF_HOUSEHOLD = 2; | ||
const FILING_MARRIED = 3; | ||
const FILING_SEPERATE = 4; | ||
|
||
const FILING_STATUSES = [ | ||
self::FILING_SINGLE => 'FILING_SINGLE', | ||
self::FILING_WIDOW => 'FILING_WIDOW', | ||
self::FILING_HEAD_OF_HOUSEHOLD => 'FILING_HEAD_OF_HOUSEHOLD', | ||
self::FILING_MARRIED => 'FILING_MARRIED', | ||
self::FILING_SEPERATE => 'FILING_SEPERATE', | ||
]; | ||
|
||
public function __construct(NewMexicoIncomeTaxInformation $tax_information, Payroll $payroll) | ||
{ | ||
parent::__construct($payroll); | ||
$this->tax_information = $tax_information; | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
src/Countries/US/NewMexico/NewMexicoIncome/V20180101/NewMexicoIncome.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\NewMexico\NewMexicoIncome\V20180101; | ||
|
||
use Appleton\Taxes\Classes\Payroll; | ||
use Appleton\Taxes\Countries\US\NewMexico\NewMexicoIncome\NewMexicoIncome as BaseNewMexicoIncome; | ||
use Appleton\Taxes\Countries\US\FederalIncome\FederalIncome; | ||
use Appleton\Taxes\Models\Countries\US\NewMexico\NewMexicoIncomeTaxInformation; | ||
|
||
class NewMexicoIncome extends BaseNewMexicoIncome | ||
{ | ||
const SUPPLEMENTAL_TAX_RATE = 0.049; | ||
|
||
const SINGLE_BRACKETS = [ | ||
[0, 0.00, 0], | ||
[2300, 0.017, 0], | ||
[7800, 0.032, 93.5], | ||
[13300, 0.047, 269.5], | ||
[18300, 0.049, 504.5], | ||
[28300, 0.049, 994.5], | ||
[44300, 0.049, 1778.5], | ||
[67300, 0.049, 2905.5], | ||
]; | ||
|
||
const MARRIED_BRACKETS = [ | ||
[0, 0.00, 0], | ||
[8650, 0.017, 0], | ||
[16650, 0.032, 136], | ||
[24650, 0.047, 392], | ||
[32650, 0.047, 768], | ||
[48650, 0.049, 1552], | ||
[72650, 0.049, 2728], | ||
[108650, 0.049, 4492], | ||
]; | ||
|
||
const EXEMPTION_ALLOWANCE_AMOUNT = 4050; | ||
|
||
public function __construct(NewMexicoIncomeTaxInformation $tax_information, FederalIncome $federal_income, Payroll $payroll) | ||
{ | ||
parent::__construct($tax_information, $payroll); | ||
$this->federal_income_tax = $federal_income->getAmount(); | ||
$this->tax_information = $tax_information; | ||
} | ||
|
||
public function getAdjustedEarnings() | ||
{ | ||
return $this->getGrossEarnings() - ($this->federal_income_tax * $this->payroll->pay_periods) - $this->getAllowanceExemption(); | ||
} | ||
|
||
public function getTaxBrackets() | ||
{ | ||
if ($this->tax_information->filing_status === static::FILING_SINGLE || $this->tax_information->filing_status === static::FILING_HEAD_OF_HOUSEHOLD) { | ||
return static::SINGLE_BRACKETS; | ||
} else { | ||
return static::MARRIED_BRACKETS; | ||
} | ||
} | ||
|
||
private function getAllowanceExemption() | ||
{ | ||
return $this->tax_information->exemptions * self::EXEMPTION_ALLOWANCE_AMOUNT; | ||
} | ||
|
||
private function getGrossEarnings() | ||
{ | ||
return ($this->payroll->earnings - $this->payroll->supplemental_earnings) * $this->payroll->pay_periods; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Countries/US/NewMexico/NewMexicoUnemployment/NewMexicoUnemployment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\NewMexico\NewMexicoUnemployment; | ||
|
||
use Appleton\Taxes\Countries\US\FederalUnemployment\BaseStateUnemployment; | ||
|
||
abstract class NewMexicoUnemployment extends BaseStateUnemployment | ||
{ | ||
const TYPE = 'state'; | ||
const WITHHELD = false; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Countries/US/NewMexico/NewMexicoUnemployment/V20180101/NewMexicoUnemployment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\NewMexico\NewMexicoUnemployment\V20180101; | ||
|
||
use Appleton\Taxes\Classes\Payroll; | ||
use Appleton\Taxes\Countries\US\NewMexico\NewMexicoUnemployment\NewMexicoUnemployment as BaseNewMexicoUnemployment; | ||
|
||
class NewMexicoUnemployment extends BaseNewMexicoUnemployment | ||
{ | ||
const FUTA_CREDIT = 0.054; | ||
|
||
const NEW_EMPLOYER_RATE = 0.01; | ||
|
||
const WAGE_BASE = 24200; | ||
|
||
public function __construct(Payroll $payroll) | ||
{ | ||
parent::__construct($payroll); | ||
$this->tax_rate = config('taxes.rates.us.new_mexico.unemployment', static::NEW_EMPLOYER_RATE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Models/Countries/US/NewMexico/NewMexicoIncomeTaxInformation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Models\Countries\US\NewMexico; | ||
|
||
use Appleton\Taxes\Countries\US\NewMexico\NewMexicoIncome\NewMexicoIncome; | ||
use Appleton\Taxes\Classes\BaseTaxInformationModel; | ||
|
||
class NewMexicoIncomeTaxInformation extends BaseTaxInformationModel | ||
{ | ||
protected $config_name = 'taxes.tables.us.new_mexico.new_mexico_income_tax_information'; | ||
|
||
public static function getDefault() | ||
{ | ||
$tax_information = new self(); | ||
$tax_information->additional_withholding = 0; | ||
$tax_information->exemptions = 0; | ||
$tax_information->filing_status = NewMexicoIncome::FILING_SINGLE; | ||
$tax_information->exempt = false; | ||
return $tax_information; | ||
} | ||
|
||
public function getAdditionalWithholding($value) | ||
{ | ||
return $value * 100; | ||
} | ||
|
||
public function setAdditionalWithholding($value) | ||
{ | ||
$this->attributes['additional_withholding'] = round($value / 100); | ||
} | ||
|
||
public static function getTax() | ||
{ | ||
return NewMexicoIncome::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/migrations/2018_01_01_000016_create_new_mexico_income_tax_information_table.php
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.