skv_report 0.3.4 → 0.3.6
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/.ruby-version +1 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +43 -83
- data/lib/skv_report/stripe.rb +9 -1
- data/lib/skv_report/stripe_charge_row.rb +3 -3
- data/lib/skv_report/version.rb +1 -1
- data/skv_report.gemspec +3 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f539fc72f07bd1058801be68ba73fd09c16f53eea29be237e6a6f9c2988fe420
|
4
|
+
data.tar.gz: 3f763ceb8b2b9940912f1ab6306f02fbc354820f84a95154701fb43fd77fb9b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 773c8d07f0d6804dfa60b018ad89f37a48f2e508ad72bd9c42faa58d475bb75878e2c659f3e9129604540a6312c4972ab0f76b38bb4beba00bbeb776c8b01a11
|
7
|
+
data.tar.gz: 110abfeafc2219ddf510c830ab827e0f7d46d98ff93b54fb575ab1234fa3b5563802b7499d00f1605622eb5a2ff163683cde8c64f34eb1a13f644a6032708389
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.6
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,119 +1,79 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
skv_report (0.3.
|
4
|
+
skv_report (0.3.6)
|
5
5
|
countries (~> 3.1.0)
|
6
6
|
money (~> 6.14)
|
7
|
+
rexml (~> 3.2)
|
7
8
|
valvat (~> 1.1)
|
8
9
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
|
13
|
-
|
14
|
-
akami (1.3.1)
|
15
|
-
gyoku (>= 0.4.0)
|
16
|
-
nokogiri
|
17
|
-
ast (2.4.1)
|
18
|
-
builder (3.2.4)
|
19
|
-
byebug (11.1.3)
|
20
|
-
coderay (1.1.3)
|
21
|
-
concurrent-ruby (1.1.8)
|
13
|
+
ast (2.4.2)
|
14
|
+
concurrent-ruby (1.1.10)
|
22
15
|
countries (3.1.0)
|
23
16
|
i18n_data (~> 0.11.0)
|
24
17
|
sixarm_ruby_unaccent (~> 1.1)
|
25
18
|
unicode_utils (~> 1.4)
|
26
|
-
diff-lcs (1.
|
27
|
-
|
28
|
-
builder (>= 2.1.2)
|
29
|
-
httpi (2.5.0)
|
30
|
-
rack
|
31
|
-
socksify
|
32
|
-
i18n (1.8.10)
|
19
|
+
diff-lcs (1.5.0)
|
20
|
+
i18n (1.12.0)
|
33
21
|
concurrent-ruby (~> 1.0)
|
34
22
|
i18n_data (0.11.0)
|
35
|
-
|
36
|
-
|
37
|
-
money (6.14.1)
|
23
|
+
json (2.6.2)
|
24
|
+
money (6.16.0)
|
38
25
|
i18n (>= 0.6.4, <= 2)
|
39
|
-
|
40
|
-
|
41
|
-
racc (~> 1.4)
|
42
|
-
nori (2.6.0)
|
43
|
-
parallel (1.20.1)
|
44
|
-
parser (3.0.0.0)
|
26
|
+
parallel (1.22.1)
|
27
|
+
parser (3.1.2.1)
|
45
28
|
ast (~> 2.4.1)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
regexp_parser (2.0.3)
|
58
|
-
rexml (3.2.4)
|
59
|
-
rspec (3.10.0)
|
60
|
-
rspec-core (~> 3.10.0)
|
61
|
-
rspec-expectations (~> 3.10.0)
|
62
|
-
rspec-mocks (~> 3.10.0)
|
63
|
-
rspec-core (3.10.1)
|
64
|
-
rspec-support (~> 3.10.0)
|
65
|
-
rspec-expectations (3.10.1)
|
29
|
+
rainbow (3.1.1)
|
30
|
+
rake (13.0.6)
|
31
|
+
regexp_parser (2.6.1)
|
32
|
+
rexml (3.2.5)
|
33
|
+
rspec (3.12.0)
|
34
|
+
rspec-core (~> 3.12.0)
|
35
|
+
rspec-expectations (~> 3.12.0)
|
36
|
+
rspec-mocks (~> 3.12.0)
|
37
|
+
rspec-core (3.12.0)
|
38
|
+
rspec-support (~> 3.12.0)
|
39
|
+
rspec-expectations (3.12.0)
|
66
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
67
|
-
rspec-support (~> 3.
|
68
|
-
rspec-mocks (3.
|
41
|
+
rspec-support (~> 3.12.0)
|
42
|
+
rspec-mocks (3.12.0)
|
69
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-support (3.
|
72
|
-
rubocop (1.
|
44
|
+
rspec-support (~> 3.12.0)
|
45
|
+
rspec-support (3.12.0)
|
46
|
+
rubocop (1.39.0)
|
47
|
+
json (~> 2.3)
|
73
48
|
parallel (~> 1.10)
|
74
|
-
parser (>= 2.
|
49
|
+
parser (>= 3.1.2.1)
|
75
50
|
rainbow (>= 2.2.2, < 4.0)
|
76
51
|
regexp_parser (>= 1.8, < 3.0)
|
77
|
-
rexml
|
78
|
-
rubocop-ast (>= 1.
|
52
|
+
rexml (>= 3.2.5, < 4.0)
|
53
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
79
54
|
ruby-progressbar (~> 1.7)
|
80
|
-
unicode-display_width (>= 1.4.0, <
|
81
|
-
rubocop-ast (1.
|
82
|
-
parser (>=
|
83
|
-
rubocop-performance (1.
|
84
|
-
rubocop (>=
|
55
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
56
|
+
rubocop-ast (1.23.0)
|
57
|
+
parser (>= 3.1.1.0)
|
58
|
+
rubocop-performance (1.15.1)
|
59
|
+
rubocop (>= 1.7.0, < 2.0)
|
85
60
|
rubocop-ast (>= 0.4.0)
|
86
|
-
rubocop-rake (0.
|
87
|
-
rubocop
|
88
|
-
rubocop-rspec (2.1.0)
|
61
|
+
rubocop-rake (0.6.0)
|
89
62
|
rubocop (~> 1.0)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
akami (~> 1.2)
|
94
|
-
builder (>= 2.1.2)
|
95
|
-
gyoku (~> 1.2)
|
96
|
-
httpi (~> 2.3)
|
97
|
-
nokogiri (>= 1.8.1)
|
98
|
-
nori (~> 2.4)
|
99
|
-
wasabi (~> 3.4)
|
63
|
+
rubocop-rspec (2.15.0)
|
64
|
+
rubocop (~> 1.33)
|
65
|
+
ruby-progressbar (1.11.0)
|
100
66
|
sixarm_ruby_unaccent (1.2.0)
|
101
|
-
|
102
|
-
unicode-display_width (1.7.0)
|
67
|
+
unicode-display_width (2.3.0)
|
103
68
|
unicode_utils (1.4.0)
|
104
|
-
valvat (1.1
|
105
|
-
|
106
|
-
wasabi (3.6.1)
|
107
|
-
addressable
|
108
|
-
httpi (~> 2.0)
|
109
|
-
nokogiri (>= 1.4.2)
|
69
|
+
valvat (1.2.1)
|
70
|
+
rexml (>= 3.2, < 4.0)
|
110
71
|
|
111
72
|
PLATFORMS
|
112
73
|
ruby
|
113
74
|
x86_64-darwin-19
|
114
75
|
|
115
76
|
DEPENDENCIES
|
116
|
-
pry-byebug
|
117
77
|
rake (~> 13.0)
|
118
78
|
rspec (~> 3.0)
|
119
79
|
rubocop (~> 1.7)
|
@@ -123,4 +83,4 @@ DEPENDENCIES
|
|
123
83
|
skv_report!
|
124
84
|
|
125
85
|
BUNDLED WITH
|
126
|
-
2.
|
86
|
+
2.3.11
|
data/lib/skv_report/stripe.rb
CHANGED
@@ -17,6 +17,7 @@ module SKVReport
|
|
17
17
|
# name: String, # contact name on selling company
|
18
18
|
# phone: String, # phone to contact on selling company
|
19
19
|
# email: String, # optional email to contact on selling company
|
20
|
+
# period_type: String, # defaults to 'quarter', can be set to month
|
20
21
|
# type_of_sales: String, # one of the following three
|
21
22
|
# ['wares', 'third_party', 'services']
|
22
23
|
# }
|
@@ -106,7 +107,14 @@ module SKVReport
|
|
106
107
|
end
|
107
108
|
|
108
109
|
def year_and_period
|
109
|
-
|
110
|
+
case @company_information.fetch(:period_type, 'quarter').to_s
|
111
|
+
when 'quarter'
|
112
|
+
"#{year_short}-#{period}"
|
113
|
+
when 'month'
|
114
|
+
"#{year_short}#{period.to_s.rjust(2, '0')}"
|
115
|
+
else
|
116
|
+
raise "Unsupported period type #{@company_information[:period_type]}"
|
117
|
+
end
|
110
118
|
end
|
111
119
|
|
112
120
|
def year_short
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'money'
|
4
|
-
require 'valvat
|
4
|
+
require 'valvat'
|
5
5
|
require 'date'
|
6
6
|
require 'countries/global'
|
7
7
|
|
@@ -40,11 +40,11 @@ module SKVReport
|
|
40
40
|
private
|
41
41
|
|
42
42
|
def vat_number
|
43
|
-
tax_object = charge.dig('customer', 'tax_ids', 'data')
|
43
|
+
tax_object = charge.dig('customer', 'tax_ids', 'data')&.find do |tax_data|
|
44
44
|
tax_data['type'].casecmp?('eu_vat')
|
45
45
|
end
|
46
46
|
|
47
|
-
tax_object&.fetch('value',
|
47
|
+
tax_object&.fetch('value', nil)
|
48
48
|
end
|
49
49
|
|
50
50
|
def swedish_buyer?
|
data/lib/skv_report/version.rb
CHANGED
data/skv_report.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['frdrkolsson']
|
9
9
|
spec.email = ['fredrik.olsson@standout.se']
|
10
10
|
|
11
|
-
spec.summary = 'Generates CSV complete string for Skatteverkets '\
|
11
|
+
spec.summary = 'Generates CSV complete string for Skatteverkets ' \
|
12
12
|
'Periodisk Sammanfattning'
|
13
13
|
spec.description = spec.summary
|
14
14
|
spec.homepage = 'https://github.com/standout/skv_report'
|
@@ -34,8 +34,10 @@ Gem::Specification.new do |spec|
|
|
34
34
|
# spec.add_dependency to register a new dependency of your gem
|
35
35
|
spec.add_dependency 'countries', '~> 3.1.0'
|
36
36
|
spec.add_dependency 'money', '~> 6.14'
|
37
|
+
spec.add_dependency 'rexml', '~> 3.2'
|
37
38
|
spec.add_dependency 'valvat', '~> 1.1'
|
38
39
|
|
39
40
|
# For more information and examples about making a new gem, checkout our
|
40
41
|
# guide at: https://bundler.io/guides/creating_gem.html
|
42
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
41
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skv_report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- frdrkolsson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '6.14'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rexml
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: valvat
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,6 +78,7 @@ files:
|
|
64
78
|
- ".gitignore"
|
65
79
|
- ".rspec"
|
66
80
|
- ".rubocop.yml"
|
81
|
+
- ".ruby-version"
|
67
82
|
- Gemfile
|
68
83
|
- Gemfile.lock
|
69
84
|
- LICENSE.txt
|
@@ -84,6 +99,7 @@ metadata:
|
|
84
99
|
homepage_uri: https://github.com/standout/skv_report
|
85
100
|
source_code_uri: https://github.com/standout/skv_report
|
86
101
|
changelog_uri: https://github.com/standout/skv_report
|
102
|
+
rubygems_mfa_required: 'true'
|
87
103
|
post_install_message:
|
88
104
|
rdoc_options: []
|
89
105
|
require_paths:
|
@@ -99,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
115
|
- !ruby/object:Gem::Version
|
100
116
|
version: '0'
|
101
117
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.3.7
|
103
119
|
signing_key:
|
104
120
|
specification_version: 4
|
105
121
|
summary: Generates CSV complete string for Skatteverkets Periodisk Sammanfattning
|