effective_orders 6.29.7 → 6.30.1
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/models/effective/order.rb +28 -10
- data/config/effective_orders.rb +5 -2
- data/db/migrate/101_create_effective_orders.rb +2 -0
- data/lib/effective_orders/version.rb +1 -1
- data/lib/effective_orders.rb +8 -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: ce25152bf55dd31ec39535b7855658a0c76ba81a4fed1c04f9f182dab38e4d43
|
|
4
|
+
data.tar.gz: 50c406f4b4cd84931e2f8d0dc50399504351deeab35e8f8fee9f8806c93c17d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9752f2d15e3d705de3dca42682a3cf4b3f051d5fdedb58a408bd915c8c1633175f42da167f9bdc6c2529de8900b521f4cc4168e3cfc1f2315fef2f0124286d78
|
|
7
|
+
data.tar.gz: 8e9593a3a0500b1503077b8ad19dd81f6b286114124484c6b4a0e630eeb43db7907a490c6ec5b0390c1d1121ab9d90ead606ae5e32233b65ff3906142d6036f0
|
|
@@ -77,7 +77,9 @@ module Effective
|
|
|
77
77
|
note_to_buyer :text # From admin to buyer
|
|
78
78
|
note_internal :text # Internal admin only
|
|
79
79
|
|
|
80
|
-
billing_name
|
|
80
|
+
billing_name :string # name of buyer
|
|
81
|
+
billing_first_name :string
|
|
82
|
+
billing_last_name :string
|
|
81
83
|
email :string # same as user.email
|
|
82
84
|
cc :string # can be set by admin
|
|
83
85
|
|
|
@@ -429,6 +431,19 @@ module Effective
|
|
|
429
431
|
[to_s, billing_name.presence, email.presence, total_to_s].compact.join(' - ')
|
|
430
432
|
end
|
|
431
433
|
|
|
434
|
+
def qb_online_customer_display_name
|
|
435
|
+
return billing_name if billing_first_name.blank? || billing_last_name.blank?
|
|
436
|
+
|
|
437
|
+
case EffectiveOrders.qb_online_customer_display_name_format
|
|
438
|
+
when :first_last
|
|
439
|
+
"#{billing_first_name} #{billing_last_name}"
|
|
440
|
+
when :last_first
|
|
441
|
+
"#{billing_last_name}, #{billing_first_name}"
|
|
442
|
+
else
|
|
443
|
+
raise("invalid qb_online_customer_display_name_format: #{EffectiveOrders.qb_online_customer_display_name_format}")
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
|
|
432
447
|
def label
|
|
433
448
|
if refund? && purchased?
|
|
434
449
|
'Refund'
|
|
@@ -472,14 +487,6 @@ module Effective
|
|
|
472
487
|
end
|
|
473
488
|
end
|
|
474
489
|
|
|
475
|
-
def billing_first_name
|
|
476
|
-
billing_name.to_s.split(' ').first
|
|
477
|
-
end
|
|
478
|
-
|
|
479
|
-
def billing_last_name
|
|
480
|
-
Array(billing_name.to_s.split(' ')[1..-1]).join(' ')
|
|
481
|
-
end
|
|
482
|
-
|
|
483
490
|
def in_progress?
|
|
484
491
|
pending? || confirmed? || deferred?
|
|
485
492
|
end
|
|
@@ -752,6 +759,7 @@ module Effective
|
|
|
752
759
|
# We support two different Quickbooks synchronization gems: effective_qb_sync and effective_qb_online
|
|
753
760
|
def sync_quickbooks!(skip:)
|
|
754
761
|
if EffectiveOrders.qb_online?
|
|
762
|
+
skip ||= (EffectiveOrders.qb_online_sync_free_orders? if free?)
|
|
755
763
|
skip ? EffectiveQbOnline.skip_order!(self) : EffectiveQbOnline.sync_order!(self)
|
|
756
764
|
end
|
|
757
765
|
|
|
@@ -927,6 +935,8 @@ module Effective
|
|
|
927
935
|
if refund?
|
|
928
936
|
EffectiveOrders.send_email(:refund_notification_to_admin, self) if EffectiveOrders.send_refund_notification_to_admin
|
|
929
937
|
end
|
|
938
|
+
|
|
939
|
+
true
|
|
930
940
|
end
|
|
931
941
|
|
|
932
942
|
def send_payment_request?
|
|
@@ -939,6 +949,7 @@ module Effective
|
|
|
939
949
|
|
|
940
950
|
EffectiveOrders.send_email(:order_email, self, payment_request: true)
|
|
941
951
|
EffectiveOrders.send_email(:order_email_to_admin, self, payment_request: true) if EffectiveOrders.send_payment_request_to_admin
|
|
952
|
+
true
|
|
942
953
|
end
|
|
943
954
|
|
|
944
955
|
# Admin datatable action
|
|
@@ -947,6 +958,7 @@ module Effective
|
|
|
947
958
|
|
|
948
959
|
EffectiveOrders.send_email(:order_email, self)
|
|
949
960
|
EffectiveOrders.send_email(:order_email_to_admin, self) if EffectiveOrders.send_order_receipt_to_admin
|
|
961
|
+
true
|
|
950
962
|
end
|
|
951
963
|
|
|
952
964
|
def send_event_registrants_cancelled_email!
|
|
@@ -1084,7 +1096,13 @@ module Effective
|
|
|
1084
1096
|
|
|
1085
1097
|
# Organization first
|
|
1086
1098
|
def assign_billing_name
|
|
1087
|
-
|
|
1099
|
+
owner = (organization || user)
|
|
1100
|
+
|
|
1101
|
+
assign_attributes(
|
|
1102
|
+
billing_name: owner.to_s.presence,
|
|
1103
|
+
billing_first_name: owner.try(:first_name).presence,
|
|
1104
|
+
billing_last_name: owner.try(:last_name).presence
|
|
1105
|
+
)
|
|
1088
1106
|
end
|
|
1089
1107
|
|
|
1090
1108
|
# User first
|
data/config/effective_orders.rb
CHANGED
|
@@ -19,10 +19,13 @@ EffectiveOrders.setup do |config|
|
|
|
19
19
|
# config.organization_enabled = false
|
|
20
20
|
# config.organization_class_name = 'Example::Organization'
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Effective Quickbooks Synchronization
|
|
23
23
|
config.use_effective_qb_sync = false
|
|
24
24
|
config.use_effective_qb_online = false
|
|
25
25
|
|
|
26
|
+
config.qb_online_sync_free_orders = true
|
|
27
|
+
config.qb_online_customer_display_name_format = :first_last
|
|
28
|
+
|
|
26
29
|
# Display the item name field on the orders#new screen
|
|
27
30
|
config.use_item_names = true
|
|
28
31
|
|
|
@@ -56,7 +59,7 @@ EffectiveOrders.setup do |config|
|
|
|
56
59
|
# Will be applied to all orders based off the after-tax total.
|
|
57
60
|
# Use 2.4 for 2.4% or nil for none
|
|
58
61
|
config.credit_card_surcharge_percent = nil
|
|
59
|
-
config.credit_card_surcharge_qb_item_name = 'Credit Card Surcharge'
|
|
62
|
+
config.credit_card_surcharge_qb_item_name = nil # 'Credit Card Surcharge'
|
|
60
63
|
|
|
61
64
|
# Minimum Charge
|
|
62
65
|
# Prevent orders less than this value from being purchased
|
data/lib/effective_orders.rb
CHANGED
|
@@ -42,7 +42,10 @@ module EffectiveOrders
|
|
|
42
42
|
:send_subscription_trialing, :send_subscription_trial_expired,
|
|
43
43
|
:send_refund_notification_to_admin,
|
|
44
44
|
|
|
45
|
-
# Quickbooks Online
|
|
45
|
+
# Quickbooks Online
|
|
46
|
+
:qb_online_sync_free_orders, :qb_online_customer_display_name_format,
|
|
47
|
+
|
|
48
|
+
# Quickbooks Online Error Emails
|
|
46
49
|
:send_qb_online_sync_error, :qb_online_sync_error_recipients,
|
|
47
50
|
|
|
48
51
|
# Features
|
|
@@ -223,6 +226,10 @@ module EffectiveOrders
|
|
|
223
226
|
use_effective_qb_online && defined?(EffectiveQbOnline)
|
|
224
227
|
end
|
|
225
228
|
|
|
229
|
+
def self.qb_online_sync_free_orders?
|
|
230
|
+
qb_online_sync_free_orders != false
|
|
231
|
+
end
|
|
232
|
+
|
|
226
233
|
def self.use_item_names?
|
|
227
234
|
use_item_names != false
|
|
228
235
|
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.
|
|
4
|
+
version: 6.30.1
|
|
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-12-
|
|
11
|
+
date: 2025-12-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|