qbwc_requests 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +8 -0
  5. data/LICENSE +22 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +29 -0
  8. data/Rakefile +1 -0
  9. data/lib/qbwc_requests/qbwc/ordered_fields.rb +35 -0
  10. data/lib/qbwc_requests/qbwc/qbwc.rb +2 -0
  11. data/lib/qbwc_requests/qbwc/request/base.rb +61 -0
  12. data/lib/qbwc_requests/qbwc/request/v07/account.rb +13 -0
  13. data/lib/qbwc_requests/qbwc/request/v07/customer.rb +29 -0
  14. data/lib/qbwc_requests/qbwc/request/v07/estimate.rb +14 -0
  15. data/lib/qbwc_requests/qbwc/request/v07/invoice.rb +15 -0
  16. data/lib/qbwc_requests/qbwc/request/v07/item.rb +11 -0
  17. data/lib/qbwc_requests/qbwc/request/v07/item_discount.rb +15 -0
  18. data/lib/qbwc_requests/qbwc/request/v07/item_group.rb +14 -0
  19. data/lib/qbwc_requests/qbwc/request/v07/item_non_inventory.rb +15 -0
  20. data/lib/qbwc_requests/qbwc/request/v07/item_other_charge.rb +16 -0
  21. data/lib/qbwc_requests/qbwc/request/v07/item_payment.rb +14 -0
  22. data/lib/qbwc_requests/qbwc/request/v07/item_service.rb +15 -0
  23. data/lib/qbwc_requests/qbwc/request/v07/item_subtotal.rb +15 -0
  24. data/lib/qbwc_requests/qbwc/request/v07/purchase_order.rb +12 -0
  25. data/lib/qbwc_requests/qbwc/request/v07/vendor.rb +25 -0
  26. data/lib/qbwc_requests/qbwc/xml_actions.rb +31 -0
  27. data/lib/qbwc_requests/version.rb +3 -0
  28. data/lib/qbwc_requests.rb +7 -0
  29. data/qbwc_requests.gemspec +23 -0
  30. data/quickbook/xml/qbxml/examples/xmlfiles/AccountQueryRq.xml +31 -0
  31. data/quickbook/xml/qbxml/examples/xmlfiles/BillQueryRq.xml +28 -0
  32. data/quickbook/xml/qbxml/examples/xmlfiles/CheckQueryRq.xml +28 -0
  33. data/quickbook/xml/qbxml/examples/xmlfiles/CompanyQueryRq.xml +28 -0
  34. data/quickbook/xml/qbxml/examples/xmlfiles/EmployeeQueryRq.xml +28 -0
  35. data/quickbook/xml/qbxml/examples/xmlfiles/EntityQueryRq.xml +29 -0
  36. data/quickbook/xml/qbxml/examples/xmlfiles/HostQueryRq.xml +29 -0
  37. data/quickbook/xml/qbxml/examples/xmlfiles/InvoiceQueryRq.xml +29 -0
  38. data/quickbook/xml/qbxml/examples/xmlfiles/ItemInventoryQueryRq.xml +29 -0
  39. data/quickbook/xml/qbxml/examples/xmlfiles/ItemSalesTaxQueryRq.xml +30 -0
  40. data/quickbook/xml/qbxml/examples/xmlfiles/ItemServiceQueryRq.xml +30 -0
  41. data/quickbook/xml/qbxml/examples/xmlfiles/PayrollItemWageQueryRq.xml +29 -0
  42. data/quickbook/xml/qbxml/examples/xmlfiles/PreferencesQueryRq.xml +29 -0
  43. data/quickbook/xml/qbxml/examples/xmlfiles/ReceivePaymentQueryRq.xml +32 -0
  44. data/quickbook/xml/qbxml/examples/xmlfiles/SalesRepQueryRq.xml +29 -0
  45. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountAddRq.xml +41 -0
  46. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_1.xml +31 -0
  47. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_2.xml +31 -0
  48. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_3.xml +31 -0
  49. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_4.xml +31 -0
  50. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_5.xml +31 -0
  51. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_6.xml +31 -0
  52. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AccountQueryRq_7.xml +31 -0
  53. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/AddInvoiceSpecifyTemplate.xml +47 -0
  54. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomDetailReport.xml +37 -0
  55. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomFieldAddValue.xml +42 -0
  56. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomFieldDelValue.xml +41 -0
  57. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomFieldModValue.xml +42 -0
  58. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomerAddRq.xml +71 -0
  59. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomerQuery.xml +29 -0
  60. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/CustomerQuery_metadata.xml +30 -0
  61. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/DepositAddRq.xml +36 -0
  62. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/DisplayList.xml +38 -0
  63. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/DisplayTxn.xml +46 -0
  64. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ErrRecovery1.xml +50 -0
  65. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ErrRecovery2.xml +28 -0
  66. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ErrRecovery3.xml +27 -0
  67. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/HostQuery.xml +27 -0
  68. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ItemServiceAddRq.xml +39 -0
  69. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ItemsAddRq.xml +80 -0
  70. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/JournalEntryAddRq.xml +55 -0
  71. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ProfitAndLossStdReport.xml +35 -0
  72. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/QueryFilterRq.xml +46 -0
  73. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ReceivePaymentAddRq.xml +49 -0
  74. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/ReceivePaymentToDepositQueryRq.xml +27 -0
  75. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/TemplateQuery.xml +37 -0
  76. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/TxnDisplayAdd_Invoice.xml +35 -0
  77. data/quickbook/xml/qbxml/examples/xmlfiles/legacy/VendorAddRq.xml +63 -0
  78. data/quickbook/xml/qbxmlops130.xml +35788 -0
  79. data/quickbook/xml/qbxmlops70.xml +29844 -0
  80. data/spec/qbwc/request/v07/account_spec.rb +32 -0
  81. data/spec/qbwc/request/v07/customer_spec.rb +32 -0
  82. data/spec/qbwc/request/v07/estimate_spec.rb +39 -0
  83. data/spec/qbwc/request/v07/invoice_spec.rb +39 -0
  84. data/spec/qbwc/request/v07/item_discount_spec.rb +32 -0
  85. data/spec/qbwc/request/v07/item_group_spec.rb +31 -0
  86. data/spec/qbwc/request/v07/item_non_inventory_spec.rb +31 -0
  87. data/spec/qbwc/request/v07/item_other_charge_spec.rb +39 -0
  88. data/spec/qbwc/request/v07/item_payment_spec.rb +29 -0
  89. data/spec/qbwc/request/v07/item_service_spec.rb +32 -0
  90. data/spec/qbwc/request/v07/item_spec.rb +7 -0
  91. data/spec/qbwc/request/v07/item_subtotal_spec.rb +52 -0
  92. data/spec/qbwc/request/v07/purchase_orders_spec.rb +36 -0
  93. data/spec/qbwc/request/v07/vendor_spec.rb +31 -0
  94. data/spec/spec_helper.rb +98 -0
  95. data/spec/support/expectations/field_validations.rb +13 -0
  96. data/spec/support/expectations/xml_equal.rb +15 -0
  97. data/spec/support/shared_examples_for_xml_requests.rb +24 -0
  98. metadata +186 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c7c569a7bf82b699c1caa556ed79041ada8a3260
4
+ data.tar.gz: 2a8447dbd33e0a7272467bd50a5971a7baa0a6fb
5
+ SHA512:
6
+ metadata.gz: 2eadbeda559a1f7b9c65a91d20a9841e1e9047ddc0494604c3869ef828dd01316870b50be8b3926fb89bd792c114033b759bb45fcd9b99cf028732e37778b66d
7
+ data.tar.gz: eadd9a14ea6b7b1e14278eda5f990c67b3ac2537d3fb6d1be53ac034ef58677ff0d49c7348fc25bcfa6e6b198d67a215f5b76d968491a0ff05163538182c27e9
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in qbwc_requests.gemspec
4
+ gem 'rspec'
5
+ gem 'activemodel'
6
+ gem 'qbxml'
7
+ gem 'pry'
8
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Alexandre Mondaini Calvão
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Alexandre Mondaini Calvão
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # QbwcRequests
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'qbwc_requests'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install qbwc_requests
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,35 @@
1
+ module Qbwc
2
+ module OrderedFields
3
+
4
+ module ClassMethods
5
+ def field attribute_name
6
+ @attr_order ||= []
7
+ @attr_order << attribute_name
8
+ attr_accessor attribute_name
9
+ end
10
+ def attr_order
11
+ @attr_order
12
+ end
13
+ end
14
+
15
+ def self.included(base)
16
+ base.extend(ClassMethods)
17
+ end
18
+
19
+ def ordered_fields
20
+ new_hash = {}
21
+ for attribute in self.class.attr_order
22
+ value = send(attribute)
23
+ if value.present?
24
+ if value.respond_to?(:ordered_fields)
25
+ new_hash[attribute] = value.ordered_fields
26
+ else
27
+ new_hash[attribute] = value
28
+ end
29
+ end
30
+ end
31
+ new_hash
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,2 @@
1
+ module Qbwc
2
+ end
@@ -0,0 +1,61 @@
1
+ module Qbwc
2
+ module Request
3
+ class Base
4
+
5
+ include Qbwc::OrderedFields
6
+ extend ActiveModel::Naming
7
+ include ActiveModel::Validations
8
+ include ActiveModel::Conversion
9
+
10
+ def self.query_all amount = 2000
11
+ XmlActions.query("#{underscore self.name.demodulize}_query_rq", amount)
12
+ end
13
+
14
+ def add
15
+ self.valid? ? add_xml : self
16
+ end
17
+
18
+ def initialize(attributes = {})
19
+ @attributes = compact(attributes)
20
+ @attributes.each do |name, value|
21
+ self.instance_variable_set("@#{name}", value)
22
+ end
23
+ end
24
+
25
+ def class_name
26
+ self.class.underscore self.class.name.demodulize
27
+ end
28
+
29
+ def persisted?
30
+ false
31
+ end
32
+
33
+ private
34
+
35
+ def self.underscore string
36
+ string.gsub(/::/, '/').
37
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
38
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
39
+ tr("-", "_").
40
+ downcase
41
+ end
42
+
43
+ def compact opts={}
44
+ # I pass two times to avoid {v: '1',k: {}}, gotta find a better algorithm (recursive)
45
+ proc = Proc.new { |k, v| v.kind_of?(Hash) ? (v.delete_if(&proc); nil) : v.empty? };
46
+ hash = opts.delete_if(&proc)
47
+ hash.delete_if { |k, v| v.empty? }
48
+ end
49
+
50
+ def add_xml
51
+ req = XmlActions.header
52
+ req['qbxml']['qbxml_msgs_rq']["#{class_name}_add_rq"] = {"xml_attributes"=>
53
+ {"requestID"=>"2"},
54
+ "#{class_name}_add"=> self.ordered_fields
55
+ }
56
+ XmlActions.to_xml(req)
57
+ end
58
+
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,13 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Account < Base
5
+
6
+ field :name
7
+
8
+ validates :name, presence: true
9
+
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Customer < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :company_name
9
+ field :salutation
10
+ field :first_name
11
+ field :middle_name
12
+ field :last_name
13
+ field :suffix
14
+ field :job_title
15
+ field :phone
16
+ field :mobile
17
+ field :pager
18
+ field :alt_phone
19
+ field :fax
20
+ field :email
21
+ field :cc
22
+ field :contact
23
+ field :parent_ref
24
+
25
+ validates :name, presence: true
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Estimate < Base
5
+
6
+ field :customer_ref
7
+ field :estimate_line_add
8
+
9
+ validates :customer_ref, presence: true
10
+ validates :estimate_line_add, presence: true
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Invoice < Base
5
+
6
+ field :customer_ref
7
+ field :invoice_line_add
8
+
9
+ validates :customer_ref, presence: true
10
+ validates :invoice_line_add, presence: true
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Item
5
+ def self.query_all
6
+ XmlActions.query "item_query_rq", 2000
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemDiscount < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :account_ref
9
+ field :discount_rate
10
+
11
+ validates :name, presence: true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemGroup < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :item_desc
9
+
10
+ validates :name, presence: true
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemNonInventory < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :pricetype
9
+ field :parent_ref
10
+
11
+ validates :name, presence: true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemOtherCharge < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :pricetype
9
+ field :sales_or_purchase
10
+
11
+ validates :sales_or_purchase, presence: true
12
+ validates :name, presence: true, length: { maximum: 41 }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemPayment < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :item_desc
9
+
10
+ validates :name, presence: true
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemService < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :price
9
+ field :sales_or_purchase
10
+
11
+ validates :name, presence: true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class ItemSubtotal < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :item_desc
9
+ field :bar_code
10
+
11
+ validates :name, presence: true
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class PurchaseOrder < Base
5
+
6
+ field :vendor_ref
7
+ field :purchase_order_line_add
8
+
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ module Qbwc
2
+ module Request
3
+ module V07
4
+ class Vendor < Base
5
+
6
+ field :name
7
+ field :is_active
8
+ field :company_name
9
+ field :salutation
10
+ field :first_name
11
+ field :middle_name
12
+ field :last_name
13
+ field :phone
14
+ field :email
15
+ field :contact
16
+ field :name_on_check
17
+ field :is_vendor_eligible_for_1099
18
+ field :open_balance
19
+
20
+ validates :name, presence: true
21
+
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,31 @@
1
+ module Qbwc
2
+ module XmlActions
3
+
4
+ def self.query req, max_returned
5
+ hash = {"qbxml"=>
6
+ {"xml_attributes"=>{},
7
+ "qbxml_msgs_rq"=>
8
+ {"xml_attributes"=>{"onError"=>"stopOnError"},
9
+ "#{req}"=>
10
+ {"xml_attributes"=>{},
11
+ "max_returned"=> max_returned}
12
+ }
13
+ }
14
+ }
15
+ to_xml(hash)
16
+ end
17
+
18
+ def self.header
19
+ {"qbxml"=>
20
+ {"xml_attributes"=>{}, "qbxml_msgs_rq"=>
21
+ {"xml_attributes"=>{"onError"=>"stopOnError"}}
22
+ }
23
+ }
24
+ end
25
+
26
+ def self.to_xml hash
27
+ "<?xml version='1.0' encoding='utf-8'?>#{Qbxml.new.to_qbxml(hash)}"
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ module QbwcRequests
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,7 @@
1
+ require "qbwc_requests/version"
2
+ require "active_model"
3
+ Dir["#{File.dirname(__FILE__)}/qbwc_requests/qbwc/**/*.rb"].each {|f| require f}
4
+
5
+ module QbwcRequests
6
+ # Your code goes here...
7
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'qbwc_requests/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "qbwc_requests"
8
+ spec.version = QbwcRequests::VERSION
9
+ spec.authors = ["Alexandre Mondaini Calvão"]
10
+ spec.email = ["apotema@gmail.com"]
11
+ spec.description = %q{A qbxml request generator}
12
+ spec.summary = %q{This gem helps you generate Qbxml requests}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" ?>
2
+ <!-- ========================================================================== -->
3
+ <!-- AccountQueryRq.xml -->
4
+ <!-- -->
5
+ <!-- INTUIT CONFIDENTIAL. -->
6
+ <!-- Copyright (c) 2001-2013 Intuit Inc. All rights reserved. -->
7
+ <!-- Use is subject to the terms specified at: -->
8
+ <!-- http://developer.intuit.com/legal/devsite_tos.html -->
9
+ <!-- -->
10
+ <!-- -->
11
+ <!-- ========================================================================== -->
12
+ <!-- Summary: Sample illustrating the account query request. -->
13
+ <!-- This XML file contains a single request to query accounts. -->
14
+ <!-- -->
15
+ <!-- Description: -->
16
+ <!-- This XML file contains a single request to query all accounts. It does not -->
17
+ <!-- filter the output so lots of accounts could cause this to be a bit slow. -->
18
+ <!-- ========================================================================== -->
19
+ <!-- Language: xml -->
20
+ <!-- Structure: QBXML -->
21
+ <!-- QuickBooks: any -->
22
+ <!-- Deployment: any -->
23
+ <!-- ========================================================================== -->
24
+ <?qbxml version="8.0"?>
25
+ <QBXML>
26
+ <QBXMLMsgsRq onError="stopOnError">
27
+ <AccountQueryRq requestID="1">
28
+ </AccountQueryRq>
29
+ </QBXMLMsgsRq>
30
+ </QBXML>
31
+
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" ?>
2
+ <!-- ========================================================================== -->
3
+ <!-- BillQueryRq.xml -->
4
+ <!-- -->
5
+ <!-- INTUIT CONFIDENTIAL. -->
6
+ <!-- Copyright (c) 2001-2013 Intuit Inc. All rights reserved. -->
7
+ <!-- Use is subject to the terms specified at: -->
8
+ <!-- http://developer.intuit.com/legal/devsite_tos.html -->
9
+ <!-- -->
10
+ <!-- -->
11
+ <!-- ========================================================================== -->
12
+ <!-- Summary: Sample illustrating the bill query request. -->
13
+ <!-- -->
14
+ <!-- Description: -->
15
+ <!-- This XML file contains a single request to query bills. -->
16
+ <!-- ========================================================================== -->
17
+ <!-- Language: xml -->
18
+ <!-- Structure: QBXML -->
19
+ <!-- QuickBooks: any -->
20
+ <!-- Deployment: any -->
21
+ <!-- ========================================================================== -->
22
+ <?qbxml version="8.0"?>
23
+ <QBXML>
24
+ <QBXMLMsgsRq onError="stopOnError">
25
+ <BillQueryRq requestID="1" />
26
+ </QBXMLMsgsRq>
27
+ </QBXML>
28
+
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" ?>
2
+ <!-- ========================================================================== -->
3
+ <!-- CheckQueryRq.xml -->
4
+ <!-- -->
5
+ <!-- INTUIT CONFIDENTIAL. -->
6
+ <!-- Copyright (c) 2001-2013 Intuit Inc. All rights reserved. -->
7
+ <!-- Use is subject to the terms specified at: -->
8
+ <!-- http://developer.intuit.com/legal/devsite_tos.html -->
9
+ <!-- -->
10
+ <!-- -->
11
+ <!-- ========================================================================== -->
12
+ <!-- Summary: Sample illustrating the check query request. -->
13
+ <!-- -->
14
+ <!-- Description: -->
15
+ <!-- This XML file contains a single request to query all checks. -->
16
+ <!-- ========================================================================== -->
17
+ <!-- Language: xml -->
18
+ <!-- Structure: QBXML -->
19
+ <!-- QuickBooks: any -->
20
+ <!-- Deployment: any -->
21
+ <!-- ========================================================================== -->
22
+ <?qbxml version="8.0"?>
23
+ <QBXML>
24
+ <QBXMLMsgsRq onError="stopOnError">
25
+ <CheckQueryRq requestID="1" />
26
+ </QBXMLMsgsRq>
27
+ </QBXML>
28
+
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" ?>
2
+ <!-- ========================================================================== -->
3
+ <!-- CompanyQueryRq.xml -->
4
+ <!-- -->
5
+ <!-- INTUIT CONFIDENTIAL. -->
6
+ <!-- Copyright (c) 2001-2013 Intuit Inc. All rights reserved. -->
7
+ <!-- Use is subject to the terms specified at: -->
8
+ <!-- http://developer.intuit.com/legal/devsite_tos.html -->
9
+ <!-- -->
10
+ <!-- -->
11
+ <!-- ========================================================================== -->
12
+ <!-- Summary: Sample illustrating the company query request. -->
13
+ <!-- -->
14
+ <!-- Description: -->
15
+ <!-- This XML file contains a single request to query all companies. -->
16
+ <!-- ========================================================================== -->
17
+ <!-- Language: xml -->
18
+ <!-- Structure: QBXML -->
19
+ <!-- QuickBooks: any -->
20
+ <!-- Deployment: any -->
21
+ <!-- ========================================================================== -->
22
+ <?qbxml version="8.0"?>
23
+ <QBXML>
24
+ <QBXMLMsgsRq onError="stopOnError">
25
+ <CompanyQueryRq requestID="1" />
26
+ </QBXMLMsgsRq>
27
+ </QBXML>
28
+