Skip to content

Commit

Permalink
Add ability to define Payer as a WHM Employer
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Nov 27, 2023
1 parent cf22b04 commit 3c6b2b5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/Entities/Payer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@

interface Payer
{
/**
* Determines if the payer is a registered Working Holiday Maker employer.
*
* In order to withhold tax for employees at a Working Holiday Maker rate, the payer must be registered as a
* Working Holiday Maker employer with the ATO. Otherwise, the employees are classified as foreign workers.
*
* @return bool
*/
public function isRegisteredWhmEmployer(): bool;
}
7 changes: 5 additions & 2 deletions src/TaxScales/October2020/Nat1004Scale3.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ public function isEligible(Payer $payer, Payee $payee, Earning $earning): bool
return false;
}

// Only applies to foreign residents.
if ($payee->getResidencyStatus() !== \ManageIt\PaygTax\Entities\Payee::FOREIGN_RESIDENT) {
// Only applies to foreign residents (or Working Holiday Makers whose employers are not registered)
if (
$payee->getResidencyStatus() === \ManageIt\PaygTax\Entities\Payee::RESIDENT
|| ($payee->getResidencyStatus() === \ManageIt\PaygTax\Entities\Payee::WORKING_HOLIDAY_MAKER && $payer->isRegisteredWhmEmployer())
) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/TaxScales/October2020/Nat1004Scale4.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function isEligible(Payer $payer, Payee $payee, Earning $earning): bool
return false;
}

// Working Holiday Makers still use their own tax scale.
if ($payee->getResidencyStatus() === Payee::WORKING_HOLIDAY_MAKER) {
// Working Holiday Makers still use their own tax scale if their payer is registered as a WHM employer.
if ($payee->getResidencyStatus() === Payee::WORKING_HOLIDAY_MAKER && $payer->isRegisteredWhmEmployer()) {
return false;
}

Expand Down
5 changes: 5 additions & 0 deletions src/TaxScales/October2020/Nat75331.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function isEligible(Payer $payer, Payee $payee, Earning $earning): bool
return false;
}

// Only applies if the payer is registered as a Working Holiday Maker employer.
if (!$payer->isRegisteredWhmEmployer()) {
return false;
}

return true;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/Fixtures/Payer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@

class Payer implements PayerInterface
{
public bool $whmEmployer = true;

public function isRegisteredWhmEmployer(): bool
{
return $this->whmEmployer;
}
}
4 changes: 4 additions & 0 deletions tests/TaxScales/October2020/Nat1004Scale3Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function testEligibility(): void
$payee->residencyStatus = Payee::WORKING_HOLIDAY_MAKER;
Assert::assertFalse($this->scale->isEligible($payer, $payee, $earning));

$payer->whmEmployer = false;
Assert::assertTrue($this->scale->isEligible($payer, $payee, $earning));

$payer->whmEmployer = true;
$payee->residencyStatus = Payee::FOREIGN_RESIDENT;
$payee->tfn = false;
Assert::assertFalse($this->scale->isEligible($payer, $payee, $earning));
Expand Down
4 changes: 4 additions & 0 deletions tests/TaxScales/October2020/Nat1004Scale4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function testEligibility(): void
$payee->residencyStatus = Payee::WORKING_HOLIDAY_MAKER;
Assert::assertFalse($this->scale->isEligible($payer, $payee, $earning));

$payer->whmEmployer = false;
Assert::assertTrue($this->scale->isEligible($payer, $payee, $earning));

$payer->whmEmployer = true;
$payee->residencyStatus = Payee::RESIDENT;
$payee->tfn = true;
Assert::assertFalse($this->scale->isEligible($payer, $payee, $earning));
Expand Down

0 comments on commit 3c6b2b5

Please sign in to comment.