Commerce 2.15 adds invoicing, VAT number handling, and Drupal 9 readiness

Developer Desk

We had a great time at DrupalCon Amsterdam last week introducing the European Drupal communtiy to our new brand, our near term product roadmap, and our recently launched support offering. It's always encouraging to hear from the many active individual and agency contributors in Europe, and the broad interest we received in Centarro Support validated our approach for providing fast, professional support in a dedicated channel.

Now that we're back home, it's time for a new Commerce release! Commerce 2.15 is another large update full of bug fixes and innovative new features. It closes over 60 issues since the 2.14 release at the end of August. Here are some highlights.

New requirements

Commerce now requires Drupal 8.7 or newer. Our build passes without deprecations on both Drupal 8.7 and Drupal 8.8, ensuring that our codebase is ready for Drupal 9. Props to Mike Lutz for his many improvements to our test suite.

Matching Drupal 8.7's new PHP requirements, we also require PHP 7.0.8 or newer. We have already added type hints to portions of the codebase and will continue to add more in future releases.

Finally, we have decided to start depending on the Token module. The Token module is already one of the most popular Drupal modules, since it is required by Pathauto. It has been a part of our Composer project templates from the very beginning. We now use it to allow users to add order details to the "Payment instructions" shown when paying with a manual gateway (such as "Cash on delivery"). It is also used for the shiny new number pattern functionality.

Number patterns

Thanks to a sponsorship from Factorial, we have created a brand new port of Commerce Invoice. It allows invoicing multiple orders at once and supports PDF generation. Another requirement for invoices was to ensure that they have customizable sequential numbers such as "2018-00038".

In D7 the Commerce Billy module was responsible for generating its own sequential numbers, while in D8 the community used the Commerce Order Number module. The existing solution is order-specific, and we needed to support numbering both placed orders and invoices, so we created a new commerce_number_pattern module and added it to core. It is enabled by default on all installations.

The number generation logic is fully configurable, with built-in plugins for generating sequential numbers infinitely or for resetting them yearly or monthly. Merchants can provide a prefix (such as INV-) or a suffix, and they can use tokens (e.g. to pull in a field from the store). The initial number can be customized to start counting from a higher number. Numbers can be generated per-store or shared between stores, and each order or invoice type can have its own number pattern.

Tax improvements

Commerce core now supports collecting VAT numbers on the checkout form, which previously required the VAT Number module. A tax number can be validated (to ensure proper format) and verified (to ensure it corresponds to an active business).

Validation and verification is handled by country-specific plugins. We ship with a plugin for the European Union, which contains validation rules for all EU countries and performs verification through the VIES web service. If the web service is unavailable, the tax number can temporarily be accepted and the order placed, allowing the merchant to retry verification at a later time.

The EuropeanUnionVat plugin has been expanded to take tax numbers into account, applying the special ”Intra-Community Supply” zero rate in case the tax number is valid and the customer is from a different EU country.

Media Library compatibility

Thanks to a bug in our inline form processing code, Media Library could not be used on products without a patch. This problem has now been resolved, just in time for Media Library to become stable in Drupal 8.8. We'll be updating our demo to use Media Library for the product images in the near future. Props to András on our team for chipping in this and a variety of other bug fixes to improve the stability of the platform this release.

Next steps

We anticipate one more Commerce release this year while we also focus on a number of new and existing contributed modules. We'll blog about the roadmap soon, but you can join our weekly meeting in the #commerce room on Drupal Slack, every Wednesday at 6 PM GMT to get the latest updates first.

Comments

Submitted by Oumar FALL (not verified) on Thu, 11/14/2019 - 15:46

Waouh!! This is a superbe release. Thank you for all the work.

Add new comment