intacctrb 0.2pre → 0.2.1pre
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/intacctrb/base.rb +8 -3
- data/lib/intacctrb/journal_entry.rb +13 -14
- data/lib/intacctrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90c68c290f0ec9f5a0834610d2a3bdff3d0066f3
|
4
|
+
data.tar.gz: 3e2591b1362b4e0fdce8808b33a608cd900d9ffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9968e5ef5547aeed64ad2df53760dcdb7c3b0ce502d4f4f91eec206353b7b0850be4b827e021eaaa6a6730c75d6f58228851ab7808278162e9624947366bbdb8
|
7
|
+
data.tar.gz: 71db9b3295041a7e10db6a8372c1d22b519961d05426f7894575aa0e6c774768db269693fde7dd4f3adc8ed1f60b67742fecd1de1ac253baa76e462360b07e8a
|
data/Gemfile.lock
CHANGED
data/lib/intacctrb/base.rb
CHANGED
@@ -6,8 +6,8 @@ module IntacctRB
|
|
6
6
|
define_hook :after_create, :after_update, :after_delete,
|
7
7
|
:after_get, :after_send_xml, :on_error, :before_create
|
8
8
|
|
9
|
-
after_create :
|
10
|
-
after_delete :
|
9
|
+
after_create :set_intacct_id
|
10
|
+
after_delete :delete_intacct_id
|
11
11
|
after_delete :delete_intacct_key
|
12
12
|
after_send_xml :set_date_time
|
13
13
|
|
@@ -15,9 +15,14 @@ module IntacctRB
|
|
15
15
|
|
16
16
|
def initialize *params
|
17
17
|
params[0] = OpenStruct.new(params[0]) if params[0].is_a? Hash
|
18
|
+
params[0] ||= OpenStruct.new()
|
18
19
|
super(*params)
|
19
20
|
end
|
20
21
|
|
22
|
+
def intacct_id
|
23
|
+
object.intacct_id
|
24
|
+
end
|
25
|
+
|
21
26
|
private
|
22
27
|
|
23
28
|
def send_xml action
|
@@ -59,7 +64,7 @@ module IntacctRB
|
|
59
64
|
@response = Nokogiri::XML(res.body)
|
60
65
|
puts res.body
|
61
66
|
if successful?
|
62
|
-
if key = response.at('//result//
|
67
|
+
if key = response.at('//result//RECORDNO')
|
63
68
|
set_intacct_id key.content if object
|
64
69
|
end
|
65
70
|
|
@@ -31,16 +31,16 @@ module IntacctRB
|
|
31
31
|
successful?
|
32
32
|
end
|
33
33
|
|
34
|
-
def delete
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
34
|
+
# def delete
|
35
|
+
# # return false unless object.payment.intacct_system_id.present?
|
36
|
+
# send_xml('delete') do |xml|
|
37
|
+
# xml.function(controlid: "1") {
|
38
|
+
# xml.delete_bill(externalkey: "false", key: object.intacct_key)
|
39
|
+
# }
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# successful?
|
43
|
+
# end
|
44
44
|
|
45
45
|
def get_list(options = {})
|
46
46
|
send_xml('readByQuery') do |xml|
|
@@ -84,7 +84,7 @@ module IntacctRB
|
|
84
84
|
xml.function(controlid: "f4") {
|
85
85
|
xml.read {
|
86
86
|
xml.object "glbatch"
|
87
|
-
xml.keys object.intacct_id || options[:
|
87
|
+
xml.keys object.try(:intacct_id) || options[:intacct_id]
|
88
88
|
if options[:fields]
|
89
89
|
xml.fields {
|
90
90
|
fields.each do |field|
|
@@ -168,7 +168,6 @@ module IntacctRB
|
|
168
168
|
xml.entries {
|
169
169
|
object.rows.each do |row|
|
170
170
|
xml.glentry {
|
171
|
-
puts "row[:specialty_id]: #{row[:specialty_id]}"
|
172
171
|
xml.tr_type row[:type]
|
173
172
|
xml.amount row[:amount]
|
174
173
|
xml.accountno row[:account_number]
|
@@ -178,12 +177,12 @@ module IntacctRB
|
|
178
177
|
xml.customer row[:customer_id] if row[:customer_id]
|
179
178
|
xml.employee row[:employee_id] if row[:employee_id]
|
180
179
|
xml.project row[:project_id] if row[:project_id]
|
181
|
-
xml.specialty row[:specialty_id] if row[:specialty_id]
|
182
180
|
xml.item row[:item_id] if row[:itemid]
|
183
|
-
xml.
|
181
|
+
xml.classid row[:class_id] if row[:class_id]
|
184
182
|
}
|
185
183
|
end
|
186
184
|
}
|
187
185
|
end
|
186
|
+
|
188
187
|
end
|
189
188
|
end
|
data/lib/intacctrb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intacctrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Hale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|