comee_core 0.3.19 → 0.3.20
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 +4 -4
- data/app/services/comee/core/customer_order_service.rb +1 -11
- data/lib/comee/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5800c13672eb17e44ca33d72b8793090222e15e35a1b3b006fcdbb8394e1440c
|
|
4
|
+
data.tar.gz: d3c846baacc27f192b2bc54cb009b98bccdc9958dc3e1a617bcbf8476c6d54c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c2a9a3381044970f4bc3a23459d3bb5438e226e8ff0265de16a952c9939dd6e88f369a453ab54d8398301d464b305500b4cc1c6405553437a4dd0514751ef5c
|
|
7
|
+
data.tar.gz: 2f18c9811f6165ce75f2bfd6cd06f300043e9699ad56b282ca5c3f87e10f83f5df7bf1d1d98a00e909462fca97547a5dd27e72c5a12b358cd04948a15c6f1948
|
|
@@ -175,17 +175,7 @@ module Comee
|
|
|
175
175
|
)
|
|
176
176
|
master_prices = MasterPrice.includes(:supplier).where(primary: true, status: Price.statuses[:current],
|
|
177
177
|
product_id: product_ids)
|
|
178
|
-
queries = master_prices.each_with_object([]) do |obj, res|
|
|
179
|
-
res << {
|
|
180
|
-
product_id: obj.product_id,
|
|
181
|
-
itemable_id: obj.supplier_id
|
|
182
|
-
}
|
|
183
|
-
end
|
|
184
178
|
|
|
185
|
-
product_lookups = queries.inject(ProductLookup.none) do |conditions, condition|
|
|
186
|
-
conditions.or(ProductLookup.where(condition))
|
|
187
|
-
end
|
|
188
|
-
product_lookups = product_lookups.includes(:itemable).where(itemable_type: "Comee::Core::Supplier")
|
|
189
179
|
items = order_items.each_with_object([]) do |item, res|
|
|
190
180
|
next if item.canceled?
|
|
191
181
|
|
|
@@ -194,9 +184,9 @@ module Comee
|
|
|
194
184
|
quantity = convert_quantity(item.quantity, item.unit_id, unit_id)
|
|
195
185
|
client_price = client_prices.find { |price| price.product_id == item.product_id }
|
|
196
186
|
master_price = master_prices.find { |price| price.product_id == item.product_id }
|
|
197
|
-
product_lookup = product_lookups.find { |lookup| lookup.product_id == item.product_id }
|
|
198
187
|
raise(StandardError, "No primary supplier found for product #{item.customer_item_no}") unless master_price
|
|
199
188
|
|
|
189
|
+
product_lookup = master_price.product_lookup
|
|
200
190
|
price = if client_price
|
|
201
191
|
convert_price(client_price.price, client_price.unit_id, unit_id)
|
|
202
192
|
else
|
data/lib/comee/core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comee_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henock L.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-07-
|
|
11
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: active_model_serializers
|