item_builder_mwh 0.1.21 → 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c9c6c65d5fee047753d199f8c7bd84fb8728e1c4b2663f6b51f4739cf00cb60
|
|
4
|
+
data.tar.gz: dd63fdff719a3efd3a6ddc2de281932dca87456811fb81b90300154eabd7f20e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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?
|
|
@@ -128,9 +136,12 @@ class ItemBuilderMwh
|
|
|
128
136
|
end
|
|
129
137
|
|
|
130
138
|
def params(allocated_stock)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
{
|
|
140
|
+
channel_id: allocated_stock.variant_listing.channel_id,
|
|
141
|
+
item_variant_id: allocated_stock.variant_listing.variant_id,
|
|
142
|
+
start_at: allocated_stock.start_at.to_date.beginning_of_day,
|
|
143
|
+
end_at: allocated_stock.end_at.to_date.end_of_day
|
|
144
|
+
}.to_query
|
|
134
145
|
end
|
|
135
146
|
|
|
136
147
|
# one_alloc_rsvd_stock fungsi untuk mendapatkan satu
|
|
@@ -47,6 +47,8 @@ class ItemBuilderMwh
|
|
|
47
47
|
raise "Response Code is #{resp.dig("response_code")}"
|
|
48
48
|
elsif resp.dig('ErrorResponse', 'Head', 'ErrorMessage') == 'E009: Access Denied'
|
|
49
49
|
return nil
|
|
50
|
+
elsif resp.dig('ErrorResponse').present?
|
|
51
|
+
return nil
|
|
50
52
|
end
|
|
51
53
|
success_handle(resp)
|
|
52
54
|
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.
|
|
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-
|
|
11
|
+
date: 2021-08-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|