effective_qb_online 0.8.3 → 0.8.5
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00ddf30ebad25aed4701012dc46d99f3b058b0923667d92f2133e388f37d91f9
|
|
4
|
+
data.tar.gz: 1e1f8ee36db0242718778a44380dcb96f39dd388d74b77aec23288ef0423c876
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d152cbc83ed643d51f03d01a43deb684cb0fecc07ce9519a3ceb7254868986b9ccef55fd6aaf389092d7256b83718edb613a252abe013c3c39dd59e560e09291
|
|
7
|
+
data.tar.gz: 28b6f1227299d67063c0d5a1a28fbf4345a7e017378e17dd49c7f04287224c9504e2f2b4f4a3d6526dd92b7e6f6970367b5b056008f8ba51790ac0705e6648a7
|
|
@@ -9,10 +9,12 @@ module Effective
|
|
|
9
9
|
@order = resource.order
|
|
10
10
|
|
|
11
11
|
to = EffectiveOrders.qb_online_sync_error_recipients.presence || EffectiveOrders.mailer_admin
|
|
12
|
+
cc = EffectiveQbOnline.sync_error_cc_recipients.presence
|
|
13
|
+
|
|
12
14
|
subject = subject_for(__method__, "Quickbooks Sync Error - Order ##{@order.to_param}", resource, opts)
|
|
13
15
|
headers = headers_for(resource, opts)
|
|
14
16
|
|
|
15
|
-
mail(to: to, subject: subject, **headers)
|
|
17
|
+
mail(to: to, cc: cc, subject: subject, **headers)
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
end
|
|
@@ -105,7 +105,25 @@ module Effective
|
|
|
105
105
|
raise('expected an Effective::Order') unless order.kind_of?(Effective::Order)
|
|
106
106
|
|
|
107
107
|
with_service('Customer') do |service|
|
|
108
|
-
|
|
108
|
+
util = Quickbooks::Util::QueryBuilder.new
|
|
109
|
+
|
|
110
|
+
# Find by display name
|
|
111
|
+
customer = service.find_by(:display_name, scrub(order.qb_online_customer_display_name))&.first
|
|
112
|
+
|
|
113
|
+
# Find by email
|
|
114
|
+
customer ||= if order.email.present?
|
|
115
|
+
email = util.clause("PrimaryEmailAddr", "LIKE", order.email)
|
|
116
|
+
service.query("SELECT * FROM Customer WHERE #{email}")&.first
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Find by first name and last name
|
|
120
|
+
customer ||= if order.billing_first_name.present? && order.billing_last_name.present?
|
|
121
|
+
first_name = util.clause("GivenName", "LIKE", order.billing_first_name)
|
|
122
|
+
last_name = util.clause("FamilyName", "LIKE", order.billing_last_name)
|
|
123
|
+
service.query("SELECT * FROM Customer WHERE #{first_name} AND #{last_name}")&.first
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
customer
|
|
109
127
|
end
|
|
110
128
|
end
|
|
111
129
|
|
|
@@ -116,7 +134,7 @@ module Effective
|
|
|
116
134
|
with_service('Customer') do |service|
|
|
117
135
|
customer = Quickbooks::Model::Customer.new(
|
|
118
136
|
primary_email_address: Quickbooks::Model::EmailAddress.new(order.email),
|
|
119
|
-
display_name: scrub(order.
|
|
137
|
+
display_name: scrub(order.qb_online_customer_display_name)
|
|
120
138
|
)
|
|
121
139
|
|
|
122
140
|
service.create(customer)
|
|
@@ -12,6 +12,12 @@ EffectiveQbOnline.setup do |config|
|
|
|
12
12
|
# https://github.com/ruckus/quickbooks-ruby
|
|
13
13
|
Quickbooks.sandbox_mode = (ENV['QUICKBOOKS_ONLINE_SANDBOX'].to_s == 'true')
|
|
14
14
|
|
|
15
|
+
# Sync Error Email
|
|
16
|
+
# When a sync error occurs, an email is sent to the following addresses:
|
|
17
|
+
# EffectiveOrders.qb_online_sync_error_recipients or EffectiveOrders.mailer_admin
|
|
18
|
+
# You can also specify a list of additional recipients to be cc'd on the email by setting:
|
|
19
|
+
# config.sync_error_cc_recipients = ['"Errors" <errors@example.com>']
|
|
20
|
+
|
|
15
21
|
# Mailer Settings
|
|
16
22
|
# Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
|
|
17
23
|
#
|
data/lib/effective_qb_online.rb
CHANGED
|
@@ -10,7 +10,7 @@ module EffectiveQbOnline
|
|
|
10
10
|
:qb_realms_table_name, :qb_receipts_table_name, :qb_receipt_items_table_name,
|
|
11
11
|
:mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
|
|
12
12
|
:oauth_client_id, :oauth_client_secret,
|
|
13
|
-
:layout
|
|
13
|
+
:layout, :sync_error_cc_recipients
|
|
14
14
|
]
|
|
15
15
|
end
|
|
16
16
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_qb_online
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.5
|
|
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-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|