Skip to content
/ Taxman Public

PHP Sales Tax calculator using custom or Canadian rates

License

Notifications You must be signed in to change notification settings

chriys/Taxman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taxman

Build Status Maintainability

PHP Sales Tax calculator using custom or Canadian rates

Requierements

Requires php >= 7.1

Installation

Install the packages via composer: composer require chriys/taxman.

Getting started

This package allows to easily calculate taxes on an amount. Currently two main ways are available: using rates of Canadian provinces or using custom rates.

Using Canadian's provinces rates

    Taxes::calculate('10.00', 'alberta');
    // expected result
    [
        'sub_total' => '10.00',
        'taxes_details' => [
            'gst' => '0.5',
            'pst' => '0.8',
        ],
        'taxes' => '1.3',
        'total' => '11.3',
    ];

Using custom taxes rates

    Taxes::calculate('45', [1, 2, 3]);
    // expected result
    [
        'sub_total' => '45',
        'taxes_details' => [
            0 => '0.45',
            1 => '0.9',
            2 => '1.35',
        ],
        'taxes' => '2.7',
        'total' => '47.7',
    ];

Security

If you discover any security related issues, please contact the package developer at christian.ahidjo@gmail.com

License

The Taxman package is open-sourced licensed under the MIT License.

About

PHP Sales Tax calculator using custom or Canadian rates

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages