effective_orders 6.23.2 → 6.24.0

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: 93fca226f877ef017fbbcbd8dcaf505a5cecce3afb8bddc5c852b526b9d6fecd
4
- data.tar.gz: f25a99203926805b4c1be5cb30898990b35de50ab1ef9175463906e7ff2cf58d
3
+ metadata.gz: 9da5a3039ab999f6469ee93178d23257c81724a4532548e536af212e082ea782
4
+ data.tar.gz: 94e9f7086405b091105bb47ffd9d7fc4181c04f9eba5cdfd1f176285959d2c91
5
5
  SHA512:
6
- metadata.gz: 78bfc57f6dcf593c16e457a186aab279e9f7a0829bc0533c433c7decff62c66c39c0016cfe12ca3b40a6c1cacd73fe6c0dd0410350a66108af10e29aa1ac1f6c
7
- data.tar.gz: aab10f6e4acf076e9825df141e671a2e0a94ee2c8700467470c0fe2564390b1aaff5f9e7aec7ac2fa4f120540dca7378651f9ecb99a9385b967546718662b638
6
+ metadata.gz: ebb63ef8c77027aef6a2fa831a14c96e22044746f208054c364d556b458f137adf16fb357ae60b00b09c1eb45a11208b9f2ac879548be8ccad1e9c87a0dbd6da
7
+ data.tar.gz: 83182d0a3220cdf5cf6ea93c7828fc90d8d3c124b4e48a9f3e54a50693de6b77bb087cf64a6da5ebfe30204a0d20d1ee6bc3d5909139cb2890f64cb82fc0e36d
@@ -32,6 +32,14 @@ module Admin
32
32
  render 'index'
33
33
  end
34
34
 
35
+ # This is used by the transactions_grouped_by_name and transactions_grouped_by_qb_name datatables
36
+ # To display a nested datatable of the orders
37
+ def nested_orders
38
+ ids = params[:ids].to_s.split("|")
39
+ @datatable = Admin::EffectiveOrdersDatatable.new(ids: ids, skip_filters: true, skip_bulk_actions: true)
40
+ nested_datatable_action
41
+ end
42
+
35
43
  def payment_providers
36
44
  @datatable = Admin::ReportPaymentProvidersDatatable.new
37
45
  @page_title = @datatable.datatable_name
@@ -1,17 +1,19 @@
1
1
  module Admin
2
2
  class EffectiveOrdersDatatable < Effective::Datatable
3
3
  bulk_actions do
4
- bulk_action(
5
- 'Send payment request email to selected orders',
6
- effective_orders.bulk_send_payment_request_admin_orders_path,
7
- data: { confirm: 'Send payment request emails?' }
8
- )
9
-
10
- bulk_action(
11
- 'Send invoice email to selected purchased orders',
12
- effective_orders.bulk_send_order_email_to_buyer_orders_path,
13
- data: { confirm: 'Send invoice emails?' }
14
- )
4
+ unless attributes[:skip_bulk_actions]
5
+ bulk_action(
6
+ 'Send payment request email to selected orders',
7
+ effective_orders.bulk_send_payment_request_admin_orders_path,
8
+ data: { confirm: 'Send payment request emails?' }
9
+ )
10
+
11
+ bulk_action(
12
+ 'Send invoice email to selected purchased orders',
13
+ effective_orders.bulk_send_order_email_to_buyer_orders_path,
14
+ data: { confirm: 'Send invoice emails?' }
15
+ )
16
+ end
15
17
  end
16
18
 
17
19
  filters do
@@ -32,7 +34,9 @@ module Admin
32
34
  datatable do
33
35
  order :updated_at
34
36
 
35
- bulk_actions_col
37
+ unless attributes[:skip_bulk_actions]
38
+ bulk_actions_col
39
+ end
36
40
 
37
41
  col :created_at, visible: false
38
42
  col :updated_at, visible: false
@@ -116,7 +120,9 @@ module Admin
116
120
  col :note_to_buyer, visible: false
117
121
  col :note_internal, visible: false
118
122
 
119
- actions_col
123
+ unless attributes[:skip_actions]
124
+ actions_col
125
+ end
120
126
 
121
127
  unless attributes[:total] == false
122
128
  aggregate :total
@@ -147,6 +153,10 @@ module Admin
147
153
  scope = scope.where(parent_id: attributes[:parent_id], parent_type: attributes[:parent_type])
148
154
  end
149
155
 
156
+ if attributes[:ids].present?
157
+ scope = scope.where(id: attributes[:ids])
158
+ end
159
+
150
160
  scope
151
161
  end
152
162
 
@@ -18,14 +18,16 @@ module Admin
18
18
  col("p - #{provider}", as: :price, visible: false)
19
19
  end
20
20
 
21
- col :orders_count
22
-
23
- val(:details, visible: false) do |_, orders|
24
- orders.map do |order|
25
- content_tag(:div, class: 'col-resource_item') do
26
- link_to(order.full_to_s, effective_orders.admin_order_path(order), title: order.full_to_s)
27
- end
28
- end.join.html_safe
21
+ col :orders_count, visible: false
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
29
31
  end
30
32
 
31
33
  col :users, visible: false
@@ -18,14 +18,16 @@ module Admin
18
18
  col("p - #{provider}", as: :price, visible: false)
19
19
  end
20
20
 
21
- col :orders_count
22
-
23
- val(:details, visible: false) do |_, orders|
24
- orders.map do |order|
25
- content_tag(:div, class: 'col-resource_item') do
26
- link_to(order.full_to_s, effective_orders.admin_order_path(order), title: order.full_to_s)
27
- end
28
- end.join.html_safe
21
+ col :orders_count, visible: false
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
29
31
  end
30
32
 
31
33
  col :users, visible: false
data/config/routes.rb CHANGED
@@ -78,6 +78,7 @@ EffectiveOrders::Engine.routes.draw do
78
78
 
79
79
  resources :order_reports, only: [] do
80
80
  collection do
81
+ get :nested_orders
81
82
  get :transactions
82
83
  get :transactions_grouped_by_name
83
84
  get :transactions_grouped_by_qb_name
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.23.2'.freeze
2
+ VERSION = '6.24.0'.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.23.2
4
+ version: 6.24.0
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-04-30 00:00:00.000000000 Z
11
+ date: 2025-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails