bit64/sars

South African Revenue Services (SARS) component for PHP

dev-dev-master 2021-07-07 06:26 UTC

This package is auto-updated.

Last update: 2024-09-07 18:56:39 UTC


README

Copyright (c) 2021-current Bit 64 Solutions Pty Ltd (bit64.co)

This component provides a tax calculator microservice specific to the South African Revenue Services (SARS) for PHP projects.

Usage

Installation via Composer

$ composer require bit64/sars

Instantiate the API class

use Bit64\SARS\Api;

$api = new Api();

Income Tax Calculator

Get the income tax calculator

$incomeTax = $api->IncomeTax();

Default age is 30 years old

$grossMonthly = 25000;

$paye = $incomeTax->calculateMonthlyTax($grossMonthly);

echo sprintf('R%0.2f', $paye);
// Output R3749.17

Specify age and context date

$grossWeekly = 12000;
$age = 68;
$contextDate = '2021-05-30';

$paye = $incomeTax->calculateWeeklyTax($grossWeekly, $age, $contextDate);

echo sprintf('R%0.2f', $paye);
// Output R2751.23