fix(medusa-plugin-brightpearl): ignore goods out created if channel id not medusa
This commit is contained in:
@@ -12,4 +12,5 @@ yarn.lock
|
|||||||
/services
|
/services
|
||||||
/models
|
/models
|
||||||
/subscribers
|
/subscribers
|
||||||
|
/utils
|
||||||
|
|
||||||
|
|||||||
@@ -576,6 +576,11 @@ class BrightpearlService extends BaseService {
|
|||||||
const goodsOut = await client.warehouses.retrieveGoodsOutNote(id)
|
const goodsOut = await client.warehouses.retrieveGoodsOutNote(id)
|
||||||
const order = await client.orders.retrieve(goodsOut.orderId)
|
const order = await client.orders.retrieve(goodsOut.orderId)
|
||||||
|
|
||||||
|
// Only relevant for medusa orders check channel id
|
||||||
|
if (order.channelId !== parseInt(this.options.channel_id)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Combine the line items that we are going to create a fulfillment for
|
// Combine the line items that we are going to create a fulfillment for
|
||||||
const lines = Object.keys(goodsOut.orderRows)
|
const lines = Object.keys(goodsOut.orderRows)
|
||||||
.map((key) => {
|
.map((key) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user