Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/spurjobs/laravel-taxes in…
Browse files Browse the repository at this point in the history
…to feature/laws-178-mn-2020-changes
  • Loading branch information
Aidancs committed Mar 24, 2020
2 parents 9cf1954 + c6778d3 commit 1c360ce
Show file tree
Hide file tree
Showing 37 changed files with 1,595 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/CassIncome/V20200101/CassIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\CassIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\CassIncome\CassIncome as BaseCassIncome;

class CassIncome extends BaseCassIncome
{
public function getTaxRate(): float
{
return 0.027;
}
}
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/DecaturIncome/V20200101/DecaturIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\DecaturIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\DecaturIncome\DecaturIncome as BaseDecaturIncome;

class DecaturIncome extends BaseDecaturIncome
{
public function getTaxRate(): float
{
return 0.025;
}
}
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/FultonIncome/V20200101/FultonIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\FultonIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\FultonIncome\FultonIncome as BaseFultonIncome;

class FultonIncome extends BaseFultonIncome
{
public function getTaxRate(): float
{
return 0.0268;
}
}
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/GibsonIncome/V20200101/GibsonIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\GibsonIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\GibsonIncome\GibsonIncome as BaseGibsonIncome;

class GibsonIncome extends BaseGibsonIncome
{
public function getTaxRate(): float
{
return 0.009;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\HamiltonIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\HamiltonIncome\HamiltonIncome as BaseHamiltonIncome;

class HamiltonIncome extends BaseHamiltonIncome
{
public function getTaxRate(): float
{
return 0.011;
}
}
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/HenryIncome/V20200101/HenryIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\HenryIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\HenryIncome\HenryIncome as BaseHenryIncome;

class HenryIncome extends BaseHenryIncome
{
public function getTaxRate(): float
{
return 0.017;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\JeffersonIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\JeffersonIncome\JeffersonIncome as BaseJeffersonIncome;

class JeffersonIncome extends BaseJeffersonIncome
{
public function getTaxRate(): float
{
return 0.009;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\JenningsIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\JenningsIncome\JenningsIncome as BaseJenningsIncome;

class JenningsIncome extends BaseJenningsIncome
{
public function getTaxRate(): float
{
return 0.025;
}
}
13 changes: 13 additions & 0 deletions src/Countries/US/Indiana/KnoxIncome/V20200101/KnoxIncome.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\KnoxIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\KnoxIncome\KnoxIncome as BaseKnoxIncome;

class KnoxIncome extends BaseKnoxIncome
{
public function getTaxRate(): float
{
return 0.012;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Appleton\Taxes\Countries\US\Indiana\TippecanoeIncome\V20200101;

use Appleton\Taxes\Countries\US\Indiana\TippecanoeIncome\TippecanoeIncome as BaseTippecanoeIncome;

class TippecanoeIncome extends BaseTippecanoeIncome
{
public function getTaxRate(): float
{
return 0.0128;
}
}
10 changes: 10 additions & 0 deletions src/Countries/US/Kentucky/LudlowCity/V20200101/LudlowCity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Appleton\Taxes\Countries\US\Kentucky\LudlowCity\V20200101;

use Appleton\Taxes\Countries\US\Kentucky\LudlowCity\LudlowCity as BaseLudlowCity;

class LudlowCity extends BaseLudlowCity
{
public const TAX_RATE = 0.02;
}
21 changes: 21 additions & 0 deletions src/Countries/US/Missouri/KansasCity/KansasCity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\KansasCity;

use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseLocalIncome;
use Appleton\Taxes\Classes\WorkerTaxes\Payroll;
use Appleton\Taxes\Models\Countries\US\Missouri\MissouriIncomeTaxInformation;

abstract class KansasCity extends BaseLocalIncome
{
public function __construct(MissouriIncomeTaxInformation $tax_information, Payroll $payroll)
{
parent::__construct($payroll);
$this->tax_information = $tax_information;
}

public function getTaxBrackets()
{
return;
}
}
19 changes: 19 additions & 0 deletions src/Countries/US/Missouri/KansasCity/V20200101/KansasCity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\KansasCity\V20200101;

use Appleton\Taxes\Countries\US\Missouri\KansasCity\KansasCity as BaseKansasCity;

use Illuminate\Database\Eloquent\Collection;

class KansasCity extends BaseKansasCity
{
const TAX_RATE = 0.001;

public function compute(Collection $tax_areas)
{
$this->tax_total = $this->payroll->withholdTax($this->payroll->getEarnings() * static::TAX_RATE);

return round($this->tax_total, 2);
}
}
21 changes: 21 additions & 0 deletions src/Countries/US/Missouri/StLouis/StLouis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\StLouis;

use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseLocalIncome;
use Appleton\Taxes\Classes\WorkerTaxes\Payroll;
use Appleton\Taxes\Models\Countries\US\Missouri\MissouriIncomeTaxInformation;

abstract class StLouis extends BaseLocalIncome
{
public function __construct(MissouriIncomeTaxInformation $tax_information, Payroll $payroll)
{
parent::__construct($payroll);
$this->tax_information = $tax_information;
}

public function getTaxBrackets()
{
return;
}
}
19 changes: 19 additions & 0 deletions src/Countries/US/Missouri/StLouis/V20200101/StLouis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\StLouis\V20200101;

use Appleton\Taxes\Countries\US\Missouri\StLouis\StLouis as BaseStLouis;

use Illuminate\Database\Eloquent\Collection;

class StLouis extends BaseStLouis
{
const TAX_RATE = 0.01;

public function compute(Collection $tax_areas)
{
$this->tax_total = $this->payroll->withholdTax($this->payroll->getEarnings() * static::TAX_RATE);

return round($this->tax_total, 2);
}
}
10 changes: 10 additions & 0 deletions src/Countries/US/Missouri/StLouisEmployer/StLouisEmployer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\StLouisEmployer;

use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseLocal;

abstract class StLouisEmployer extends BaseLocal
{
const WITHHELD = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Appleton\Taxes\Countries\US\Missouri\StLouisEmployer\V20200101;

use Appleton\Taxes\Countries\US\Missouri\StLouisEmployer\StLouisEmployer as BaseStLouisEmployer;
use Illuminate\Database\Eloquent\Collection;

class StLouisEmployer extends BaseStLouisEmployer
{
const TAX_RATE = 0.005;

public function compute(Collection $tax_areas)
{
$this->tax_total = $this->payroll->withholdTax($this->payroll->getEarnings() * static::TAX_RATE);

return round($this->tax_total, 2);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Appleton\Taxes\Countries\US\Utah\UtahUnemployment\V20200101;

use Appleton\Taxes\Classes\WorkerTaxes\Payroll;
use Appleton\Taxes\Countries\US\Utah\UtahUnemployment\UtahUnemployment as BaseUtahUnemployment;

class UtahUnemployment extends BaseUtahUnemployment
{
const FUTA_CREDIT = 0.054;
const NEW_EMPLOYER_RATE = 0.03;
const WAGE_BASE = 36600;


public function __construct(Payroll $payroll)
{
parent::__construct($payroll);
$this->tax_rate = config('taxes.rates.us.utah.unemployment', static::NEW_EMPLOYER_RATE);
}
}
3 changes: 3 additions & 0 deletions src/Providers/TaxServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ class TaxServiceProvider extends ServiceProvider
\Appleton\Taxes\Countries\US\Minnesota\MinnesotaUnemployment\MinnesotaUnemployment::class,
\Appleton\Taxes\Countries\US\Mississippi\MississippiIncome\MississippiIncome::class,
\Appleton\Taxes\Countries\US\Mississippi\MississippiUnemployment\MississippiUnemployment::class,
\Appleton\Taxes\Countries\US\Missouri\KansasCity\KansasCity::class,
\Appleton\Taxes\Countries\US\Missouri\MissouriIncome\MissouriIncome::class,
\Appleton\Taxes\Countries\US\Missouri\StLouis\StLouis::class,
\Appleton\Taxes\Countries\US\Missouri\StLouisEmployer\StLouisEmployer::class,
\Appleton\Taxes\Countries\US\Missouri\MissouriUnemployment\MissouriUnemployment::class,
\Appleton\Taxes\Countries\US\Montana\MontanaIncome\MontanaIncome::class,
\Appleton\Taxes\Countries\US\Montana\MontanaUnemployment\MontanaUnemployment::class,
Expand Down

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions src/migrations/2020_03_11_000003_add_st_louis_taxes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

use Appleton\Taxes\Countries\US\Missouri\StLouis\StLouis;
use Appleton\Taxes\Countries\US\Missouri\StLouisEmployer\StLouisEmployer;
use Appleton\Taxes\Models\TaxArea;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class AddStLouisTaxes extends Migration
{
protected $governmental_unit_areas = 'governmental_unit_areas';
protected $tax_areas = 'tax_areas';

/**
* Run the migrations.
*/
public function up()
{
$st_louis_gua_id = DB::table($this->governmental_unit_areas)->insertGetId([
'name' => 'St. Louis, MO',
'area' => '0106000020E610000001000000010300000001000000A900000028B85851839456C02F6D382C0D4C43406A87BF266B9456C06C7A50508A4C434005F69848699456C0E42F2DEA934C4340384A5E9D639456C0CAA5F10BAF4C4340774CDD955D9456C0A305685BCD4C4340336DFFCA4A9456C0FB04508C2C4D434099F221A81A9456C0EE1F0BD1214E434081AD122C0E9456C0805EB873614E43402572C119FC9356C0C85A43A9BD4E43403385CE6BEC9356C0AB74779D0D4F434070CE88D2DE9356C014CE6E2D934F434084EFFD0DDA9356C0C0E78711C24F43409EB30584D69356C0C62FBC92E44F4340A9DC442DCD9356C0FCC0559E405043405395B6B8C69356C036E84B6F7F50434001BD70E7C29356C0C954C1A8A450434092AE997CB39356C04D66BCADF4504340925A28999C9356C04C89247A19514340C5ABAC6D8A9356C05758703FE0514340C8957A16849356C034643C4A255243406EDC627E6E9356C07DB1F7E28B5243409FE238F06A9356C067994528B6524340DA8F1491619356C0E0BBCD1B275343401B48179B569356C08B6CE7FBA953434018416326519356C028F1B913EC5343405626FC523F9356C0CF4D9B711A5443402DEBFEB1109356C0E597C11891544340D0B2EE1F0B9356C07F87A2409F54434058C9C7EE029356C0F19C2D20B4544340D07B6308009356C041F33977BB5443409C685721E59256C0E200FA7DFF544340849ECDAACF9256C0CD052E8F35554340334FAE29909256C0D4282499D5554340959C137B689256C0A1BC8FA33956434031EBC5504E9256C0CCCD37A27B5643406E4BE482339256C0DF4E22C2BF564340AFE94141299256C0F0BF95ECD856434040F50F22199256C0BEF6CC920057434051F2EA1C039256C0F430B43A395743403BAA9A20EA9156C0C9C6832D765743403E7782FDD79156C0409FC893A45743402C616D8C9D9156C077F52A323A5843402979758E019156C0C5707500C45943409CA223B9FC9056C05AD76839D0594340A67D737FF59056C0DFBF7971E2594340F4DA6CACC49056C047C8409E5D5A43409A046F48A39056C04C50C3B7B05A4340D47ABFD18E9056C04A287D21E45A43401DE736E15E9056C0F487669E5C5B4340DE8D0585419056C0D4B48B69A65B43400341800C1D9056C0635DDC46035C434046D09849D48F56C028F04E3E3D5C43406C3D4338668F56C031CD74AF935C43403E0455A3578F56C00E1478279F5C4340EC1516DC0F8F56C020787C7BD75C43401C7A8B87F78E56C0A06F0B96EA5C4340295AB917988E56C06DFDF49F355D43408D23D6E2538E56C0A71E69705B5D4340836C59BE2E8E56C0DE1E84807C5D43406246787B108E56C0705D3123BC5D4340F31ABB44F58D56C0207BBDFBE35D434009A52F849C8D56C02367614F3B5E4340CD02ED0E298D56C01DE21FB6F45E4340807D74EACA8C56C0310400C79E5F43403673486AA18C56C0F54BC45BE75F4340615111A7938C56C0C095ECD8086043402EA9DA6E828C56C0E0F2583332604340BEF8A23D5E8C56C040118B1876604340A17F828B158C56C0DF30D12005614340ECD808C4EB8B56C0E256410C7461434045D3D9C9E08B56C00FD07D39B3614340E54526E0D78B56C0C6FB71FBE5614340AD31E884D08B56C02E90A0F831624340E36F7B82C48B56C065C39ACAA26243405E29CB10C78B56C0417E3672DD624340750305DEC98B56C01901158E20634340C8EC2C7AA78B56C0BF64E3C116634340AAA4F71CA98A56C09342F884DF624340AB2006BAF68A56C008E412471E624340E3C04CD52E8B56C0698D793D646143400E0F61FC348B56C08AE8D7D64F6143404A83D329398B56C02FDADA7427614340633F8BA5488B56C0FDBFEAC891604340B1321AF9BC8B56C070067FBF985F4340E10F1242C08B56C0EB522C81955F43408C9B1A683E8C56C046CCECF3185F4340FAB31F29228D56C019E25817B75D43409D465A2A6F8D56C062A1D634EF5C4340F4E084F4838D56C0C07398EC6C5C43400803CFBD878D56C01C7C6132555C434080ECF5EE8F8D56C0E3141DC9E55B4340321B6492918D56C0C876BE9F1A5B4340C1FF56B2638D56C0CBA145B6F3594340BA427CC9F18C56C01445B709C5584340253B3602F18C56C0A2B437F8C2584340E4FDB846A78C56C0D32889AD46584340CE0FB4DF8A8C56C00ABCACCC16584340C486CCFD808C56C0E88BFA23065843408A7615527E8C56C0B22E6EA30158434058E8714DF48B56C083629221705643406E693524EE8B56C0ED7C3F355E564340E1D3058CDE8B56C0CB046F0E115643400B7BDAE1AF8B56C0613255302A5543401735ED02AF8B56C0D37B5D7423554340ACDA47D49A8B56C03B5AF86087544340A0BE654E978B56C0D40968226C5443406FB65850968B56C04022C953625443409BAED7CC6A8B56C0737A464FB4524340048BC3995F8B56C083C0CAA145524340865786A75F8B56C0B5D1226842524340D7AE889B608B56C0125B96370952434038AF4F82648B56C01045F2201F5143401A170E84648B56C085EB51B81E514340A88C7F9F718B56C0A223B9FC87504340C7B99FB8AC8B56C049820B0D1B4F43403CF20703CF8B56C0056B9C4D474E43402D5FA750D78B56C0998DD9A42A4E434061120F0AF28B56C0D7EA2D67CE4D4340D600A5A1468C56C00874266DAA4C434000AAB8718B8C56C089096AF8164C43408F2B7AD6E78C56C078985715724B43402385B2F0F58C56C0FCE07CEA584B43406F4FAC38188D56C090D2FD832E4B4340EF05E48F278D56C037B4A48A1B4B4340E9616875728D56C0B6BB07E8BE4A4340A629029CDE8D56C07EC34483144A4340B8763C73F38D56C01EEA71C2024A4340F1687179288E56C0AF543B97D549434025034015378E56C08D5F7825C94943401A20DE45478E56C0E938508FB3494340BAD7497D598E56C01B446B459B49434085D2EF95618E56C062EFAB688749434006BE2E5D3C8F56C0169D47B06E474340FEAB16B85F8F56C0A68A0BF41747434027A3CA30EE8F56C01D37FC6EBA45434056678AA0049056C09F668FE2794543403B3996587F9056C02DF975D4184443408063CF9ECB9056C0E0490B97554443408B6B7C26FB9056C0E31934F44F444340E945ED7E159156C0033DD4B66144434059F624B0399156C049BA66F2CD444340C1C8CB9A589156C03D635FB2F14443400CC7F319509156C0492D944C4E45434033A7CB62629156C0D68A36C7B9454340C24D4695619156C0FEB5BC72BD4543402E3BC43F6C9156C004780B24284643400C040132749156C0D174763238464340EEE9EA8EC59156C0CAE028797546434052D2C3D0EA9156C006BB61DBA2464340675E0EBBEF9156C0CEA96400A8464340EE5D83BEF49156C05F234910AE46434014AFB2B6299256C02BDB87BCE54643402E52280B5F9256C04DBD6E1118474340531EDD088B9256C014200A664C47434078EA9106B79256C0F3C7B4368D474340520C9068029356C09128B4ACFB474340B7CF2A33A59356C0D47B2AA73D494340DFFAB0DEA89356C05456D3F544494340F7CABC55D79356C09B525E2BA1494340D6C743DFDD9356C0E8D84125AE49434050A73CBA119456C054FCDF11154A43405260014C199456C0D2A8C0C9364A43403FC4060B279456C02A1DACFF734A43406FB6B9313D9456C0F7E461A1D64A4340F86BB2463D9456C0EB36A8FDD64A434077499C15519456C017B6662B2F4B43402159C0046E9456C0185DDE1CAE4B4340A167B3EA739456C0C6C1A563CE4B434028B85851839456C02F6D382C0D4C4340'
]);

$st_louis_earnings_tax = DB::table('taxes')->insertGetId([
'name' => 'St. Louis Earnings Tax',
'class' => StLouis::class,
]);

$st_louis_employer_tax = DB::table('taxes')->insertGetId([
'name' => 'St. Louis Payroll Expense Tax',
'class' => StLouisEmployer::class,
]);

DB::table($this->tax_areas)->insert([[
'tax_id' => $st_louis_earnings_tax,
'home_governmental_unit_area_id' => $st_louis_gua_id,
'work_governmental_unit_area_id' => $st_louis_gua_id,
'based' => TaxArea::BASED_ON_EITHER_LOCATION,
]]);

DB::table($this->tax_areas)->insert([[
'tax_id' => $st_louis_employer_tax,
'work_governmental_unit_area_id' => $st_louis_gua_id,
'based' => TaxArea::BASED_ON_WORK_LOCATION,
]]);
}
}
Loading

0 comments on commit 1c360ce

Please sign in to comment.