Skip to content

Commit

Permalink
Merge pull request #298 from spurwork/feature/SS-944-2023-taxes
Browse files Browse the repository at this point in the history
Feature/ss 944 2023 taxes
  • Loading branch information
stevespur authored Feb 1, 2023
2 parents 7f321f5 + e7e6142 commit 14239dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Countries/US/FederalIncome/FederalIncome.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Appleton\Taxes\Classes\WorkerTaxes\Payroll;
use Appleton\Taxes\Classes\WorkerTaxes\Taxes\BaseIncome;
use Appleton\Taxes\Models\Countries\US\FederalIncomeTaxInformation;
use Appleton\Taxes\Traits\HasIncome;
use Illuminate\Database\Eloquent\Collection;

abstract class FederalIncome extends BaseIncome
Expand Down Expand Up @@ -44,9 +43,10 @@ public function compute(Collection $tax_areas): float
return 0.00;
}

$withholding_amount = max($this->withholdingAmount($this->adjustedAnnualWages()) - $this->taxCredits(), 0);

$this->tax_total = $this->payroll->withholdTax(
$this->withholdingAmount($this->adjustedAnnualWages())
- $this->taxCredits()
$withholding_amount
+ $this->tax_information->getExtraWithholding(),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public function testTax(array $parameters): void
public function provideTestData(): array
{
return [
'tax_credit_more_than_wages' => [[
'filing_status' => BaseFederalIncome::FILING_SINGLE,
'dependents_deduction_amount' => 2500,
'earnings' => 500,
'expected' => 0.0,
]],
'married' => [[
'filing_status' => BaseFederalIncome::FILING_JOINTLY,
'earnings' => 1000,
Expand Down

0 comments on commit 14239dc

Please sign in to comment.