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 +4 -4
- data/lib/quickbooks-ruby.rb +2 -1
- data/lib/quickbooks/model/item.rb +3 -1
- data/lib/quickbooks/model/transfer.rb +21 -0
- data/lib/quickbooks/service/estimate.rb +6 -0
- data/lib/quickbooks/service/transfer.rb +16 -0
- data/lib/quickbooks/util/multipart.rb +1 -3
- data/lib/quickbooks/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c1f7609fbdad9a588640b0ecb0249f9b25d1cd5
|
4
|
+
data.tar.gz: 478cfbcb38a9b85550eab9bb0c4a50bd37e70aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8debdcbde394d52e675e5000b519a0ba4a213a7151cf108c97502716658e2361a3a0a4eb7d6ffef3f95b412786dbe4f8bacb41ded9a6f049a597c1eb1aac99aa
|
7
|
+
data.tar.gz: 556d4cf4a82481b7300a9ae737f7b0423b6bc411df2fd5fc904fbcdb5363b1e7b8cb2d575c1e91f55b5a2d22ea50f1c48c97854be7eb206e843799660cad11a6
|
data/lib/quickbooks-ruby.rb
CHANGED
@@ -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
|
-
|
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
|
|
@@ -4,7 +4,7 @@ end
|
|
4
4
|
require "oauth"
|
5
5
|
|
6
6
|
OAuth::Consumer.class_eval do
|
7
|
-
def
|
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
|
data/lib/quickbooks/version.rb
CHANGED
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.
|
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:
|
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
|