effective_orders 6.21.3 → 6.22.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/effective/concerns/purchase.rb +1 -1
- data/app/models/effective/order.rb +12 -3
- data/app/models/effective/order_email.rb +5 -0
- data/app/models/effective/order_item.rb +4 -0
- data/app/views/effective/orders/_order_items.html.haml +4 -2
- 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: 7355efac3dc644c7345ef82d62786ebfc6224047d8a67d81c14778fcc490b0ac
|
4
|
+
data.tar.gz: 23ac4db7e268dbb3927bd19ce650d52585cdf8821ef0ae0462ccb61cdd93f8de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6434225d448689ff1eb02e4b3db328c29ab23f1e000726e65b76cd9556f1f521f58c7eb1f1fa91755ef074485caabb228321e934ff7f27c9c3e3448bb5e6508
|
7
|
+
data.tar.gz: d918d1edbb87a1444c6c306627d11f20a7e881ae12527e8d1adcc28eb49f5f47c13de1d3d95811df5f58cb26af6b0f45561823e94b5efbd36317070f6e723255
|
@@ -21,7 +21,7 @@ module Effective
|
|
21
21
|
Effective::Cart.where(user: @order.current_user).destroy_all if @order.current_user.present?
|
22
22
|
|
23
23
|
if flash[:success].blank?
|
24
|
-
if email && EffectiveOrders.send_order_receipt_to_buyer
|
24
|
+
if email && EffectiveOrders.send_order_receipt_to_buyer && !@order.skip_order_emails?
|
25
25
|
flash[:success] = "Payment successful! A receipt has been sent to #{@order.email}"
|
26
26
|
else
|
27
27
|
flash[:success] = "Payment successful! An email receipt has not been sent."
|
@@ -612,7 +612,6 @@ module Effective
|
|
612
612
|
present_order_items.map { |oi| oi.quantity }.sum
|
613
613
|
end
|
614
614
|
|
615
|
-
|
616
615
|
def skip_buyer_validations?
|
617
616
|
EffectiveResources.truthy?(skip_buyer_validations)
|
618
617
|
end
|
@@ -628,7 +627,9 @@ module Effective
|
|
628
627
|
self.addresses.clear if addresses.any? { |address| address.valid? == false }
|
629
628
|
save!
|
630
629
|
|
631
|
-
|
630
|
+
if send_payment_request_to_buyer?
|
631
|
+
after_commit { send_payment_request_to_buyer! }
|
632
|
+
end
|
632
633
|
|
633
634
|
true
|
634
635
|
end
|
@@ -877,8 +878,16 @@ module Effective
|
|
877
878
|
(emails + [cc.presence]).compact.uniq.to_sentence
|
878
879
|
end
|
879
880
|
|
881
|
+
def skip_order_emails?
|
882
|
+
return true if purchased? && free? && !EffectiveOrders.send_order_receipts_when_free
|
883
|
+
return true if purchased? && free? && OrderEmail.new(self).event_all_waitlisted_or_archived?
|
884
|
+
false
|
885
|
+
end
|
886
|
+
|
880
887
|
def send_order_emails!
|
881
|
-
|
888
|
+
return false if skip_order_emails?
|
889
|
+
|
890
|
+
if purchased_or_deferred?
|
882
891
|
EffectiveOrders.send_email(:order_email, self) if EffectiveOrders.send_order_receipt_to_buyer
|
883
892
|
EffectiveOrders.send_email(:order_email_to_admin, self) if EffectiveOrders.send_order_receipt_to_admin
|
884
893
|
end
|
@@ -43,6 +43,7 @@ module Effective
|
|
43
43
|
|
44
44
|
def subject
|
45
45
|
if event.present? && order.purchased_or_deferred?
|
46
|
+
return "Receipt - Order ##{order.to_param}" if order.purchased? && order.delayed_payment_date_past?
|
46
47
|
return "Confirmation - #{event}" if event_none_waitlisted?
|
47
48
|
return "Confirmation & Waitlist - #{event}" if event_some_waitlisted?
|
48
49
|
return "Waitlist - #{event}" if event_all_waitlisted?
|
@@ -98,5 +99,9 @@ module Effective
|
|
98
99
|
event_registrants.all? { |er| er.waitlisted_not_promoted? }
|
99
100
|
end
|
100
101
|
|
102
|
+
def event_all_waitlisted_or_archived?
|
103
|
+
return false unless event_registrants.present?
|
104
|
+
event_registrants.all? { |er| er.waitlisted_not_promoted? || er.archived? }
|
105
|
+
end
|
101
106
|
end
|
102
107
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
.effective-order-items
|
2
|
+
- present_order_items = order.order_items.reject(&:archived?)
|
3
|
+
|
2
4
|
%table.table{style: "margin-bottom: 20px;"}
|
3
5
|
%thead
|
4
6
|
%tr
|
5
7
|
%th.quantity Qty
|
6
|
-
%th.item=
|
8
|
+
%th.item= present_order_items.length > 1 ? 'Items' : 'Item'
|
7
9
|
%th.price Price
|
8
10
|
|
9
11
|
%tbody
|
10
|
-
-
|
12
|
+
- present_order_items.each do |item|
|
11
13
|
%tr
|
12
14
|
%td.quantity= item.quantity
|
13
15
|
|
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.22.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-03-
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|