comee_core 0.3.18 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7b45dd03c08ff2f2aaecfa3bb2b4c48c0640240ccc8f2988311754ff25e031a
4
- data.tar.gz: f992aef504e763d0583ecaecdc1744dede77600bcfcdf2530e21c6da0f14bf27
3
+ metadata.gz: 5800c13672eb17e44ca33d72b8793090222e15e35a1b3b006fcdbb8394e1440c
4
+ data.tar.gz: d3c846baacc27f192b2bc54cb009b98bccdc9958dc3e1a617bcbf8476c6d54c5
5
5
  SHA512:
6
- metadata.gz: 99585c3f085b3a361c9cf06b04aa5dca4a5273093457e3f80c2abcb6c139fdb1e49f088db13aa9c02df1a75c8897239aa8d90216acc9e6d6d18a0024b0fc1930
7
- data.tar.gz: 9a63b2fa0373ee075bb40b16786ba3926c40559410475f11c12bed3b235726c760d196b152a42620e056458f890706439f67d6d97f075b4eda371187c53e1b99
6
+ metadata.gz: 6c2a9a3381044970f4bc3a23459d3bb5438e226e8ff0265de16a952c9939dd6e88f369a453ab54d8398301d464b305500b4cc1c6405553437a4dd0514751ef5c
7
+ data.tar.gz: 2f18c9811f6165ce75f2bfd6cd06f300043e9699ad56b282ca5c3f87e10f83f5df7bf1d1d98a00e909462fca97547a5dd27e72c5a12b358cd04948a15c6f1948
@@ -1,7 +1,7 @@
1
1
  module Comee
2
2
  module Core
3
3
  class SupplierSerializer < ActiveModel::Serializer
4
- attributes :id, :code, :name, :locale, :user_id, :payment_terms, :tax_code, :vat_number
4
+ attributes :id, :code, :name, :locale, :user_id, :payment_terms, :tax_code, :vat_number, :currency_id
5
5
  belongs_to :currency
6
6
  has_many :supplier_addresses
7
7
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.3.18".freeze
3
+ VERSION = "0.3.20".freeze
4
4
  end
5
5
  end
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.18
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-04 00:00:00.000000000 Z
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