sie 4.0.0 → 4.1.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/lib/sie/document.rb +3 -1
- data/lib/sie/version.rb +1 -1
- data/spec/unit/document_spec.rb +25 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f115a1741394b88505486a4cc41995e93e0c4e00065c1c2aa1bd428a7b9dd1
|
4
|
+
data.tar.gz: f9a4828e5c6acf66b4021b186ee2ec8009ff4eb7ae360195663015e2a92eca0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cc67c2a17bdf79f50d8b26c333e2e486e54685c3478f2034f93ba9137100da650fc8f503cc6905f085abf892999a00f8f799e00fdb98614299209d42b9ce48c
|
7
|
+
data.tar.gz: c260f73d18c737c32449c8e9f44cae2d784c77333a9013f86603ee9c9c31e544cbc764d810a30c0e6fecfcb5c8062935cbc726aabdd756dd17451a2cf3cd76e1
|
data/lib/sie/document.rb
CHANGED
@@ -10,7 +10,7 @@ module Sie
|
|
10
10
|
# - Visma etc -> 100
|
11
11
|
DESCRIPTION_LENGTH_MAX = 100
|
12
12
|
|
13
|
-
pattr_initialize :data_source
|
13
|
+
pattr_initialize :data_source, [ exclude_balance_rows: false ]
|
14
14
|
|
15
15
|
def render
|
16
16
|
add_header
|
@@ -55,6 +55,8 @@ module Sie
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def add_balances
|
58
|
+
return if exclude_balance_rows
|
59
|
+
|
58
60
|
financial_years.each_with_index do |date_range, index|
|
59
61
|
add_balance_rows("IB", -index, balance_account_numbers, date_range.begin)
|
60
62
|
add_balance_rows("UB", -index, balance_account_numbers, date_range.end)
|
data/lib/sie/version.rb
CHANGED
data/spec/unit/document_spec.rb
CHANGED
@@ -88,8 +88,8 @@ describe Sie::Document, "#render" do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
-
let(:
|
92
|
-
|
91
|
+
let(:data_source) {
|
92
|
+
TestDataSource.new(
|
93
93
|
accounts: accounts,
|
94
94
|
vouchers: vouchers,
|
95
95
|
program: "Foonomic",
|
@@ -101,6 +101,9 @@ describe Sie::Document, "#render" do
|
|
101
101
|
closing_account_numbers: [ 3100, 9999 ],
|
102
102
|
dimensions: dimensions
|
103
103
|
)
|
104
|
+
}
|
105
|
+
|
106
|
+
let(:doc) {
|
104
107
|
Sie::Document.new(data_source)
|
105
108
|
}
|
106
109
|
|
@@ -199,6 +202,26 @@ describe Sie::Document, "#render" do
|
|
199
202
|
)
|
200
203
|
end
|
201
204
|
|
205
|
+
it "excludes balance rows if given the option 'exclude_balance_rows'" do
|
206
|
+
document_without_balance_rows = Sie::Document.new(data_source, exclude_balance_rows: true)
|
207
|
+
sie_file = Sie::Parser.new.parse(document_without_balance_rows.render)
|
208
|
+
expect(sie_file.entries_with_label("ib")).to be_empty
|
209
|
+
expect(sie_file.entries_with_label("ub")).to be_empty
|
210
|
+
expect(sie_file.entries_with_label("res")).to be_empty
|
211
|
+
|
212
|
+
document_with_balance_rows = Sie::Document.new(data_source, exclude_balance_rows: false)
|
213
|
+
sie_file = Sie::Parser.new.parse(document_with_balance_rows.render)
|
214
|
+
expect(sie_file.entries_with_label("ib")).not_to be_empty
|
215
|
+
expect(sie_file.entries_with_label("ub")).not_to be_empty
|
216
|
+
expect(sie_file.entries_with_label("res")).not_to be_empty
|
217
|
+
|
218
|
+
document_will_default_with_balance_rows = Sie::Document.new(data_source)
|
219
|
+
sie_file = Sie::Parser.new.parse(document_will_default_with_balance_rows.render)
|
220
|
+
expect(sie_file.entries_with_label("ib")).not_to be_empty
|
221
|
+
expect(sie_file.entries_with_label("ub")).not_to be_empty
|
222
|
+
expect(sie_file.entries_with_label("res")).not_to be_empty
|
223
|
+
end
|
224
|
+
|
202
225
|
context "with really long descriptions" do
|
203
226
|
let(:accounts) {
|
204
227
|
[
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barsoom AB
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attr_extras
|