chriys / taxman
PHP 销售税率计算器,使用自定义或加拿大税率
dev-analysis-86DowP
2018-02-19 14:41 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 6.5
This package is not auto-updated.
Last update: 2024-09-29 04:20:22 UTC
README
PHP 销售税率计算器,使用自定义或加拿大税率
需求
需要 php >= 7.1
安装
通过 composer 安装包: composer require chriys/taxman
.
入门
此包允许轻松计算金额的税费。目前有两种主要方式:使用加拿大省份的税率或使用自定义税率。
使用加拿大省份的税率
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',
];
使用自定义税费率
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',
];
安全性
如果您发现任何与安全相关的问题,请联系包开发者:christian.ahidjo@gmail.com
许可证
taxman 包是开源的,遵循 MIT 许可证。