addeeandra/vat-calculator
Composer 安装命令:
composer require addeeandra/vat-calculator
包简介
VAT Calculator
关键字:
README 文档
README
VAT Calculator
Configurable VAT Rate & Calculator
Vat Calculator ID
This library is a simple VAT calculator.
What's in this library?
- VAT Rule 11%
- VAT Rule 12% with custom base (e.g. 11/12)
- VAT Calculator, when given VAT Rule, you can
- Calculate VAT of an amount (e.g.
AmountExclVat=100_000=>11_000) - Extract VAT from an amount (e.g.
AmountInclVat=111_000=>11_000) - Get total amount include VAT (e.g.
AmountExclVat=100_000=>111_000) - Get amount exclude VAT from (e.g.
AmountInclVat=111_000=>100_000)
- Calculate VAT of an amount (e.g.
Installation
You can install this package by simply running composer require addeeandra/vat-calculator
How to use
To use this library is simple.
use \Addeeandra\VatCalculator\Rules; use \Addeeandra\VatCalculator\Builders; # To use PPN 11% Rule $rule = new Rules\Vat12Rule(); $rule->calculate(100_000); // 11_000 (float) $rule->calculator()->vatInAmount(111_000); // 11_000 (float) # To use PPN 12% Rule $rule = new Rules\Vat12Rule(); $rule->calculate(100_000); // 11_000 (float) $rule->calculator()->vatInAmount(111_000); // 11_000 (float)
See VatRuleTest and VatCalculatorTest for more examples.
Need Custom VAT Rule?
You can make custom VAT Rule using VatRuleBuilder considering how fluid is our country's regulation.
// new VAT Rate 12% without base 11/12 $newVatRule = \Addeeandra\VatCalculator\Builders\VatRuleBuilder::make() ->rate(12) // 12% ->build(); // new VAT Rate 12% with base 15/12 which equals to 15% $newVatRule = \Addeeandra\VatCalculator\Builders\VatRuleBuilder::make() ->rate(12) // 12% ->base(fn (int|float $amount) => $amount * 15 / 12) // whoops, it's actually 15% :) ->build();
License
MIT License
addeeandra/vat-calculator 适用场景与选型建议
addeeandra/vat-calculator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「vat-calculator」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 addeeandra/vat-calculator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 addeeandra/vat-calculator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 addeeandra/vat-calculator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
Turn any PDF into a Pingen-ready A4 letter (generated address cover page + A4 normalisation + safe margins) and send it through the Pingen print & mail API. Laravel-first.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-11