定制 veltix/tax-engine 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

veltix/tax-engine

Composer 安装命令:

composer require veltix/tax-engine

包简介

A Laravel TAX/VAT calculation engine

README 文档

README

A Laravel package for EU tax/VAT calculation with support for OSS, IOSS, reverse charge, and export rules.

Requirements

  • PHP 8.2+
  • Laravel 11 or 12
  • ext-bcmath

Installation

composer require veltix/tax-engine

Publish the configuration:

php artisan vendor:publish --tag=tax-engine-config

If using database storage for compliance snapshots, publish and run migrations:

php artisan vendor:publish --tag=tax-engine-migrations
php artisan migrate

Configuration

Key settings in config/tax.php:

Key Description Default
seller.country Seller's EU country code NL
oss.enabled Enable One-Stop Shop false
ioss.enabled Enable Import One-Stop Shop false
rounding.mode Rounding mode (half_up, half_down, half_even) half_up
compliance.store_decisions Store tax decisions true
compliance.store_evidence Store evidence (requires store_decisions with database driver) true
compliance.storage_driver Storage backend (array or database) array

Usage

use Veltix\TaxEngine\Actions\CalculateTaxAction;
use Veltix\TaxEngine\Data\TransactionData;
use Veltix\TaxEngine\Enums\CustomerType;
use Veltix\TaxEngine\Enums\SupplyType;
use Veltix\TaxEngine\Support\Country;
use Veltix\TaxEngine\Support\Money;

$action = app(CalculateTaxAction::class);

$result = $action->execute(new TransactionData(
    transactionId: 'order-123',
    amount: Money::fromCents(10000), // EUR 100.00
    sellerCountry: new Country('DE'),
    buyerCountry: new Country('FR'),
    customerType: CustomerType::B2C,
    supplyType: SupplyType::DigitalServices,
));

$result->taxAmount;    // Money object with calculated tax
$result->grossAmount;  // Net + tax
$result->decision;     // TaxDecisionData with scheme, rate, reasoning

Available Rules

Rules are evaluated by priority (highest first):

Rule Priority Description
IOSS 70 Import of goods into EU (max EUR 150)
Export 60 Goods export from EU to non-EU
Service Export 59 Services from EU to non-EU (outside scope)
Reverse Charge 50 B2B cross-border EU with VAT number
OSS 40 B2C cross-border EU (when OSS enabled)
Domestic Reverse Charge 30 Domestic B2B reverse charge
Cross-Border B2C Fallback 20 B2C cross-border EU without OSS (seller rate)
Domestic Standard 10 Domestic EU sale

Extending with Custom Rules

Implement RuleContract and tag it in your service provider:

use Veltix\TaxEngine\Contracts\RuleContract;

class MyCustomRule implements RuleContract
{
    public function applies(TransactionData $transaction): bool { /* ... */ }
    public function evaluate(TransactionData $transaction): TaxDecisionData { /* ... */ }
    public function priority(): int { return 25; }
}

// In your service provider:
$this->app->bind(MyCustomRule::class, fn () => new MyCustomRule());
$this->app->tag(MyCustomRule::class, 'tax-engine.rules');

License

MIT

veltix/tax-engine 适用场景与选型建议

veltix/tax-engine 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 veltix/tax-engine 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 veltix/tax-engine 我们能提供哪些服务?
定制开发 / 二次开发

基于 veltix/tax-engine 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 33
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-21