承接 veltix/tax-engine 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

veltix/tax-engine

最新稳定版本:v1.0.3

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固