Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Sebastian Rindom committed 2021-03-29 09:08:39 +02:00
commit d78a7ce858
19 files changed
+112 -28

No files matched your search

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.9](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.8...medusa-plugin-brightpearl@1.1.9) (2021-03-25)
**Note:** Version bump only for package medusa-plugin-brightpearl
## [1.1.8](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.7...medusa-plugin-brightpearl@1.1.8) (2021-03-17)
**Note:** Version bump only for package medusa-plugin-brightpearl
@@ -1,6 +1,6 @@
{
"name": "medusa-plugin-brightpearl",
"version": "1.1.8",
"version": "1.1.9",
"description": "Brightpearl plugin for Medusa Commerce",
"main": "index.js",
"repository": {
@@ -182,7 +182,16 @@ class BrightpearlService extends BaseService {
if (availability) {
const brightpearlProduct = await client.products.retrieve(productId)
const onHand = availability[productId].total.onHand
const prodAvail = availability[productId]
let onHand = 0
if (
prodAvail.warehouses &&
prodAvail.warehouses[`${this.options.warehouse}`]
) {
onHand = prodAvail.warehouses[`${this.options.warehouse}`].onHand
}
const sku = brightpearlProduct.identity.sku
if (!sku) return