effective_orders 6.23.1 → 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 +4 -4
- data/app/controllers/admin/order_reports_controller.rb +8 -0
- data/app/datatables/admin/effective_orders_datatable.rb +23 -13
- data/app/datatables/admin/report_transactions_grouped_by_name_datatable.rb +16 -5
- data/app/datatables/admin/report_transactions_grouped_by_qb_name_datatable.rb +16 -5
- data/app/models/effective/order.rb +9 -1
- data/config/routes.rb +1 -0
- data/lib/effective_orders/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: 9da5a3039ab999f6469ee93178d23257c81724a4532548e536af212e082ea782
|
4
|
+
data.tar.gz: 94e9f7086405b091105bb47ffd9d7fc4181c04f9eba5cdfd1f176285959d2c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
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
|
-
|
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,9 +18,18 @@ module Admin
|
|
18
18
|
col("p - #{provider}", as: :price, visible: false)
|
19
19
|
end
|
20
20
|
|
21
|
-
col :orders_count
|
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
|
31
|
+
end
|
22
32
|
|
23
|
-
col :orders, visible: false
|
24
33
|
col :users, visible: false
|
25
34
|
|
26
35
|
col :filtered_start_date, as: :date, search: false, sort: false, visible: false do
|
@@ -53,10 +62,12 @@ module Admin
|
|
53
62
|
items.sum { |item| (item.order.payment_provider == payment_provider) ? item.total : 0 }.to_i
|
54
63
|
end
|
55
64
|
|
65
|
+
orders = items.map { |item| item.order }.uniq.sort
|
66
|
+
|
56
67
|
row += [
|
57
|
-
|
58
|
-
|
59
|
-
|
68
|
+
orders.length,
|
69
|
+
orders,
|
70
|
+
orders.map(&:user),
|
60
71
|
start_date,
|
61
72
|
end_date
|
62
73
|
]
|
@@ -18,9 +18,18 @@ module Admin
|
|
18
18
|
col("p - #{provider}", as: :price, visible: false)
|
19
19
|
end
|
20
20
|
|
21
|
-
col :orders_count
|
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
|
31
|
+
end
|
22
32
|
|
23
|
-
col :orders, visible: false
|
24
33
|
col :users, visible: false
|
25
34
|
|
26
35
|
col :start_date, as: :date, search: false, sort: false, visible: false do
|
@@ -53,10 +62,12 @@ module Admin
|
|
53
62
|
items.sum { |item| (item.order.payment_provider == payment_provider) ? item.total : 0 }.to_i
|
54
63
|
end
|
55
64
|
|
65
|
+
orders = items.map { |item| item.order }.uniq.sort
|
66
|
+
|
56
67
|
row += [
|
57
|
-
|
58
|
-
|
59
|
-
|
68
|
+
orders.length,
|
69
|
+
orders,
|
70
|
+
orders.map(&:user),
|
60
71
|
start_date,
|
61
72
|
end_date
|
62
73
|
]
|
@@ -416,6 +416,10 @@ module Effective
|
|
416
416
|
[label, ' #', to_param].join
|
417
417
|
end
|
418
418
|
|
419
|
+
def full_to_s
|
420
|
+
[to_s, billing_name.presence, email.presence, total_to_s].compact.join(' - ')
|
421
|
+
end
|
422
|
+
|
419
423
|
def label
|
420
424
|
if refund? && purchased?
|
421
425
|
'Refund'
|
@@ -434,6 +438,10 @@ module Effective
|
|
434
438
|
purchased? ? 'Total paid' : 'Total due'
|
435
439
|
end
|
436
440
|
|
441
|
+
def total_to_s
|
442
|
+
"$#{'%0.2f' % total_to_f}"
|
443
|
+
end
|
444
|
+
|
437
445
|
def payment_method
|
438
446
|
payment_method_value if purchased?
|
439
447
|
end
|
@@ -582,7 +590,7 @@ module Effective
|
|
582
590
|
return unless delayed? && deferred? && delayed_payment_provider?
|
583
591
|
return unless delayed_payment_date_upcoming?
|
584
592
|
|
585
|
-
"Your #{delayed_payment_method} will be charged
|
593
|
+
"Your #{delayed_payment_method} will be charged #{total_to_s} on #{delayed_payment_date.strftime('%A, %B %e, %Y')}."
|
586
594
|
end
|
587
595
|
|
588
596
|
def delayed_payment_date_past?
|
data/config/routes.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2025-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|