quickeebooks 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzYxYWEyZDlkYjBhMDk1OGY2ZDBlNDUxYTBkY2UwNDk3MzU2MGJjMQ==
4
+ Y2ExZWExMTliNjAzMWQ2YThiNmM5NGMyZDNjYTBhNzZkMWRjZjU5OQ==
5
5
  data.tar.gz: !binary |-
6
- MDE2ZWIzMDJhOGZiNGJhNTY3NTRlYzcwYTg3YzQ4MTk5YmUyZjVmOQ==
6
+ MDYxNjk0ZWU3NjFhOTIyNWQxNjkwYWQxOTA4ZGJiZWFlMzdmMTg3NA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWZlYzFiMmY3ZTQwMzIwN2UwMDZjYTlhNTU1MTQzM2Y2Y2I0ZGMyYWIxM2I2
10
- ZjIwM2YzNzBlYjQ4ZWE5OWUxMTNkYTA3ZDBhMTQ1YzEzNTEwNTJlOWMyODkz
11
- MTkyMWYxNDI2ZTA4Yjg0MjMzOTlkZDFmMzY3NTkyM2M1NDZjZDQ=
9
+ OTNjZGVmYmYyYjJjOWVmMmQ3NjQwMjgwZmZlZThkYjc3Yjg1YjM2M2ZlNDQ1
10
+ MWRkMTRlOTMzNDk3ZWUyYTFkMjRkYmJhNTkxOTU5OWJjOTBjMzlmMmE4NGU1
11
+ YjYzZDhjM2I3NjM1MTU1N2JiNWMwZmIwNzc1Y2NiMzE4MDA0YzI=
12
12
  data.tar.gz: !binary |-
13
- ZTQ5ZDQ5OGI0OWMyZGVhNTY4YmQyYzc2MjFlMWFhZWM3YWMzMjcyNzYwMTEx
14
- ZWI2NWYzZGEzZTI3M2NhMDBkNDhkMTAyMzEwOWE0NDRhNDVlNDMwY2NhZmFj
15
- NjRlMjMwOGQyOGYwNTQzMzNiYTdjYTI3YThjZjNhOGZiMmIyNjk=
13
+ N2RiNTMyYmIzN2QxYTc5MWQ2NzBkNTNjNGE5ZGY2NTc3MzllNDE3MDc5NDhm
14
+ NjE4MGU0ZTlhNzFiMjBkYzM2ZDNhOTVkOWFiZTA0NjJjYzM3NjZmMWM4ZGY0
15
+ ZDdjN2U1YjMwMGQxMGVmZTliY2UwNmZmYzMwMWI1NDc3YTE1N2I=
@@ -94,6 +94,7 @@ require 'quickeebooks/online/model/invoice'
94
94
  require 'quickeebooks/online/model/invoice_header'
95
95
  require 'quickeebooks/online/model/invoice_line_item'
96
96
  require 'quickeebooks/online/model/item'
97
+ require 'quickeebooks/online/model/job'
97
98
  require 'quickeebooks/online/model/unit_price'
98
99
  require 'quickeebooks/online/model/meta_data'
99
100
  require 'quickeebooks/online/model/price'
@@ -102,6 +103,7 @@ require 'quickeebooks/online/model/payment'
102
103
  require 'quickeebooks/online/model/payment_header'
103
104
  require 'quickeebooks/online/model/payment_line_item'
104
105
  require 'quickeebooks/online/model/payment_detail'
106
+ require 'quickeebooks/online/model/payment_method'
105
107
  require 'quickeebooks/online/model/credit_card'
106
108
  require 'quickeebooks/online/model/credit_charge_info'
107
109
  require 'quickeebooks/online/model/credit_charge_response'
@@ -133,8 +135,10 @@ require 'quickeebooks/online/service/bill'
133
135
  require 'quickeebooks/online/service/bill_payment'
134
136
  require 'quickeebooks/online/service/invoice'
135
137
  require 'quickeebooks/online/service/item'
138
+ require 'quickeebooks/online/service/job'
136
139
  require 'quickeebooks/online/service/entitlement'
137
140
  require 'quickeebooks/online/service/payment'
141
+ require 'quickeebooks/online/service/payment_method'
138
142
  require 'quickeebooks/online/service/access_token'
139
143
  require 'quickeebooks/online/service/vendor'
140
144
  require 'quickeebooks/online/service/sales_receipt'
@@ -0,0 +1,47 @@
1
+ require "quickeebooks"
2
+ require "quickeebooks/online/model/id"
3
+ require "quickeebooks/online/model/meta_data"
4
+ require "quickeebooks/online/model/address"
5
+ require "quickeebooks/online/model/phone"
6
+ require "quickeebooks/online/model/web_site"
7
+ require "quickeebooks/online/model/email"
8
+ require "quickeebooks/online/model/note"
9
+ require "quickeebooks/online/model/customer_custom_field"
10
+ require "quickeebooks/online/model/open_balance"
11
+ require "quickeebooks/common/online_entity_model"
12
+
13
+ module Quickeebooks
14
+ module Online
15
+ module Model
16
+ class Job < Quickeebooks::Online::Model::IntuitType
17
+ include ActiveModel::Validations
18
+ include OnlineEntityModel
19
+ include Quickeebooks::Model::Addressable
20
+
21
+ XML_NODE = "Job"
22
+ REST_RESOURCE = "job"
23
+
24
+ xml_accessor :notes, :from => 'Notes', :as => [Quickeebooks::Online::Model::Note]
25
+ xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Online::Model::CustomerCustomField]
26
+ xml_accessor :paymethod_method_id, :from => 'PaymentMethodId', :as => Quickeebooks::Online::Model::Id
27
+ xml_accessor :payment_method_name, :from => 'PaymentMethodName'
28
+ xml_accessor :customer_id, :from => 'CustomerId', :as => Quickeebooks::Online::Model::Id
29
+ xml_accessor :customer_name, :from => 'CustomerName'
30
+ xml_accessor :job_parent_id, :from => 'JobParentId', :as => Quickeebooks::Online::Model::Id
31
+ xml_accessor :job_parent_name, :from => 'JobParentName'
32
+
33
+ validates_length_of :name, :minimum => 1
34
+ validate :require_a_customer
35
+
36
+ private
37
+
38
+ def require_a_customer
39
+ if customer_id.nil?
40
+ errors.add(:customer_id, "Must provide a Customer ID.")
41
+ end
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,27 @@
1
+ module Quickeebooks
2
+ module Online
3
+ module Model
4
+ class PaymentMethod < Quickeebooks::Online::Model::IntuitType
5
+ include ActiveModel::Validations
6
+
7
+ XML_COLLECTION_NODE = 'PaymentMethods'
8
+ XML_NODE = 'PaymentMethod'
9
+
10
+ # https://qbo.sbfinance.intuit.com/resource/payment-methods/v2/<realmID>
11
+ REST_RESOURCE = "payment-method"
12
+
13
+ xml_name 'PaymentMethod'
14
+ xml_convention :camelcase
15
+ xml_accessor :id, :from => 'Id', :as => Quickeebooks::Online::Model::Id
16
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
17
+ xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Online::Model::MetaData
18
+ xml_accessor :external_key, :from => 'ExternalKey'
19
+ xml_accessor :name, :from => 'Name'
20
+ xml_accessor :active, :from => 'Active'
21
+ xml_accessor :type, :from => 'Type'
22
+
23
+ validates_length_of :name, :minimum => 1
24
+ end
25
+ end
26
+ end
27
+ end
@@ -6,6 +6,10 @@ module Quickeebooks
6
6
  class WebSite < Quickeebooks::Online::Model::IntuitType
7
7
  xml_accessor :uri, :from => 'URI'
8
8
 
9
+ def initialize(uri = nil)
10
+ self.uri = uri if uri
11
+ end
12
+
9
13
  def to_xml(options = {})
10
14
  return "" if uri.to_s.empty?
11
15
  super(options)
@@ -0,0 +1,13 @@
1
+ require 'quickeebooks/online/service/service_base'
2
+ require 'quickeebooks/common/service_crud'
3
+ require 'nokogiri'
4
+
5
+ module Quickeebooks
6
+ module Online
7
+ module Service
8
+ class Job < ServiceBase
9
+ include ServiceCRUD
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ require 'quickeebooks/online/model/payment_method'
2
+ require 'quickeebooks/online/service/service_base'
3
+
4
+ module Quickeebooks
5
+ module Online
6
+ module Service
7
+ class PaymentMethod < ServiceBase
8
+ include ServiceCRUD
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Quickeebooks
2
2
 
3
- VERSION = "0.1.19"
3
+ VERSION = "0.1.20"
4
4
 
5
5
  end
@@ -9,66 +9,80 @@ require "quickeebooks/windows/model/custom_field"
9
9
 
10
10
 
11
11
  module Quickeebooks
12
- module Windows
13
- module Model
14
- class Employee < Quickeebooks::Windows::Model::IntuitType
12
+ module Windows
13
+ module Model
14
+ class Employee < Quickeebooks::Windows::Model::IntuitType
15
+ include ActiveModel::Validations
15
16
 
16
- XML_COLLECTION_NODE = 'Employees'
17
- XML_NODE = 'Employee'
18
-
19
- # https://services.intuit.com/sb/employee/v2/<realmID>
20
- REST_RESOURCE = "employee"
21
-
22
- xml_convention :camelcase
23
- xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
24
- xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
25
- xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
26
- xml_accessor :external_key, :from => 'ExternalKey'
27
- xml_accessor :synchronized, :from => 'Synchronized'
28
- xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
29
- xml_accessor :draft
30
- xml_accessor :object_state, :from => 'ObjectState'
31
- xml_accessor :party_reference_id, :from => 'PartyReferenceId'
32
- xml_accessor :type_of, :from => 'TypeOf'
33
- xml_accessor :name, :from => 'Name'
34
- xml_accessor :addresses, :from => 'Address', :as => [Quickeebooks::Windows::Model::Address]
35
- xml_accessor :phone, :from => 'Phone', :as => [Quickeebooks::Windows::Model::Phone]
36
- xml_accessor :web_site, :from => 'WebSite', :as => Quickeebooks::Windows::Model::WebSite
37
- xml_accessor :email, :from => 'Email', :as => Quickeebooks::Windows::Model::Email
38
- xml_accessor :title, :from => 'Title'
39
- xml_accessor :given_name, :from => 'GivenName'
40
- xml_accessor :middle_name, :from => 'MiddleName'
41
- xml_accessor :family_name, :from => 'FamilyName'
42
- xml_accessor :suffix, :from => 'Suffix'
43
- xml_accessor :gender, :from => 'Gender'
44
- xml_accessor :dba_name, :from => 'DBAName'
45
- xml_accessor :tax_identifier, :from => 'TaxIdentifier'
46
- xml_accessor :notes, :from => 'Note', :as => [Quickeebooks::Windows::Model::Note]
47
- xml_accessor :active, :from => 'Active'
48
- xml_accessor :show_as, :from => 'ShowAs'
49
- xml_accessor :employee_type, :from => 'EmployeeType'
50
- xml_accessor :hired_date, :from => 'HiredDate'
51
- xml_accessor :released_date, :from => 'ReleasedDate'
52
- xml_accessor :use_time_entry, :from => 'UseTimeEntry'
53
-
54
- def address=(address)
55
- self.addresses ||= []
56
- self.addresses << address
57
- end
17
+ XML_COLLECTION_NODE = 'Employees'
18
+ XML_NODE = 'Employee'
58
19
 
59
- def billing_address
60
- addresses.detect { |address| address.tag == "Billing" }
61
- end
20
+ # https://services.intuit.com/sb/employee/v2/<realmID>
21
+ REST_RESOURCE = "employee"
62
22
 
63
- def shipping_address
64
- addresses.detect { |address| address.tag == "Shipping" }
65
- end
23
+ xml_convention :camelcase
24
+ xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
25
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
26
+ xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
27
+ xml_accessor :external_key, :from => 'ExternalKey'
28
+ xml_accessor :synchronized, :from => 'Synchronized'
29
+ xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
30
+ xml_accessor :draft
31
+ xml_accessor :object_state, :from => 'ObjectState'
32
+ xml_accessor :party_reference_id, :from => 'PartyReferenceId'
33
+ xml_accessor :type_of, :from => 'TypeOf'
34
+ xml_accessor :name, :from => 'Name'
35
+ xml_accessor :addresses, :from => 'Address', :as => [Quickeebooks::Windows::Model::Address]
36
+ xml_accessor :phone, :from => 'Phone', :as => Quickeebooks::Windows::Model::Phone
37
+ xml_accessor :web_site, :from => 'WebSite', :as => Quickeebooks::Windows::Model::WebSite
38
+ xml_accessor :email, :from => 'Email', :as => Quickeebooks::Windows::Model::Email
39
+ xml_accessor :title, :from => 'Title'
40
+ xml_accessor :given_name, :from => 'GivenName'
41
+ xml_accessor :middle_name, :from => 'MiddleName'
42
+ xml_accessor :family_name, :from => 'FamilyName'
43
+ xml_accessor :suffix, :from => 'Suffix'
44
+ xml_accessor :gender, :from => 'Gender'
45
+ xml_accessor :dba_name, :from => 'DBAName'
46
+ xml_accessor :tax_identifier, :from => 'TaxIdentifier'
47
+ xml_accessor :notes, :from => 'Note', :as => [Quickeebooks::Windows::Model::Note]
48
+ xml_accessor :active, :from => 'Active'
49
+ xml_accessor :show_as, :from => 'ShowAs'
50
+ xml_accessor :employee_type, :from => 'EmployeeType'
51
+ xml_accessor :hired_date, :from => 'HiredDate'
52
+ xml_accessor :released_date, :from => 'ReleasedDate'
53
+ xml_accessor :use_time_entry, :from => 'UseTimeEntry'
66
54
 
67
- end
68
- end
69
- end
70
- end
55
+ validates_length_of :name, :minimum => 1
56
+ validate :name_cannot_contain_invalid_characters
57
+
58
+ def valid_for_create?
59
+ valid?
60
+ if type_of.nil?
61
+ errors.add(:type_of, "Missing required attribute TypeOf for Create")
62
+ end
63
+ errors.empty?
64
+ end
65
+
66
+ def name_cannot_contain_invalid_characters
67
+ if name.to_s.index(':')
68
+ errors.add(:name, "Name cannot contain a colon (:)")
69
+ end
70
+ end
71
71
 
72
+ def address=(address)
73
+ self.addresses ||= []
74
+ self.addresses << address
75
+ end
72
76
 
77
+ def billing_address
78
+ addresses.detect { |address| address.tag == "Billing" }
79
+ end
73
80
 
74
-
81
+ def shipping_address
82
+ addresses.detect { |address| address.tag == "Shipping" }
83
+ end
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -11,56 +11,69 @@ require "quickeebooks/windows/model/time_activity_vendor"
11
11
 
12
12
 
13
13
  module Quickeebooks
14
- module Windows
15
- module Model
16
- class TimeActivity < Quickeebooks::Windows::Model::IntuitType
14
+ module Windows
15
+ module Model
16
+ class TimeActivity < Quickeebooks::Windows::Model::IntuitType
17
+ include ActiveModel::Validations
17
18
 
18
- XML_COLLECTION_NODE = 'TimeActivities'
19
- XML_NODE = 'TimeActivity'
20
-
21
- # https://services.intuit.com/sb/timeactivity/v2/<realmID>
22
- REST_RESOURCE = "timeactivity"
23
-
24
- xml_convention :camelcase
25
- xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
26
- xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
27
- xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
28
- xml_accessor :external_key, :from => 'ExternalKey'
29
- xml_accessor :synchronized, :from => 'Synchronized'
30
- xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
31
- xml_accessor :draft
32
- xml_accessor :object_state, :from => 'ObjectState'
33
- xml_accessor :txn_date, :from => 'TxnDate'
34
- xml_accessor :name_of, :from => 'NameOf'
35
- xml_accessor :employee, :from => 'Employee', :as => Quickeebooks::Windows::Model::TimeActivityEmployee
36
- xml_accessor :vendor, :from => 'Vendor', :as => Quickeebooks::Windows::Model::TimeActivityVendor
37
- xml_accessor :customer_id, :from => 'CustomerId'
38
- xml_accessor :customer_name, :from => 'CustomerName'
39
- xml_accessor :job_id, :from => 'JobId', :as => Quickeebooks::Windows::Model::Id
40
- xml_accessor :job_name, :from => 'JobName'
41
- xml_accessor :item_id, :from => 'ItemId', :as => Quickeebooks::Windows::Model::Id
42
- xml_accessor :item_name, :from => 'ItemName'
43
- xml_accessor :item_type, :from => 'ItemType'
44
- xml_accessor :class_id, :from => 'ClassId', :as => Quickeebooks::Windows::Model::Id
45
- xml_accessor :pay_item_id, :from => 'PayItemId', :as => Quickeebooks::Windows::Model::Id
46
- xml_accessor :pay_item_name, :from => 'PayItemName'
47
- xml_accessor :billable_status, :from => 'BillableStatus'
48
- xml_accessor :taxable, :from => 'Taxable'
49
- xml_accessor :hourly_rate, :from => 'HourlyRate'
50
- xml_accessor :hours, :from => 'Hours'
51
- xml_accessor :minutes, :from => 'Minutes'
52
- xml_accessor :seconds, :from => 'Seconds'
53
- xml_accessor :break_hours, :from => 'BreakHours'
54
- xml_accessor :break_minutes, :from => 'BreakMinutes'
55
- xml_accessor :start_time, :from => 'StartTime'
56
- xml_accessor :end_time, :from => 'EndTime'
57
- xml_accessor :description, :from => 'Description'
19
+ XML_COLLECTION_NODE = 'TimeActivities'
20
+ XML_NODE = 'TimeActivity'
58
21
 
59
- end
60
- end
61
- end
62
- end
22
+ # https://services.intuit.com/sb/timeactivity/v2/<realmID>
23
+ REST_RESOURCE = "timeactivity"
24
+
25
+ xml_convention :camelcase
26
+ xml_accessor :id, :from => 'Id', :as => Quickeebooks::Windows::Model::Id
27
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
28
+ xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
29
+ xml_accessor :external_key, :from => 'ExternalKey'
30
+ xml_accessor :synchronized, :from => 'Synchronized'
31
+ xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
32
+ xml_accessor :draft
33
+ xml_accessor :object_state, :from => 'ObjectState'
34
+ xml_accessor :txn_date, :from => 'TxnDate'
35
+ xml_accessor :name_of, :from => 'NameOf'
36
+ xml_accessor :employee, :from => 'Employee', :as => Quickeebooks::Windows::Model::TimeActivityEmployee
37
+ xml_accessor :vendor, :from => 'Vendor', :as => Quickeebooks::Windows::Model::TimeActivityVendor
38
+ xml_accessor :customer_id, :from => 'CustomerId'
39
+ xml_accessor :customer_name, :from => 'CustomerName'
40
+ xml_accessor :job_id, :from => 'JobId', :as => Quickeebooks::Windows::Model::Id
41
+ xml_accessor :job_name, :from => 'JobName'
42
+ xml_accessor :item_id, :from => 'ItemId', :as => Quickeebooks::Windows::Model::Id
43
+ xml_accessor :item_name, :from => 'ItemName'
44
+ xml_accessor :item_type, :from => 'ItemType'
45
+ xml_accessor :class_id, :from => 'ClassId', :as => Quickeebooks::Windows::Model::Id
46
+ xml_accessor :pay_item_id, :from => 'PayItemId', :as => Quickeebooks::Windows::Model::Id
47
+ xml_accessor :pay_item_name, :from => 'PayItemName'
48
+ xml_accessor :billable_status, :from => 'BillableStatus'
49
+ xml_accessor :taxable, :from => 'Taxable'
50
+ xml_accessor :hourly_rate, :from => 'HourlyRate'
51
+ xml_accessor :hours, :from => 'Hours'
52
+ xml_accessor :minutes, :from => 'Minutes'
53
+ xml_accessor :seconds, :from => 'Seconds'
54
+ xml_accessor :break_hours, :from => 'BreakHours'
55
+ xml_accessor :break_minutes, :from => 'BreakMinutes'
56
+ xml_accessor :start_time, :from => 'StartTime'
57
+ xml_accessor :end_time, :from => 'EndTime'
58
+ xml_accessor :description, :from => 'Description'
63
59
 
60
+ validates_inclusion_of :name_of, :in => %w(Employee Vendor)
61
+ validates_inclusion_of :billable_status, :in => %w(Billable NotBillable HasBeenBilled),
62
+ :allow_blank => true
63
+ validate :duration_is_set
64
64
 
65
+ def valid_for_create?
66
+ valid?
67
+ errors.empty?
68
+ end
65
69
 
66
-
70
+ def duration_is_set
71
+ unless (self.hours || self.minutes || self.seconds)
72
+ errors.add(:base, 'A duration is required')
73
+ end
74
+ end
75
+
76
+ end
77
+ end
78
+ end
79
+ end
@@ -9,6 +9,10 @@ module Quickeebooks
9
9
  xml_accessor :tag, :from => 'Tag'
10
10
  xml_accessor :default, :from => 'Default'
11
11
 
12
+ def initialize(uri = nil)
13
+ self.uri = uri if uri
14
+ end
15
+
12
16
  def to_xml(options = {})
13
17
  return "" if uri.to_s.empty?
14
18
  end
@@ -8,7 +8,20 @@ module Quickeebooks
8
8
  def list(filters = [], page = 1, per_page = 20, sort = nil, options = {})
9
9
  fetch_collection(Quickeebooks::Windows::Model::Employee, nil, filters, page, per_page, sort, options)
10
10
  end
11
+
12
+ def create(employee)
13
+ raise InvalidModelException unless employee.valid_for_create?
14
+
15
+ # XML is a wrapped 'object' where the type is specified as an attribute
16
+ # <Object xsi:type="Invoice">
17
+ xml_node = employee.to_xml(:name => 'Object')
18
+ xml_node.set_attribute('xsi:type', 'Employee')
19
+ xml = Quickeebooks::Shared::Service::OperationNode.new.add do |content|
20
+ content << "<ExternalRealmId>#{self.realm_id}</ExternalRealmId>#{xml_node}"
21
+ end
22
+ perform_write(Quickeebooks::Windows::Model::Employee, xml)
23
+ end
11
24
  end
12
25
  end
13
26
  end
14
- end
27
+ end
@@ -10,7 +10,20 @@ module Quickeebooks
10
10
  fetch_collection(Quickeebooks::Windows::Model::TimeActivity, nil, filters, page, per_page, sort, options)
11
11
  end
12
12
 
13
+ def create(time_activity)
14
+ raise InvalidModelException unless time_activity.valid_for_create?
15
+
16
+ # XML is a wrapped 'object' where the type is specified as an attribute
17
+ # <Object xsi:type="Invoice">
18
+ xml_node = time_activity.to_xml(:name => 'Object')
19
+ xml_node.set_attribute('xsi:type', 'TimeActivity')
20
+ xml = Quickeebooks::Shared::Service::OperationNode.new.add do |content|
21
+ content << "<ExternalRealmId>#{self.realm_id}</ExternalRealmId>#{xml_node}"
22
+ end
23
+ perform_write(Quickeebooks::Windows::Model::TimeActivity, xml)
24
+ end
25
+
13
26
  end
14
27
  end
15
28
  end
16
- end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickeebooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-12 00:00:00.000000000 Z
11
+ date: 2013-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roxml
@@ -202,6 +202,7 @@ files:
202
202
  - lib/quickeebooks/online/model/invoice_header.rb
203
203
  - lib/quickeebooks/online/model/invoice_line_item.rb
204
204
  - lib/quickeebooks/online/model/item.rb
205
+ - lib/quickeebooks/online/model/job.rb
205
206
  - lib/quickeebooks/online/model/journal_entry.rb
206
207
  - lib/quickeebooks/online/model/journal_entry_header.rb
207
208
  - lib/quickeebooks/online/model/journal_entry_line_item.rb
@@ -212,6 +213,7 @@ files:
212
213
  - lib/quickeebooks/online/model/payment_detail.rb
213
214
  - lib/quickeebooks/online/model/payment_header.rb
214
215
  - lib/quickeebooks/online/model/payment_line_item.rb
216
+ - lib/quickeebooks/online/model/payment_method.rb
215
217
  - lib/quickeebooks/online/model/phone.rb
216
218
  - lib/quickeebooks/online/model/price.rb
217
219
  - lib/quickeebooks/online/model/purchase_cost.rb
@@ -237,9 +239,11 @@ files:
237
239
  - lib/quickeebooks/online/service/filter.rb
238
240
  - lib/quickeebooks/online/service/invoice.rb
239
241
  - lib/quickeebooks/online/service/item.rb
242
+ - lib/quickeebooks/online/service/job.rb
240
243
  - lib/quickeebooks/online/service/journal_entry.rb
241
244
  - lib/quickeebooks/online/service/pagination.rb
242
245
  - lib/quickeebooks/online/service/payment.rb
246
+ - lib/quickeebooks/online/service/payment_method.rb
243
247
  - lib/quickeebooks/online/service/sales_receipt.rb
244
248
  - lib/quickeebooks/online/service/service_base.rb
245
249
  - lib/quickeebooks/online/service/sort.rb