intacctrb 0.5.1 → 0.5.2

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: 21f35e4684be137686062e57fad13b6ac4ebd9fd
4
- data.tar.gz: 00cf4ba8c13d6b7918366b2a661fb100f1f7ff3c
3
+ metadata.gz: 91d680b66aff9543c9aba09e0b1e6a77e29b5891
4
+ data.tar.gz: c6b10cc66d8e9162572140b03cdd2cd613de1fda
5
5
  SHA512:
6
- metadata.gz: f3d02a67e2becb735c1aa7a46c92e00d2357c244913bd06976ae060d744359bf23759aefaab1801953cf181430cf2ce08c619f18558aafeefa8dfd2d64a4c015
7
- data.tar.gz: 9e2810c35c8820394b88d38cdf3af2bb0baf2e0879ea9419b64e17673bd72bd8e67a8eddecedfa02d0e92898ae8acdf86ca96b67cb9bc2a85543e7fc5f63631b
6
+ metadata.gz: 7deff2d0b8f5ac3e835f3292dc14ec34a43b81ba80843a10ddf1291fb405d1631505a357a42350a1cb476f8ef3377cbd94a2f107745e2cad4b22d9f6ab7e0ad1
7
+ data.tar.gz: bb6095bc147643c4345a1a75d5d3c7c9ad66581c0ad9c0bd21da6a4341c74f8455307a329c3297bab1db10f0cc3cc9f91d49535ceda21aeb7e6a80fbbd37dd24
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- intacctrb (0.5.1)
4
+ intacctrb (0.5.2)
5
5
  hooks
6
6
  nokogiri
7
7
 
@@ -21,6 +21,26 @@ module IntacctRB
21
21
  object.intacct_id
22
22
  end
23
23
 
24
+ def update
25
+ raise 'You must pass an id to update an ap payment' unless object.intacct_id.present?
26
+
27
+ send_xml('update') do |xml|
28
+ xml.function(controlid: "f1") {
29
+ xml.update {
30
+ xml.appayment(key: object.intacct_id) {
31
+ ap_payment_xml xml
32
+ }
33
+ }
34
+ }
35
+ end
36
+
37
+ if !successful?
38
+ raise(response.at('//error//description2'))
39
+ end
40
+
41
+ object.intacct_id
42
+ end
43
+
24
44
  def reverse
25
45
  return false unless object.id.present?
26
46
 
@@ -132,9 +152,9 @@ module IntacctRB
132
152
  end
133
153
 
134
154
  def ap_payment_xml xml
135
- xml.key object.intacct_id if object.intacct_id
136
- xml.bankaccountid object.bank_account_id if object.bank_account_id
137
- xml.chargecardid object.charge_card_id if object.charge_card_id
155
+ xml.key object.intacct_id unless object.intacct_id.blank?
156
+ xml.bankaccountid object.bank_account_id unless object.bank_account_id.blank?
157
+ xml.chargecardid object.charge_card_id unless object.charge_card_id.blank?
138
158
  xml.vendorid object.vendor_id
139
159
  xml.memo object.memo
140
160
  xml.paymentmethod object.payment_method
@@ -1,3 +1,3 @@
1
1
  module IntacctRB
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Hale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri