xrechnung 0.1.3 → 0.3.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/.github/workflows/rspec.yml +23 -0
- data/.github/workflows/validate-fixtures.yml +4 -4
- data/Gemfile.lock +56 -40
- data/Rakefile +1 -1
- data/lib/xrechnung/invoice_line.rb +13 -1
- data/lib/xrechnung/invoice_period.rb +20 -0
- data/lib/xrechnung/legal_monetary_total.rb +4 -4
- data/lib/xrechnung/member_container.rb +18 -27
- data/lib/xrechnung/party_legal_entity.rb +5 -0
- data/lib/xrechnung/price.rb +4 -2
- data/lib/xrechnung/tax_category.rb +13 -0
- data/lib/xrechnung/version.rb +1 -1
- data/lib/xrechnung.rb +14 -5
- data/xrechnung.gemspec +1 -1
- metadata +13 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb95657d503486400ca7f7ff6664ae22a0cbbeb4e6e6588ed9edab03ebd31ee9
|
|
4
|
+
data.tar.gz: '0926fa0b0dfb0ffd51cc271cfca28897936bbe9b5a93a38c577a17da415925fe'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84a2cc18d6ace05c0355154f0ae0addd91d23516d5654f50f11d9ea6c01d94e12ac8ea7d615d5feaf18d2e90fb20bc7fe9b9f700f93351c0ae6aa43272f057ae
|
|
7
|
+
data.tar.gz: edb7fb59d4435c67acd2e54bce2222a534d0752cb17572873005de1e99f44fabc06cecd8d4b328ccd05be70b0ac62ae75b68e3183bd9dff957429c587f3905b2
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Ruby
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
name: Ruby ${{ matrix.ruby }}
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
ruby: ['2.7', '3.0', '3.2']
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Ruby
|
|
17
|
+
uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
|
|
22
|
+
- name: Run rspec
|
|
23
|
+
run: bundle exec rake spec
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
name: Validate spec fixtures
|
|
2
2
|
|
|
3
|
-
on: push
|
|
3
|
+
on: [push, pull_request]
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
validate:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
|
|
9
9
|
steps:
|
|
10
|
-
- uses: actions/checkout@
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
11
|
|
|
12
12
|
- uses: actions/setup-java@v2
|
|
13
13
|
with:
|
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
|
|
17
17
|
- uses: ruby/setup-ruby@v1
|
|
18
18
|
with:
|
|
19
|
-
ruby-version: "2
|
|
19
|
+
ruby-version: "3.2"
|
|
20
20
|
bundler-cache: true
|
|
21
21
|
|
|
22
22
|
- name: Prepare validator
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
- name: Run validator
|
|
26
26
|
run: bundle exec rake validator:run
|
|
27
27
|
|
|
28
|
-
- uses: actions/upload-artifact@
|
|
28
|
+
- uses: actions/upload-artifact@v4
|
|
29
29
|
if: failure()
|
|
30
30
|
with:
|
|
31
31
|
name: validation-results
|
data/Gemfile.lock
CHANGED
|
@@ -1,65 +1,81 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
xrechnung (0.
|
|
4
|
+
xrechnung (0.3.0)
|
|
5
5
|
builder (~> 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
ast (2.4.2)
|
|
11
|
-
builder (3.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
builder (3.3.0)
|
|
12
|
+
csv (3.3.0)
|
|
13
|
+
diff-lcs (1.5.1)
|
|
14
|
+
httparty (0.22.0)
|
|
15
|
+
csv
|
|
16
|
+
mini_mime (>= 1.0.0)
|
|
15
17
|
multi_xml (>= 0.5.2)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
json (2.7.2)
|
|
19
|
+
language_server-protocol (3.17.0.3)
|
|
20
|
+
mini_mime (1.1.5)
|
|
19
21
|
multi_xml (0.6.0)
|
|
20
|
-
parallel (1.
|
|
21
|
-
parser (3.
|
|
22
|
+
parallel (1.25.1)
|
|
23
|
+
parser (3.3.3.0)
|
|
22
24
|
ast (~> 2.4.1)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
rspec-
|
|
33
|
-
|
|
25
|
+
racc
|
|
26
|
+
racc (1.8.0)
|
|
27
|
+
rainbow (3.1.1)
|
|
28
|
+
rake (13.2.1)
|
|
29
|
+
regexp_parser (2.9.2)
|
|
30
|
+
rexml (3.3.1)
|
|
31
|
+
strscan
|
|
32
|
+
rspec (3.13.0)
|
|
33
|
+
rspec-core (~> 3.13.0)
|
|
34
|
+
rspec-expectations (~> 3.13.0)
|
|
35
|
+
rspec-mocks (~> 3.13.0)
|
|
36
|
+
rspec-core (3.13.0)
|
|
37
|
+
rspec-support (~> 3.13.0)
|
|
38
|
+
rspec-expectations (3.13.1)
|
|
34
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.
|
|
36
|
-
rspec-mocks (3.
|
|
40
|
+
rspec-support (~> 3.13.0)
|
|
41
|
+
rspec-mocks (3.13.1)
|
|
37
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-support (3.
|
|
40
|
-
rubocop (1.
|
|
43
|
+
rspec-support (~> 3.13.0)
|
|
44
|
+
rspec-support (3.13.1)
|
|
45
|
+
rubocop (1.64.1)
|
|
46
|
+
json (~> 2.3)
|
|
47
|
+
language_server-protocol (>= 3.17.0)
|
|
41
48
|
parallel (~> 1.10)
|
|
42
|
-
parser (>= 3.
|
|
49
|
+
parser (>= 3.3.0.2)
|
|
43
50
|
rainbow (>= 2.2.2, < 4.0)
|
|
44
51
|
regexp_parser (>= 1.8, < 3.0)
|
|
45
|
-
rexml
|
|
46
|
-
rubocop-ast (>= 1.
|
|
52
|
+
rexml (>= 3.2.5, < 4.0)
|
|
53
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
|
47
54
|
ruby-progressbar (~> 1.7)
|
|
48
|
-
unicode-display_width (>=
|
|
49
|
-
rubocop-ast (1.
|
|
50
|
-
parser (>=
|
|
51
|
-
rubocop-
|
|
52
|
-
rubocop (~> 1.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
56
|
+
rubocop-ast (1.31.3)
|
|
57
|
+
parser (>= 3.3.1.0)
|
|
58
|
+
rubocop-capybara (2.21.0)
|
|
59
|
+
rubocop (~> 1.41)
|
|
60
|
+
rubocop-factory_bot (2.26.1)
|
|
61
|
+
rubocop (~> 1.61)
|
|
62
|
+
rubocop-rspec (2.31.0)
|
|
63
|
+
rubocop (~> 1.40)
|
|
64
|
+
rubocop-capybara (~> 2.17)
|
|
65
|
+
rubocop-factory_bot (~> 2.22)
|
|
66
|
+
rubocop-rspec_rails (~> 2.28)
|
|
67
|
+
rubocop-rspec_rails (2.29.1)
|
|
68
|
+
rubocop (~> 1.61)
|
|
69
|
+
ruby-progressbar (1.13.0)
|
|
70
|
+
rubyzip (2.3.2)
|
|
71
|
+
strscan (3.1.0)
|
|
72
|
+
unicode-display_width (2.5.0)
|
|
57
73
|
|
|
58
74
|
PLATFORMS
|
|
59
75
|
ruby
|
|
60
76
|
|
|
61
77
|
DEPENDENCIES
|
|
62
|
-
httparty
|
|
78
|
+
httparty (~> 0.22)
|
|
63
79
|
rake (~> 13.0)
|
|
64
80
|
rspec (~> 3.0)
|
|
65
81
|
rubocop-rspec (~> 2.1)
|
|
@@ -67,4 +83,4 @@ DEPENDENCIES
|
|
|
67
83
|
xrechnung!
|
|
68
84
|
|
|
69
85
|
BUNDLED WITH
|
|
70
|
-
2.
|
|
86
|
+
2.4.19
|
data/Rakefile
CHANGED
|
@@ -14,7 +14,7 @@ namespace :validator do
|
|
|
14
14
|
},
|
|
15
15
|
scenarios: {
|
|
16
16
|
filename: "validator/scenarios.xml",
|
|
17
|
-
release_url: "https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-
|
|
17
|
+
release_url: "https://github.com/itplr-kosit/validator-configuration-xrechnung/releases/download/release-2023-05-12/validator-configuration-xrechnung_2.3.1_2023-05-12.zip",
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require "xrechnung/invoice_period"
|
|
2
|
+
|
|
1
3
|
module Xrechnung
|
|
2
4
|
class InvoiceLine
|
|
3
5
|
include MemberContainer
|
|
@@ -14,6 +16,10 @@ module Xrechnung
|
|
|
14
16
|
# @return [Xrechnung::Currency]
|
|
15
17
|
member :line_extension_amount, type: Xrechnung::Currency
|
|
16
18
|
|
|
19
|
+
# @!attribute invoice_period
|
|
20
|
+
# @return [Xrechnung::InvoicePeriod]
|
|
21
|
+
member :invoice_period, type: Xrechnung::InvoicePeriod, optional: true
|
|
22
|
+
|
|
17
23
|
# @!attribute item
|
|
18
24
|
# @return [Xrechnung::Item]
|
|
19
25
|
member :item, type: Xrechnung::Item
|
|
@@ -23,7 +29,9 @@ module Xrechnung
|
|
|
23
29
|
member :price, type: Xrechnung::Price
|
|
24
30
|
|
|
25
31
|
def initialize(**kwargs)
|
|
26
|
-
kwargs[:line_extension_amount]
|
|
32
|
+
unless kwargs[:line_extension_amount].is_a?(Currency)
|
|
33
|
+
kwargs[:line_extension_amount] = Currency::EUR(kwargs[:line_extension_amount])
|
|
34
|
+
end
|
|
27
35
|
super(**kwargs)
|
|
28
36
|
end
|
|
29
37
|
|
|
@@ -33,6 +41,10 @@ module Xrechnung
|
|
|
33
41
|
xml.cbc :ID, id
|
|
34
42
|
xml.cbc :InvoicedQuantity, invoiced_quantity.amount_to_s, unitCode: invoiced_quantity.unit_code
|
|
35
43
|
xml.cbc :LineExtensionAmount, *line_extension_amount.xml_args
|
|
44
|
+
|
|
45
|
+
unless self.class.members[:invoice_period].optional && invoice_period.nil?
|
|
46
|
+
invoice_period&.to_xml(xml)
|
|
47
|
+
end
|
|
36
48
|
item&.to_xml(xml)
|
|
37
49
|
price&.to_xml(xml)
|
|
38
50
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Xrechnung
|
|
2
|
+
class InvoicePeriod
|
|
3
|
+
include MemberContainer
|
|
4
|
+
|
|
5
|
+
# @!attribute start_date
|
|
6
|
+
# @return [Date]
|
|
7
|
+
member :start_date, type: Date
|
|
8
|
+
|
|
9
|
+
# @!attribute end_date
|
|
10
|
+
# @return [Date]
|
|
11
|
+
member :end_date, type: Date
|
|
12
|
+
|
|
13
|
+
def to_xml(xml)
|
|
14
|
+
xml.cac :InvoicePeriod do
|
|
15
|
+
xml.cbc :StartDate, start_date
|
|
16
|
+
xml.cbc :EndDate, end_date
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -3,7 +3,7 @@ module Xrechnung
|
|
|
3
3
|
include MemberContainer
|
|
4
4
|
|
|
5
5
|
transform_currency = ->(v) {
|
|
6
|
-
Currency::EUR(v)
|
|
6
|
+
v.is_a?(Currency) ? v : Currency::EUR(v)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
# @!attribute line_extension_amount
|
|
@@ -40,10 +40,10 @@ module Xrechnung
|
|
|
40
40
|
|
|
41
41
|
# noinspection RubyResolve
|
|
42
42
|
def to_xml(xml)
|
|
43
|
-
members.
|
|
44
|
-
next if self[
|
|
43
|
+
self.class.members.each_key do |name|
|
|
44
|
+
next if self[name].nil?
|
|
45
45
|
|
|
46
|
-
xml.cbc :"#{
|
|
46
|
+
xml.cbc :"#{name.to_s.split("_").map(&:capitalize).join}", *self[name].xml_args
|
|
47
47
|
end
|
|
48
48
|
xml.target!
|
|
49
49
|
end
|
|
@@ -6,8 +6,9 @@ module Xrechnung
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def initialize(**kwargs)
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# initialize default values
|
|
10
|
+
self.class.members.each do |name, member|
|
|
11
|
+
self[name] = member.default.dup unless member.default.nil?
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
kwargs.each do |k, v|
|
|
@@ -15,54 +16,44 @@ module Xrechnung
|
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
def members
|
|
19
|
-
self.class.instance_variable_get :@members
|
|
20
|
-
end
|
|
21
|
-
|
|
22
19
|
def [](key)
|
|
23
20
|
send(key)
|
|
24
21
|
end
|
|
25
22
|
|
|
26
23
|
def []=(key, value)
|
|
27
|
-
send(
|
|
24
|
+
send("#{key}=", value)
|
|
28
25
|
end
|
|
29
26
|
|
|
27
|
+
Member = Struct.new(:type, :default, :optional, :transform_value, keyword_init: true)
|
|
28
|
+
|
|
30
29
|
module ClassMethods
|
|
30
|
+
def members
|
|
31
|
+
@members
|
|
32
|
+
end
|
|
33
|
+
|
|
31
34
|
# @param [String] member_name
|
|
32
35
|
# @param [Array<Class>, Class] type
|
|
33
36
|
# @param [Object] default
|
|
34
37
|
# @param [TrueClass, FalseClass] optional When true, omits tag rather than rendering an empty tag on nil
|
|
35
38
|
# @param [Proc] transform_value A Proc which is called with the input value to perform type conversion.
|
|
36
|
-
def member(member_name,
|
|
39
|
+
def member(member_name, **kwargs)
|
|
37
40
|
attr_reader member_name
|
|
38
|
-
|
|
39
|
-
@members[member_name] = { optional: optional, setter_name: setter_name }
|
|
41
|
+
kwargs[:default].freeze
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
end
|
|
45
|
-
end
|
|
43
|
+
setter_name = :"#{member_name}="
|
|
44
|
+
member = Member.new(**kwargs)
|
|
45
|
+
@members[member_name] = member
|
|
46
46
|
|
|
47
47
|
define_method setter_name do |in_value|
|
|
48
|
-
in_value = transform_value.call(in_value) if transform_value
|
|
48
|
+
in_value = member.transform_value.call(in_value) if member.transform_value
|
|
49
49
|
|
|
50
|
-
if type && !in_value.nil? && Array(type).none? { |t| in_value.is_a?(t) }
|
|
51
|
-
raise ArgumentError, "expected #{type} for :#{member_name}, got: #{in_value.class}"
|
|
50
|
+
if member.type && !in_value.nil? && Array(member.type).none? { |t| in_value.is_a?(t) }
|
|
51
|
+
raise ArgumentError, "expected #{member.type} for :#{member_name}, got: #{in_value.class}"
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
instance_variable_set :"@#{member_name}", in_value
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
|
-
|
|
58
|
-
def after_initialize(&block)
|
|
59
|
-
@after_initialize_blocks ||= []
|
|
60
|
-
if block
|
|
61
|
-
@after_initialize_blocks << block
|
|
62
|
-
else
|
|
63
|
-
@after_initialize_blocks
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
57
|
end
|
|
67
58
|
end
|
|
68
59
|
end
|
|
@@ -2,6 +2,10 @@ module Xrechnung
|
|
|
2
2
|
class PartyLegalEntity
|
|
3
3
|
include MemberContainer
|
|
4
4
|
|
|
5
|
+
# @!attribute company_id
|
|
6
|
+
# @return [String]
|
|
7
|
+
member :company_id, type: String
|
|
8
|
+
|
|
5
9
|
# @!attribute registration_name
|
|
6
10
|
# @return [String]
|
|
7
11
|
member :registration_name, type: String
|
|
@@ -9,6 +13,7 @@ module Xrechnung
|
|
|
9
13
|
# noinspection RubyResolve
|
|
10
14
|
def to_xml(xml)
|
|
11
15
|
xml.cac :PartyLegalEntity do
|
|
16
|
+
xml.cbc(:CompanyID, company_id) unless company_id.nil?
|
|
12
17
|
xml.cbc :RegistrationName, registration_name
|
|
13
18
|
end
|
|
14
19
|
end
|
data/lib/xrechnung/price.rb
CHANGED
|
@@ -15,7 +15,9 @@ module Xrechnung
|
|
|
15
15
|
member :allowance_charge, type: Xrechnung::AllowanceCharge
|
|
16
16
|
|
|
17
17
|
def initialize(**kwargs)
|
|
18
|
-
kwargs[:price_amount]
|
|
18
|
+
unless kwargs[:price_amount].is_a?(Currency)
|
|
19
|
+
kwargs[:price_amount] = Currency::EUR(kwargs[:price_amount])
|
|
20
|
+
end
|
|
19
21
|
super(**kwargs)
|
|
20
22
|
end
|
|
21
23
|
|
|
@@ -23,7 +25,7 @@ module Xrechnung
|
|
|
23
25
|
def to_xml(xml)
|
|
24
26
|
xml.cac :Price do
|
|
25
27
|
xml.cbc :PriceAmount, *price_amount.xml_args
|
|
26
|
-
xml.cbc
|
|
28
|
+
xml.cbc(:BaseQuantity, *base_quantity.xml_args) unless base_quantity.nil?
|
|
27
29
|
allowance_charge&.to_xml(xml)
|
|
28
30
|
end
|
|
29
31
|
end
|
|
@@ -29,6 +29,14 @@ module Xrechnung
|
|
|
29
29
|
# @return [String]
|
|
30
30
|
member :tax_scheme_id, type: String, default: "VAT"
|
|
31
31
|
|
|
32
|
+
# @!attribute tax_exemption_reason_code
|
|
33
|
+
# @return [String]
|
|
34
|
+
member :tax_exemption_reason_code, type: String
|
|
35
|
+
|
|
36
|
+
# @!attribute tax_exemption_reason
|
|
37
|
+
# @return [String]
|
|
38
|
+
member :tax_exemption_reason, type: String
|
|
39
|
+
|
|
32
40
|
# noinspection RubyResolve
|
|
33
41
|
def to_xml(xml, root_tag_name: :TaxCategory)
|
|
34
42
|
xml.cac root_tag_name do
|
|
@@ -37,6 +45,11 @@ module Xrechnung
|
|
|
37
45
|
xml.cac :TaxScheme do
|
|
38
46
|
xml.cbc :ID, tax_scheme_id
|
|
39
47
|
end
|
|
48
|
+
|
|
49
|
+
unless tax_exemption_reason_code.nil?
|
|
50
|
+
xml.cbc :TaxExemptionReasonCode, tax_exemption_reason_code
|
|
51
|
+
xml.cbc :TaxExemptionReason, tax_exemption_reason
|
|
52
|
+
end
|
|
40
53
|
end
|
|
41
54
|
end
|
|
42
55
|
end
|
data/lib/xrechnung/version.rb
CHANGED
data/lib/xrechnung.rb
CHANGED
|
@@ -21,6 +21,7 @@ require "xrechnung/allowance_charge"
|
|
|
21
21
|
require "xrechnung/price"
|
|
22
22
|
require "xrechnung/invoice_line"
|
|
23
23
|
require "xrechnung/invoice_document_reference"
|
|
24
|
+
require "xrechnung/invoice_period"
|
|
24
25
|
require "builder"
|
|
25
26
|
|
|
26
27
|
module Xrechnung
|
|
@@ -168,6 +169,10 @@ module Xrechnung
|
|
|
168
169
|
# @return [Xrechnung::InvoiceDocumentReference]
|
|
169
170
|
member :billing_reference, type: Xrechnung::InvoiceDocumentReference, optional: true
|
|
170
171
|
|
|
172
|
+
# @!attribute invoice_period
|
|
173
|
+
# @return [Xrechnung::InvoicePeriod]
|
|
174
|
+
member :invoice_period, type: Xrechnung::InvoicePeriod, optional: true
|
|
175
|
+
|
|
171
176
|
# Contract reference BT-12
|
|
172
177
|
#
|
|
173
178
|
# Eine eindeutige Bezeichnung des Vertrages (z. B. Vertragsnummer).
|
|
@@ -250,7 +255,7 @@ module Xrechnung
|
|
|
250
255
|
"xmlns:cbc" => "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",
|
|
251
256
|
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
|
252
257
|
"xsi:schemaLocation" => "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 http://docs.oasis-open.org/ubl/os-UBL-2.1/xsd/maindoc/UBL-Invoice-2.1.xsd" do
|
|
253
|
-
xml.cbc :CustomizationID, "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.
|
|
258
|
+
xml.cbc :CustomizationID, "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3"
|
|
254
259
|
xml.cbc :ID, id
|
|
255
260
|
xml.cbc :IssueDate, issue_date
|
|
256
261
|
xml.cbc :DueDate, due_date
|
|
@@ -260,19 +265,23 @@ module Xrechnung
|
|
|
260
265
|
xml.cbc :Note, note
|
|
261
266
|
end
|
|
262
267
|
|
|
263
|
-
xml.cbc :TaxPointDate, tax_point_date
|
|
268
|
+
xml.cbc :TaxPointDate, tax_point_date unless tax_point_date.nil?
|
|
264
269
|
xml.cbc :DocumentCurrencyCode, document_currency_code
|
|
265
270
|
xml.cbc :TaxCurrencyCode, tax_currency_code
|
|
266
271
|
xml.cbc :BuyerReference, buyer_reference
|
|
267
272
|
|
|
273
|
+
unless self.class.members[:invoice_period].optional && invoice_period.nil?
|
|
274
|
+
invoice_period&.to_xml(xml)
|
|
275
|
+
end
|
|
276
|
+
|
|
268
277
|
xml.cac :OrderReference do
|
|
269
278
|
xml.cbc :ID, purchase_order_reference
|
|
270
|
-
unless members[:sales_order_reference]
|
|
279
|
+
unless self.class.members[:sales_order_reference].optional && sales_order_reference.nil?
|
|
271
280
|
xml.cbc :SalesOrderID, sales_order_reference
|
|
272
281
|
end
|
|
273
282
|
end
|
|
274
283
|
|
|
275
|
-
unless members[:billing_reference]
|
|
284
|
+
unless self.class.members[:billing_reference].optional && billing_reference.nil?
|
|
276
285
|
xml.cac :BillingReference do
|
|
277
286
|
billing_reference&.to_xml(xml)
|
|
278
287
|
end
|
|
@@ -294,7 +303,7 @@ module Xrechnung
|
|
|
294
303
|
accounting_customer_party&.to_xml(xml)
|
|
295
304
|
end
|
|
296
305
|
|
|
297
|
-
unless members[:tax_representative_party]
|
|
306
|
+
unless self.class.members[:tax_representative_party].optional && tax_representative_party.nil?
|
|
298
307
|
xml.cac :TaxRepresentativeParty do
|
|
299
308
|
tax_representative_party&.to_xml(xml)
|
|
300
309
|
end
|
data/xrechnung.gemspec
CHANGED
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.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julian Kornberger
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|
|
@@ -28,16 +28,16 @@ dependencies:
|
|
|
28
28
|
name: httparty
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
33
|
+
version: '0.22'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
40
|
+
version: '0.22'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rubyzip
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -52,13 +52,14 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '2.0'
|
|
55
|
-
description:
|
|
55
|
+
description:
|
|
56
56
|
email:
|
|
57
57
|
- jk+github@digineo.de
|
|
58
58
|
executables: []
|
|
59
59
|
extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
|
61
61
|
files:
|
|
62
|
+
- ".github/workflows/rspec.yml"
|
|
62
63
|
- ".github/workflows/validate-fixtures.yml"
|
|
63
64
|
- ".gitignore"
|
|
64
65
|
- ".rspec"
|
|
@@ -78,6 +79,7 @@ files:
|
|
|
78
79
|
- lib/xrechnung/id.rb
|
|
79
80
|
- lib/xrechnung/invoice_document_reference.rb
|
|
80
81
|
- lib/xrechnung/invoice_line.rb
|
|
82
|
+
- lib/xrechnung/invoice_period.rb
|
|
81
83
|
- lib/xrechnung/item.rb
|
|
82
84
|
- lib/xrechnung/legal_monetary_total.rb
|
|
83
85
|
- lib/xrechnung/member_container.rb
|
|
@@ -101,7 +103,7 @@ licenses:
|
|
|
101
103
|
metadata:
|
|
102
104
|
homepage_uri: https://github.com/digineo/xrechnung
|
|
103
105
|
source_code_uri: https://github.com/digineo/xrechnung
|
|
104
|
-
post_install_message:
|
|
106
|
+
post_install_message:
|
|
105
107
|
rdoc_options: []
|
|
106
108
|
require_paths:
|
|
107
109
|
- lib
|
|
@@ -116,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
116
118
|
- !ruby/object:Gem::Version
|
|
117
119
|
version: '0'
|
|
118
120
|
requirements: []
|
|
119
|
-
rubygems_version: 3.
|
|
120
|
-
signing_key:
|
|
121
|
+
rubygems_version: 3.4.19
|
|
122
|
+
signing_key:
|
|
121
123
|
specification_version: 4
|
|
122
124
|
summary: Library to create invoices in the XRechnung format.
|
|
123
125
|
test_files: []
|