quickeebooks 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +18 -18
- data/README.md +9 -2
- data/Rakefile +1 -1
- data/lib/quickeebooks.rb +37 -1
- data/lib/quickeebooks/online/model/account.rb +12 -1
- data/lib/quickeebooks/online/model/company_meta_data.rb +30 -0
- data/lib/quickeebooks/online/model/credit_card.rb +14 -0
- data/lib/quickeebooks/online/model/credit_charge_info.rb +17 -0
- data/lib/quickeebooks/online/model/credit_charge_response.rb +13 -0
- data/lib/quickeebooks/online/model/customer.rb +13 -4
- data/lib/quickeebooks/online/model/id.rb +21 -0
- data/lib/quickeebooks/online/model/intuit_type.rb +17 -0
- data/lib/quickeebooks/online/model/invoice.rb +25 -2
- data/lib/quickeebooks/online/model/invoice_header.rb +4 -2
- data/lib/quickeebooks/online/model/invoice_line_item.rb +7 -6
- data/lib/quickeebooks/online/model/item.rb +8 -2
- data/lib/quickeebooks/online/model/payment.rb +58 -0
- data/lib/quickeebooks/online/model/payment_detail.rb +12 -0
- data/lib/quickeebooks/online/model/payment_header.rb +24 -0
- data/lib/quickeebooks/online/model/payment_line_item.rb +15 -0
- data/lib/quickeebooks/online/service/account.rb +5 -5
- data/lib/quickeebooks/online/service/company_meta_data.rb +24 -0
- data/lib/quickeebooks/online/service/customer.rb +5 -5
- data/lib/quickeebooks/online/service/invoice.rb +39 -10
- data/lib/quickeebooks/online/service/item.rb +5 -5
- data/lib/quickeebooks/online/service/payment.rb +63 -0
- data/lib/quickeebooks/online/service/service_base.rb +62 -31
- data/lib/quickeebooks/version.rb +1 -1
- data/lib/quickeebooks/windows/model/account.rb +7 -0
- data/lib/quickeebooks/windows/model/address.rb +8 -0
- data/lib/quickeebooks/windows/model/custom_field.rb +1 -1
- data/lib/quickeebooks/windows/model/customer.rb +12 -1
- data/lib/quickeebooks/windows/model/customer_msg.rb +31 -0
- data/lib/quickeebooks/windows/model/error.rb +19 -0
- data/lib/quickeebooks/windows/model/external_key.rb +21 -0
- data/lib/quickeebooks/windows/model/id.rb +21 -0
- data/lib/quickeebooks/windows/model/invoice.rb +10 -2
- data/lib/quickeebooks/windows/model/invoice_header.rb +13 -15
- data/lib/quickeebooks/windows/model/invoice_line_item.rb +7 -7
- data/lib/quickeebooks/windows/model/item.rb +6 -3
- data/lib/quickeebooks/windows/model/object_ref.rb +14 -0
- data/lib/quickeebooks/windows/model/other_name.rb +16 -0
- data/lib/quickeebooks/windows/model/other_name_id.rb +21 -0
- data/lib/quickeebooks/windows/model/rest_response.rb +34 -0
- data/lib/quickeebooks/windows/model/sales_rep.rb +40 -0
- data/lib/quickeebooks/windows/model/sales_tax.rb +33 -0
- data/lib/quickeebooks/windows/model/ship_method.rb +31 -0
- data/lib/quickeebooks/windows/model/success.rb +17 -0
- data/lib/quickeebooks/windows/model/vendor.rb +16 -0
- data/lib/quickeebooks/windows/model/vendor_id.rb +21 -0
- data/lib/quickeebooks/windows/service/customer.rb +1 -1
- data/lib/quickeebooks/windows/service/customer_msg.rb +15 -0
- data/lib/quickeebooks/windows/service/invoice.rb +19 -1
- data/lib/quickeebooks/windows/service/item.rb +1 -1
- data/lib/quickeebooks/windows/service/sales_rep.rb +16 -0
- data/lib/quickeebooks/windows/service/sales_tax.rb +15 -0
- data/lib/quickeebooks/windows/service/service_base.rb +47 -8
- data/lib/quickeebooks/windows/service/ship_method.rb +15 -0
- data/quickeebooks.gemspec +2 -1
- data/spec/quickeebooks/online/company_meta_data_spec.rb +30 -0
- data/spec/quickeebooks/online/invoice_spec.rb +2 -2
- data/spec/quickeebooks/online/payment_spec.rb +23 -0
- data/spec/quickeebooks/online/services/account_spec.rb +28 -20
- data/spec/quickeebooks/online/services/company_meta_data_spec.rb +40 -0
- data/spec/quickeebooks/online/services/customer_spec.rb +32 -28
- data/spec/quickeebooks/online/services/invoice_spec.rb +52 -0
- data/spec/quickeebooks/online/services/service_base_spec.rb +17 -7
- data/spec/quickeebooks/windows/services/customer_spec.rb +49 -0
- data/spec/quickeebooks/windows/services/invoice_spec.rb +133 -0
- data/spec/quickeebooks/windows/services/sales_rep_spec.rb +47 -0
- data/spec/quickeebooks/windows/services/sales_taxes_spec.rb +41 -0
- data/spec/quickeebooks/windows/services/ship_method_spec.rb +38 -0
- data/spec/quickeebooks_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/xml/online/api_error.xml +6 -0
- data/spec/xml/online/company_meta_data.xml +37 -0
- data/spec/xml/online/determine_base_url.xml +10 -0
- data/spec/xml/online/invoice.xml +26 -31
- data/spec/xml/online/payment.xml +24 -0
- data/spec/xml/windows/invoice_success_create.xml +11 -0
- data/spec/xml/windows/invoices.xml +436 -0
- data/spec/xml/windows/sales_reps.xml +204 -0
- data/spec/xml/windows/sales_taxes.xml +34 -0
- data/spec/xml/windows/ship_methods.xml +139 -0
- metadata +80 -22
@@ -17,34 +17,42 @@ module Quickeebooks
|
|
17
17
|
class ServiceBase
|
18
18
|
attr_accessor :realm_id
|
19
19
|
attr_accessor :oauth
|
20
|
-
|
20
|
+
attr_accessor :base_uri
|
21
21
|
|
22
22
|
QB_BASE_URI = "https://qbo.intuit.com/qbo1/rest/user/v2"
|
23
23
|
XML_NS = %{xmlns:ns2="http://www.intuit.com/sb/cdm/qbo" xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns3="http://www.intuit.com/sb/cdm"}
|
24
24
|
|
25
|
-
def initialize(
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
raise ArgumentError, "#{base_url} doesn't appear to be a valid host name!"
|
34
|
-
end
|
35
|
-
@base_uri = base_url
|
25
|
+
def initialize(oauth_access_token = nil, realm_id = nil)
|
26
|
+
if !oauth_access_token.nil? && !realm_id.nil?
|
27
|
+
msg = "Quickeebooks::Online::ServiceBase - "
|
28
|
+
msg += "This version of the constructor is deprecated. "
|
29
|
+
msg += "Use the no-arg constructor and set the AccessToken and the RealmID using the accessors."
|
30
|
+
warn(msg)
|
31
|
+
access_token = oauth_access_token
|
32
|
+
realm_id = realm_id
|
36
33
|
end
|
37
34
|
end
|
38
35
|
|
36
|
+
def access_token=(token)
|
37
|
+
@oauth = token
|
38
|
+
end
|
39
|
+
|
40
|
+
def realm_id=(realm_id)
|
41
|
+
@realm_id = realm_id
|
42
|
+
determine_base_url
|
43
|
+
end
|
44
|
+
|
45
|
+
def base_url=(uri)
|
46
|
+
@base_uri = uri
|
47
|
+
end
|
48
|
+
|
39
49
|
# Given a realm ID we need to determine the real Base URL
|
40
50
|
# to use for all subsequenet REST operations
|
41
51
|
# See: https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0400_QuickBooks_Online/0100_Calling_Data_Services/0010_Getting_the_Base_URL
|
42
52
|
def determine_base_url
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
doc = parse_xml(response.body)
|
47
|
-
element = doc.xpath("//qbo:QboUser/qbo:CurrentCompany/qbo:BaseURI")[0]
|
53
|
+
if service_response
|
54
|
+
if service_response.code == "200"
|
55
|
+
element = base_doc.xpath("//qbo:QboUser/qbo:CurrentCompany/qbo:BaseURI")[0]
|
48
56
|
if element
|
49
57
|
@base_uri = element.text
|
50
58
|
end
|
@@ -67,7 +75,29 @@ module Quickeebooks
|
|
67
75
|
"#{QB_BASE_URI}/#{@realm_id}"
|
68
76
|
end
|
69
77
|
|
78
|
+
# store service base response
|
79
|
+
# so it can be accessed by other methods
|
80
|
+
def service_response
|
81
|
+
@service_response ||= @oauth.request(:get, qb_base_uri_with_realm_id)
|
82
|
+
end
|
83
|
+
|
84
|
+
# allows for reuse of service base's xml doc
|
85
|
+
# rather than loading it each time we need it
|
86
|
+
def base_doc
|
87
|
+
@base_doc ||= parse_xml(service_response.body)
|
88
|
+
end
|
89
|
+
|
90
|
+
# gives us the qbo user's LoginName
|
91
|
+
# useful for verifying email address against
|
92
|
+
def login_name
|
93
|
+
@login_name ||= base_doc.xpath("//qbo:QboUser/qbo:LoginName")[0].text
|
94
|
+
end
|
95
|
+
|
70
96
|
private
|
97
|
+
|
98
|
+
def determined_base_url?
|
99
|
+
@base_uri != nil
|
100
|
+
end
|
71
101
|
|
72
102
|
def parse_xml(xml)
|
73
103
|
Nokogiri::XML(xml)
|
@@ -77,10 +107,10 @@ module Quickeebooks
|
|
77
107
|
%Q{<?xml version="1.0" encoding="utf-8"?>\n#{xml.strip}}
|
78
108
|
end
|
79
109
|
|
80
|
-
def fetch_collection(
|
81
|
-
raise ArgumentError, "missing resource to fetch" if resource.nil?
|
82
|
-
raise ArgumentError, "missing result container" if container.nil?
|
110
|
+
def fetch_collection(model, filters = [], page = 1, per_page = 20, sort = nil, options ={})
|
83
111
|
raise ArgumentError, "missing model to instantiate" if model.nil?
|
112
|
+
|
113
|
+
determine_base_url unless determined_base_url?
|
84
114
|
|
85
115
|
post_body_lines = []
|
86
116
|
|
@@ -97,7 +127,7 @@ module Quickeebooks
|
|
97
127
|
end
|
98
128
|
|
99
129
|
body = post_body_lines.join("&")
|
100
|
-
response = do_http_post(url_for_resource(
|
130
|
+
response = do_http_post(url_for_resource(model.resource_for_collection), body, {}, {'Content-Type' => 'application/x-www-form-urlencoded'})
|
101
131
|
if response
|
102
132
|
collection = Quickeebooks::Collection.new
|
103
133
|
xml = parse_xml(response.body)
|
@@ -105,14 +135,14 @@ module Quickeebooks
|
|
105
135
|
results = []
|
106
136
|
collection.count = xml.xpath("//qbo:SearchResults/qbo:Count")[0].text.to_i
|
107
137
|
if collection.count > 0
|
108
|
-
xml.xpath("//qbo:SearchResults/qbo:CdmCollections/xmlns:#{
|
138
|
+
xml.xpath("//qbo:SearchResults/qbo:CdmCollections/xmlns:#{model::XML_NODE}").each do |xa|
|
109
139
|
results << model.from_xml(xa)
|
110
140
|
end
|
111
141
|
end
|
112
142
|
collection.entries = results
|
113
143
|
collection.current_page = xml.xpath("//qbo:SearchResults/qbo:CurrentPage")[0].text.to_i
|
114
144
|
rescue => ex
|
115
|
-
log("Error parsing XML: #{ex.message}")
|
145
|
+
#log("Error parsing XML: #{ex.message}")
|
116
146
|
raise IntuitRequestException.new("Error parsing XML: #{ex.message}")
|
117
147
|
end
|
118
148
|
collection
|
@@ -121,25 +151,26 @@ module Quickeebooks
|
|
121
151
|
end
|
122
152
|
end
|
123
153
|
|
124
|
-
def do_http_post(
|
125
|
-
url = add_query_string_to_url(
|
126
|
-
do_http(:post,
|
154
|
+
def do_http_post(resource, body = "", params = {}, headers = {}) # throws IntuitRequestException
|
155
|
+
url = add_query_string_to_url(resource, params)
|
156
|
+
do_http(:post, resource, body, headers)
|
127
157
|
end
|
128
158
|
|
129
|
-
def do_http_get(
|
159
|
+
def do_http_get(resource, params = {}, headers = {}) # throws IntuitRequestException
|
130
160
|
url = add_query_string_to_url(url, params)
|
131
|
-
do_http(:get,
|
161
|
+
do_http(:get, resource, "", headers)
|
132
162
|
end
|
133
163
|
|
134
|
-
def do_http(method,
|
164
|
+
def do_http(method, resource, body, headers) # throws IntuitRequestException
|
135
165
|
unless headers.has_key?('Content-Type')
|
136
166
|
headers.merge!({'Content-Type' => 'application/xml'})
|
137
167
|
end
|
168
|
+
determine_base_url unless determined_base_url?
|
138
169
|
# puts "METHOD = #{method}"
|
139
170
|
# puts "URL = #{url}"
|
140
171
|
# puts "BODY = #{body == nil ? "<NIL>" : body}"
|
141
172
|
# puts "HEADERS = #{headers.inspect}"
|
142
|
-
response = @oauth.request(method,
|
173
|
+
response = @oauth.request(method, resource, body, headers)
|
143
174
|
check_response(response)
|
144
175
|
end
|
145
176
|
|
@@ -199,4 +230,4 @@ module Quickeebooks
|
|
199
230
|
end
|
200
231
|
end
|
201
232
|
end
|
202
|
-
end
|
233
|
+
end
|
data/lib/quickeebooks/version.rb
CHANGED
@@ -7,6 +7,13 @@ module Quickeebooks
|
|
7
7
|
module Model
|
8
8
|
class Account < Quickeebooks::Windows::Model::IntuitType
|
9
9
|
include ActiveModel::Validations
|
10
|
+
|
11
|
+
XML_COLLECTION_NODE = 'Accounts'
|
12
|
+
XML_NODE = 'Account'
|
13
|
+
|
14
|
+
# https://services.intuit.com/sb/account/v2/<realmID>
|
15
|
+
REST_RESOURCE = "account"
|
16
|
+
|
10
17
|
xml_convention :camelcase
|
11
18
|
xml_accessor :id, :from => 'Id'
|
12
19
|
xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
|
@@ -4,7 +4,7 @@ module Quickeebooks
|
|
4
4
|
module Windows
|
5
5
|
module Model
|
6
6
|
class CustomField < Quickeebooks::Windows::Model::IntuitType
|
7
|
-
xml_accessor :definition_id, :from => 'DefinitionId'
|
7
|
+
xml_accessor :definition_id, :from => 'DefinitionId', :as => Quickeebooks::Windows::Model::Id
|
8
8
|
xml_accessor :value, :from => 'Value'
|
9
9
|
xml_accessor :name, :from => 'Name'
|
10
10
|
end
|
@@ -18,8 +18,11 @@ module Quickeebooks
|
|
18
18
|
XML_COLLECTION_NODE = 'Customers'
|
19
19
|
XML_NODE = 'Customer'
|
20
20
|
|
21
|
+
# https://services.intuit.com/sb/customer/v2/<realmID>
|
22
|
+
REST_RESOURCE = "customer"
|
23
|
+
|
21
24
|
xml_convention :camelcase
|
22
|
-
xml_accessor :id, :from => 'Id'
|
25
|
+
xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
|
23
26
|
xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
|
24
27
|
xml_accessor :synchronized, :from => 'Synchronized'
|
25
28
|
xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
|
@@ -76,6 +79,14 @@ module Quickeebooks
|
|
76
79
|
active == 'true'
|
77
80
|
end
|
78
81
|
|
82
|
+
def billing_address
|
83
|
+
addresses.detect { |address| address.tag == "Billing" }
|
84
|
+
end
|
85
|
+
|
86
|
+
def shipping_address
|
87
|
+
addresses.detect { |address| address.tag == "Shipping" }
|
88
|
+
end
|
89
|
+
|
79
90
|
def has_required_attributes
|
80
91
|
if name.is_a?(String) && name.index(':') != nil
|
81
92
|
errors.add(:name, "Attribute :name cannot contain a colon")
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'quickeebooks'
|
2
|
+
require 'quickeebooks/windows/model/id'
|
3
|
+
require 'quickeebooks/windows/model/external_key'
|
4
|
+
require 'quickeebooks/windows/model/custom_field'
|
5
|
+
require 'quickeebooks/windows/model/meta_data'
|
6
|
+
|
7
|
+
module Quickeebooks
|
8
|
+
module Windows
|
9
|
+
module Model
|
10
|
+
class CustomerMsg < Quickeebooks::Windows::Model::IntuitType
|
11
|
+
|
12
|
+
XML_COLLECTION_NODE = 'CustomerMsgs'
|
13
|
+
XML_NODE = 'CustomerMsg'
|
14
|
+
|
15
|
+
# https://services.intuit.com/sb/customermsg/v2/<realmID>
|
16
|
+
REST_RESOURCE = "customermsg"
|
17
|
+
|
18
|
+
xml_convention :camelcase
|
19
|
+
xml_accessor :id, :as => Quickeebooks::Windows::Model::Id
|
20
|
+
xml_accessor :sync_token
|
21
|
+
xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
|
22
|
+
xml_accessor :external_key, :as => Quickeebooks::Windows::Model::ExternalKey
|
23
|
+
xml_accessor :synchronized
|
24
|
+
xml_accessor :custom_fields, :as => [Quickeebooks::Windows::Model::CustomField]
|
25
|
+
xml_accessor :name
|
26
|
+
xml_accessor :active
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "quickeebooks/windows/model/object_ref"
|
2
|
+
module Quickeebooks
|
3
|
+
module Windows
|
4
|
+
module Model
|
5
|
+
class Error < Quickeebooks::Windows::Model::IntuitType
|
6
|
+
|
7
|
+
xml_convention :camelcase
|
8
|
+
|
9
|
+
xml_accessor :request_id, :from => '@RequestId'
|
10
|
+
xml_accessor :object_ref, :as => Quickeebooks::Windows::Model::ObjectRef
|
11
|
+
xml_accessor :request_name
|
12
|
+
xml_accessor :processed_time, :as => Time
|
13
|
+
xml_accessor :code, :from => 'ErrorCode'
|
14
|
+
xml_accessor :desc, :from => 'ErrorDesc'
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "quickeebooks"
|
2
|
+
|
3
|
+
module Quickeebooks
|
4
|
+
module Windows
|
5
|
+
module Model
|
6
|
+
class ExternalKey < Quickeebooks::Windows::Model::IntuitType
|
7
|
+
|
8
|
+
DOMAIN = "QB"
|
9
|
+
|
10
|
+
xml_convention :camelcase
|
11
|
+
xml_accessor :idDomain, :from => '@idDomain' # Attribute with name 'idDomain'
|
12
|
+
xml_accessor :value, :from => :content
|
13
|
+
|
14
|
+
def initialize(value = nil)
|
15
|
+
self.idDomain = DOMAIN
|
16
|
+
self.value = value
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "quickeebooks"
|
2
|
+
|
3
|
+
module Quickeebooks
|
4
|
+
module Windows
|
5
|
+
module Model
|
6
|
+
class Id < Quickeebooks::Windows::Model::IntuitType
|
7
|
+
|
8
|
+
DOMAIN = "QB"
|
9
|
+
|
10
|
+
xml_convention :camelcase
|
11
|
+
xml_accessor :idDomain, :from => '@idDomain' # Attribute with name 'idDomain'
|
12
|
+
xml_accessor :value, :from => :content
|
13
|
+
|
14
|
+
def initialize(value = nil)
|
15
|
+
self.idDomain = DOMAIN
|
16
|
+
self.value = value
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'quickeebooks/windows/model/id'
|
1
2
|
require 'quickeebooks/windows/model/invoice_header'
|
2
3
|
require 'quickeebooks/windows/model/invoice_line_item'
|
3
4
|
require 'quickeebooks/windows/model/address'
|
@@ -9,8 +10,15 @@ module Quickeebooks
|
|
9
10
|
module Model
|
10
11
|
class Invoice < Quickeebooks::Windows::Model::IntuitType
|
11
12
|
include ActiveModel::Validations
|
13
|
+
|
14
|
+
XML_COLLECTION_NODE = 'Invoices'
|
15
|
+
XML_NODE = 'Invoice'
|
16
|
+
|
17
|
+
# https://services.intuit.com/sb/invoice/v2/<realmID>
|
18
|
+
REST_RESOURCE = "invoice"
|
19
|
+
|
12
20
|
xml_convention :camelcase
|
13
|
-
xml_accessor :id, :from => 'Id', :as =>
|
21
|
+
xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
|
14
22
|
xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
|
15
23
|
xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
|
16
24
|
xml_accessor :external_key, :from => 'ExternalKey'
|
@@ -27,7 +35,7 @@ module Quickeebooks
|
|
27
35
|
def initialize
|
28
36
|
ensure_line_items_initialization
|
29
37
|
end
|
30
|
-
|
38
|
+
|
31
39
|
private
|
32
40
|
|
33
41
|
def after_parse
|
@@ -14,26 +14,24 @@ module Quickeebooks
|
|
14
14
|
xml_accessor :msg, :from => 'Msg'
|
15
15
|
xml_accessor :note, :from => 'Note'
|
16
16
|
xml_accessor :status, :from => 'Status'
|
17
|
-
xml_accessor :customer_id, :from => 'CustomerId'
|
17
|
+
xml_accessor :customer_id, :from => 'CustomerId', :as => Quickeebooks::Windows::Model::Id
|
18
18
|
xml_accessor :customer_name, :from => 'CustomerName'
|
19
|
-
xml_accessor :job_id, :from => 'JobId'
|
19
|
+
xml_accessor :job_id, :from => 'JobId', :as => Quickeebooks::Windows::Model::Id
|
20
20
|
xml_accessor :job_name, :from => 'JobName'
|
21
|
-
xml_accessor :remit_to_id, :from => 'RemitToId'
|
21
|
+
xml_accessor :remit_to_id, :from => 'RemitToId', :as => Quickeebooks::Windows::Model::Id
|
22
22
|
xml_accessor :remit_to_name, :from => 'RemitToName'
|
23
|
-
xml_accessor :class_id, :from => 'ClassId'
|
23
|
+
xml_accessor :class_id, :from => 'ClassId', :as => Quickeebooks::Windows::Model::Id
|
24
24
|
xml_accessor :class_name, :from => 'ClassName'
|
25
|
-
xml_accessor :sales_rep_id, :from => 'SalesRepId'
|
25
|
+
xml_accessor :sales_rep_id, :from => 'SalesRepId', :as => Quickeebooks::Windows::Model::Id
|
26
26
|
xml_accessor :sales_rep_name, :from => 'SalesRepName'
|
27
|
-
xml_accessor :
|
28
|
-
xml_accessor :sales_rep_name, :from => 'SalesRepName'
|
29
|
-
xml_accessor :sales_tax_code_id, :from => 'SalesTaxCodeId'
|
27
|
+
xml_accessor :sales_tax_code_id, :from => 'SalesTaxCodeId', :as => Quickeebooks::Windows::Model::Id
|
30
28
|
xml_accessor :sales_tax_code_name, :from => 'SalesTaxCodeName'
|
31
29
|
xml_accessor :po_number, :from => 'PONumber'
|
32
30
|
xml_accessor :ship_date, :from => 'ShipDate', :as => Time
|
33
31
|
xml_accessor :sub_total_amount, :from => 'SubTotalAmt', :as => Float
|
34
|
-
xml_accessor :tax_id, :from => 'TaxId'
|
35
|
-
xml_accessor :tax_name, :from => 'TaxName'
|
36
|
-
xml_accessor :tax_group_id, :from => 'TaxGroupId'
|
32
|
+
xml_accessor :tax_id, :from => 'TaxId' # FEIN
|
33
|
+
xml_accessor :tax_name, :from => 'TaxName' # Business Name related to the FEIN
|
34
|
+
xml_accessor :tax_group_id, :from => 'TaxGroupId', :as => Quickeebooks::Windows::Model::Id
|
37
35
|
xml_accessor :tax_group_name, :from => 'TaxGroupName'
|
38
36
|
xml_accessor :tax_rate, :from => 'TaxRate', :as => Float
|
39
37
|
xml_accessor :tax_amount, :from => 'TaxAmt', :as => Float
|
@@ -41,17 +39,17 @@ module Quickeebooks
|
|
41
39
|
xml_accessor :to_be_printed, :from => 'ToBePrinted'
|
42
40
|
xml_accessor :to_be_emailed, :from => 'ToBeEmailed'
|
43
41
|
xml_accessor :custom, :from => 'Custom'
|
44
|
-
xml_accessor :ar_account_id, :from => 'ARAccountId'
|
42
|
+
xml_accessor :ar_account_id, :from => 'ARAccountId', :as => Quickeebooks::Windows::Model::Id
|
45
43
|
xml_accessor :ar_account_name, :from => 'ARAccountName'
|
46
|
-
xml_accessor :sales_term_id, :from => 'SalesTermId'
|
44
|
+
xml_accessor :sales_term_id, :from => 'SalesTermId', :as => Quickeebooks::Windows::Model::Id
|
47
45
|
xml_accessor :sales_term_name, :from => 'SalesTermName'
|
48
46
|
xml_accessor :due_date, :from => 'DueDate', :as => Time
|
49
47
|
xml_accessor :billing_address, :from => 'BillAddr', :as => Quickeebooks::Windows::Model::Address
|
50
48
|
xml_accessor :shipping_address, :from => 'ShipAddr', :as => Quickeebooks::Windows::Model::Address
|
51
49
|
xml_accessor :bill_email, :from => 'BillEmail'
|
52
|
-
xml_accessor :ship_method_id, :from => 'ShipMethodId'
|
50
|
+
xml_accessor :ship_method_id, :from => 'ShipMethodId', :as => Quickeebooks::Windows::Model::Id
|
53
51
|
xml_accessor :ship_method_name, :from => 'ShipMethodName'
|
54
|
-
xml_accessor :balance, :from => 'Balance'
|
52
|
+
xml_accessor :balance, :from => 'Balance', :as => Float
|
55
53
|
xml_accessor :discount_amount, :from => 'DiscountAmt', :as => Float
|
56
54
|
xml_accessor :discount_rate, :from => 'DiscountRate', :as => Float
|
57
55
|
xml_accessor :discount_account_id, :from => 'DiscountAccountId'
|
@@ -3,35 +3,35 @@ module Quickeebooks
|
|
3
3
|
module Model
|
4
4
|
class InvoiceLineItem < Quickeebooks::Windows::Model::IntuitType
|
5
5
|
xml_name 'Line'
|
6
|
-
xml_accessor :id, :from => 'Id'
|
6
|
+
xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
|
7
7
|
xml_accessor :desc, :from => 'Desc'
|
8
8
|
xml_accessor :group_member, :from => 'GroupMember'
|
9
9
|
xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
|
10
10
|
xml_accessor :amount, :from => 'Amount', :as => Float
|
11
|
-
xml_accessor :class_id, :from => 'ClassId'
|
11
|
+
xml_accessor :class_id, :from => 'ClassId', :as => Quickeebooks::Windows::Model::Id
|
12
12
|
xml_accessor :class_name, :from => 'ClassName'
|
13
13
|
xml_accessor :taxable, :from => 'Taxable'
|
14
|
-
xml_accessor :item_id, :from => 'ItemId'
|
14
|
+
xml_accessor :item_id, :from => 'ItemId', :as => Quickeebooks::Windows::Model::Id
|
15
15
|
xml_accessor :item_name, :from => 'ItemName'
|
16
16
|
xml_accessor :item_type, :from => 'ItemType'
|
17
17
|
xml_accessor :unit_price, :from => 'UnitPrice', :as => Float
|
18
18
|
xml_accessor :rate_percent, :from => 'RatePercent', :as => Float
|
19
|
-
xml_accessor :price_level_id, :from => 'PriceLevelId'
|
19
|
+
xml_accessor :price_level_id, :from => 'PriceLevelId', :as => Quickeebooks::Windows::Model::Id
|
20
20
|
xml_accessor :price_level_name, :from => 'PriceLevelName'
|
21
21
|
xml_accessor :uom_id, :from => 'UOMId'
|
22
22
|
xml_accessor :uom_abbrev, :from => 'UOMAbbrv'
|
23
23
|
xml_accessor :override_item_account_id, :from => 'OverrideItemAccountId'
|
24
24
|
xml_accessor :override_item_account_name, :from => 'OverrideItemAccountName'
|
25
|
-
xml_accessor :discount_id, :from => 'DiscountId'
|
25
|
+
xml_accessor :discount_id, :from => 'DiscountId', :as => Quickeebooks::Windows::Model::Id
|
26
26
|
xml_accessor :discount_name, :from => 'DiscountName'
|
27
27
|
xml_accessor :quantity, :from => 'Qty', :as => Float
|
28
|
-
xml_accessor :sales_tax_code_id, :from => 'SalesTaxCodeId'
|
28
|
+
xml_accessor :sales_tax_code_id, :from => 'SalesTaxCodeId', :as => Quickeebooks::Windows::Model::Id
|
29
29
|
xml_accessor :sales_tax_code_name, :from => 'SalesTaxCodeName'
|
30
30
|
xml_accessor :service_date, :from => 'ServiceDate', :as => Time
|
31
31
|
xml_accessor :custom1, :from => 'Custom1'
|
32
32
|
xml_accessor :custom2, :from => 'Custom2'
|
33
33
|
xml_accessor :txn_id, :from => 'TxnId'
|
34
|
-
xml_accessor :txn_line_id, :from => 'TxnLineId'
|
34
|
+
xml_accessor :txn_line_id, :from => 'TxnLineId', :as => Quickeebooks::Windows::Model::Id
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|