Download the PHP package webgriffe/sylius-italian-invoiceable-order-plugin without Composer

On this page you can find all versions of the php package webgriffe/sylius-italian-invoiceable-order-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sylius-italian-invoiceable-order-plugin

Italian Invoiceable Order Plugin

Sylius plugin which allows Italian merchants to collect invoice data for their orders such as tax code, VAT number, SDI code, etc... as well as allowing the merchant to only apply taxes to those customers that can (and must) pay taxes in advance.

Build Status

Installation

  1. Require the plugin:

  2. If they have not been added automatically, you have to add these bundles to config/bundles.php file:

  3. Add the plugin's configs by creating the config/packages/webgriffe_sylius_italian_invoiceable_order_plugin.yaml file with the following content:

  4. By default, the parameter webgriffe_sylius_italian_invoiceable_order.taxation.eu_zone_code is set to "EU", as it must be the code of a zone representing the EU. This is used to determine if an order is invoiced to a company within the EU or not. Please change this parameter according to your Sylius's zone configuration if needed:

  5. Your Address entity must implement the Webgriffe\SyliusItalianInvoiceableOrderPlugin\Model\ItalianInvoiceableAddressInterface and the Symfony\Component\Validator\GroupSequenceProviderInterface. You can use the Webgriffe\SyliusItalianInvoiceableOrderPlugin\Model\ItalianInvoiceableAddressTrait as implementation for both interfaces.

  6. Your Order entity must implement the Webgriffe\SyliusItalianInvoiceableOrderPlugin\Model\ItalianInvoiceableOrderInterface. You can use the Webgriffe\SyliusItalianInvoiceableOrderPlugin\Model\ItalianInvoiceableOrderTrait as default implementation for the interface.

  7. You need to import the Address and Order validator configuration into your project by copying the configuration files provided by this plugin:

    WAIT! We are not done with this step yet. You must edit these files to change the namespace Tests\Webgriffe\SyliusItalianInvoiceableOrderPlugin to your own project namespace: there are 3 references that you have to change among these files.

    If you have the "App" as the base namespace of your app, this command should be enough:

    Linux:

    MacOS:

    If you already have some validator file for these entities you have to merge the configuration manually.

    NB Please, note that currently these validation rules are applied in strict mode. This means that if the VIES service is not available for some reason, the validation of the VAT number will fail. This could occur frequently on specific countries like Germany or France due to this problem: https://viesapi.eu/vies-problems-with-verifying-companies-from-germany-de/. If you want to avoid this strict behavior you can change the strict option of the Webgriffe\SyliusItalianInvoiceableOrderPlugin\Validator\Constraints\EuropeanVatNumber constraint to false in the validation configuration file. This way, if the VIES service is not available, the VAT number will be considered valid and the checkout will not be blocked.

  8. Configure Sylius to use the Italian tax calculation tax calculation strategy.

  9. To properly enable group sequence validation of your Address entity you must set the Default validation group instead of the sylius validation group:

    For more information see here.

  10. Run migration

  11. Add invoiceable fields to the address show template for admin. To do so you have to override this template:

    by copying directly our implementation provided in the plugin:

    or by copying the original template and adding the invoiceable fields by yourself. In this case your template should look like the following:

Features

Once installed this plugin will allow the users of the shop to enter all the invoicing information needed by an Italian company to properly invoice the order. In addition, this plugin checks the billing data of the order and uses them to decide whether the customer has to pay taxes or not.

This plugin will add the following fields to your address form:

This plugin will also require the Sylius's company field to be populated if the billing recipient type is set to company.

This plugin also replaces the Sylius's Sylius\Component\Addressing\Comparator\AddressComparatorInterface implementation by decorating it and by comparing also invoiceable fields. So different invoiceable address information provided during checkout are saved in the customer address book as new addresses.

This plugin also allows to select an invoiceable address from the address book in the checkout and properly fill the address form with all the invoicing information.

Contributing

To contribute you need to:

  1. Clone this repository into you development environment and go to the plugin's root directory,

  2. Then, from the plugin's root directory, run the following commands:

  3. Copy tests/TestApplication/.env in tests/TestApplication/.env.local and set configuration specific for your development environment.

  4. Link node_modules:

  5. Run docker (create a compose.override.yml if you need to customize services):

  6. Then, from the plugin's root directory, run the following commands:

  7. Run your local server:

  8. Now at http://localhost:8080/ you have a full Sylius testing application which runs the plugin

Static checks

Testing

After your changes you must ensure that the tests are still passing.

First setup your test database:

And build assets:

The current CI suite runs the following tests:

License

This library is under the MIT license. See the complete license in the LICENSE file.

Credits

Developed by Webgriffe®.


All versions of sylius-italian-invoiceable-order-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
dragonbe/vies Version ^2.3.2
sylius/sylius Version ^2.2
webmozart/assert Version ^1.9
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webgriffe/sylius-italian-invoiceable-order-plugin contains the following files

Loading the files please wait ...