comee_core 0.2.93 → 0.2.94

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: 00aa0d03e978f41456860d673aa0ff6d29b7ad6fd2131a1066adb2e092021535
4
- data.tar.gz: f4b1feb0b76ace742407abe93a5cb0b3c0a914d5371802a5c71d14d8eee17f3c
3
+ metadata.gz: 42bca2e115b3f616797fdace3e7406c364a0561d3e9db19d451c6ddbbe161753
4
+ data.tar.gz: 24dbfec939f0d8dc835572c410d48ba24d660112acf3b05e7c66ee4b8a539c08
5
5
  SHA512:
6
- metadata.gz: a53f80f9c119900ac82d8581af88227345c3f624aa82ef1f402323709ae42e1910147595d0a1a069522dc0fe1a9f5cded5513d0847a1f828e58af93c4fb99caf
7
- data.tar.gz: bc3cf5e4b4df6f13b1a3f8270a7ed9eebcc9f120dbced0c7ecee3e4cde629ac87d0c172e2b5805f5c9fd19e336bae2a1e3b75953a03cf95ea928556f47daf7a3
6
+ metadata.gz: 0e20549cb187a7b2ad921186d8fa672044d75826150d22351d693327e65526abe7301f99ccaa2182a55ce85980049e57e298b64a3b5215765872d410149fd8d6
7
+ data.tar.gz: 9e5c76893dab3fff9dc261857438caf0c87ed549642232d5b57bfbccd5f8f32bce037a0a2fb9e188dbe8639174256548e1889d7d23f56a34e1f06775120bc769
@@ -18,7 +18,10 @@ module Comee
18
18
  end
19
19
 
20
20
  def filter
21
- data = CustomerOrderItem.includes(:product, :unit).ransack(params[:q]).result
21
+ data = CustomerOrderItem.includes(:product, :unit)
22
+ .ransack(params[:q])
23
+ .result
24
+ .order(:serial_no)
22
25
  render_content(data, {include: ["unit"]})
23
26
  end
24
27
 
@@ -23,7 +23,7 @@ module Comee
23
23
  :source,
24
24
  :product,
25
25
  :unit
26
- ).ransack(params[:q]).result
26
+ ).ransack(params[:q]).result.order(:serial_no)
27
27
  render_content(data)
28
28
  end
29
29
 
@@ -21,6 +21,7 @@ module Comee
21
21
  address
22
22
  code
23
23
  name
24
+ match_code
24
25
  locale
25
26
  parent_id
26
27
  subsidiary
@@ -13,7 +13,7 @@ module Comee
13
13
  validates :serial_no, numericality: {greater_than: 0, only_integer: true}
14
14
 
15
15
  def calculate_total_price
16
- self.total_price = price * quantity
16
+ self.total_price = (price * quantity).round(2)
17
17
  end
18
18
 
19
19
  def self.ransackable_attributes(_auth_object = nil)
@@ -6,6 +6,8 @@ module Comee
6
6
 
7
7
  validates :code, :item_description, presence: true
8
8
 
9
+ validates :code, uniqueness: {scope: %i[product_id itemable_id]}
10
+
9
11
  def self.ransackable_attributes(_auth_object = nil)
10
12
  %w[id code item_description itemable_id itemable_type product_id]
11
13
  end
@@ -19,7 +19,7 @@ module Comee
19
19
  delegate(:po_number, to: :purchase_order, prefix: false)
20
20
 
21
21
  def calculate_total_price
22
- self.total_price = price * quantity
22
+ self.total_price = (price * quantity).round(2)
23
23
  end
24
24
 
25
25
  def calculate_confirmation_values
@@ -29,7 +29,7 @@ module Comee
29
29
 
30
30
  self.confirmed_delivery_date = delivery_date unless confirmed_delivery_date
31
31
 
32
- self.confirmed_total_price = confirmed_price * confirmed_quantity
32
+ self.confirmed_total_price = (confirmed_price * confirmed_quantity).round(2)
33
33
  end
34
34
 
35
35
  def self.ransackable_attributes(_auth_object = nil)
@@ -29,7 +29,7 @@ module Comee
29
29
  end
30
30
 
31
31
  def calculate_total_price
32
- self.total_price = price * quantity
32
+ self.total_price = (price * quantity).round(2)
33
33
  end
34
34
 
35
35
  def quantity_remaining
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.93".freeze
3
+ VERSION = "0.2.94".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.2.93
4
+ version: 0.2.94
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-06-13 00:00:00.000000000 Z
11
+ date: 2024-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers