item_builder_mwh 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 433fd54a7f90b3889e4e1ca203c4fc6212e1613718b6220fb40b7c9ca8923760
4
- data.tar.gz: e2832bdad60f6f48f6a4715f6014ec3790ee9d6adfeaa52d20f23a0cbd10db62
3
+ metadata.gz: 5c9c6c65d5fee047753d199f8c7bd84fb8728e1c4b2663f6b51f4739cf00cb60
4
+ data.tar.gz: dd63fdff719a3efd3a6ddc2de281932dca87456811fb81b90300154eabd7f20e
5
5
  SHA512:
6
- metadata.gz: 69f3d4575556e47967ec0dd47f0e82909c85c32abbb9a7e9fcb6082c0e514f9890d78cd9f0c806a3448d49119d1accb17b9c34e7e2f15242affdf3c7878c7d08
7
- data.tar.gz: 3a90c1e89b7945d0f21e6c84bd879ab309689504b2301a70608878929183525101a4497226b1d832c733315197b43cfb287661098153e0f396d627b74749fb23
6
+ metadata.gz: e56af16e87e30221e3941dc4e2219dd371718176fac6b6d81b713403aed250b5d1b78cc6e9f8e9b7955c09a0f5c7c550f038163955c213bb3098a1e804ed2ea0
7
+ data.tar.gz: a174536640d9d9c52b6f5611f1751337578af9b53648146e5c8652eed697458ff03f7704ffe12cbc36ace789df14b076ec292bbc1e192466572c01f25198413c
@@ -79,10 +79,18 @@ class ItemBuilderMwh
79
79
  end
80
80
 
81
81
  def listing_warehouse_routing_quantity
82
- warehouse_spaces = WarehouseSpace.where(item_variant_id: variant.id)
82
+ warehouse_spaces = WarehouseSpace.where(item_variant_id: variant.id, warehouse_id: wh_ids)
83
83
  warehouse_spaces.sum(:quantity)
84
84
  end
85
85
 
86
+ def wh_mappings
87
+ WarehouseMapping.where(profile_channel_association_id: listing.profile_channel_association_id)
88
+ end
89
+
90
+ def wh_ids
91
+ @wh_ids ||= wh_mappings.map{|x|x.warehouse_id}.flatten.uniq
92
+ end
93
+
86
94
  def qty_bundle
87
95
  # Quantity for bundle config
88
96
  if @bundle_variants.present?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ItemBuilderMwh
4
- VERSION = '0.1.24'
4
+ VERSION = '0.1.25'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: item_builder_mwh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ivander
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-05 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler