netvisor 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ class ElementBase
2
+ def initialize(args = {})
3
+ args.each_pair do |key, val|
4
+ self.send("#{key}=", val) if ElementBase.method_defined? key
5
+ end
6
+ end
7
+ end
@@ -2,6 +2,7 @@ require 'happymapper'
2
2
  require 'netvisor/sales_invoice_line'
3
3
  require 'netvisor/vat_percentage'
4
4
  require 'netvisor/dimension'
5
+ require 'netvisor/element_base'
5
6
 
6
7
  module Netvisor
7
8
  class SalesInvoice
@@ -9,21 +10,14 @@ module Netvisor
9
10
 
10
11
  tag self.name.split('::').last
11
12
 
12
- class InvoiceDate
13
+ class InvoiceDate < ElementBase
13
14
  include HappyMapper
14
15
 
15
16
  attribute :format, String
16
- content :date, Date
17
+ content :value, Date
17
18
  end
18
19
 
19
- class InvoiceDeliveryDate
20
- include HappyMapper
21
-
22
- attribute :format, String
23
- content :date, Date
24
- end
25
-
26
- class InvoiceAmount
20
+ class InvoiceAmount < ElementBase
27
21
  include HappyMapper
28
22
 
29
23
  attribute :iso4217currencycode, String
@@ -31,42 +25,42 @@ module Netvisor
31
25
  content :amount, Float
32
26
  end
33
27
 
34
- class SellerId
28
+ class SellerId < ElementBase
35
29
  include HappyMapper
36
30
 
37
31
  attribute :type, String
38
32
  content :id, String
39
33
  end
40
34
 
41
- class InvoiceStatus
35
+ class InvoiceStatus < ElementBase
42
36
  include HappyMapper
43
37
 
44
38
  attribute :type, String
45
39
  content :status, String
46
40
  end
47
41
 
48
- class CustomerId
42
+ class CustomerId < ElementBase
49
43
  include HappyMapper
50
44
 
51
45
  attribute :type, String
52
46
  content :id, String
53
47
  end
54
48
 
55
- class CountryCode
49
+ class CountryCode < ElementBase
56
50
  include HappyMapper
57
51
 
58
52
  attribute :type, String
59
53
  content :country_code, String
60
54
  end
61
55
 
62
- class CashDiscount
56
+ class CashDiscount < ElementBase
63
57
  include HappyMapper
64
58
 
65
59
  attribute :type, String
66
60
  content :discount, Integer
67
61
  end
68
62
 
69
- class DirectDebitLink
63
+ class DirectDebitLink < ElementBase
70
64
  include HappyMapper
71
65
 
72
66
  attribute :mode, String
@@ -76,12 +70,12 @@ module Netvisor
76
70
  class InvoiceVoucherLines
77
71
  include HappyMapper
78
72
 
79
- class VoucherLine
73
+ class VoucherLine < ElementBase
80
74
  include HappyMapper
81
75
 
82
76
  tag 'VoucherLine'
83
77
 
84
- class LineSum
78
+ class LineSum < ElementBase
85
79
  include HappyMapper
86
80
 
87
81
  attribute :type, String
@@ -103,7 +97,7 @@ module Netvisor
103
97
  class SalesInvoiceAttachments
104
98
  include HappyMapper
105
99
 
106
- class InvoiceAttachment
100
+ class InvoiceAttachment < ElementBase
107
101
  include HappyMapper
108
102
 
109
103
  tag self.name.split('::').last
@@ -122,10 +116,10 @@ module Netvisor
122
116
  include HappyMapper
123
117
 
124
118
 
125
- class CustomTag
119
+ class CustomTag < ElementBase
126
120
  include HappyMapper
127
121
 
128
- class TagValue
122
+ class TagValue < ElementBase
129
123
  include HappyMapper
130
124
 
131
125
  attribute :datatype, String
@@ -149,14 +143,14 @@ module Netvisor
149
143
 
150
144
  end
151
145
 
152
- class ChannelFormat
146
+ class ChannelFormat < ElementBase
153
147
  include HappyMapper
154
148
 
155
149
  attribute :type, String
156
150
  content :format, String
157
151
  end
158
152
 
159
- class SecondName
153
+ class SecondName < ElementBase
160
154
  include HappyMapper
161
155
 
162
156
  attribute :type, String
@@ -166,7 +160,7 @@ module Netvisor
166
160
  class InvoiceAccrual
167
161
  include HappyMapper
168
162
 
169
- class AccrualVoucherEntry
163
+ class AccrualVoucherEntry < ElementBase
170
164
  include HappyMapper
171
165
 
172
166
  element :month, Integer
@@ -181,7 +175,7 @@ module Netvisor
181
175
 
182
176
  element :invoice_number, String, :tag => 'SalesInvoiceNumber'
183
177
  element :invoice_date, InvoiceDate, :tag => 'SalesInvoiceDate'
184
- element :invoice_delivery_date, InvoiceDeliveryDate, :tag => 'SalesInvoiceDeliveryDate'
178
+ element :invoice_delivery_date, InvoiceDate, :tag => 'SalesInvoiceDeliveryDate'
185
179
  element :reference_number, String, :tag => 'SalesInvoiceReferenceNumber'
186
180
  element :invoice_amount, InvoiceAmount, :tag => 'SalesInvoiceAmount'
187
181
  element :seller_id, SellerId, :tag => 'SellerIdentifier'
@@ -1,18 +1,19 @@
1
1
  require 'happymapper'
2
2
  require 'netvisor/vat_percentage'
3
3
  require 'netvisor/dimension'
4
+ require 'netvisor/element_base'
4
5
 
5
6
  module Netvisor
6
7
  class SalesInvoiceProductLine
7
8
  include HappyMapper
8
9
 
9
- class ProductId
10
+ class ProductId < ElementBase
10
11
  include HappyMapper
11
12
 
12
13
  attribute :type, String
13
14
  content :id, String
14
15
  end
15
- class UnitPrice
16
+ class UnitPrice < ElementBase
16
17
  include HappyMapper
17
18
 
18
19
  attribute :type, String
@@ -1,7 +1,8 @@
1
1
  require 'happymapper'
2
+ require 'netvisor/element_base'
2
3
 
3
4
  module Netvisor
4
- class VatPercentage
5
+ class VatPercentage < ElementBase
5
6
  include HappyMapper
6
7
 
7
8
  attribute :vatcode, String
@@ -1,3 +1,3 @@
1
1
  module Netvisor
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netvisor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 2
10
- version: 0.8.2
9
+ - 3
10
+ version: 0.8.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Timo Sand
@@ -179,6 +179,7 @@ files:
179
179
  - lib/netvisor/base.rb
180
180
  - lib/netvisor/configuration.rb
181
181
  - lib/netvisor/dimension.rb
182
+ - lib/netvisor/element_base.rb
182
183
  - lib/netvisor/request.rb
183
184
  - lib/netvisor/root.rb
184
185
  - lib/netvisor/sales_invoice.rb