xrechnung 0.2.0 → 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 +1 -1
- data/.github/workflows/validate-fixtures.yml +2 -2
- data/Gemfile.lock +27 -20
- data/lib/xrechnung/invoice_line.rb +3 -1
- data/lib/xrechnung/legal_monetary_total.rb +1 -1
- 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/xrechnung.gemspec +1 -1
- metadata +7 -7
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
|
data/.github/workflows/rspec.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
name: Validate spec fixtures
|
2
2
|
|
3
|
-
on: push
|
3
|
+
on: [push, pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
6
|
validate:
|
@@ -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
|
data/Gemfile.lock
CHANGED
@@ -1,45 +1,48 @@
|
|
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.
|
11
|
+
builder (3.3.0)
|
12
|
+
csv (3.3.0)
|
12
13
|
diff-lcs (1.5.1)
|
13
|
-
httparty (0.
|
14
|
+
httparty (0.22.0)
|
15
|
+
csv
|
14
16
|
mini_mime (>= 1.0.0)
|
15
17
|
multi_xml (>= 0.5.2)
|
16
|
-
json (2.7.
|
18
|
+
json (2.7.2)
|
17
19
|
language_server-protocol (3.17.0.3)
|
18
20
|
mini_mime (1.1.5)
|
19
21
|
multi_xml (0.6.0)
|
20
|
-
parallel (1.
|
21
|
-
parser (3.3.0
|
22
|
+
parallel (1.25.1)
|
23
|
+
parser (3.3.3.0)
|
22
24
|
ast (~> 2.4.1)
|
23
25
|
racc
|
24
|
-
racc (1.
|
26
|
+
racc (1.8.0)
|
25
27
|
rainbow (3.1.1)
|
26
|
-
rake (13.1
|
27
|
-
regexp_parser (2.9.
|
28
|
-
rexml (3.
|
28
|
+
rake (13.2.1)
|
29
|
+
regexp_parser (2.9.2)
|
30
|
+
rexml (3.3.1)
|
31
|
+
strscan
|
29
32
|
rspec (3.13.0)
|
30
33
|
rspec-core (~> 3.13.0)
|
31
34
|
rspec-expectations (~> 3.13.0)
|
32
35
|
rspec-mocks (~> 3.13.0)
|
33
36
|
rspec-core (3.13.0)
|
34
37
|
rspec-support (~> 3.13.0)
|
35
|
-
rspec-expectations (3.13.
|
38
|
+
rspec-expectations (3.13.1)
|
36
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
40
|
rspec-support (~> 3.13.0)
|
38
|
-
rspec-mocks (3.13.
|
41
|
+
rspec-mocks (3.13.1)
|
39
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
43
|
rspec-support (~> 3.13.0)
|
41
44
|
rspec-support (3.13.1)
|
42
|
-
rubocop (1.
|
45
|
+
rubocop (1.64.1)
|
43
46
|
json (~> 2.3)
|
44
47
|
language_server-protocol (>= 3.17.0)
|
45
48
|
parallel (~> 1.10)
|
@@ -50,25 +53,29 @@ GEM
|
|
50
53
|
rubocop-ast (>= 1.31.1, < 2.0)
|
51
54
|
ruby-progressbar (~> 1.7)
|
52
55
|
unicode-display_width (>= 2.4.0, < 3.0)
|
53
|
-
rubocop-ast (1.31.
|
54
|
-
parser (>= 3.3.0
|
55
|
-
rubocop-capybara (2.
|
56
|
+
rubocop-ast (1.31.3)
|
57
|
+
parser (>= 3.3.1.0)
|
58
|
+
rubocop-capybara (2.21.0)
|
56
59
|
rubocop (~> 1.41)
|
57
|
-
rubocop-factory_bot (2.
|
58
|
-
rubocop (~> 1.
|
59
|
-
rubocop-rspec (2.
|
60
|
+
rubocop-factory_bot (2.26.1)
|
61
|
+
rubocop (~> 1.61)
|
62
|
+
rubocop-rspec (2.31.0)
|
60
63
|
rubocop (~> 1.40)
|
61
64
|
rubocop-capybara (~> 2.17)
|
62
65
|
rubocop-factory_bot (~> 2.22)
|
66
|
+
rubocop-rspec_rails (~> 2.28)
|
67
|
+
rubocop-rspec_rails (2.29.1)
|
68
|
+
rubocop (~> 1.61)
|
63
69
|
ruby-progressbar (1.13.0)
|
64
70
|
rubyzip (2.3.2)
|
71
|
+
strscan (3.1.0)
|
65
72
|
unicode-display_width (2.5.0)
|
66
73
|
|
67
74
|
PLATFORMS
|
68
75
|
ruby
|
69
76
|
|
70
77
|
DEPENDENCIES
|
71
|
-
httparty
|
78
|
+
httparty (~> 0.22)
|
72
79
|
rake (~> 13.0)
|
73
80
|
rspec (~> 3.0)
|
74
81
|
rubocop-rspec (~> 2.1)
|
@@ -29,7 +29,9 @@ module Xrechnung
|
|
29
29
|
member :price, type: Xrechnung::Price
|
30
30
|
|
31
31
|
def initialize(**kwargs)
|
32
|
-
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
|
33
35
|
super(**kwargs)
|
34
36
|
end
|
35
37
|
|
@@ -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/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
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
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
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.4.19
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Library to create invoices in the XRechnung format.
|