qbxml 0.3.0 → 0.5.0
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 +5 -5
- data/.gitignore +2 -0
- data/Appraisals +19 -0
- data/README.md +1 -5
- data/gemfiles/rails_5.0.gemfile +7 -0
- data/gemfiles/rails_5.0.gemfile.lock +69 -0
- data/gemfiles/rails_5.1.gemfile +7 -0
- data/gemfiles/rails_5.1.gemfile.lock +69 -0
- data/gemfiles/rails_5.2.gemfile +7 -0
- data/gemfiles/rails_5.2.gemfile.lock +69 -0
- data/gemfiles/rails_6.0.gemfile +7 -0
- data/gemfiles/rails_6.0.gemfile.lock +71 -0
- data/gemfiles/rails_6.1.gemfile +7 -0
- data/gemfiles/rails_6.1.gemfile.lock +70 -0
- data/lib/qbxml/hash.rb +25 -2
- data/lib/qbxml/qbxml.rb +2 -1
- data/lib/qbxml/types.rb +2 -2
- data/lib/qbxml/version.rb +1 -1
- data/lib/qbxml.rb +0 -1
- data/qbxml.gemspec +2 -3
- data/schema/qbxmlops140.xml +35792 -0
- data/test/unit/xml_to_hash_test.rb +252 -1
- metadata +19 -65
- data/.travis.yml +0 -6
- data/spec/backwards_compatibility.rb +0 -26
- data/spec/spec_helper.rb +0 -25
- data/spec/support/requests/account_query_rq.xml +0 -8
- data/spec/support/requests/customer_add_rq.xml +0 -28
- data/spec/support/requests/customer_query_iterator_rq.xml +0 -11
- data/spec/support/requests/customer_query_rq.xml +0 -9
- data/spec/support/requests/estimate_add_rq.xml +0 -45
- data/spec/support/requests/invoice_add_rq.xml +0 -40
- data/spec/support/requests/item_inventory_add_rq.xml +0 -22
- data/spec/support/requests/purchase_order_query_rq.xml +0 -14
- data/spec/support/requests/receive_payment_add_rq.xml +0 -35
- data/spec/support/requests/receive_payment_query_rq.xml +0 -9
- data/spec/support/requests/sales_receipt_add_rq.xml +0 -49
- data/spec/support/responses/account_query_rs.xml +0 -42
- data/spec/support/responses/customer_add_rs.xml +0 -37
- data/spec/support/responses/customer_query_rs.xml +0 -49
- data/spec/support/responses/customer_query_terator_rs.xml +0 -34
- data/spec/support/responses/item_inventory_add_rs.xml +0 -40
- data/spec/support/responses/purchase_order_query_rs.xml +0 -84
- data/spec/support/responses/receive_payment_query_rs.xml +0 -51
- data/spec/support/responses/sales_receipt_add_rs.xml +0 -89
@@ -26,5 +26,256 @@ class XmlToHashTest < Minitest::Test
|
|
26
26
|
assert_equal h, qbxml.from_qbxml("<?qbxml version=\"7.0\"?>\n<QBXML>\n <QBXMLMsgsRq>\n <InvoiceQueryRq>\n <IncludeRetElement>TxnID</IncludeRetElement>\n <IncludeRetElement>RefNumber</IncludeRetElement>\n </InvoiceQueryRq>\n </QBXMLMsgsRq>\n</QBXML>\n")
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
def test_array_with_one_element
|
30
|
+
qbxml = Qbxml.new
|
31
|
+
h = {
|
32
|
+
"qbxml" => {
|
33
|
+
"xml_attributes" => {},
|
34
|
+
"qbxml_msgs_rs" => {
|
35
|
+
"xml_attributes" => {},
|
36
|
+
'customer_query_rs' => {
|
37
|
+
"xml_attributes" => {},
|
38
|
+
'customer_ret' => [{
|
39
|
+
"xml_attributes"=> {},
|
40
|
+
'list_id' => 'abc'
|
41
|
+
}]
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
assert_equal h, qbxml.from_qbxml("<?qbxml version=\"7.0\"?>\n<QBXML>\n <QBXMLMsgsRs>\n <CustomerQueryRs>\n <CustomerRet><ListID>abc</ListID></CustomerRet>\n </CustomerQueryRs>\n </QBXMLMsgsRs>\n</QBXML>\n")
|
47
|
+
end
|
30
48
|
|
49
|
+
def test_float_percentage
|
50
|
+
qbxml = Qbxml.new
|
51
|
+
h = {
|
52
|
+
"qbxml" => {
|
53
|
+
"xml_attributes" => {},
|
54
|
+
"qbxml_msgs_rs" => {
|
55
|
+
"xml_attributes" => {},
|
56
|
+
"item_query_rs" => {
|
57
|
+
"xml_attributes" => {
|
58
|
+
"requestID" => "Retrieve items",
|
59
|
+
"statusCode" => "0",
|
60
|
+
"statusSeverity" => "Info",
|
61
|
+
"statusMessage" => "Status OK",
|
62
|
+
"iteratorRemainingCount" => "0",
|
63
|
+
"iteratorID" => "{10c05cbd-b25b-4a85-8aa0-8bce89e6e900}"
|
64
|
+
},
|
65
|
+
"item_service_ret" => {
|
66
|
+
"xml_attributes" => {},
|
67
|
+
"list_id" => "80000005-1468535148",
|
68
|
+
"time_created" => "2016-07-14T15:25:48+00:00",
|
69
|
+
"time_modified" => "2016-07-14T15:25:48+00:00",
|
70
|
+
"edit_sequence" => "1468535148",
|
71
|
+
"name" => "let's get intuit",
|
72
|
+
"full_name" => "let's get intuit",
|
73
|
+
"is_active" => true,
|
74
|
+
"sublevel" => 0,
|
75
|
+
"sales_or_purchase" => {
|
76
|
+
"xml_attributes" => {},
|
77
|
+
"price_percent" => 18.0,
|
78
|
+
"account_ref" => {
|
79
|
+
"xml_attributes" => {},
|
80
|
+
"list_id" => "80000015-1457547358",
|
81
|
+
"full_name" => "Repairs and Maintenance"
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
xml = <<-XML
|
91
|
+
<QBXML>
|
92
|
+
<QBXMLMsgsRs>
|
93
|
+
<ItemQueryRs requestID="Retrieve items"
|
94
|
+
statusCode="0"
|
95
|
+
statusSeverity="Info"
|
96
|
+
statusMessage="Status OK"
|
97
|
+
iteratorRemainingCount="0"
|
98
|
+
iteratorID="{10c05cbd-b25b-4a85-8aa0-8bce89e6e900}">
|
99
|
+
<ItemServiceRet>
|
100
|
+
<ListID>80000005-1468535148</ListID>
|
101
|
+
<TimeCreated>2016-07-14T15:25:48+00:00</TimeCreated>
|
102
|
+
<TimeModified>2016-07-14T15:25:48+00:00</TimeModified>
|
103
|
+
<EditSequence>1468535148</EditSequence>
|
104
|
+
<Name>let's get intuit</Name>
|
105
|
+
<FullName>let's get intuit</FullName>
|
106
|
+
<IsActive>true</IsActive>
|
107
|
+
<Sublevel>0</Sublevel>
|
108
|
+
<SalesOrPurchase>
|
109
|
+
<PricePercent>18.0%</PricePercent>
|
110
|
+
<AccountRef>
|
111
|
+
<ListID>80000015-1457547358</ListID>
|
112
|
+
<FullName>Repairs and Maintenance</FullName>
|
113
|
+
</AccountRef>
|
114
|
+
</SalesOrPurchase>
|
115
|
+
</ItemServiceRet>
|
116
|
+
</ItemQueryRs>
|
117
|
+
</QBXMLMsgsRs>
|
118
|
+
</QBXML>
|
119
|
+
XML
|
120
|
+
|
121
|
+
assert_equal h, qbxml.from_qbxml(xml)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_bigdecimal
|
125
|
+
injected_time = Time.now.strftime("%Y-%m-%dT%H:%M:%S%:z")
|
126
|
+
|
127
|
+
qbxml = Qbxml.new
|
128
|
+
h = {
|
129
|
+
"qbxml" => {
|
130
|
+
"xml_attributes" => {},
|
131
|
+
"qbxml_msgs_rs"=> {
|
132
|
+
"xml_attributes" => {},
|
133
|
+
"sales_receipt_add_rs" => {
|
134
|
+
"xml_attributes" => {
|
135
|
+
"statusCode" => "0",
|
136
|
+
"statusSeverity" => "Info",
|
137
|
+
"statusMessage" => "Status OK"
|
138
|
+
},
|
139
|
+
"sales_receipt_ret" => {
|
140
|
+
"xml_attributes" => {},
|
141
|
+
"txn_id" => "1C0-1433857054",
|
142
|
+
"time_created" => injected_time,
|
143
|
+
"time_modified" => injected_time,
|
144
|
+
"edit_sequence" => "1433850554",
|
145
|
+
"txn_number" => 89,
|
146
|
+
"customer_ref" => {
|
147
|
+
"xml_attributes" => {},
|
148
|
+
"list_id" => "80000013-1433852150",
|
149
|
+
"full_name" => "custfullname"
|
150
|
+
},
|
151
|
+
"template_ref" => {
|
152
|
+
"xml_attributes" => {},
|
153
|
+
"list_id" => "80000009-1433199758",
|
154
|
+
"full_name" => "Custom Sales Receipt"
|
155
|
+
},
|
156
|
+
"txn_date" => "2019-06-09",
|
157
|
+
"ref_number" => "1040000529",
|
158
|
+
"is_pending" => false,
|
159
|
+
"payment_method_ref" => {
|
160
|
+
"xml_attributes" => {},
|
161
|
+
"list_id" => "8000000A-1433718272",
|
162
|
+
"full_name" => "paymentmethod"
|
163
|
+
},
|
164
|
+
"due_date" => "2019-06-09",
|
165
|
+
"ship_date" => "2019-06-09",
|
166
|
+
"subtotal" => 0.2,
|
167
|
+
"item_sales_tax_ref" => {
|
168
|
+
"xml_attributes" => {},
|
169
|
+
"list_id" => "80000009-1433719484",
|
170
|
+
"full_name" => "Tax agency"
|
171
|
+
},
|
172
|
+
"sales_tax_percentage" => 8.25,
|
173
|
+
"sales_tax_total" => 0.02,
|
174
|
+
"total_amount" => 0.22,
|
175
|
+
"is_to_be_printed" => true,
|
176
|
+
"is_to_be_emailed" => false,
|
177
|
+
"customer_sales_tax_code_ref" => {
|
178
|
+
"xml_attributes" => {},
|
179
|
+
"list_id" => "80000002-1403304324",
|
180
|
+
"full_name" => "Non"
|
181
|
+
},
|
182
|
+
"deposit_to_account_ref" => {
|
183
|
+
"xml_attributes" => {},
|
184
|
+
"list_id" => "8000003D-1433719666",
|
185
|
+
"full_name" => "Undeposited Funds"
|
186
|
+
},
|
187
|
+
"sales_receipt_line_ret" => {
|
188
|
+
"xml_attributes" => {},
|
189
|
+
"txn_line_id" => "1C2-1433632154",
|
190
|
+
"item_ref" => {
|
191
|
+
"xml_attributes" => {},
|
192
|
+
"list_id" => "8000001F-1433854453",
|
193
|
+
"full_name" => "ABCD0000"
|
194
|
+
},
|
195
|
+
"desc" => "description",
|
196
|
+
"quantity" => 0.2,
|
197
|
+
"rate" => 1.0,
|
198
|
+
"amount" => 0.2,
|
199
|
+
"service_date" => "2019-06-09",
|
200
|
+
"sales_tax_code_ref"=> {
|
201
|
+
"xml_attributes" => {},
|
202
|
+
"list_id" => "80000001-1403304324",
|
203
|
+
"full_name"=>"Tax"
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
xml = <<-XML
|
213
|
+
<QBXML>
|
214
|
+
<QBXMLMsgsRs>
|
215
|
+
<SalesReceiptAddRs statusCode="0" statusSeverity="Info" statusMessage="Status OK">
|
216
|
+
<SalesReceiptRet>
|
217
|
+
<TxnID>1C0-1433857054</TxnID>
|
218
|
+
<TimeCreated>#{injected_time}</TimeCreated>
|
219
|
+
<TimeModified>#{injected_time}</TimeModified>
|
220
|
+
<EditSequence>1433850554</EditSequence>
|
221
|
+
<TxnNumber>89</TxnNumber>
|
222
|
+
<CustomerRef>
|
223
|
+
<ListID>80000013-1433852150</ListID>
|
224
|
+
<FullName>custfullname</FullName>
|
225
|
+
</CustomerRef>
|
226
|
+
<TemplateRef>
|
227
|
+
<ListID>80000009-1433199758</ListID>
|
228
|
+
<FullName>Custom Sales Receipt</FullName>
|
229
|
+
</TemplateRef>
|
230
|
+
<TxnDate>2019-06-09</TxnDate>
|
231
|
+
<RefNumber>1040000529</RefNumber>
|
232
|
+
<IsPending>false</IsPending>
|
233
|
+
<PaymentMethodRef>
|
234
|
+
<ListID>8000000A-1433718272</ListID>
|
235
|
+
<FullName>paymentmethod</FullName>
|
236
|
+
</PaymentMethodRef>
|
237
|
+
<DueDate>2019-06-09</DueDate>
|
238
|
+
<ShipDate>2019-06-09</ShipDate>
|
239
|
+
<Subtotal>0.20</Subtotal>
|
240
|
+
<ItemSalesTaxRef>
|
241
|
+
<ListID>80000009-1433719484</ListID>
|
242
|
+
<FullName>Tax agency</FullName>
|
243
|
+
</ItemSalesTaxRef>
|
244
|
+
<SalesTaxPercentage>8.25</SalesTaxPercentage>
|
245
|
+
<SalesTaxTotal>0.02</SalesTaxTotal>
|
246
|
+
<TotalAmount>0.22</TotalAmount>
|
247
|
+
<IsToBePrinted>true</IsToBePrinted>
|
248
|
+
<IsToBeEmailed>false</IsToBeEmailed>
|
249
|
+
<CustomerSalesTaxCodeRef>
|
250
|
+
<ListID>80000002-1403304324</ListID>
|
251
|
+
<FullName>Non</FullName>
|
252
|
+
</CustomerSalesTaxCodeRef>
|
253
|
+
<DepositToAccountRef>
|
254
|
+
<ListID>8000003D-1433719666</ListID>
|
255
|
+
<FullName>Undeposited Funds</FullName>
|
256
|
+
</DepositToAccountRef>
|
257
|
+
<SalesReceiptLineRet>
|
258
|
+
<TxnLineID>1C2-1433632154</TxnLineID>
|
259
|
+
<ItemRef>
|
260
|
+
<ListID>8000001F-1433854453</ListID>
|
261
|
+
<FullName>ABCD0000</FullName>
|
262
|
+
</ItemRef>
|
263
|
+
<Desc>description</Desc>
|
264
|
+
<Quantity>0.2</Quantity>
|
265
|
+
<Rate>1.00</Rate>
|
266
|
+
<Amount>0.20</Amount>
|
267
|
+
<ServiceDate>2019-06-09</ServiceDate>
|
268
|
+
<SalesTaxCodeRef>
|
269
|
+
<ListID>80000001-1403304324</ListID>
|
270
|
+
<FullName>Tax</FullName>
|
271
|
+
</SalesTaxCodeRef>
|
272
|
+
</SalesReceiptLineRet>
|
273
|
+
</SalesReceiptRet>
|
274
|
+
</SalesReceiptAddRs>
|
275
|
+
</QBXMLMsgsRs>
|
276
|
+
</QBXML>
|
277
|
+
XML
|
278
|
+
|
279
|
+
assert_equal h, qbxml.from_qbxml(xml)
|
280
|
+
end
|
281
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qbxml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Skryl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-03-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 5.0.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 5.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: nokogiri
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,21 +82,7 @@ dependencies:
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: '0'
|
98
|
-
- !ruby/object:Gem::Dependency
|
99
|
-
name: simplecov
|
85
|
+
name: rake
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
101
87
|
requirements:
|
102
88
|
- - ">="
|
@@ -110,7 +96,7 @@ dependencies:
|
|
110
96
|
- !ruby/object:Gem::Version
|
111
97
|
version: '0'
|
112
98
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
99
|
+
name: appraisal
|
114
100
|
requirement: !ruby/object:Gem::Requirement
|
115
101
|
requirements:
|
116
102
|
- - ">="
|
@@ -132,11 +118,21 @@ extensions: []
|
|
132
118
|
extra_rdoc_files: []
|
133
119
|
files:
|
134
120
|
- ".gitignore"
|
135
|
-
-
|
121
|
+
- Appraisals
|
136
122
|
- Gemfile
|
137
123
|
- LICENSE.txt
|
138
124
|
- README.md
|
139
125
|
- Rakefile
|
126
|
+
- gemfiles/rails_5.0.gemfile
|
127
|
+
- gemfiles/rails_5.0.gemfile.lock
|
128
|
+
- gemfiles/rails_5.1.gemfile
|
129
|
+
- gemfiles/rails_5.1.gemfile.lock
|
130
|
+
- gemfiles/rails_5.2.gemfile
|
131
|
+
- gemfiles/rails_5.2.gemfile.lock
|
132
|
+
- gemfiles/rails_6.0.gemfile
|
133
|
+
- gemfiles/rails_6.0.gemfile.lock
|
134
|
+
- gemfiles/rails_6.1.gemfile
|
135
|
+
- gemfiles/rails_6.1.gemfile.lock
|
140
136
|
- lib/qbxml.rb
|
141
137
|
- lib/qbxml/hash.rb
|
142
138
|
- lib/qbxml/qbxml.rb
|
@@ -148,6 +144,7 @@ files:
|
|
148
144
|
- schema/qbxmlops110.xml
|
149
145
|
- schema/qbxmlops120.xml
|
150
146
|
- schema/qbxmlops130.xml
|
147
|
+
- schema/qbxmlops140.xml
|
151
148
|
- schema/qbxmlops20.xml
|
152
149
|
- schema/qbxmlops30.xml
|
153
150
|
- schema/qbxmlops40.xml
|
@@ -157,27 +154,6 @@ files:
|
|
157
154
|
- schema/qbxmlops70.xml
|
158
155
|
- schema/qbxmlops80.xml
|
159
156
|
- schema/qbxmlopsCA30.xml
|
160
|
-
- spec/backwards_compatibility.rb
|
161
|
-
- spec/spec_helper.rb
|
162
|
-
- spec/support/requests/account_query_rq.xml
|
163
|
-
- spec/support/requests/customer_add_rq.xml
|
164
|
-
- spec/support/requests/customer_query_iterator_rq.xml
|
165
|
-
- spec/support/requests/customer_query_rq.xml
|
166
|
-
- spec/support/requests/estimate_add_rq.xml
|
167
|
-
- spec/support/requests/invoice_add_rq.xml
|
168
|
-
- spec/support/requests/item_inventory_add_rq.xml
|
169
|
-
- spec/support/requests/purchase_order_query_rq.xml
|
170
|
-
- spec/support/requests/receive_payment_add_rq.xml
|
171
|
-
- spec/support/requests/receive_payment_query_rq.xml
|
172
|
-
- spec/support/requests/sales_receipt_add_rq.xml
|
173
|
-
- spec/support/responses/account_query_rs.xml
|
174
|
-
- spec/support/responses/customer_add_rs.xml
|
175
|
-
- spec/support/responses/customer_query_rs.xml
|
176
|
-
- spec/support/responses/customer_query_terator_rs.xml
|
177
|
-
- spec/support/responses/item_inventory_add_rs.xml
|
178
|
-
- spec/support/responses/purchase_order_query_rs.xml
|
179
|
-
- spec/support/responses/receive_payment_query_rs.xml
|
180
|
-
- spec/support/responses/sales_receipt_add_rs.xml
|
181
157
|
- test/unit/hash_to_xml_test.rb
|
182
158
|
- test/unit/version_test.rb
|
183
159
|
- test/unit/xml_to_hash_test.rb
|
@@ -199,33 +175,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
175
|
- !ruby/object:Gem::Version
|
200
176
|
version: '0'
|
201
177
|
requirements: []
|
202
|
-
|
203
|
-
rubygems_version: 2.4.6
|
178
|
+
rubygems_version: 3.1.4
|
204
179
|
signing_key:
|
205
180
|
specification_version: 4
|
206
181
|
summary: Quickbooks XML Parser and Validation Tool
|
207
182
|
test_files:
|
208
|
-
- spec/backwards_compatibility.rb
|
209
|
-
- spec/spec_helper.rb
|
210
|
-
- spec/support/requests/account_query_rq.xml
|
211
|
-
- spec/support/requests/customer_add_rq.xml
|
212
|
-
- spec/support/requests/customer_query_iterator_rq.xml
|
213
|
-
- spec/support/requests/customer_query_rq.xml
|
214
|
-
- spec/support/requests/estimate_add_rq.xml
|
215
|
-
- spec/support/requests/invoice_add_rq.xml
|
216
|
-
- spec/support/requests/item_inventory_add_rq.xml
|
217
|
-
- spec/support/requests/purchase_order_query_rq.xml
|
218
|
-
- spec/support/requests/receive_payment_add_rq.xml
|
219
|
-
- spec/support/requests/receive_payment_query_rq.xml
|
220
|
-
- spec/support/requests/sales_receipt_add_rq.xml
|
221
|
-
- spec/support/responses/account_query_rs.xml
|
222
|
-
- spec/support/responses/customer_add_rs.xml
|
223
|
-
- spec/support/responses/customer_query_rs.xml
|
224
|
-
- spec/support/responses/customer_query_terator_rs.xml
|
225
|
-
- spec/support/responses/item_inventory_add_rs.xml
|
226
|
-
- spec/support/responses/purchase_order_query_rs.xml
|
227
|
-
- spec/support/responses/receive_payment_query_rs.xml
|
228
|
-
- spec/support/responses/sales_receipt_add_rs.xml
|
229
183
|
- test/unit/hash_to_xml_test.rb
|
230
184
|
- test/unit/version_test.rb
|
231
185
|
- test/unit/xml_to_hash_test.rb
|
data/.travis.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'quickbooks'
|
3
|
-
|
4
|
-
describe Qbxml do
|
5
|
-
context 'backwards compatibility with the quickbooks_api gem' do
|
6
|
-
|
7
|
-
let(:qb_old) { Quickbooks::API[:qb] }
|
8
|
-
let(:qb_new) { Qbxml.new(:qb) }
|
9
|
-
|
10
|
-
it 'should produce the same results when parsing qbxml/hash data' do
|
11
|
-
(requests + responses).each do |data|
|
12
|
-
old_parse = qb_old.qbxml_to_hash(data, true)
|
13
|
-
|
14
|
-
new_parse1 = qb_new.from_qbxml(data)
|
15
|
-
new_parse1.should == { 'qbxml' => old_parse }
|
16
|
-
|
17
|
-
# XML is a pain to compare so we can compare the parsed hash resulting
|
18
|
-
# from the generated XML instead.
|
19
|
-
#
|
20
|
-
new_parse2 = qb_new.from_qbxml(qb_new.to_qbxml(new_parse1))
|
21
|
-
new_parse2.should == { 'qbxml' => old_parse }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'simplecov'
|
2
|
-
SimpleCov.start
|
3
|
-
|
4
|
-
require 'rubygems'
|
5
|
-
require 'bundler/setup'
|
6
|
-
Bundler.require :default
|
7
|
-
|
8
|
-
require 'qbxml'
|
9
|
-
RSpec.configure do |config|
|
10
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
11
|
-
config.filter_run :focus => true
|
12
|
-
config.run_all_when_everything_filtered = true
|
13
|
-
end
|
14
|
-
|
15
|
-
SUPPORT_DIR = "#{File.dirname(__FILE__)}/support" unless defined? SUPPORT_DIR
|
16
|
-
REQUEST_DIR = "#{SUPPORT_DIR}/requests" unless defined? REQUEST_DIR
|
17
|
-
RESPONSE_DIR = "#{SUPPORT_DIR}/responses" unless defined? RESPONSE_DIR
|
18
|
-
|
19
|
-
def requests
|
20
|
-
Dir["#{REQUEST_DIR}/*.xml"].map { |f| File.read(f) }
|
21
|
-
end
|
22
|
-
|
23
|
-
def responses
|
24
|
-
Dir["#{RESPONSE_DIR}/*.xml"].map { |f| File.read(f) }
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="2.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="stopOnError">
|
5
|
-
<CustomerAddRq requestID="15">
|
6
|
-
<CustomerAdd>
|
7
|
-
<Name>20706 - Eastern XYZ University</Name>
|
8
|
-
<CompanyName>Eastern XYZ University</CompanyName>
|
9
|
-
<FirstName>Keith</FirstName>
|
10
|
-
<LastName>Palmer</LastName>
|
11
|
-
<BillAddress>
|
12
|
-
<Addr1>Eastern XYZ University</Addr1>
|
13
|
-
<Addr2>College of Engineering</Addr2>
|
14
|
-
<Addr3>123 XYZ Road</Addr3>
|
15
|
-
<City>Storrs-Mansfield</City>
|
16
|
-
<State>CT</State>
|
17
|
-
<PostalCode>06268</PostalCode>
|
18
|
-
<Country>United States</Country>
|
19
|
-
</BillAddress>
|
20
|
-
<Phone>860-634-1602</Phone>
|
21
|
-
<AltPhone>860-429-0021</AltPhone>
|
22
|
-
<Fax>860-429-5183</Fax>
|
23
|
-
<Email>keith@consolibyte.com</Email>
|
24
|
-
<Contact>Keith Palmer</Contact>
|
25
|
-
</CustomerAdd>
|
26
|
-
</CustomerAddRq>
|
27
|
-
</QBXMLMsgsRq>
|
28
|
-
</QBXML>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="5.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="continueOnError">
|
5
|
-
<CustomerQueryRq requestID="1" iterator="Start">
|
6
|
-
<MaxReturned>5</MaxReturned>
|
7
|
-
<FromModifiedDate>1984-01-29T22:03:19</FromModifiedDate>
|
8
|
-
<OwnerID>0</OwnerID>
|
9
|
-
</CustomerQueryRq>
|
10
|
-
</QBXMLMsgsRq>
|
11
|
-
</QBXML>
|
@@ -1,45 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="6.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="stopOnError">
|
5
|
-
<EstimateAddRq requestID="2">
|
6
|
-
<EstimateAdd>
|
7
|
-
|
8
|
-
<CustomerRef>
|
9
|
-
<FullName>Keith's Company</FullName>
|
10
|
-
</CustomerRef>
|
11
|
-
|
12
|
-
<TxnDate>2007-12-14</TxnDate>
|
13
|
-
<RefNumber>9668</RefNumber>
|
14
|
-
|
15
|
-
<BillAddress>
|
16
|
-
<Addr1>56 Cowles Road</Addr1>
|
17
|
-
<City>Willington</City>
|
18
|
-
<State>CT</State>
|
19
|
-
<PostalCode>06279</PostalCode>
|
20
|
-
<Country>United States</Country>
|
21
|
-
</BillAddress>
|
22
|
-
|
23
|
-
<EstimateLineAdd>
|
24
|
-
<ItemRef>
|
25
|
-
<FullName>Item Name 1</FullName>
|
26
|
-
</ItemRef>
|
27
|
-
<Desc>Item 1 Description Goes Here</Desc>
|
28
|
-
<Quantity>1</Quantity>
|
29
|
-
<Rate>295</Rate>
|
30
|
-
</EstimateLineAdd>
|
31
|
-
|
32
|
-
<EstimateLineAdd>
|
33
|
-
<ItemRef>
|
34
|
-
<FullName>Item Name 2</FullName>
|
35
|
-
</ItemRef>
|
36
|
-
<Desc>Item 2 Description Goes Here</Desc>
|
37
|
-
<Quantity>3</Quantity>
|
38
|
-
<Rate>25</Rate>
|
39
|
-
</EstimateLineAdd>
|
40
|
-
|
41
|
-
</EstimateAdd>
|
42
|
-
</EstimateAddRq>
|
43
|
-
</QBXMLMsgsRq>
|
44
|
-
</QBXML>
|
45
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="2.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="stopOnError">
|
5
|
-
<InvoiceAddRq requestID="2">
|
6
|
-
<InvoiceAdd>
|
7
|
-
<CustomerRef>
|
8
|
-
<ListID>F560000-1197683156</ListID>
|
9
|
-
</CustomerRef>
|
10
|
-
<TxnDate>2007-12-14</TxnDate>
|
11
|
-
<RefNumber>9668</RefNumber>
|
12
|
-
<BillAddress>
|
13
|
-
<Addr1>56 Cowles Road</Addr1>
|
14
|
-
<City>Willington</City>
|
15
|
-
<State>CT</State>
|
16
|
-
<PostalCode>06279</PostalCode>
|
17
|
-
<Country>United States</Country>
|
18
|
-
</BillAddress>
|
19
|
-
<PONumber/>
|
20
|
-
<Memo/>
|
21
|
-
<InvoiceLineAdd>
|
22
|
-
<ItemRef>
|
23
|
-
<FullName>Downloaded Invoice</FullName>
|
24
|
-
</ItemRef>
|
25
|
-
<Desc>Item 1 Description Goes Here</Desc>
|
26
|
-
<Quantity>1</Quantity>
|
27
|
-
<Rate>295</Rate>
|
28
|
-
</InvoiceLineAdd>
|
29
|
-
<InvoiceLineAdd>
|
30
|
-
<ItemRef>
|
31
|
-
<FullName>Downloaded Invoice</FullName>
|
32
|
-
</ItemRef>
|
33
|
-
<Desc>Item 2 Description Goes Here</Desc>
|
34
|
-
<Quantity>3</Quantity>
|
35
|
-
<Rate>25</Rate>
|
36
|
-
</InvoiceLineAdd>
|
37
|
-
</InvoiceAdd>
|
38
|
-
</InvoiceAddRq>
|
39
|
-
</QBXMLMsgsRq>
|
40
|
-
</QBXML>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="7.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="stopOnError">
|
5
|
-
<ItemInventoryAddRq requestID="SXRlbUludmVudG9yeUFkZHwxNTA=" >
|
6
|
-
<ItemInventoryAdd>
|
7
|
-
<Name>product name here</Name>
|
8
|
-
<SalesDesc>your sales description here</SalesDesc>
|
9
|
-
<SalesPrice>85.00</SalesPrice>
|
10
|
-
<IncomeAccountRef>
|
11
|
-
<FullName>Sales</FullName>
|
12
|
-
</IncomeAccountRef>
|
13
|
-
<COGSAccountRef>
|
14
|
-
<FullName>Cost of Goods Sold</FullName>
|
15
|
-
</COGSAccountRef>
|
16
|
-
<AssetAccountRef>
|
17
|
-
<FullName>Inventory Asset</FullName>
|
18
|
-
</AssetAccountRef>
|
19
|
-
</ItemInventoryAdd>
|
20
|
-
</ItemInventoryAddRq>
|
21
|
-
</QBXMLMsgsRq>
|
22
|
-
</QBXML>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<?qbxml version="8.0"?>
|
3
|
-
<QBXML>
|
4
|
-
<QBXMLMsgsRq onError="stopOnError">
|
5
|
-
<PurchaseOrderQueryRq requestID="UHVyY2hhc2VPcmRlckltcG9ydHwx" iterator="Start" >
|
6
|
-
<MaxReturned>10</MaxReturned>
|
7
|
-
<!--<ModifiedDateRangeFilter>
|
8
|
-
<FromModifiedDate>2010-09-27T22:20:09</FromModifiedDate>
|
9
|
-
</ModifiedDateRangeFilter>-->
|
10
|
-
<IncludeLineItems>true</IncludeLineItems>
|
11
|
-
<OwnerID>0</OwnerID>
|
12
|
-
</PurchaseOrderQueryRq>
|
13
|
-
</QBXMLMsgsRq>
|
14
|
-
</QBXML>
|