{"id":15021830,"url":"https://github.com/gewebe/syliusvatplugin","last_synced_at":"2025-07-19T17:11:14.652Z","repository":{"id":56983110,"uuid":"232197685","full_name":"gewebe/SyliusVATPlugin","owner":"gewebe","description":"Sylius EU-VAT number plugin, validate European VAT numbers real time with VIES, add a predefined set of standard VAT rates for EU countries.","archived":false,"fork":false,"pushed_at":"2025-04-07T21:24:39.000Z","size":274,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"1.4","last_synced_at":"2025-04-07T21:38:49.936Z","etag":null,"topics":["eu-vat-number","eu-vat-rates","sylius"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gewebe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-06T22:35:41.000Z","updated_at":"2025-04-07T20:36:44.000Z","dependencies_parsed_at":"2025-02-18T00:31:32.901Z","dependency_job_id":"cee48241-a4c4-400a-a245-afaad9e27aa3","html_url":"https://github.com/gewebe/SyliusVATPlugin","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":0.1578947368421053,"last_synced_commit":"da3d49446d87e39ab4c632057d11b8f0dd02bfda"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gewebe%2FSyliusVATPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gewebe%2FSyliusVATPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gewebe%2FSyliusVATPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gewebe%2FSyliusVATPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gewebe","download_url":"https://codeload.github.com/gewebe/SyliusVATPlugin/tar.gz/refs/heads/1.4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288361,"owners_count":21078903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eu-vat-number","eu-vat-rates","sylius"],"created_at":"2024-09-24T19:57:06.984Z","updated_at":"2025-04-10T20:12:16.808Z","avatar_url":"https://github.com/gewebe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Sylius VAT number and rates plugin\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE)\n[![Build][ico-build]][link-build]\n[![Quality Score][ico-code-quality]][link-code-quality]\n\n## Features\n * Installer for EU VAT rates with countries and zones\n * New fields for VAT number at `Address` and `ShopBillingData` entity\n * Configure VAT number field requirement:\n    * Optional / Required\n    * Required if customer filled “Company” field\n    * Required in selected countries\n * Validate VAT number:\n    * Format for selected country\n    * Country is same as selected country\n    * Validity using [VIES API](http://ec.europa.eu/taxation_customs/vies/) for EU VAT number\n * Revalidate customers VAT numbers after a given time\n * Placing an order without VAT in the EU, if\n    * VAT number validation was successful\n    * Customers taxation country is different from shop billing country\n\n## Installation\n\n### Download the plugin via composer\n```bash\ncomposer require gewebe/sylius-vat-plugin\n```\n\n### Enable the plugin in bundles.php\n```php\n# config/bundles.php\n\nreturn [\n    # ...\n    \n    Gewebe\\SyliusVATPlugin\\GewebeSyliusVATPlugin::class =\u003e ['all' =\u003e true],\n];\n```\n\n### Import the plugin configurations\n```yaml\n# config/packages/_sylius.yaml\n\nimports:\n    # ...\n       \n    - { resource: '@GewebeSyliusVATPlugin/config/app/config.yml'}\n```\n\n### Configure taxation address\n\nFor EU VAT, the address for taxation should be set to the shipping address in the Sylius configuration.\n```yaml\n# config/packages/_sylius.yaml\n\nsylius_core:\n    shipping_address_based_taxation: true\n```\n\n### Copy templates\nCopy customized templates to your templates directory (e.g `templates/bundles/`):\n\n```bash\nmkdir -p templates/bundles/SyliusAdminBundle/\ncp -R vendor/gewebe/sylius-vat-plugin/templates/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/\nmkdir -p templates/bundles/SyliusShopBundle/\ncp -R vendor/gewebe/sylius-vat-plugin/templates/SyliusShopBundle/* templates/bundles/SyliusShopBundle/\n```\n\n### Extend `Address` entity\n\n```php\n# src/Entity/Addressing/Address.php\n\nnamespace App\\Entity\\Addressing;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Gewebe\\SyliusVATPlugin\\Entity\\VatNumberAddressInterface;\nuse Gewebe\\SyliusVATPlugin\\Entity\\VatNumberAwareTrait;\nuse Sylius\\Component\\Core\\Model\\Address as BaseAddress;\n\n/**\n * @ORM\\Entity\n * @ORM\\Table(name=\"sylius_address\")\n */\n#[ORM\\Entity]\n#[ORM\\Table(name: 'sylius_address')]\nclass Address extends BaseAddress implements VatNumberAddressInterface\n{\n    use VatNumberAwareTrait;\n```\n\nIf you use `yaml` mapping add also:\n```yaml\n# config/doctrine/Address.orm.yaml\n\nApp\\Entity\\Addressing\\Address:\n    type: entity\n    table: sylius_address\n    fields:\n        vatNumber:\n            type: string\n            column: vat_number\n            nullable: true\n        vatValid:\n            type: boolean\n            column: vat_valid\n        vatValidatedAt:\n            type: datetime\n            column: vat_validated_at\n            nullable: true\n```\n\n### Add or Extend `ShopBillingData` entity\n\n```php\n# src/Entity/Channel/ShopBillingData.php\n\nnamespace App\\Entity\\Channel;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Gewebe\\SyliusVATPlugin\\Entity\\ShopBillingDataVatNumberAwareTrait;\nuse Gewebe\\SyliusVATPlugin\\Entity\\ShopBillingDataVatNumberInterface;\nuse Sylius\\Component\\Core\\Model\\ShopBillingData as BaseShopBillingData;\n\n/**\n * @ORM\\Entity\n * @ORM\\Table(name=\"sylius_shop_billing_data\")\n */\n#[ORM\\Entity]\n#[ORM\\Table(name: 'sylius_shop_billing_data')]\nclass ShopBillingData extends BaseShopBillingData implements ShopBillingDataVatNumberInterface\n{\n    use ShopBillingDataVatNumberAwareTrait;\n```\n\nIf you use `yaml` mapping add also:\n```yaml\n# config/doctrine/ShopBillingData.orm.yaml\n\nApp\\Entity\\Channel\\ShopBillingData:\n    type: entity\n    table: sylius_shop_billing_data\n    fields:\n        vatNumber:\n            type: string\n            column: vat_number\n            nullable: true\n```\n\nOverride the resource for `shop_billing_data` in your sylius config:\n```yaml\n# config/packages/_sylius.yaml\n\nsylius_core:\n    resources:\n        shop_billing_data:\n            classes:\n                model: App\\Entity\\Channel\\ShopBillingData\n```\n\n### Update your database schema\n\n```bash\nbin/console doctrine:migrations:diff\nbin/console doctrine:migrations:migrate\n```\n\n## Usage\n\n### Install EU countries and VAT rates\n\n```bash\n# EU VAT on digital services (MOSS scheme)\nbin/console vat:install:eu\n\n# EU with French VAT (cross-border)\nbin/console vat:install:eu FR\n\n# EU with French VAT and passed threshold in Spain and Portugal (cross-border)\nbin/console vat:install:eu FR -t ES,PT\n\n# EU with French VAT included in price\nbin/console vat:install:eu FR -i\n\n# EU with German standard and reduced VAT categories\nbin/console vat:install:eu DE -c standard,reduced\n```\n\n### Validate customers VAT number\n\n##### 1. Create new order with VAT number at shipping address\n![Screenshot checkout address with vat number](docs/images/checkout_address.png)\n\n##### 2. Show VAT number and validation status at admin orders\n![Screenshot order shipping address with vat number](docs/images/admin_order_address.png)\n\n\n## Testing\n\nSetup Traditional\n```bash\n$ composer install\n$ cd tests/Application\n$ yarn install\n$ yarn build\n$ bin/console assets:install public -e test\n$ bin/console doctrine:schema:create -e test\n\n$ export APP_ENV=test\n$ symfony server:start --port=8080 --dir=public\n```\n\nSetup Docker\n```bash\n$ docker compose up -d\n$ docker compose exec app make init\n```\n\nRun Tests\n```bash\n$ vendor/bin/behat\n$ vendor/bin/phpspec run\n$ vendor/bin/phpstan analyse -c phpstan.neon -l max src/\n```\n\nCoding Standard\n```bash\n$ vendor/bin/ecs check\n```\n\n[ico-version]: https://img.shields.io/packagist/v/gewebe/sylius-vat-plugin.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/gewebe/SyliusVATPlugin.svg?style=flat-square\n[ico-build]: https://github.com/gewebe/SyliusVATPlugin/actions/workflows/build.yml/badge.svg\n\n[link-packagist]: https://packagist.org/packages/gewebe/sylius-vat-plugin\n[link-code-quality]: https://scrutinizer-ci.com/g/gewebe/SyliusVATPlugin\n[link-build]: https://github.com/gewebe/SyliusVATPlugin/actions/workflows/build.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgewebe%2Fsyliusvatplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgewebe%2Fsyliusvatplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgewebe%2Fsyliusvatplugin/lists"}