xrechnung 0.5.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/xrechnung/additional_document_reference.rb +34 -0
- data/lib/xrechnung/attachment.rb +27 -0
- data/lib/xrechnung/version.rb +1 -1
- data/lib/xrechnung.rb +12 -10
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78c300f8df950e3c2c73b875bc6976833fea6d85b75f8a9702972f6833d8a1ad
|
4
|
+
data.tar.gz: b7104e08877570bf376a8adc108965729d641f8fb73c49962a80b891570d3900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b68cacfa965ff9b830c5b635f6e866043e8a91756bae106c044475c0f5a69ce6a5759d9570361788ec80f45b04dc7c5279ce9930f3f3f4f496f1fad0b590168
|
7
|
+
data.tar.gz: b9604f5e4669e5284c50da9328587a6c0c64b1c04854276e2ceb0c5e2c3039ab22ec0c51662c775d95ab38cbe78fd13c2a64596ef1c78a5f0f2d7c4587c12275
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
require "xrechnung/attachment"
|
2
|
+
|
3
|
+
module Xrechnung
|
4
|
+
class AdditionalDocumentReference
|
5
|
+
include MemberContainer
|
6
|
+
|
7
|
+
# @!attribute id
|
8
|
+
# @return [String]
|
9
|
+
member :id, type: String
|
10
|
+
|
11
|
+
# @!attribute document_type
|
12
|
+
# @return [String]
|
13
|
+
member :document_type, type: String, optional: true
|
14
|
+
|
15
|
+
# @!attribute document_description
|
16
|
+
# @return [String]
|
17
|
+
member :document_description, type: String, optional: true
|
18
|
+
|
19
|
+
# @!attribute attachment
|
20
|
+
# @return [Xrechnung::Attachment]
|
21
|
+
member :attachment, type: Xrechnung::Attachment, optional: true
|
22
|
+
|
23
|
+
# noinspection RubyResolve
|
24
|
+
def to_xml(xml)
|
25
|
+
xml.cac :AdditionalDocumentReference do
|
26
|
+
xml.cbc :ID, id
|
27
|
+
xml.cbc :DocumentType, document_type
|
28
|
+
xml.cbc :DocumentDescription, document_description
|
29
|
+
|
30
|
+
attachment&.to_xml(xml)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "base64"
|
2
|
+
|
3
|
+
module Xrechnung
|
4
|
+
class Attachment
|
5
|
+
include MemberContainer
|
6
|
+
|
7
|
+
# @!attribute mime_code
|
8
|
+
# @return [String]
|
9
|
+
member :mime_code, type: String
|
10
|
+
|
11
|
+
# @!attribute filename
|
12
|
+
# @return [String]
|
13
|
+
member :filename, type: String
|
14
|
+
|
15
|
+
member :payload
|
16
|
+
|
17
|
+
# noinspection RubyResolve
|
18
|
+
def to_xml(xml)
|
19
|
+
xml.cac :Attachment do
|
20
|
+
xml.cbc :EmbeddedDocumentBinaryObject,
|
21
|
+
Base64.strict_encode64(payload),
|
22
|
+
mimeCode: mime_code,
|
23
|
+
filename: filename
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/xrechnung/version.rb
CHANGED
data/lib/xrechnung.rb
CHANGED
@@ -4,6 +4,7 @@ require "xrechnung/currency"
|
|
4
4
|
require "xrechnung/quantity"
|
5
5
|
require "xrechnung/id"
|
6
6
|
require "xrechnung/member_container"
|
7
|
+
require "xrechnung/additional_document_reference"
|
7
8
|
require "xrechnung/contact"
|
8
9
|
require "xrechnung/party_identification"
|
9
10
|
require "xrechnung/party_legal_entity"
|
@@ -34,7 +35,7 @@ module Xrechnung
|
|
34
35
|
|
35
36
|
# Default customization specs
|
36
37
|
DEFAULT_CUSTOMIZATION_ID = "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0"
|
37
|
-
DEFAULT_PROFILE_ID
|
38
|
+
DEFAULT_PROFILE_ID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"
|
38
39
|
|
39
40
|
# Document customization identifier
|
40
41
|
#
|
@@ -187,6 +188,11 @@ module Xrechnung
|
|
187
188
|
# @return [Xrechnung::InvoiceDocumentReference]
|
188
189
|
member :billing_reference, type: Xrechnung::InvoiceDocumentReference, optional: true
|
189
190
|
|
191
|
+
# Additional supporting documents BG-24
|
192
|
+
# @!attribute additional_document_references
|
193
|
+
# @return [Array]
|
194
|
+
member :additional_document_references, type: Array, default: []
|
195
|
+
|
190
196
|
# @!attribute invoice_period
|
191
197
|
# @return [Xrechnung::InvoicePeriod]
|
192
198
|
member :invoice_period, type: Xrechnung::InvoicePeriod, optional: true
|
@@ -341,6 +347,8 @@ module Xrechnung
|
|
341
347
|
end
|
342
348
|
end
|
343
349
|
|
350
|
+
additional_document_references.each { _1.to_xml(xml) }
|
351
|
+
|
344
352
|
xml.cac :AccountingSupplierParty do
|
345
353
|
accounting_supplier_party&.to_xml(xml)
|
346
354
|
end
|
@@ -359,17 +367,13 @@ module Xrechnung
|
|
359
367
|
payment_means&.to_xml(xml)
|
360
368
|
end
|
361
369
|
|
362
|
-
unless self.class.members[:payee_party].optional && payee_party.nil?
|
363
|
-
payee_party&.to_xml(xml)
|
364
|
-
end
|
370
|
+
payee_party&.to_xml(xml) unless self.class.members[:payee_party].optional && payee_party.nil?
|
365
371
|
|
366
372
|
xml.cac :PaymentTerms do
|
367
373
|
xml.cbc :Note, payment_terms_note
|
368
374
|
end
|
369
375
|
|
370
|
-
allowance_charges.each
|
371
|
-
allowance_charge&.to_xml(xml)
|
372
|
-
end
|
376
|
+
allowance_charges.each { _1.to_xml(xml) }
|
373
377
|
|
374
378
|
xml.cac :TaxTotal do
|
375
379
|
tax_total&.to_xml(xml)
|
@@ -379,9 +383,7 @@ module Xrechnung
|
|
379
383
|
legal_monetary_total&.to_xml(xml)
|
380
384
|
end
|
381
385
|
|
382
|
-
invoice_lines.each
|
383
|
-
invoice_line&.to_xml(xml)
|
384
|
-
end
|
386
|
+
invoice_lines.each { _1.to_xml(xml) }
|
385
387
|
end
|
386
388
|
|
387
389
|
target
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xrechnung
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Kornberger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -73,7 +73,9 @@ files:
|
|
73
73
|
- bin/console
|
74
74
|
- bin/setup
|
75
75
|
- lib/xrechnung.rb
|
76
|
+
- lib/xrechnung/additional_document_reference.rb
|
76
77
|
- lib/xrechnung/allowance_charge.rb
|
78
|
+
- lib/xrechnung/attachment.rb
|
77
79
|
- lib/xrechnung/contact.rb
|
78
80
|
- lib/xrechnung/currency.rb
|
79
81
|
- lib/xrechnung/id.rb
|