cfonb 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfonb/operation_detail/mmo.rb +2 -1
- data/spec/cfonb/operation_spec.rb +14 -0
- 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: 92590bdbb35e07a65cd7b8dbb244a276a5efdcb05c424b0a3372f562742dc79e
|
4
|
+
data.tar.gz: 73d29480cb94c937a465f31b3342ff7bc4cdb4df23a6ad9b6c47db624cdf8488
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e893921454fdfb646796d64a0cf0d1a1150488ccf73952d23e55db36d2d5e7551eab014550006195cbde4c2915aa52e6a50253605d98d2f1edc3871baf58ed1
|
7
|
+
data.tar.gz: a44a4b448a3bcb560bd0f4bc61dbd7beb1bf5083ffcb72be1862546af6d0f59dd549e758e796f0e3ff5e6915b94e46ac4fb3fa0b2c1d3f4c81f9c9f28cb263e0
|
@@ -15,7 +15,8 @@ module CFONB
|
|
15
15
|
|
16
16
|
operation.original_amount = sign * BigDecimal(line.detail[4..17]) / (10**scale)
|
17
17
|
exchange_rate_value = line.detail[26..29]
|
18
|
-
|
18
|
+
|
19
|
+
return if exchange_rate_value.nil? || exchange_rate_value.strip.empty?
|
19
20
|
|
20
21
|
exchange_rate_scale = line.detail[18]
|
21
22
|
operation.exchange_rate = BigDecimal(exchange_rate_value) / (10**BigDecimal(exchange_rate_scale))
|
@@ -106,6 +106,20 @@ describe CFONB::Operation do
|
|
106
106
|
)
|
107
107
|
end
|
108
108
|
end
|
109
|
+
|
110
|
+
context 'when exchange rate is missing' do
|
111
|
+
let(:detail) { OpenStruct.new(body: '', detail_code: 'MMO', detail: 'EUR200000001875625 04') }
|
112
|
+
|
113
|
+
it 'Adds the original currency information' do
|
114
|
+
operation.merge_detail(detail)
|
115
|
+
|
116
|
+
expect(operation).to have_attributes(
|
117
|
+
original_currency: 'EUR',
|
118
|
+
original_amount: -18_756.25,
|
119
|
+
exchange_rate: nil,
|
120
|
+
)
|
121
|
+
end
|
122
|
+
end
|
109
123
|
end
|
110
124
|
|
111
125
|
context 'with a NPY detail' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfonb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Le Bray
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-11-
|
12
|
+
date: 2023-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: license_finder
|