intacctrb 0.2pre → 0.2.1pre

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: 7b907457bb9c38a786dc11039cfe95cbbc3866d9
4
- data.tar.gz: 1bac18e1a52376b34b634c3eedadb67cd1fcf6be
3
+ metadata.gz: 90c68c290f0ec9f5a0834610d2a3bdff3d0066f3
4
+ data.tar.gz: 3e2591b1362b4e0fdce8808b33a608cd900d9ffc
5
5
  SHA512:
6
- metadata.gz: 86af4bdd45ff5e41850300a35551f50fdeed91f58bab0eeebdf127ac2cbfe90418e0c7727eb99fb33ac138adf59233d5ac90084dc31d8239767934e9e0308118
7
- data.tar.gz: bfdd573f465fa321000ec80406e118ab350a143834020ac55faf3025d8b5a3d3516dac5d9689e22e87e964d48870258a51c1cc11a1b87cf048dbf81c24705b1d
6
+ metadata.gz: 9968e5ef5547aeed64ad2df53760dcdb7c3b0ce502d4f4f91eec206353b7b0850be4b827e021eaaa6a6730c75d6f58228851ab7808278162e9624947366bbdb8
7
+ data.tar.gz: 71db9b3295041a7e10db6a8372c1d22b519961d05426f7894575aa0e6c774768db269693fde7dd4f3adc8ed1f60b67742fecd1de1ac253baa76e462360b07e8a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- intacctrb (0.2pre)
4
+ intacctrb (0.2.1pre)
5
5
  hooks
6
6
  nokogiri
7
7
 
@@ -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 :set_intacct_system_id
10
- after_delete :delete_intacct_system_id
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//recordno')
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
- # 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
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[:intact_id]
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.class row[:class_id] if row[:class_id]
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
@@ -1,3 +1,3 @@
1
1
  module IntacctRB
2
- VERSION = "0.2pre"
2
+ VERSION = "0.2.1pre"
3
3
  end
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.2pre
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-15 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri