quickbooks-ruby 0.2.1 → 0.2.2

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: ca953110f19adc2d6eaac99ad1d2b78e3afee201
4
- data.tar.gz: aab52b8a7cb8074d1525c51620328d18690d55fb
3
+ metadata.gz: fc2f4401510ff725d9f746e57a8de1d4931da81d
4
+ data.tar.gz: c5e667d5a6a04b855e3dd09ef18aad5c5aa9a8cd
5
5
  SHA512:
6
- metadata.gz: 82b7cca62afb14e5f94b6d7e8c2b223ef6012cc817b01626528845caf2584c1ea045e5218c115e123357f0f6eecadc1055621f83305f0545cba7f1c27e7e843e
7
- data.tar.gz: 2b8b39f095192c215fab751ae1ccc23dba5faae48c1963d92d7bb52c3bec4efb74a6e2f2ccab626c8e29f9285a47eddc7b3e0e5b71be5999ef248b6e08071185
6
+ metadata.gz: 4e64551e8c02a945d1f58a0de0d8593ec495bb2a5f53ed2f20054d3ae55a22f7c4289b6872d4d77e26bdeaf8cf8098132927685698c009433686fac7a9887686
7
+ data.tar.gz: 57d7788ccbf821a300a35e490068c840f9cb1ce2b6ed49e509b66ae4922ba2f93774ad6ddd2d6ae45d50f753ce1b0c1a9f71179852688da21d7d28c298be8935
@@ -45,6 +45,8 @@ require 'quickbooks/model/journal_entry_line_detail'
45
45
  require 'quickbooks/model/line'
46
46
  require 'quickbooks/model/journal_entry'
47
47
  require 'quickbooks/model/item'
48
+ require 'quickbooks/model/budget_line_item'
49
+ require 'quickbooks/model/budget'
48
50
  require 'quickbooks/model/account'
49
51
  require 'quickbooks/model/check_payment'
50
52
  require 'quickbooks/model/deposit_line_detail'
@@ -112,6 +114,7 @@ require 'quickbooks/service/department'
112
114
  require 'quickbooks/service/invoice'
113
115
  require 'quickbooks/service/deposit'
114
116
  require 'quickbooks/service/item'
117
+ require 'quickbooks/service/budget'
115
118
  require 'quickbooks/service/journal_entry'
116
119
  require 'quickbooks/service/sales_receipt'
117
120
  require 'quickbooks/service/account'
@@ -4,7 +4,7 @@ require 'quickbooks/model/custom_field'
4
4
  module Quickbooks
5
5
  module Model
6
6
  class AttachableRef < BaseModel
7
- xml_accessor :entity_ref, :as => EntityRef
7
+ xml_accessor :entity_ref, :as => BaseReference
8
8
  xml_accessor :line_info
9
9
  xml_accessor :include_on_send?
10
10
  xml_accessor :inactive?
@@ -19,4 +19,4 @@ module Quickbooks
19
19
 
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -1,6 +1,8 @@
1
1
  module Quickbooks
2
2
  module Model
3
3
  class BillPayment < BaseModel
4
+ include HasLineItems
5
+
4
6
  XML_COLLECTION_NODE = "BillPayment"
5
7
  XML_NODE = "BillPayment"
6
8
  REST_RESOURCE = 'billpayment'
@@ -0,0 +1,27 @@
1
+ module Quickbooks
2
+ module Model
3
+ class Budget < BaseModel
4
+ include HasLineItems
5
+
6
+ XML_COLLECTION_NODE = "Budget"
7
+ XML_NODE = "Budget"
8
+ REST_RESOURCE = 'budget'
9
+
10
+ xml_name XML_NODE
11
+
12
+ xml_accessor :id, :from => 'Id'
13
+ xml_accessor :name, :from => 'Name'
14
+ xml_accessor :type, :from => 'BudgetType'
15
+ xml_accessor :entry_type, :from => 'BudgetEntryType'
16
+ xml_accessor :start_date, :from => 'StartDate'
17
+ xml_accessor :end_date, :from => 'EndDate'
18
+ xml_accessor :active?, :from => 'Active'
19
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
20
+ xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
21
+
22
+ xml_accessor :line_items, :from => 'BudgetDetail', :as => [BudgetLineItem]
23
+
24
+ reference_setters
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,15 @@
1
+ module Quickbooks
2
+ module Model
3
+ class BudgetLineItem < BaseModel
4
+
5
+ xml_accessor :date, :from => 'BudgetDate', :as => Date
6
+ xml_accessor :amount, :from => 'Amount'
7
+ xml_accessor :account_ref, :from => 'AccountRef', :as => BaseReference
8
+ xml_accessor :customer_ref, :from => 'CustomerRef', :as => BaseReference
9
+ xml_accessor :class_ref, :from => 'ClassRef', :as => BaseReference
10
+ xml_accessor :department_ref, :from => 'DepartmentRef', :as => BaseReference
11
+
12
+ reference_setters
13
+ end
14
+ end
15
+ end
@@ -1,6 +1,8 @@
1
1
  module Quickbooks
2
2
  module Model
3
3
  class GroupLineDetail < BaseModel
4
+ include HasLineItems
5
+
4
6
  xml_accessor :group_item_ref, :from => 'CustomerRef', :as => BaseReference
5
7
  xml_accessor :quantity, :from => 'Quantity', :as => BigDecimal, :to_xml => to_xml_big_decimal
6
8
  xml_accessor :line_items, :from => 'Line', :as => [Line]
@@ -13,6 +13,7 @@ module Quickbooks
13
13
  module Model
14
14
  class Purchase < BaseModel
15
15
  include GlobalTaxCalculation
16
+ include HasLineItems
16
17
 
17
18
  #== Constants
18
19
  REST_RESOURCE = 'purchase'
@@ -44,6 +45,9 @@ module Quickbooks
44
45
 
45
46
  reference_setters
46
47
 
48
+ #== Validations
49
+ validate :line_item_size
50
+
47
51
  #== This adds aliases for backwards compatability to old attributes names
48
52
  alias_method :total_amount, :total
49
53
  alias_method :total_amount=, :total=
@@ -2,6 +2,7 @@ module Quickbooks
2
2
  module Model
3
3
  class PurchaseOrder < BaseModel
4
4
  include GlobalTaxCalculation
5
+ include HasLineItems
5
6
 
6
7
  #== Constants
7
8
  REST_RESOURCE = 'purchaseorder'
@@ -6,6 +6,7 @@ module Quickbooks
6
6
  module Model
7
7
  class VendorCredit < BaseModel
8
8
  include GlobalTaxCalculation
9
+ include HasLineItems
9
10
 
10
11
  #== Constants
11
12
  REST_RESOURCE = 'vendorcredit'
@@ -0,0 +1,12 @@
1
+ module Quickbooks
2
+ module Service
3
+ class Budget < BaseService
4
+
5
+ private
6
+
7
+ def model
8
+ Quickbooks::Model::Budget
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickbooks-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Caughlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -199,6 +199,8 @@ files:
199
199
  - lib/quickbooks/model/bill_payment_check.rb
200
200
  - lib/quickbooks/model/bill_payment_credit_card.rb
201
201
  - lib/quickbooks/model/bill_payment_line_item.rb
202
+ - lib/quickbooks/model/budget.rb
203
+ - lib/quickbooks/model/budget_line_item.rb
202
204
  - lib/quickbooks/model/check_payment.rb
203
205
  - lib/quickbooks/model/class.rb
204
206
  - lib/quickbooks/model/company_info.rb
@@ -274,6 +276,7 @@ files:
274
276
  - lib/quickbooks/service/batch.rb
275
277
  - lib/quickbooks/service/bill.rb
276
278
  - lib/quickbooks/service/bill_payment.rb
279
+ - lib/quickbooks/service/budget.rb
277
280
  - lib/quickbooks/service/class.rb
278
281
  - lib/quickbooks/service/company_info.rb
279
282
  - lib/quickbooks/service/credit_memo.rb