agris 0.4.5 → 0.4.6

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: 12b5830cb1e4319dfa867826afad41f0b12d163d
4
- data.tar.gz: b6ad68beec0392d71711ecf4d17524861d631ec4
3
+ metadata.gz: 0f3658a027b00d5a197bde8b526403608e3957b0
4
+ data.tar.gz: 9d26a844edf3668282a51403248a8f00ac4d179b
5
5
  SHA512:
6
- metadata.gz: f25c312d5dc0bbf025899f3373cc077b30e4aae6b5d548481f41900b8abe449d6a3dc8e7f1b49308e2cb800fcda7802842cbc2f9adbc375a60e7486c5943e8c4
7
- data.tar.gz: 848ff87534276cbe4e44bf1b1019a1e16e686a17908ac03d21d8188ce8cb1db6cca0f0a88de7b9f70a803d8c248821fb8b9952302f2a26e79e165bea6b3d32a2
6
+ metadata.gz: f68eb9fe1188ca3bff9e761745d6f2a7280a581da452206f80671d7ce694a1576fbf5f4555ac056ab8fdf278ce77c2a23669223e086413c2a68a7844e9c24019
7
+ data.tar.gz: 1b1059533e6629cc2ae5da8d6d152f4578909b2427c220b1620a19c4ad3d103c45037bfdf51e1393056142447b16407d9dde782c9219af5da8b10add742b56c8
@@ -71,7 +71,8 @@ module Agris
71
71
  unique_id
72
72
  ).freeze
73
73
 
74
- attr_reader(*(%w(line_items) + ATTRIBUTE_NAMES))
74
+ attr_reader :record_type
75
+ attr_accessor(*(%w(line_items) + ATTRIBUTE_NAMES))
75
76
 
76
77
  def self.from_xml_hash(hash)
77
78
  super.tap do |document|
@@ -90,7 +91,39 @@ module Agris
90
91
  def initialize(hash = {})
91
92
  super
92
93
 
94
+ @record_type = 'ACRI0'
93
95
  @line_items = []
96
+ @general_ledger_details = []
97
+ end
98
+
99
+ def add_line_item(line_item)
100
+ @line_items ||= []
101
+ @line_items << line_item
102
+
103
+ self
104
+ end
105
+
106
+ def records
107
+ [self] + line_items + general_ledger_details
108
+ end
109
+
110
+ def line_items
111
+ @line_items || []
112
+ end
113
+
114
+ def general_ledger_details
115
+ @general_ledger_details || []
116
+ end
117
+
118
+ def xml_ignore_attributes
119
+ %i(line_items general_ledger_details)
120
+ end
121
+
122
+ def add_general_ledger_detail(general_ledger_detail)
123
+ @general_ledger_details ||= []
124
+ @general_ledger_details << general_ledger_detail
125
+
126
+ self
94
127
  end
95
128
 
96
129
  class LineItem
@@ -158,7 +191,24 @@ module Agris
158
191
  cost_adjustment_description
159
192
  ).freeze
160
193
 
161
- attr_reader(*ATTRIBUTE_NAMES)
194
+ attr_accessor(*ATTRIBUTE_NAMES)
195
+ end
196
+
197
+ class GeneralLedgerDetail
198
+ include XmlModel
199
+
200
+ ATTRIBUTE_NAMES = %w(
201
+ distribution_amount
202
+ gl_account_main_code
203
+ gl_account_detail_code
204
+ record_type
205
+ ).freeze
206
+
207
+ def initialize(hash = {})
208
+ super(hash)
209
+
210
+ @record_type = 'ACRI2'
211
+ end
162
212
  end
163
213
  end
164
214
  end
@@ -23,6 +23,10 @@ module Agris
23
23
  Agris::Api::AccountsReceivables::Invoice
24
24
  )
25
25
  end
26
+
27
+ def create_invoice(new_invoice)
28
+ import(new_invoice)
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -18,7 +18,7 @@ module Agris
18
18
  context = Agris.context,
19
19
  credentials = Agris.credentials,
20
20
  options = {},
21
- dataset = Agris.dataset
21
+ dataset = context.default_dataset
22
22
  )
23
23
  @context = context
24
24
  @logger = options[:logger] || Agris.logger
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Agris
3
- VERSION = '0.4.5'
3
+ VERSION = '0.4.6'
4
4
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Gray
8
8
  - Joseph Bridgwater-Rowe
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-03-12 00:00:00.000000000 Z
12
+ date: 2020-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon
@@ -137,7 +137,7 @@ dependencies:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: '2.3'
140
- description:
140
+ description:
141
141
  email:
142
142
  - wopr42@gmail.com
143
143
  - freakyjoe@gmail.com
@@ -228,7 +228,7 @@ homepage: https://github.com/westernmilling/agris.rb
228
228
  licenses:
229
229
  - MIT
230
230
  metadata: {}
231
- post_install_message:
231
+ post_install_message:
232
232
  rdoc_options: []
233
233
  require_paths:
234
234
  - lib
@@ -243,9 +243,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  - !ruby/object:Gem::Version
244
244
  version: '0'
245
245
  requirements: []
246
- rubyforge_project:
246
+ rubyforge_project:
247
247
  rubygems_version: 2.6.14
248
- signing_key:
248
+ signing_key:
249
249
  specification_version: 4
250
250
  summary: Ruby client library for Agris API
251
251
  test_files: []