Decimal Stock migration concept

Edit on GitHub

The feature supports decimal inventory in terms of stock and availability, amount of reserved products, as well as amount values of a packaging unit.

Migration process

You can upgrade all modules affected by the feature in bulk.

To update all the modules affected by feature in bulk, do the following:

  1. Run the following composer command. Feel free to remove the modules that are irrelevant to your project from the packages list.
composer remove spryker/stock-sales-connector
composer update "spryker/*" "spryker-shop/*"

composer require "spryker/availability: ^9.0.0" "spryker/oms: ^11.0.0" "spryker/stock: ^8.0.0" "spryker/stock-gui: ^2.0.0" "spryker/availability-storage: ^2.0.0" "spryker/availability-gui: ^6.0.0" "spryker/availability-cart-connector: ^7.0.0" "spryker/availability-offer-connector: ^4.0.0" "spryker/cart-variant: ^2.0.0" "spryker/product-availabilities-rest-api: ^4.0.0" "spryker/product-bundle: ^7.0.0" "spryker/discount-promotion: ^4.0.0" "spryker/product-packaging-unit: ^4.0.0" "spryker/product-measurement-unit: ^5.0.0" "spryker/product-packaging-unit-data-import: ^2.0.0" "spryker/product-packaging-unit-storage: ^5.0.0" "spryker/product-management: ^0.19.0" "spryker-shop/product-packaging-unit-widget: ^0.5.0" --update-with-dependencies
  1. Follow the steps in the individual migration guide for ProductPackagingUnit.
  2. Update the database entity schema for each store in the system:
APPLICATION_STORE=DE console propel:schema:copy
APPLICATION_STORE=US console propel:schema:copy
  1. Run the database migration:
console propel:install
console transfer:generate
  1. Follow the steps in the individual migration guide for ProductPackagingUnitStorage.
  2. Follow the steps in the individual migration guide for Availability.

Care should be taken on the project level code to handle the availability and stock values as decimal objects. Due to the PHP floating-point precision issues, all decimal numbers in Spryker are wrapped in decimal-object that handles the calculations performed on them to allow exact precision. For more information about thedecimal-object library, see HowTo: Integrate and use precise decimal numbers.

The following table lists the modules affected by the Decimal Stock update and will be released as a major or a semantic major.

spryker/availability 9.0.0 Upgrade the Availability module
spryker/oms 11.0.0 Migration Guide - OMS
spryker/stock 8.0.0 Migration Guide - Stock
spryker/availability-storage 2.0.0 Upgrade the AvailabilityStorage module
spryker/availability-gui 6.0.0 Upgrade the AvailabilityGui module
spryker/availability-cart-connector 7.0.0 Upgrade the AvailabilityCartConnector module
spryker/availability-offer-connector 4.0.0 Upgrade the AvailabilityOfferConnector module
spryker/cart-variant 2.0.0 Upgrade the CartVariant module
spryker/product-availabilities-rest-api 4.0.0 Migration Guide - ProductAvailabilitiesRestApi
spryker/product-bundle 7.0.0 Migration Guide - ProductBundle
spryker/discount-promotion 4.0.0 Migration Guide - DiscountPromotion
spryker/product-packaging-unit 4.0.0 Migration Guide - ProductPackagingUnit
spryker/product-measurement-unit 5.0.0 Migration Guide - ProductMeasurementUnit
spryker/product-packaging-unit-data-import 2.0.0 Upgrade the ProductPackagingUnitDataImport module
spryker/product-packaging-unit-storage 5.0.0 Migration Guide - ProductPackagingUnitStorage
spryker/product-management 0.19.0 Upgrade the ProductManagement module
spryker-shop/product-packaging-unit-widget 0.5.0 Migration Guide - ProductPackagingUnitWidget