quickbooks-ruby 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f022da1bd07f94626aeaa48e9e2191a33317437
4
- data.tar.gz: 3659e63ed15e2735f003ff203829bc43d31d84ff
3
+ metadata.gz: 8c1f7609fbdad9a588640b0ecb0249f9b25d1cd5
4
+ data.tar.gz: 478cfbcb38a9b85550eab9bb0c4a50bd37e70aca
5
5
  SHA512:
6
- metadata.gz: 34a057792381dff10a2cb9072ede8a05578d6cdd3436b8337ae47cd1b0d60a4cd41e7b7884b10857a8c0a3311f15ac49723287e40679805ab0ffb6604d369c7c
7
- data.tar.gz: ac73b452460c70a84e0ceff4a29e81db2769e98b2071e569146e80d34c8ac1fe4ab35697be4f1d6199540b2a58ce35212f6cf4aa86a0560cc47b76aa0151b9ef
6
+ metadata.gz: 8debdcbde394d52e675e5000b519a0ba4a213a7151cf108c97502716658e2361a3a0a4eb7d6ffef3f95b412786dbe4f8bacb41ded9a6f049a597c1eb1aac99aa
7
+ data.tar.gz: 556d4cf4a82481b7300a9ae737f7b0423b6bc411df2fd5fc904fbcdb5363b1e7b8cb2d575c1e91f55b5a2d22ea50f1c48c97854be7eb206e843799660cad11a6
@@ -109,7 +109,7 @@ require 'quickbooks/model/item_change'
109
109
  require 'quickbooks/model/report'
110
110
  require 'quickbooks/model/credit_memo_change'
111
111
  require 'quickbooks/model/payment_change'
112
-
112
+ require 'quickbooks/model/transfer'
113
113
 
114
114
  #== Services
115
115
  require 'quickbooks/service/service_crud'
@@ -159,6 +159,7 @@ require 'quickbooks/service/item_change'
159
159
  require 'quickbooks/service/reports'
160
160
  require 'quickbooks/service/credit_memo_change'
161
161
  require 'quickbooks/service/payment_change'
162
+ require 'quickbooks/service/transfer'
162
163
 
163
164
  module Quickbooks
164
165
  @@sandbox_mode = false
@@ -15,13 +15,15 @@ module Quickbooks
15
15
  INVENTORY_TYPE = 'Inventory'
16
16
  NON_INVENTORY_TYPE = 'NonInventory'
17
17
  SERVICE_TYPE = 'Service'
18
- ITEM_TYPES = [INVENTORY_TYPE, NON_INVENTORY_TYPE, SERVICE_TYPE]
18
+ CATEGORY_TYPE = 'Category'
19
+ ITEM_TYPES = [INVENTORY_TYPE, NON_INVENTORY_TYPE, SERVICE_TYPE, CATEGORY_TYPE]
19
20
 
20
21
  xml_name 'Item'
21
22
  xml_accessor :id, :from => 'Id'
22
23
  xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
23
24
  xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
24
25
  xml_accessor :name, :from => 'Name'
26
+ xml_accessor :sku, :from => 'Sku'
25
27
  xml_accessor :description, :from => 'Description'
26
28
  xml_accessor :active?, :from => 'Active'
27
29
  xml_accessor :sub_item?, :from => 'SubItem'
@@ -0,0 +1,21 @@
1
+ module Quickbooks
2
+ module Model
3
+ class Transfer < BaseModel
4
+ XML_COLLECTION_NODE = "Transfer"
5
+ XML_NODE = "Transfer"
6
+ REST_RESOURCE = 'transfer'
7
+
8
+ xml_accessor :id, :from => 'Id'
9
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
10
+ xml_accessor :meta_data, :from => 'MetaData', :as => MetaData
11
+ xml_accessor :txn_date, :from => 'TxnDate', :as => Date
12
+ xml_accessor :currency_ref, :from => 'CurrencyRef', :as => BaseReference
13
+ xml_accessor :private_note, :from => 'PrivateNote'
14
+ xml_accessor :from_account_ref, :from => 'FromAccountRef', :as => BaseReference
15
+ xml_accessor :to_account_ref, :from => 'ToAccountRef', :as => BaseReference
16
+ xml_accessor :amount, :from => 'Amount', :as => BigDecimal, :to_xml => to_xml_big_decimal
17
+
18
+ reference_setters :currency_ref, :to_account_ref, :from_account_ref
19
+ end
20
+ end
21
+ end
@@ -5,6 +5,12 @@ module Quickbooks
5
5
  def delete(estimate)
6
6
  delete_by_query_string(estimate)
7
7
  end
8
+
9
+ def pdf(estimate)
10
+ url = "#{url_for_resource(model::REST_RESOURCE)}/#{estimate.id}/pdf"
11
+ response = do_http_raw_get(url, {}, {'Accept' => 'application/pdf'})
12
+ response.plain_body
13
+ end
8
14
 
9
15
  private
10
16
 
@@ -0,0 +1,16 @@
1
+ module Quickbooks
2
+ module Service
3
+ class Transfer < BaseService
4
+
5
+ def delete(transfer)
6
+ delete_by_query_string(transfer)
7
+ end
8
+
9
+ private
10
+
11
+ def model
12
+ Quickbooks::Model::Transfer
13
+ end
14
+ end
15
+ end
16
+ end
@@ -4,7 +4,7 @@ end
4
4
  require "oauth"
5
5
 
6
6
  OAuth::Consumer.class_eval do
7
- def create_http_request_with_multipart(http_method, path, *arguments)
7
+ def create_http_request(http_method, path, *arguments)
8
8
  http_method = http_method.to_sym
9
9
 
10
10
  if [:post, :put].include?(http_method)
@@ -60,8 +60,6 @@ OAuth::Consumer.class_eval do
60
60
  request
61
61
 
62
62
  end
63
-
64
- alias_method_chain :create_http_request, :multipart
65
63
  end
66
64
 
67
65
  OAuth::AccessToken.class_eval do
@@ -1,5 +1,5 @@
1
1
  module Quickbooks
2
2
 
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
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.4.2
4
+ version: 0.4.3
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-11-11 00:00:00.000000000 Z
11
+ date: 2016-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -272,6 +272,7 @@ files:
272
272
  - lib/quickbooks/model/term.rb
273
273
  - lib/quickbooks/model/time_activity.rb
274
274
  - lib/quickbooks/model/transaction_tax_detail.rb
275
+ - lib/quickbooks/model/transfer.rb
275
276
  - lib/quickbooks/model/upload.rb
276
277
  - lib/quickbooks/model/validator.rb
277
278
  - lib/quickbooks/model/vendor.rb
@@ -320,6 +321,7 @@ files:
320
321
  - lib/quickbooks/service/tax_service.rb
321
322
  - lib/quickbooks/service/term.rb
322
323
  - lib/quickbooks/service/time_activity.rb
324
+ - lib/quickbooks/service/transfer.rb
323
325
  - lib/quickbooks/service/upload.rb
324
326
  - lib/quickbooks/service/vendor.rb
325
327
  - lib/quickbooks/service/vendor_change.rb