effective_qb_online 0.3.0 → 0.3.2
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: c2ddde7401c7aaaa2461796d66a640bf9ec38ab749ec858f8ef5e5a403885fb6
|
4
|
+
data.tar.gz: bf8a3d9c0ca0ea906d32e841aede9b8e05fd9b04675f54fb84e7472fa2a1b533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceeb4d37581de7b426ef5fde3f43ef4d2efcb50e75b2b715cfd9ddf91aa827d07fcf75a1f693c5fb9f89c92c7be03364596d0ac56918d13fff2618f38e723e4e
|
7
|
+
data.tar.gz: b161ebde1d8c67e80e95d45a689c7327594920ac4e4b75ccb9e1b581c01abec425609363dc4b1f55d96a5435976812e596a84dab6c58a7c9035c6ae790c1020e
|
@@ -110,7 +110,7 @@ module Effective
|
|
110
110
|
|
111
111
|
# Find by given name and family name
|
112
112
|
customer ||= if user.respond_to?(:first_name) && user.respond_to?(:last_name)
|
113
|
-
service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name)}' AND FamilyName LIKE '#{scrub(user.last_name)}'")&.first
|
113
|
+
service.query("SELECT * FROM Customer WHERE GivenName LIKE '#{scrub(user.first_name, sql: true)}' AND FamilyName LIKE '#{scrub(user.last_name, sql: true)}'")&.first
|
114
114
|
end
|
115
115
|
|
116
116
|
# Find by display name
|
@@ -217,9 +217,11 @@ module Effective
|
|
217
217
|
end
|
218
218
|
end
|
219
219
|
|
220
|
-
def scrub(value)
|
220
|
+
def scrub(value, sql: false)
|
221
221
|
return nil unless value.present?
|
222
|
-
value.gsub(':', '')
|
222
|
+
value = value.gsub(':', '')
|
223
|
+
value = value.gsub("'", "\\'") if sql
|
224
|
+
value
|
223
225
|
end
|
224
226
|
|
225
227
|
end
|
@@ -118,7 +118,7 @@ module Effective
|
|
118
118
|
line_item = Quickbooks::Model::Line.new(amount: api.price_to_amount(order.surcharge), description: 'Credit Card Surcharge')
|
119
119
|
|
120
120
|
line_item.sales_item! do |line|
|
121
|
-
line.item_id = surcharge_item.
|
121
|
+
line.item_id = surcharge_item.id
|
122
122
|
line.tax_code_id = tax_code.id # Surcharge is taxed at same rate as items
|
123
123
|
|
124
124
|
line.unit_price = api.price_to_amount(order.surcharge)
|
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.3.
|
4
|
+
version: 0.3.2
|
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:
|
11
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|