ruconomic 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruconomic/api/cash_book.rb +8 -4
- data/lib/ruconomic/api/cash_book_entry.rb +2 -2
- data/lib/ruconomic/api/current_invoice.rb +29 -39
- data/lib/ruconomic/api/current_invoice_line.rb +17 -20
- data/lib/ruconomic/api/debtor.rb +67 -68
- data/lib/ruconomic/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: 7776054f005bb98b19444eaff7b8b0c8a8874477
|
4
|
+
data.tar.gz: 0d9de84e8ba54a88aff2deca04a934604558b494
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c9948789c91888522388a521821a4f87d6a1ecb68d8aa33bd2d4459f18db393275aee06429cd28a6f845ae1d85561a158bc622bd49ef8bde0f6cec325dbd9e0
|
7
|
+
data.tar.gz: 91e028c86371b168c48d4ed4adbf462b938213083c6993ca5cee7ba09ab7870af88a1a7053dfa269ef61df7c93fe33388cd852903f004f9d0aff98160f14b59b
|
@@ -127,13 +127,17 @@ module Ruconomic
|
|
127
127
|
|
128
128
|
# Get the next available voucher number for the cashbook.
|
129
129
|
#
|
130
|
-
# @note TODO: This method was autogenerated from the WSDL - see https://github.com/coherify/ruconomic#contributing"
|
131
130
|
# @see https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=CashBook_GetNextVoucherNumber
|
132
|
-
# @return [
|
133
|
-
def self.get_next_voucher_number
|
131
|
+
# @return [int] The body content of the SOAP response.
|
132
|
+
def self.get_next_voucher_number(handle)
|
134
133
|
response = invoke('CashBook_GetNextVoucherNumber') do |message|
|
135
|
-
|
134
|
+
message.add_handle('cashBookHandle', handle)
|
136
135
|
end
|
136
|
+
|
137
|
+
response.to_hash.dig(
|
138
|
+
:cash_book_get_next_voucher_number_response,
|
139
|
+
:cash_book_get_next_voucher_number_result
|
140
|
+
)
|
137
141
|
end
|
138
142
|
|
139
143
|
# Gets the entries in the cashbook.
|
@@ -235,7 +235,7 @@ module Ruconomic
|
|
235
235
|
# Parameters: data: The data object that specifies the properties of the new cash book entry.
|
236
236
|
#
|
237
237
|
# @see https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=CashBookEntry_CreateFromData
|
238
|
-
# @return [
|
238
|
+
# @return [Array] with cashbook entry ids.
|
239
239
|
def self.create_from_data(entry_data)
|
240
240
|
response = invoke('CashBookEntry_CreateFromData') do |message|
|
241
241
|
message.add 'data' do |data|
|
@@ -282,7 +282,7 @@ module Ruconomic
|
|
282
282
|
response.to_hash.dig(
|
283
283
|
:cash_book_entry_create_from_data_response,
|
284
284
|
:cash_book_entry_create_from_data_result
|
285
|
-
)
|
285
|
+
).values
|
286
286
|
end
|
287
287
|
|
288
288
|
# Creates new cash book entries from data objects.
|
@@ -489,48 +489,38 @@ module Ruconomic
|
|
489
489
|
def self.create_from_data(invoice_data)
|
490
490
|
response = invoke('CurrentInvoice_CreateFromData') do |message|
|
491
491
|
message.add 'data' do |data|
|
492
|
-
data.add
|
493
|
-
data.
|
494
|
-
|
495
|
-
|
496
|
-
data.
|
497
|
-
data.
|
498
|
-
data.
|
499
|
-
data.
|
500
|
-
data.add
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
data.
|
507
|
-
data.add
|
508
|
-
|
509
|
-
|
510
|
-
data.
|
511
|
-
data.add
|
512
|
-
|
513
|
-
|
514
|
-
data.add
|
515
|
-
data.add
|
516
|
-
data.add 'LayoutHandle' do |layout_handle|
|
517
|
-
layout_handle.add 'Id', invoice_data.fetch(:layout_handle, {}).fetch(:id, nil)
|
518
|
-
end
|
519
|
-
data.add 'DeliveryDate', invoice_data.fetch(:delivery_date, nil)
|
520
|
-
data.add 'Heading', invoice_data.fetch(:heading, nil)
|
521
|
-
data.add 'TextLine1', invoice_data.fetch(:text_line1, nil)
|
522
|
-
data.add 'TextLine2', invoice_data.fetch(:text_line2, nil)
|
523
|
-
data.add 'NetAmount', invoice_data.fetch(:net_amount, nil)
|
524
|
-
data.add 'VatAmount', invoice_data.fetch(:vat_amount, nil)
|
525
|
-
data.add 'GrossAmount', invoice_data.fetch(:gross_amount, nil)
|
526
|
-
data.add 'Margin', invoice_data.fetch(:margin, nil)
|
527
|
-
data.add 'MarginAsPercent', invoice_data.fetch(:margin_as_percent, nil)
|
492
|
+
data.add('Id', invoice_data.dig(:id))
|
493
|
+
data.add_handle('DebtorHandle', invoice_data.dig(:debtor_handle, :number))
|
494
|
+
data.add('DebtorName', invoice_data.dig(:debtor_name))
|
495
|
+
data.add_optional('DebtorAddress', invoice_data.dig(:debtor_address))
|
496
|
+
data.add_optional('DebtorPostalCode', invoice_data.dig(:debtor_postal_code))
|
497
|
+
data.add_optional('DebtorCity', invoice_data.dig(:debtor_city))
|
498
|
+
data.add_optional('DebtorCountry', invoice_data.dig(:debtor_country))
|
499
|
+
data.add_handle('AttentionHandle', invoice_data.dig(:attention_handle, :id), 'Id')
|
500
|
+
data.add('Date', invoice_data.dig(:date))
|
501
|
+
data.add_handle('TermOfPaymentHandle', invoice_data.dig(:term_of_payment_handle, :id), 'Id')
|
502
|
+
data.add('DueDate', invoice_data.dig(:due_date))
|
503
|
+
data.add_handle('CurrencyHandle', invoice_data.dig(:currency_handle, :code), 'Code')
|
504
|
+
data.add_optional('ExchangeRate', invoice_data.dig(:exchange_rate))
|
505
|
+
data.add('IsVatIncluded', invoice_data.dig(:is_vat_included))
|
506
|
+
data.add_handle('LayoutHandle', invoice_data.dig(:layout_handle, :id), 'Id')
|
507
|
+
data.add('DeliveryDate', invoice_data.dig(:delivery_date))
|
508
|
+
data.add_optional('Heading', invoice_data.dig(:heading))
|
509
|
+
data.add_optional('TextLine1', invoice_data.dig(:text_line1))
|
510
|
+
data.add_optional('TextLine2', invoice_data.dig(:text_line2))
|
511
|
+
data.add('NetAmount', invoice_data.dig(:net_amount))
|
512
|
+
data.add('VatAmount', invoice_data.dig(:vat_amount))
|
513
|
+
data.add('GrossAmount', invoice_data.dig(:gross_amount))
|
514
|
+
data.add('Margin', invoice_data.dig(:margin))
|
515
|
+
data.add('MarginAsPercent', invoice_data.dig(:margin_as_percent))
|
528
516
|
end
|
529
517
|
end
|
530
518
|
|
531
|
-
response.to_hash
|
532
|
-
|
533
|
-
|
519
|
+
response.to_hash.dig(
|
520
|
+
:current_invoice_create_from_data_response,
|
521
|
+
:current_invoice_create_from_data_result,
|
522
|
+
:id
|
523
|
+
)
|
534
524
|
end
|
535
525
|
|
536
526
|
# Creates new current invoices from data objects.
|
@@ -9,29 +9,26 @@ module Ruconomic
|
|
9
9
|
def self.create_from_data(line_data)
|
10
10
|
response = invoke('CurrentInvoiceLine_CreateFromData') do |message|
|
11
11
|
message.add 'data' do |data|
|
12
|
-
data.add 'Number', line_data.
|
13
|
-
data.
|
14
|
-
|
15
|
-
|
16
|
-
data.
|
17
|
-
data.
|
18
|
-
data.add
|
19
|
-
|
20
|
-
|
21
|
-
data.
|
22
|
-
|
23
|
-
|
24
|
-
data.add
|
25
|
-
data.add 'UnitNetPrice', line_data.fetch(:unit_net_price, nil)
|
26
|
-
data.add 'DiscountAsPercent', line_data.fetch(:discount_as_percent, nil)
|
27
|
-
data.add 'UnitCostPrice', line_data.fetch(:unit_cost_price, nil)
|
28
|
-
data.add 'TotalNetAmount', line_data.fetch(:total_net_amount, nil)
|
29
|
-
data.add 'TotalMargin', line_data.fetch(:total_margin, nil)
|
30
|
-
data.add 'MarginAsPercent', line_data.fetch(:margin_as_percent, nil)
|
12
|
+
data.add 'Number', line_data.dig(:number)
|
13
|
+
data.add_handle('InvoiceHandle', line_data.dig(:invoice_handle, :id), 'Id')
|
14
|
+
data.add_optional('Description', line_data.dig(:description))
|
15
|
+
data.add 'DeliveryDate', line_data.dig(:delivery_date)
|
16
|
+
data.add_handle('UnitHandle', line_data.dig(:unit_handle, :number))
|
17
|
+
data.add_handle('ProductHandle', line_data.dig(:product_handle, :number))
|
18
|
+
data.add('Quantity', line_data.dig(:quantity))
|
19
|
+
data.add('UnitNetPrice', line_data.dig(:unit_net_price))
|
20
|
+
data.add('DiscountAsPercent', line_data.dig(:discount_as_percent))
|
21
|
+
data.add_optional('UnitCostPrice', line_data.dig(:unit_cost_price))
|
22
|
+
data.add('TotalNetAmount', line_data.dig(:total_net_amount))
|
23
|
+
data.add('TotalMargin', line_data.dig(:total_margin))
|
24
|
+
data.add('MarginAsPercent', line_data.dig(:margin_as_percent))
|
31
25
|
end
|
32
26
|
end
|
33
27
|
|
34
|
-
response.to_hash
|
28
|
+
response.to_hash.dig(
|
29
|
+
:current_invoice_line_create_from_data_response,
|
30
|
+
:current_invoice_line_create_from_data_result
|
31
|
+
)
|
35
32
|
end
|
36
33
|
|
37
34
|
# Creates new current invoice lines from data objects.
|
data/lib/ruconomic/api/debtor.rb
CHANGED
@@ -206,74 +206,42 @@ module Ruconomic
|
|
206
206
|
def self.create_from_data(debtor_data)
|
207
207
|
response = invoke('Debtor_CreateFromData') do |message|
|
208
208
|
message.add 'data' do |data|
|
209
|
-
data.
|
210
|
-
|
211
|
-
|
212
|
-
data.add
|
213
|
-
data.add
|
214
|
-
|
215
|
-
|
216
|
-
data.
|
217
|
-
data.add
|
218
|
-
data.
|
219
|
-
|
220
|
-
|
221
|
-
data.
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
data.
|
230
|
-
data.
|
231
|
-
data.
|
232
|
-
data.
|
233
|
-
data.
|
234
|
-
data.
|
235
|
-
data.
|
236
|
-
data.
|
237
|
-
data.add 'City', debtor_data.fetch(:city, nil)
|
238
|
-
data.add 'Country', debtor_data.fetch(:country, nil)
|
239
|
-
if credit_maximum = debtor_data.fetch(:credit_maximum, nil)
|
240
|
-
data.add 'CreditMaximum', credit_maximum
|
241
|
-
end
|
242
|
-
data.add 'VatNumber', debtor_data.fetch(:vat_number, nil)
|
243
|
-
data.add 'CINumber', debtor_data.fetch(:ci_number, nil)
|
244
|
-
data.add 'TermOfPaymentHandle' do |handle|
|
245
|
-
handle.add 'Id', debtor_data.fetch(:term_of_payment_handle, {}).fetch(:id, nil)
|
246
|
-
end
|
247
|
-
if layout_id = debtor_data.fetch(:layout_handle, {}).fetch(:id, nil)
|
248
|
-
data.add 'LayoutHandle' do |handle|
|
249
|
-
handle.add 'Id', layout_id
|
250
|
-
end
|
251
|
-
end
|
252
|
-
if attention_id = debtor_data.fetch(:attention_handle, {}).fetch(:id, nil)
|
253
|
-
data.add 'AttentionHandle' do |handle|
|
254
|
-
handle.add 'Id', attention_id
|
255
|
-
end
|
256
|
-
end
|
257
|
-
if your_reference_id = debtor_data.fetch(:your_reference_handle, {}).fetch(:id, nil)
|
258
|
-
data.add 'YourReferenceHandle' do |handle|
|
259
|
-
handle.add 'Id', your_reference_id
|
260
|
-
end
|
261
|
-
end
|
262
|
-
if our_reference_handle = debtor_data.fetch(:our_reference_handle, {}).fetch(:number, nil)
|
263
|
-
data.add 'OurReferenceHandle' do |handle|
|
264
|
-
handle.add 'Number', our_reference_handle
|
265
|
-
end
|
266
|
-
end
|
267
|
-
data.add 'Balance', debtor_data.fetch(:balance, nil)
|
268
|
-
if delivery_id = debtor_data.fetch(:default_delivery_location_handle, {}).fetch(:id, nil)
|
269
|
-
data.add 'DefaultDeliveryLocationHandle' do |handle|
|
270
|
-
handle.add 'Id', delivery_id
|
271
|
-
end
|
272
|
-
end
|
209
|
+
data.add_handle('Handle', debtor_data.dig(:handle, :number))
|
210
|
+
data.add('Number', debtor_data.dig(:number))
|
211
|
+
data.add_handle('DebtorGroupHandle', debtor_data.dig(:debtor_group_handle, :number))
|
212
|
+
data.add('Name', debtor_data.dig(:name))
|
213
|
+
data.add('VatZone', debtor_data.dig(:vat_zone))
|
214
|
+
data.add_handle('ExtendedVatZone', debtor_data.dig(:extended_vat_zone, :number))
|
215
|
+
data.add_handle('CurrencyHandle', debtor_data.dig(:currency_handle, :code), 'Code')
|
216
|
+
data.add_handle('PriceGroupHandle', debtor_data.dig(:price_group_handle, :number))
|
217
|
+
data.add('IsAccessible', debtor_data.dig(:is_accessible))
|
218
|
+
data.add_optional('Ean', debtor_data.dig(:ean))
|
219
|
+
data.add_optional('PublicEntryNumber', debtor_data.dig(:public_entry_number))
|
220
|
+
data.add_optional('Email', debtor_data.dig(:email))
|
221
|
+
data.add_optional('TelephoneAndFaxNumber', debtor_data.dig(:telephone_and_fax_number))
|
222
|
+
data.add_optional('Website', debtor_data.dig(:website))
|
223
|
+
data.add_optional('Address', debtor_data.dig(:address))
|
224
|
+
data.add_optional('PostalCode', debtor_data.dig(:postal_code))
|
225
|
+
data.add_optional('City', debtor_data.dig(:city))
|
226
|
+
data.add_optional('Country', debtor_data.dig(:country))
|
227
|
+
data.add_optional('CreditMaximum', debtor_data.dig(:credit_maximum))
|
228
|
+
data.add_optional('VatNumber', debtor_data.dig(:vat_number))
|
229
|
+
data.add_optional('CINumber', debtor_data.dig(:ci_number))
|
230
|
+
data.add_handle('TermOfPaymentHandle', debtor_data.dig(:term_of_payment_handle, :id), 'Id')
|
231
|
+
data.add_handle('LayoutHandle', debtor_data.dig(:layout_handle, :id), 'Id')
|
232
|
+
data.add_handle('AttentionHandle', debtor_data.dig(:attention_handle, :id), 'Id')
|
233
|
+
data.add_handle('YourReferenceHandle', debtor_data.dig(:your_reference_handle, :id), 'Id')
|
234
|
+
data.add_handle('OurReferenceHandle', debtor_data.dig(:our_reference_handle, :number))
|
235
|
+
data.add_optional('Balance', debtor_data.dig(:balance))
|
236
|
+
data.add_handle('DefaultDeliveryLocationHandle', debtor_data.dig(:default_delivery_location_handle, :id), 'Id')
|
273
237
|
end
|
274
238
|
end
|
275
239
|
|
276
|
-
response.to_hash
|
240
|
+
response.to_hash.dig(
|
241
|
+
:debtor_create_from_data_response,
|
242
|
+
:debtor_create_from_data_result,
|
243
|
+
:number
|
244
|
+
)
|
277
245
|
end
|
278
246
|
|
279
247
|
# Creates new debtors from data objects.
|
@@ -303,13 +271,44 @@ module Ruconomic
|
|
303
271
|
# Updates a debtor from a data object.
|
304
272
|
# Parameters: data: The data object.
|
305
273
|
#
|
306
|
-
# @note TODO: This method was autogenerated from the WSDL - see https://github.com/coherify/ruconomic#contributing"
|
307
274
|
# @see https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=Debtor_UpdateFromData
|
308
275
|
# @return [Hash] The body content of the SOAP response.
|
309
|
-
def self.update_from_data
|
276
|
+
def self.update_from_data(debtor_data)
|
310
277
|
response = invoke('Debtor_UpdateFromData') do |message|
|
311
|
-
|
278
|
+
message.add 'data' do |data|
|
279
|
+
data.add_handle('Handle', debtor_data.dig(:handle, :number))
|
280
|
+
data.add('Number', debtor_data.dig(:number))
|
281
|
+
data.add_handle('DebtorGroupHandle', debtor_data.dig(:debtor_group_handle, :number))
|
282
|
+
data.add('Name', debtor_data.dig(:name))
|
283
|
+
data.add('VatZone', debtor_data.dig(:vat_zone))
|
284
|
+
data.add_handle('ExtendedVatZone', debtor_data.dig(:extended_vat_zone, :number))
|
285
|
+
data.add_handle('CurrencyHandle', debtor_data.dig(:currency_handle, :code), 'Code')
|
286
|
+
data.add_handle('PriceGroupHandle', debtor_data.dig(:price_group_handle, :number))
|
287
|
+
data.add('IsAccessible', debtor_data.dig(:is_accessible))
|
288
|
+
data.add_optional('Ean', debtor_data.dig(:ean))
|
289
|
+
data.add_optional('PublicEntryNumber', debtor_data.dig(:public_entry_number))
|
290
|
+
data.add_optional('Email', debtor_data.dig(:email))
|
291
|
+
data.add_optional('TelephoneAndFaxNumber', debtor_data.dig(:telephone_and_fax_number))
|
292
|
+
data.add_optional('Website', debtor_data.dig(:website))
|
293
|
+
data.add_optional('Address', debtor_data.dig(:address))
|
294
|
+
data.add_optional('PostalCode', debtor_data.dig(:postal_code))
|
295
|
+
data.add_optional('City', debtor_data.dig(:city))
|
296
|
+
data.add_optional('Country', debtor_data.dig(:country))
|
297
|
+
data.add_optional('CreditMaximum', debtor_data.dig(:credit_maximum))
|
298
|
+
data.add_optional('VatNumber', debtor_data.dig(:vat_number))
|
299
|
+
data.add_optional('CINumber', debtor_data.dig(:ci_number))
|
300
|
+
data.add_handle('TermOfPaymentHandle', debtor_data.dig(:term_of_payment_handle, :id), 'Id')
|
301
|
+
data.add_handle('LayoutHandle', debtor_data.dig(:layout_handle, :id), 'Id')
|
302
|
+
data.add_handle('AttentionHandle', debtor_data.dig(:attention_handle, :id), 'Id')
|
303
|
+
data.add_handle('YourReferenceHandle', debtor_data.dig(:your_reference_handle, :id), 'Id')
|
304
|
+
data.add_handle('OurReferenceHandle', debtor_data.dig(:our_reference_handle, :number))
|
305
|
+
data.add_optional('Balance', debtor_data.dig(:balance))
|
306
|
+
data.add_handle('DefaultDeliveryLocationHandle', debtor_data.dig(:default_delivery_location_handle, :id), 'Id')
|
307
|
+
end
|
312
308
|
end
|
309
|
+
|
310
|
+
response.to_hash[:debtor_update_from_data_response] \
|
311
|
+
[:debtor_update_from_data_result][:number]
|
313
312
|
end
|
314
313
|
|
315
314
|
# Returns a debtor data object for a given debtor.
|
data/lib/ruconomic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruconomic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tonni Tølbøll Lund Aagesen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curb
|