effective_qb_online 0.9.8 → 0.9.9
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: e9c2123d98959752c1fc3282eaed56393c472270627852362f18f481df53effb
|
|
4
|
+
data.tar.gz: 5337ce9494f3677d72d3d8b5fb95ed43612d3a1580631cc6954d0f0dbac20f83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba8008ddd33147f3cf9f793a9f8a2477ed231ba91588cbaa47246ce571b91107eff55298d4a1eef5fb28144279ee011d35c7b5fe5b0ca1680cb1eaa6a3714f26
|
|
7
|
+
data.tar.gz: 3ab35742a9bd30d10248a8a8efeaf4511c42bc9a1390283f6a5387a69ec76e95e3faeb39673e97b31065d336a5c6e8d5229597dcbfc529d13afe610661aecbc7
|
|
@@ -100,7 +100,7 @@ module Effective
|
|
|
100
100
|
|
|
101
101
|
receipt.qb_receipt_items.each do |receipt_item|
|
|
102
102
|
order_item = receipt_item.order_item
|
|
103
|
-
line_item = Quickbooks::Model::Line.new(amount: api.price_to_amount(order_item.subtotal), description: order_item.name)
|
|
103
|
+
line_item = Quickbooks::Model::Line.new(amount: api.price_to_amount(order_item.subtotal), description: strip_html(order_item.name))
|
|
104
104
|
|
|
105
105
|
line_item.sales_item! do |line|
|
|
106
106
|
line.item_id = receipt_item.item_id
|
|
@@ -161,5 +161,15 @@ module Effective
|
|
|
161
161
|
value.to_s.downcase.strip
|
|
162
162
|
end
|
|
163
163
|
|
|
164
|
+
# Order item names may contain HTML (e.g. an EventRegistrant's "Member" badge).
|
|
165
|
+
# QuickBooks line item descriptions are plain text, so strip the markup while keeping
|
|
166
|
+
# the badge text. Convert line breaks to spaces first so adjacent text doesn't run together.
|
|
167
|
+
def self.strip_html(value)
|
|
168
|
+
return value if value.blank?
|
|
169
|
+
|
|
170
|
+
text = value.to_s.gsub(/<br\s*\/?>/i, ' ')
|
|
171
|
+
ActionView::Base.full_sanitizer.sanitize(text).squish
|
|
172
|
+
end
|
|
173
|
+
|
|
164
174
|
end
|
|
165
175
|
end
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
= f.fields_for :qb_receipt_items do |fi|
|
|
29
29
|
%tr
|
|
30
30
|
%td= fi.object.order_item_id
|
|
31
|
-
%td= fi.object.order_item
|
|
31
|
+
%td= fi.object.order_item.to_s.html_safe
|
|
32
32
|
%td
|
|
33
33
|
- if fi.object.item_id.present?
|
|
34
34
|
- existing = items.find { |(name, id)| id == fi.object.item_id }&.first
|
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.9.
|
|
4
|
+
version: 0.9.9
|
|
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: 2026-06-
|
|
11
|
+
date: 2026-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|