effective_orders 6.21.2 → 6.21.4

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: d44441a4047ff2e429c716b1d6a1fd0468cd3e4b6d3e507f4f2ad979f1d19cfa
4
- data.tar.gz: b7e63a71d07f0fa59218a938174004022732d925b17185fb45d1376620521af1
3
+ metadata.gz: 39ce34f3c38a2b137ae5d6277b766bab2215e1ef14271dc9ae26ced61897216a
4
+ data.tar.gz: b27f892799caee6f152f14f6dc3757ca910a1db2568b146736c3aa877c226f15
5
5
  SHA512:
6
- metadata.gz: 9f9ea59b2fb67092f6ea3d871954ab2437dab6d09f7f8828bc430be00754945afcdb0df8ea602d9228ce91cb2208ff0084d27d93b8eaca93621217fcdf0a9140
7
- data.tar.gz: a35a53e9e14675b9a311c8a21b9138569cc62599ea1f8397a0819758644f96c4d1dfc0b28e880f0caa88fd7c23c82124bc1e471234d3745361bd20f7841c32a5
6
+ metadata.gz: 496a570f6ce2aa2fa1182c5b341761abb9183ea2da79e6d1e465b8c81bab11590edb529c385c825407258827ab703dfaba7c63da6d8680ccd6e607b2550bff90
7
+ data.tar.gz: c26a9381da40a34dcfc49dd08c933dc86caf75bc29a80876905081806e04df5ea31b7af64abb9c74aa446cefe1adbf328817b91c4c17f2d458aa5d89a24b6c93
@@ -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,7 @@ module Effective
628
627
  self.addresses.clear if addresses.any? { |address| address.valid? == false }
629
628
  save!
630
629
 
631
- if EffectiveResources.truthy?(send_payment_request_to_buyer)
630
+ if send_payment_request_to_buyer?
632
631
  after_commit { send_payment_request_to_buyer! }
633
632
  end
634
633
 
@@ -879,8 +878,16 @@ module Effective
879
878
  (emails + [cc.presence]).compact.uniq.to_sentence
880
879
  end
881
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?
884
+ false
885
+ end
886
+
882
887
  def send_order_emails!
883
- if purchased_or_deferred? && (!free? || EffectiveOrders.send_order_receipts_when_free)
888
+ return false if skip_order_emails?
889
+
890
+ if purchased_or_deferred?
884
891
  EffectiveOrders.send_email(:order_email, self) if EffectiveOrders.send_order_receipt_to_buyer
885
892
  EffectiveOrders.send_email(:order_email_to_admin, self) if EffectiveOrders.send_order_receipt_to_admin
886
893
  end
@@ -895,6 +902,10 @@ module Effective
895
902
  end
896
903
  end
897
904
 
905
+ def send_payment_request_to_buyer?
906
+ EffectiveResources.truthy?(send_payment_request_to_buyer)
907
+ end
908
+
898
909
  # Admin datatable action
899
910
  def send_payment_request_to_buyer!
900
911
  EffectiveOrders.send_email(:order_email, self, payment_request: true) unless (purchased? || refund?)
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.21.2'.freeze
2
+ VERSION = '6.21.4'.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.21.2
4
+ version: 6.21.4
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-02-27 00:00:00.000000000 Z
11
+ date: 2025-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails