rconomic 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/README.md +2 -1
  2. data/lib/economic/cash_book_entry.rb +42 -36
  3. data/lib/economic/creditor.rb +67 -0
  4. data/lib/economic/creditor_contact.rb +62 -0
  5. data/lib/economic/creditor_entry.rb +26 -0
  6. data/lib/economic/current_invoice.rb +30 -10
  7. data/lib/economic/current_invoice_line.rb +2 -0
  8. data/lib/economic/debtor_entry.rb +27 -0
  9. data/lib/economic/economic.wsdl +23134 -17255
  10. data/lib/economic/entity/handle.rb +1 -1
  11. data/lib/economic/entity.rb +8 -4
  12. data/lib/economic/entry.rb +26 -0
  13. data/lib/economic/proxies/cash_book_entry_proxy.rb +53 -15
  14. data/lib/economic/proxies/creditor_contact_proxy.rb +64 -0
  15. data/lib/economic/proxies/creditor_entry_proxy.rb +42 -0
  16. data/lib/economic/proxies/creditor_proxy.rb +73 -0
  17. data/lib/economic/proxies/current_invoice_proxy.rb +2 -1
  18. data/lib/economic/proxies/debtor_entry_proxy.rb +32 -0
  19. data/lib/economic/proxies/entity_proxy.rb +2 -2
  20. data/lib/economic/proxies/entry_proxy.rb +63 -0
  21. data/lib/economic/proxies/invoice_proxy.rb +2 -1
  22. data/lib/economic/session.rb +21 -4
  23. data/lib/economic/support/string.rb +5 -0
  24. data/lib/rconomic/version.rb +1 -1
  25. data/lib/rconomic.rb +10 -0
  26. data/rconomic.gemspec +6 -1
  27. data/spec/economic/creditor_contact_spec.rb +106 -0
  28. data/spec/economic/creditor_spec.rb +52 -0
  29. data/spec/economic/current_invoice_spec.rb +14 -0
  30. data/spec/economic/debtor_entry_spec.rb +20 -0
  31. data/spec/economic/debtor_spec.rb +12 -0
  32. data/spec/economic/entity/handle_spec.rb +21 -0
  33. data/spec/economic/entity_spec.rb +31 -0
  34. data/spec/economic/entry_spec.rb +20 -0
  35. data/spec/economic/proxies/cash_book_entry_proxy_spec.rb +35 -2
  36. data/spec/economic/proxies/creditor_contact_proxy_spec.rb +55 -0
  37. data/spec/economic/proxies/creditor_entry_proxy_spec.rb +49 -0
  38. data/spec/economic/proxies/creditor_proxy_spec.rb +81 -0
  39. data/spec/economic/proxies/current_invoice_line_proxy_spec.rb +1 -1
  40. data/spec/economic/proxies/current_invoice_proxy_spec.rb +3 -3
  41. data/spec/economic/proxies/debtor_entry_proxy_spec.rb +47 -0
  42. data/spec/economic/proxies/entry_proxy_spec.rb +73 -0
  43. data/spec/economic/proxies/invoice_proxy_spec.rb +3 -3
  44. data/spec/fixtures/cash_book_entry_create_creditor_invoice/success.xml +11 -0
  45. data/spec/fixtures/cash_book_entry_create_creditor_payment/success.xml +11 -0
  46. data/spec/fixtures/cash_book_entry_get_data/success.xml +4 -4
  47. data/spec/fixtures/cash_book_entry_set_due_date/success.xml +6 -0
  48. data/spec/fixtures/cash_book_get_all/multiple.xml +2 -2
  49. data/spec/fixtures/cash_book_get_entries/success.xml +4 -4
  50. data/spec/fixtures/creditor_contact_get_data/success.xml +22 -0
  51. data/spec/fixtures/creditor_entry_find_by_invoice_number/many.xml +15 -0
  52. data/spec/fixtures/creditor_entry_find_by_invoice_number/single.xml +12 -0
  53. data/spec/fixtures/creditor_entry_get_data/success.xml +32 -0
  54. data/spec/fixtures/creditor_entry_match_entries/success.xml +5 -0
  55. data/spec/fixtures/creditor_find_by_number/found.xml +10 -0
  56. data/spec/fixtures/creditor_find_by_number/not_found.xml +7 -0
  57. data/spec/fixtures/creditor_get_all/multiple.xml +15 -0
  58. data/spec/fixtures/creditor_get_all/single.xml +12 -0
  59. data/spec/fixtures/creditor_get_data/success.xml +49 -0
  60. data/spec/fixtures/creditor_get_data_array/multiple.xml +93 -0
  61. data/spec/fixtures/current_invoice_book_with_number/success.xml +10 -0
  62. data/spec/fixtures/current_invoice_get_data_array/multiple.xml +4 -4
  63. data/spec/fixtures/debtor_entry_find_by_invoice_number/many.xml +15 -0
  64. data/spec/fixtures/debtor_entry_find_by_invoice_number/single.xml +12 -0
  65. data/spec/fixtures/debtor_entry_match_entries/success.xml +6 -0
  66. data/spec/fixtures/debtor_get_data_array/multiple.xml +4 -4
  67. data/spec/fixtures/entry_find_by_date_interval/many.xml +15 -0
  68. data/spec/fixtures/entry_find_by_date_interval/none.xml +9 -0
  69. data/spec/fixtures/entry_find_by_date_interval/single.xml +12 -0
  70. data/spec/fixtures/entry_find_by_serial_number_interval/many.xml +15 -0
  71. data/spec/fixtures/entry_find_by_serial_number_interval/none.xml +9 -0
  72. data/spec/fixtures/entry_find_by_serial_number_interval/single.xml +12 -0
  73. data/spec/fixtures/entry_get_data/success.xml +40 -0
  74. data/spec/fixtures/entry_get_last_used_serial_number/success.xml +8 -0
  75. data/spec/spec_helper.rb +22 -2
  76. metadata +68 -11
  77. data/Gemfile.lock +0 -61
  78. data/spec/fixtures/wsdl.xml +0 -56596
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3
+ <soap:Body>
4
+ <Entry_FindBySerialNumberIntervalResponse xmlns="http://e-conomic.com">
5
+ <Entry_FindBySerialNumberIntervalResult>
6
+ <EntryHandle>
7
+ <SerialNumber>1</SerialNumber>
8
+ </EntryHandle>
9
+ </Entry_FindBySerialNumberIntervalResult>
10
+ </Entry_FindBySerialNumberIntervalResponse>
11
+ </soap:Body>
12
+ </soap:Envelope>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3
+ <soap:Body>
4
+ <Entry_GetDataResponse xmlns="http://e-conomic.com">
5
+ <Entry_GetDataResult>
6
+ <Handle>
7
+ <SerialNumber>int</SerialNumber>
8
+ </Handle>
9
+ <SerialNumber>int</SerialNumber>
10
+ <AccountHandle>
11
+ <Number>int</Number>
12
+ </AccountHandle>
13
+ <Amount>decimal</Amount>
14
+ <AmountDefaultCurrency>decimal</AmountDefaultCurrency>
15
+ <CurrencyHandle>
16
+ <Code>string</Code>
17
+ </CurrencyHandle>
18
+ <Date>dateTime</Date>
19
+ <Text>string</Text>
20
+ <Type>DebtorInvoice or DebtorPayment or CreditorInvoice or CreditorPayment or JournalEntry or Reminder or OpeningEntry or TransferredOpeningEntry or SystemEntry or ManualDebtorInvoice</Type>
21
+ <DepartmentHandle>
22
+ <Number>int</Number>
23
+ </DepartmentHandle>
24
+ <DistributionKeyHandle>
25
+ <Number>int</Number>
26
+ </DistributionKeyHandle>
27
+ <VatAccountHandle>
28
+ <VatCode>string</VatCode>
29
+ </VatAccountHandle>
30
+ <VoucherNumber>int</VoucherNumber>
31
+ <ProjectHandle>
32
+ <Number>int</Number>
33
+ </ProjectHandle>
34
+ <DocumentHandle>
35
+ <Number>int</Number>
36
+ </DocumentHandle>
37
+ </Entry_GetDataResult>
38
+ </Entry_GetDataResponse>
39
+ </soap:Body>
40
+ </soap:Envelope>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3
+ <soap:Body>
4
+ <Entry_GetLastUsedSerialNumberResponse xmlns="http://e-conomic.com">
5
+ <Entry_GetLastUsedSerialNumberResult>123</Entry_GetLastUsedSerialNumberResult>
6
+ </Entry_GetLastUsedSerialNumberResponse>
7
+ </soap:Body>
8
+ </soap:Envelope>
data/spec/spec_helper.rb CHANGED
@@ -25,7 +25,7 @@ module Savon
25
25
  module Wasabi
26
26
  class Document < ::Wasabi::Document
27
27
  def resolve_document
28
- Savon::Spec::Fixture['wsdl']
28
+ File.read(File.expand_path('../../lib/economic/economic.wsdl', __FILE__))
29
29
  end
30
30
  end
31
31
  end
@@ -94,4 +94,24 @@ def make_debtor(properties = {})
94
94
  debtor.layout_handle ||= { :id => 16 }
95
95
 
96
96
  debtor
97
- end
97
+ end
98
+
99
+ def make_creditor(properties = {})
100
+ creditor = Economic::Creditor.new
101
+
102
+ # Assign specified properties
103
+ properties.each { |key, value|
104
+ creditor.send("#{key}=", value)
105
+ }
106
+
107
+ # Use defaults for the rest of the properties
108
+ creditor.session ||= make_session
109
+ creditor.handle ||= { :number => 42 }
110
+ creditor.number ||= 42
111
+ creditor.name ||= 'Bob'
112
+ creditor.vat_zone ||= 'HomeCountry' # HomeCountry, EU, Abroad
113
+ creditor.is_accessible ||= true
114
+ creditor.ci_number ||= '12345678'
115
+
116
+ creditor
117
+ end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rconomic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- version: "0.3"
8
+ - 4
9
+ version: "0.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jakob Skjerning
@@ -14,8 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-11-10 00:00:00 +01:00
18
- default_executable:
17
+ date: 2012-07-04 00:00:00 Z
19
18
  dependencies:
20
19
  - !ruby/object:Gem::Dependency
21
20
  name: savon
@@ -34,9 +33,25 @@ dependencies:
34
33
  type: :runtime
35
34
  version_requirements: *id001
36
35
  - !ruby/object:Gem::Dependency
37
- name: activesupport
36
+ name: gyoku
38
37
  prerelease: false
39
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - "="
42
+ - !ruby/object:Gem::Version
43
+ hash: 7
44
+ segments:
45
+ - 0
46
+ - 4
47
+ - 4
48
+ version: 0.4.4
49
+ type: :runtime
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ name: activesupport
53
+ prerelease: false
54
+ requirement: &id003 !ruby/object:Gem::Requirement
40
55
  none: false
41
56
  requirements:
42
57
  - - ~>
@@ -47,7 +62,7 @@ dependencies:
47
62
  - 0
48
63
  version: "3.0"
49
64
  type: :runtime
50
- version_requirements: *id002
65
+ version_requirements: *id003
51
66
  description: " Ruby wrapper for the e-conomic SOAP API, that aims at making working with the API bearable.\n\n E-conomic is a web-based accounting system. For their marketing speak, see http://www.e-conomic.co.uk/about/. More details about their API at http://www.e-conomic.co.uk/integration/integration-partner/.\n"
52
67
  email: jakob@mentalized.net
53
68
  executables: []
@@ -59,7 +74,6 @@ extra_rdoc_files: []
59
74
  files:
60
75
  - .travis.yml
61
76
  - Gemfile
62
- - Gemfile.lock
63
77
  - Guardfile
64
78
  - LICENSE
65
79
  - README.md
@@ -67,22 +81,32 @@ files:
67
81
  - lib/economic/account.rb
68
82
  - lib/economic/cash_book.rb
69
83
  - lib/economic/cash_book_entry.rb
84
+ - lib/economic/creditor.rb
85
+ - lib/economic/creditor_contact.rb
86
+ - lib/economic/creditor_entry.rb
70
87
  - lib/economic/current_invoice.rb
71
88
  - lib/economic/current_invoice_line.rb
72
89
  - lib/economic/debtor.rb
73
90
  - lib/economic/debtor_contact.rb
91
+ - lib/economic/debtor_entry.rb
74
92
  - lib/economic/economic.wsdl
75
93
  - lib/economic/entity.rb
76
94
  - lib/economic/entity/handle.rb
95
+ - lib/economic/entry.rb
77
96
  - lib/economic/invoice.rb
78
97
  - lib/economic/proxies/account_proxy.rb
79
98
  - lib/economic/proxies/cash_book_entry_proxy.rb
80
99
  - lib/economic/proxies/cash_book_proxy.rb
100
+ - lib/economic/proxies/creditor_contact_proxy.rb
101
+ - lib/economic/proxies/creditor_entry_proxy.rb
102
+ - lib/economic/proxies/creditor_proxy.rb
81
103
  - lib/economic/proxies/current_invoice_line_proxy.rb
82
104
  - lib/economic/proxies/current_invoice_proxy.rb
83
105
  - lib/economic/proxies/debtor_contact_proxy.rb
106
+ - lib/economic/proxies/debtor_entry_proxy.rb
84
107
  - lib/economic/proxies/debtor_proxy.rb
85
108
  - lib/economic/proxies/entity_proxy.rb
109
+ - lib/economic/proxies/entry_proxy.rb
86
110
  - lib/economic/proxies/invoice_proxy.rb
87
111
  - lib/economic/session.rb
88
112
  - lib/economic/support/string.rb
@@ -91,31 +115,55 @@ files:
91
115
  - rconomic.gemspec
92
116
  - spec/economic/cash_book_entry_spec.rb
93
117
  - spec/economic/cash_book_spec.rb
118
+ - spec/economic/creditor_contact_spec.rb
119
+ - spec/economic/creditor_spec.rb
94
120
  - spec/economic/current_invoice_line_spec.rb
95
121
  - spec/economic/current_invoice_spec.rb
96
122
  - spec/economic/debtor_contact_spec.rb
123
+ - spec/economic/debtor_entry_spec.rb
97
124
  - spec/economic/debtor_spec.rb
98
125
  - spec/economic/entity/handle_spec.rb
99
126
  - spec/economic/entity_spec.rb
127
+ - spec/economic/entry_spec.rb
100
128
  - spec/economic/invoice_spec.rb
101
129
  - spec/economic/proxies/cash_book_entry_proxy_spec.rb
102
130
  - spec/economic/proxies/cash_book_proxy_spec.rb
131
+ - spec/economic/proxies/creditor_contact_proxy_spec.rb
132
+ - spec/economic/proxies/creditor_entry_proxy_spec.rb
133
+ - spec/economic/proxies/creditor_proxy_spec.rb
103
134
  - spec/economic/proxies/current_invoice_line_proxy_spec.rb
104
135
  - spec/economic/proxies/current_invoice_proxy_spec.rb
105
136
  - spec/economic/proxies/debtor_contact_proxy_spec.rb
137
+ - spec/economic/proxies/debtor_entry_proxy_spec.rb
106
138
  - spec/economic/proxies/debtor_proxy_spec.rb
139
+ - spec/economic/proxies/entry_proxy_spec.rb
107
140
  - spec/economic/proxies/invoice_proxy_spec.rb
108
141
  - spec/economic/session_spec.rb
109
142
  - spec/fixtures/cash_book_book/success.xml
143
+ - spec/fixtures/cash_book_entry_create_creditor_invoice/success.xml
144
+ - spec/fixtures/cash_book_entry_create_creditor_payment/success.xml
110
145
  - spec/fixtures/cash_book_entry_create_debtor_payment/success.xml
111
146
  - spec/fixtures/cash_book_entry_create_finance_voucher/success.xml
112
147
  - spec/fixtures/cash_book_entry_create_from_data/success.xml
113
148
  - spec/fixtures/cash_book_entry_get_data/success.xml
149
+ - spec/fixtures/cash_book_entry_set_due_date/success.xml
114
150
  - spec/fixtures/cash_book_get_all/multiple.xml
115
151
  - spec/fixtures/cash_book_get_entries/success.xml
116
152
  - spec/fixtures/cash_book_get_name/success.xml
117
153
  - spec/fixtures/connect/success.xml
154
+ - spec/fixtures/creditor_contact_get_data/success.xml
155
+ - spec/fixtures/creditor_entry_find_by_invoice_number/many.xml
156
+ - spec/fixtures/creditor_entry_find_by_invoice_number/single.xml
157
+ - spec/fixtures/creditor_entry_get_data/success.xml
158
+ - spec/fixtures/creditor_entry_match_entries/success.xml
159
+ - spec/fixtures/creditor_find_by_number/found.xml
160
+ - spec/fixtures/creditor_find_by_number/not_found.xml
161
+ - spec/fixtures/creditor_get_all/multiple.xml
162
+ - spec/fixtures/creditor_get_all/single.xml
163
+ - spec/fixtures/creditor_get_data/success.xml
164
+ - spec/fixtures/creditor_get_data_array/multiple.xml
118
165
  - spec/fixtures/current_invoice_book/success.xml
166
+ - spec/fixtures/current_invoice_book_with_number/success.xml
119
167
  - spec/fixtures/current_invoice_create_from_data/success.xml
120
168
  - spec/fixtures/current_invoice_find_by_date_interval/many.xml
121
169
  - spec/fixtures/current_invoice_find_by_date_interval/none.xml
@@ -128,6 +176,9 @@ files:
128
176
  - spec/fixtures/current_invoice_get_data_array/single.xml
129
177
  - spec/fixtures/current_invoice_line_get_data/success.xml
130
178
  - spec/fixtures/debtor_contact_get_data/success.xml
179
+ - spec/fixtures/debtor_entry_find_by_invoice_number/many.xml
180
+ - spec/fixtures/debtor_entry_find_by_invoice_number/single.xml
181
+ - spec/fixtures/debtor_entry_match_entries/success.xml
131
182
  - spec/fixtures/debtor_find_by_ci_number/many.xml
132
183
  - spec/fixtures/debtor_find_by_number/found.xml
133
184
  - spec/fixtures/debtor_find_by_number/not_found.xml
@@ -136,6 +187,14 @@ files:
136
187
  - spec/fixtures/debtor_get_data/success.xml
137
188
  - spec/fixtures/debtor_get_data_array/multiple.xml
138
189
  - spec/fixtures/debtor_get_next_available_number/success.xml
190
+ - spec/fixtures/entry_find_by_date_interval/many.xml
191
+ - spec/fixtures/entry_find_by_date_interval/none.xml
192
+ - spec/fixtures/entry_find_by_date_interval/single.xml
193
+ - spec/fixtures/entry_find_by_serial_number_interval/many.xml
194
+ - spec/fixtures/entry_find_by_serial_number_interval/none.xml
195
+ - spec/fixtures/entry_find_by_serial_number_interval/single.xml
196
+ - spec/fixtures/entry_get_data/success.xml
197
+ - spec/fixtures/entry_get_last_used_serial_number/success.xml
139
198
  - spec/fixtures/invoice_find_by_date_interval/many.xml
140
199
  - spec/fixtures/invoice_find_by_date_interval/none.xml
141
200
  - spec/fixtures/invoice_find_by_date_interval/single.xml
@@ -146,9 +205,7 @@ files:
146
205
  - spec/fixtures/spec_entity_delete/success.xml
147
206
  - spec/fixtures/spec_entity_get_data/success.xml
148
207
  - spec/fixtures/spec_entity_update_from_data/success.xml
149
- - spec/fixtures/wsdl.xml
150
208
  - spec/spec_helper.rb
151
- has_rdoc: true
152
209
  homepage: https://github.com/lokalebasen/rconomic
153
210
  licenses: []
154
211
 
@@ -178,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
235
  requirements: []
179
236
 
180
237
  rubyforge_project:
181
- rubygems_version: 1.4.2
238
+ rubygems_version: 1.8.24
182
239
  signing_key:
183
240
  specification_version: 3
184
241
  summary: Wrapper for e-conomic.dk's SOAP API.
data/Gemfile.lock DELETED
@@ -1,61 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- rconomic (0.3)
5
- activesupport (~> 3.0)
6
- savon (= 0.9.5)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- activesupport (3.0.9)
12
- akami (1.0.0)
13
- gyoku (>= 0.4.0)
14
- builder (3.0.0)
15
- diff-lcs (1.1.2)
16
- guard (0.8.8)
17
- thor (~> 0.14.6)
18
- guard-rspec (0.5.0)
19
- guard (>= 0.8.4)
20
- gyoku (0.4.4)
21
- builder (>= 2.1.2)
22
- httpi (0.9.5)
23
- rack
24
- mocha (0.9.12)
25
- nokogiri (1.5.0)
26
- nori (1.0.2)
27
- rack (1.3.0)
28
- rake (0.9.2)
29
- rspec (2.6.0)
30
- rspec-core (~> 2.6.0)
31
- rspec-expectations (~> 2.6.0)
32
- rspec-mocks (~> 2.6.0)
33
- rspec-core (2.6.4)
34
- rspec-expectations (2.6.0)
35
- diff-lcs (~> 1.1.2)
36
- rspec-mocks (2.6.0)
37
- savon (0.9.5)
38
- akami (~> 1.0)
39
- builder (>= 2.1.2)
40
- gyoku (>= 0.4.0)
41
- httpi (~> 0.9)
42
- nokogiri (>= 1.4.0)
43
- nori (~> 1.0)
44
- wasabi (~> 1.0)
45
- savon_spec (0.1.6)
46
- mocha (>= 0.9.8)
47
- rspec (>= 2.0.0)
48
- savon (>= 0.8.0)
49
- thor (0.14.6)
50
- wasabi (1.0.0)
51
- nokogiri (>= 1.4.0)
52
-
53
- PLATFORMS
54
- ruby
55
-
56
- DEPENDENCIES
57
- guard
58
- guard-rspec
59
- rake
60
- rconomic!
61
- savon_spec (= 0.1.6)