qbwc_requests 0.0.9 → 0.0.9.01

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
  SHA1:
3
- metadata.gz: 5d6594578c5d8563d509fd1181cbe303c752632c
4
- data.tar.gz: 4e2d5b8f6394d3d876a5ad125d661a7035d82f34
3
+ metadata.gz: 576fa8649096364cde407c5a2b710bda6b006f0d
4
+ data.tar.gz: 1f8ceb7be93f1c89e71ab2f493237fa40959cf76
5
5
  SHA512:
6
- metadata.gz: 810a75787b7b703fa49333162b7c155524a8d2a0af81e4a5dc0c04449ba2159b4125544c8ba8605b811bac47db7758a0d1c73c2909c8349aa0004b396efbf9ce
7
- data.tar.gz: 7e50c0abed86edcce9bc2694bf8e472a6f5f47200cf3947225aafb91a6cf33773463ee8d1fb412816717f2508a8467b1966be7451a9d786b7220a8da8c64acf0
6
+ metadata.gz: de9e87018b55d4bf600d85695e8c6c828991e7b516ba9ed8c0eab314598888d6ed17faa28ee5fbd6777c95b50670e65abaae955dad8849eed7730044daee8b76
7
+ data.tar.gz: fa19f642bb751d1e4c2ec7643c95715c001e80447b3e5dfb0e5667c9458c66832bd664d1c251db4e196c0bcf7a13a3ace2232eed0f61680e703a99891da947b5
@@ -43,6 +43,7 @@ module Qbwc
43
43
 
44
44
  def compact opts={}
45
45
  # I pass two times to avoid {v: '1',k: {}}, gotta find a better algorithm (recursive)
46
+ return {} if opts.nil?
46
47
  proc = Proc.new { |k, v| v.kind_of?(Hash) ? (v.delete_if(&proc); nil) : v.empty? };
47
48
  hash = opts.delete_if(&proc)
48
49
  hash.delete_if { |k, v| v.empty? }
@@ -0,0 +1,9 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Bill < Qbwc::Request::Base
5
+ field :vendor_ref
6
+ end
7
+ end
8
+ end
9
+ end
@@ -4,7 +4,28 @@ module Qbwc
4
4
  class PurchaseOrder < Qbwc::Request::Base
5
5
 
6
6
  field :vendor_ref
7
+ field :class_ref
8
+ field :ship_to_entity_ref
9
+ field :template_ref
10
+ field :txn_date
11
+ field :ref_number
12
+ field :vendor_address
13
+ field :ship_address
14
+ field :terms_ref
15
+ field :due_date
16
+ field :expected_date
17
+ field :ship_method_ref
18
+ field :FOB
19
+ field :memo
20
+ field :vendor_msg
21
+ field :is_to_be_printed
22
+ field :is_to_be_emailed
23
+ field :is_tax_included
24
+ field :sales_tax_code_ref
25
+ field :other1
26
+ field :other2
7
27
  field :purchase_order_line_add
28
+ field :purchase_order_line_group_add
8
29
 
9
30
  end
10
31
  end
@@ -1,3 +1,3 @@
1
1
  module QbwcRequests
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.9.01"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ class GenericBase < Qbwc::Request::Base
4
+
5
+ end
6
+
7
+ describe GenericBase do
8
+
9
+ describe '#initialize' do
10
+
11
+ it 'should deal with nil values' do
12
+ expect {
13
+ GenericBase.new(nil)
14
+ }.to_not raise_error
15
+ end
16
+
17
+ end
18
+
19
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Qbwc::Request::V07::Bill do
4
+
5
+ it_behaves_like 'queryable'
6
+
7
+ describe "add" do
8
+
9
+ let(:bill){ Qbwc::Request::V07::Bill.new() }
10
+
11
+ it "should create an add bill xml" do
12
+ xml = <<-XML
13
+ <?xml version='1.0' encoding='utf-8'?>
14
+ <?qbxml version="7.0"?>
15
+ <QBXML>
16
+ <QBXMLMsgsRq onError="stopOnError">
17
+ <BillAddRq requestID="2">
18
+ <BillAdd>
19
+ </BillAdd>
20
+ </BillAddRq>
21
+ </QBXMLMsgsRq>
22
+ </QBXML>
23
+ XML
24
+ expect( bill.add ).to be_xml_equal_to xml
25
+ end
26
+
27
+ end
28
+
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbwc_requests
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.9.01
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Mondaini Calvão
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: qbxml
@@ -85,6 +85,7 @@ files:
85
85
  - lib/qbwc_requests/qbwc/qbwc.rb
86
86
  - lib/qbwc_requests/qbwc/request/base.rb
87
87
  - lib/qbwc_requests/qbwc/request/v07/account.rb
88
+ - lib/qbwc_requests/qbwc/request/v07/bill.rb
88
89
  - lib/qbwc_requests/qbwc/request/v07/customer.rb
89
90
  - lib/qbwc_requests/qbwc/request/v07/estimate.rb
90
91
  - lib/qbwc_requests/qbwc/request/v07/invoice.rb
@@ -151,7 +152,9 @@ files:
151
152
  - quickbook/xml/qbxml/examples/xmlfiles/legacy/VendorAddRq.xml
152
153
  - quickbook/xml/qbxmlops130.xml
153
154
  - quickbook/xml/qbxmlops70.xml
155
+ - spec/qbwc/request/base_spec.rb
154
156
  - spec/qbwc/request/v07/account_spec.rb
157
+ - spec/qbwc/request/v07/bill_spec.rb
155
158
  - spec/qbwc/request/v07/customer_spec.rb
156
159
  - spec/qbwc/request/v07/estimate_spec.rb
157
160
  - spec/qbwc/request/v07/invoice_spec.rb
@@ -194,7 +197,9 @@ signing_key:
194
197
  specification_version: 4
195
198
  summary: This gem helps you generate Qbxml requests
196
199
  test_files:
200
+ - spec/qbwc/request/base_spec.rb
197
201
  - spec/qbwc/request/v07/account_spec.rb
202
+ - spec/qbwc/request/v07/bill_spec.rb
198
203
  - spec/qbwc/request/v07/customer_spec.rb
199
204
  - spec/qbwc/request/v07/estimate_spec.rb
200
205
  - spec/qbwc/request/v07/invoice_spec.rb