Download the PHP package feimx/tax without Composer
On this page you can find all versions of the php package feimx/tax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package tax
Short Description This Package allow calculate Tax to an amount
License MIT
Homepage https://github.com/feimx/tax
Informations about the package tax
Calculate taxes for a given amount
The feimx/tax
package provide a simple way for calculate taxes of an amount.
Basic Usage
Installation
You can install the package via composer:
Note: If your Laravel versions is >=5.5
you don't need register providers.
Note: This is not necesary if you are not using Laravel
You can optionally publish the config file with:
This is the contents of the published config file:
Note: This is not necesary if you are not using Laravel
You can optionally publish the migrations file with:
Note: This is not necesary if you are not using Laravel
Usage
Firt need create a new instance of TaxManager
:
Second you need to add the taxes for calculate the final amount:
The first parameter could be a tax name ['iva', 'ieps', 'isr']
or an instance of FeiMx\Tax\Contracts\TaxContract
.
Exist 3 Tax Objects:
Note: You can pass a string for a tax type of given config file instead the retention boolean param.
You can add multiple taxes at once:
Now you can get the final amount:
You can get a list for given data:
This is the contents of get method:
Models
You can assign Taxable trait to your models.
You can assign tax groups to your model:
You can pass a name and multiples tax groups:
You can sync too:
And you can remove:
You can verify if a model has a TaxGroup:
For get the total amount after taxes, must need to know what column use, for defaul we use price
column,
but you can use another one:
Now you can get the total of a given TaxGroup:
And you can obtain the content of the get method of the TaxManager:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Jorge Andrade
- All Contributors
Support us
FEI is a Digital Invoicing startup based in Yucatán, México. You'll find an overview of all our open source projects on our website.
Does your business depend on our contributions? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.
License
The MIT License (MIT). Please see License File for more information.