-
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.
Merge pull request #238 from spurjobs/feature/laws-193-ky-local-updates
LAWS-193 2020 Kentucky Local Tax Updates: Smiths Grove, Highland Heights, Pendleton County, Elliott County
- Loading branch information
Showing
14 changed files
with
320 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\Kentucky\ElliottCounty; | ||
|
||
use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseOccupational; | ||
|
||
abstract class ElliottCounty extends BaseOccupational | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Countries/US/Kentucky/ElliottCounty/V20200101/ElliottCounty.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,10 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\Kentucky\ElliottCounty\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\ElliottCounty\ElliottCounty as BaseElliottCounty; | ||
|
||
class ElliottCounty extends BaseElliottCounty | ||
{ | ||
public const TAX_RATE = 0.01; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Countries/US/Kentucky/HighlandHeightsCity/V20200101/HighlandHeightsCity.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,19 @@ | ||
<?php | ||
namespace Appleton\Taxes\Countries\US\Kentucky\HighlandHeightsCity\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\HighlandHeightsCity\HighlandHeightsCity as BaseHighlandHeightsCity; | ||
use Appleton\Taxes\Traits\HasWageBase; | ||
use Illuminate\Database\Eloquent\Collection; | ||
|
||
class HighlandHeightsCity extends BaseHighlandHeightsCity | ||
{ | ||
use HasWageBase; | ||
|
||
public const TAX_RATE = 0.01; | ||
const WAGE_BASE = 137700; | ||
|
||
public function compute(Collection $tax_areas) | ||
{ | ||
return round($this->payroll->withholdTax(min($this->payroll->getEarnings(), $this->getBaseEarnings($tax_areas->first()->workGovernmentalUnitArea)) * self::TAX_RATE), 2); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Countries/US/Kentucky/PendletonCounty/V20200101/PendletonCounty.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,10 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\Kentucky\PendletonCounty\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\PendletonCounty\PendletonCounty as BasePendletonCounty; | ||
|
||
class PendletonCounty extends BasePendletonCounty | ||
{ | ||
public const TAX_RATE = 0.01; | ||
} |
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,9 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\Kentucky\SmithsGrove; | ||
|
||
use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseOccupational; | ||
|
||
abstract class SmithsGrove extends BaseOccupational | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Countries/US/Kentucky/SmithsGrove/V20200101/SmithsGrove.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,10 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\Kentucky\SmithsGrove\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\SmithsGrove\SmithsGrove as BaseSmithsGrove; | ||
|
||
class SmithsGrove extends BaseSmithsGrove | ||
{ | ||
public const TAX_RATE = 0.01; | ||
} |
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
38 changes: 38 additions & 0 deletions
38
src/migrations/2020_04_02_000000_add_smiths_grove_kentucky_local_tax.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,38 @@ | ||
<?php | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\SmithsGrove\SmithsGrove; | ||
use Appleton\Taxes\Models\TaxArea; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Support\Facades\DB; | ||
|
||
class AddSmithsGroveKentuckyLocalTax extends Migration | ||
{ | ||
protected $governmental_unit_areas = 'governmental_unit_areas'; | ||
protected $taxes = 'taxes'; | ||
protected $tax_areas = 'tax_areas'; | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$smiths_grove_gua_id = DB::table($this->governmental_unit_areas)->insertGetId([ | ||
'name' => 'Smiths Grove, KY', | ||
'area' => '0106000020E61000000100000001030000000100000021000000D00A0C59DD8D55C0BBEEAD484C864240D13FC1C58A8D55C0E961687572864240F86A47718E8D55C03048FAB48A8642408507CDAE7B8D55C03656629E95864240FC885FB1868D55C0A1DAE044F4874240577A6D36568D55C045F30016F987424029C93A1C5D8D55C0103FFF3D788742408F6E8445458D55C04B3D0B42798742406991ED7C3F8D55C0D21742CEFB874240A912656F298D55C05A7F4B00FE8742409A94826E2F8D55C001C11C3D7E8742407E18213CDA8C55C09E978A8D79874240C0249529E68C55C0F54883DBDA864240A0A696ADF58C55C0CB64389ECF8642402D978DCEF98C55C03A77BB5E9A864240EDEF6C8FDE8C55C01EFAEE569686424066BFEE74E78C55C01FF5D72B2C864240AE44A0FA078D55C02DE8BD3104864240321AF9BCE28C55C0C1AC50A4FB854240C5C72764E78C55C08481E7DEC3854240F05014E8138D55C067EDB60BCD8542404B21904B1C8D55C0DF180280638542400AA01859328D55C0F62345645885424081785DBF608D55C0740B5D8940854240020F0C207C8D55C09944BDE0D384424050340F60918D55C021C9ACDEE1844240A6F0A0D9758D55C07218CC5F21854240D3BB783F6E8D55C09A081B9E5E85424076C1E09A3B8D55C016139B8F6B8542400FF10F5B7A8D55C0C18A53AD85854240E78A5242B08D55C070AFCC5B75854240ECBE6378EC8D55C09A25016A6A854240D00A0C59DD8D55C0BBEEAD484C864240' | ||
]); | ||
|
||
|
||
$smiths_grove_tax_id = DB::table($this->taxes)->insertGetId([ | ||
'name' => 'Smiths Grove Kentucky Tax', | ||
'class' => SmithsGrove::class, | ||
]); | ||
|
||
DB::table($this->tax_areas)->insert([[ | ||
'tax_id' => $smiths_grove_tax_id, | ||
'work_governmental_unit_area_id' => $smiths_grove_gua_id, | ||
'based' => TaxArea::BASED_ON_WORK_LOCATION, | ||
]]); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/migrations/2020_04_02_000001_add_elliott_county_kentucky_local_tax.php
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
tests/Unit/Countries/US/Kentucky/V20200101/local/ElliottCountyTest.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,33 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\Kentucky\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\ElliottCounty\ElliottCounty; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\TaxTestCase; | ||
|
||
class ElliottCountyTest extends TaxTestCase | ||
{ | ||
private const DATE = '2020-01-01'; | ||
private const LOCATION = 'us.kentucky.elliott_county'; | ||
private const TAX_CLASS = ElliottCounty::class; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
public function testTax(): void | ||
{ | ||
$this->validate( | ||
(new TestParametersBuilder())->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52) | ||
->setWagesInCents(30000) | ||
->setExpectedAmountInCents(300) | ||
->build() | ||
); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
tests/Unit/Countries/US/Kentucky/V20200101/local/HighlandHeightsCityTest.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,74 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\Kentucky\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\HighlandHeightsCity\HighlandHeightsCity; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParameters; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\TaxTestCase; | ||
|
||
class HighlandHeightsCityTest extends TaxTestCase | ||
{ | ||
private const DATE = '2020-01-01'; | ||
private const LOCATION = 'us.kentucky.highland_heights_city'; | ||
private const TAX_CLASS = HighlandHeightsCity::class; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
/** | ||
* @dataProvider provideTestData | ||
*/ | ||
public function testTax(TestParameters $parameters): void | ||
{ | ||
$this->validate($parameters); | ||
} | ||
|
||
public function provideTestData(): array | ||
{ | ||
$builder = new TestParametersBuilder(); | ||
$builder | ||
->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52); | ||
|
||
return [ | ||
'00' => [ | ||
$builder | ||
->setWagesInCents(0) | ||
->setYtdWagesInCents(0) | ||
->setExpectedAmountInCents(0) | ||
->setExpectedEarningsInCents(0) | ||
->build() | ||
], | ||
'01' => [ | ||
$builder | ||
->setWagesInCents(30000) | ||
->setYtdWagesInCents(500000) | ||
->setExpectedAmountInCents(300) | ||
->setExpectedEarningsInCents(30000) | ||
->build() | ||
], | ||
'02' => [ | ||
$builder | ||
->setWagesInCents(90000) | ||
->setYtdWagesInCents(9910000) | ||
->setExpectedAmountInCents(900) | ||
->setExpectedEarningsInCents(90000) | ||
->build() | ||
], | ||
'over wage base' => [ | ||
$builder | ||
->setWagesInCents(77100) | ||
->setYtdWagesInCents(13770000) | ||
->setExpectedAmountInCents(0) | ||
->setExpectedEarningsInCents(0) | ||
->build() | ||
], | ||
]; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
tests/Unit/Countries/US/Kentucky/V20200101/local/PendletonCountyTest.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,33 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\Kentucky\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\PendletonCounty\PendletonCounty; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\TaxTestCase; | ||
|
||
class PendletonCountyTest extends TaxTestCase | ||
{ | ||
private const DATE = '2020-01-01'; | ||
private const LOCATION = 'us.kentucky.pendleton_county'; | ||
private const TAX_CLASS = PendletonCounty::class; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
public function testTax(): void | ||
{ | ||
$this->validate( | ||
(new TestParametersBuilder())->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52) | ||
->setWagesInCents(30000) | ||
->setExpectedAmountInCents(300) | ||
->build() | ||
); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
tests/Unit/Countries/US/Kentucky/V20200101/local/SmithsGroveTest.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,33 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\Kentucky\V20200101; | ||
|
||
use Appleton\Taxes\Countries\US\Kentucky\SmithsGrove\SmithsGrove; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\TaxTestCase; | ||
|
||
class SmithsGroveTest extends TaxTestCase | ||
{ | ||
private const DATE = '2020-01-01'; | ||
private const LOCATION = 'us.kentucky.smiths_grove'; | ||
private const TAX_CLASS = SmithsGrove::class; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
public function testTax(): void | ||
{ | ||
$this->validate( | ||
(new TestParametersBuilder())->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52) | ||
->setWagesInCents(30000) | ||
->setExpectedAmountInCents(300) | ||
->build() | ||
); | ||
} | ||
} |
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