effective_orders 6.24.1 → 6.24.2

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: 1d22477dce74cc4074f01e3e485eec9ca74abc26749db4c4032c8af01a783114
4
- data.tar.gz: 25e61d01d9ef14b48992920c13f7aec6f4a419862676c3534dfabbf4329d4aa1
3
+ metadata.gz: 92f82229bbfabfdb94cd12f4155853a6f7a18ee196373404ad2b24525a84155b
4
+ data.tar.gz: 3f7bf5b05d87d50f3e86fb275d7f4f610210cd3fd2c3ddcbf85b3620e35d6de5
5
5
  SHA512:
6
- metadata.gz: d25536f15cc4c458ef39eaa8362dbf6371ed8ea2f3f33b4e92fd6029b1c89cac05f129099fd9484103d834301a16673cc7ef5ff8697ebf2f72066ad48a5bd9e9
7
- data.tar.gz: ab6e648a304c8c3acd308cfd47f27181df6e0fa757a0e32dc8946f88134172262891d888633403455eaafc4c369c128a40ca1b05690f1797743f7dd095fa16b4
6
+ metadata.gz: fbeda4073c818295729b10718d3b3ad96f238d1e4659ca2fac0e1de7070335ab4e85f05438e684eef5992c35ffc0cc2c1f739fb91028db0a6f3b0b5833b80b46
7
+ data.tar.gz: 3dd836f02ed0972487a7739a7550384cdd3a3ef15d67174914cc644b280eecf82f27123e98f84ca66bae033d8279846b8c4776931e87f90df7e46d65fd23b1a4
@@ -17,16 +17,6 @@ module Admin
17
17
 
18
18
  col :orders_count, visible: false
19
19
 
20
- col(:orders, col_class: 'col-actions') do |orders|
21
- if orders.present?
22
- title = pluralize(orders.length, 'orders')
23
- order_ids = orders.map(&:id).join("|")
24
-
25
- path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
26
- nested_datatable_link_to(title, path)
27
- end
28
- end
29
-
30
20
  col :users, visible: false
31
21
 
32
22
  col :filtered_start_date, as: :date, search: false, sort: false, visible: false do
@@ -37,6 +27,16 @@ module Admin
37
27
  date_range.end&.strftime('%F')
38
28
  end
39
29
 
30
+ col(:orders, col_class: 'col-actions', search: false, sort: false) do |orders, row|
31
+ if orders.present?
32
+ title = pluralize(orders.length, 'orders')
33
+ order_ids = orders.map(&:id).join("|")
34
+
35
+ path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
36
+ nested_datatable_link_to(title, path, title: row.first)
37
+ end
38
+ end
39
+
40
40
  aggregate :total
41
41
  end
42
42
 
@@ -44,7 +44,7 @@ module Admin
44
44
  start_date = date_range.begin&.strftime('%F')
45
45
  end_date = date_range.end&.strftime('%F')
46
46
 
47
- orders = Effective::Order.purchased.where(purchased_at: date_range).where('total != 0')
47
+ orders = Effective::Order.purchased.where(purchased_at: date_range).where('total != 0').includes(:user)
48
48
  order_items = Effective::OrderItem.where(order_id: orders).includes(:purchasable, order: :user)
49
49
 
50
50
  payment_providers.map do |provider|
@@ -57,10 +57,10 @@ module Admin
57
57
  items.sum { |item| (item.total < 0 ? item.total : 0) }.to_i,
58
58
  items.sum { |item| item.total }.to_i,
59
59
  provider_orders.length,
60
- provider_orders,
61
60
  provider_orders.map(&:user),
62
61
  start_date,
63
- end_date
62
+ end_date,
63
+ provider_orders
64
64
  ]
65
65
  end
66
66
  end
@@ -20,15 +20,6 @@ module Admin
20
20
 
21
21
  col :orders_count, visible: false
22
22
 
23
- col(:orders, col_class: 'col-actions') do |orders|
24
- if orders.present?
25
- title = pluralize(orders.length, 'orders')
26
- order_ids = orders.map(&:id).join("|")
27
-
28
- path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
29
- nested_datatable_link_to(title, path)
30
- end
31
- end
32
23
 
33
24
  col :users, visible: false
34
25
 
@@ -40,6 +31,16 @@ module Admin
40
31
  date_range.end&.strftime('%F')
41
32
  end
42
33
 
34
+ col(:orders, col_class: 'col-actions', search: false, sort: false) do |orders, row|
35
+ if orders.present?
36
+ title = pluralize(orders.length, 'orders')
37
+ order_ids = orders.map(&:id).join("|")
38
+
39
+ path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
40
+ nested_datatable_link_to(title, path, title: row.first)
41
+ end
42
+ end
43
+
43
44
  aggregate :total
44
45
  end
45
46
 
@@ -66,10 +67,10 @@ module Admin
66
67
 
67
68
  row += [
68
69
  orders.length,
69
- orders,
70
70
  orders.map(&:user),
71
71
  start_date,
72
- end_date
72
+ end_date,
73
+ orders
73
74
  ]
74
75
 
75
76
  row
@@ -20,16 +20,6 @@ module Admin
20
20
 
21
21
  col :orders_count, visible: false
22
22
 
23
- col(:orders, col_class: 'col-actions') do |orders|
24
- if orders.present?
25
- title = pluralize(orders.length, 'orders')
26
- order_ids = orders.map(&:id).join("|")
27
-
28
- path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
29
- nested_datatable_link_to(title, path)
30
- end
31
- end
32
-
33
23
  col :users, visible: false
34
24
 
35
25
  col :start_date, as: :date, search: false, sort: false, visible: false do
@@ -40,6 +30,16 @@ module Admin
40
30
  date_range.end&.strftime('%F')
41
31
  end
42
32
 
33
+ col(:orders, col_class: 'col-actions', search: false, sort: false) do |orders, row|
34
+ if orders.present?
35
+ title = pluralize(orders.length, 'orders')
36
+ order_ids = orders.map(&:id).join("|")
37
+
38
+ path = effective_orders.nested_orders_admin_order_reports_path(ids: order_ids)
39
+ nested_datatable_link_to(title, path, title: row.first)
40
+ end
41
+ end
42
+
43
43
  aggregate :total
44
44
  end
45
45
 
@@ -66,10 +66,10 @@ module Admin
66
66
 
67
67
  row += [
68
68
  orders.length,
69
- orders,
70
69
  orders.map(&:user),
71
70
  start_date,
72
- end_date
71
+ end_date,
72
+ orders
73
73
  ]
74
74
 
75
75
  row
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.24.1'.freeze
2
+ VERSION = '6.24.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.24.1
4
+ version: 6.24.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-06 00:00:00.000000000 Z
11
+ date: 2025-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails