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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85f6bbc0d3b93bd081c3bbb00ac463b6907937b9520b628abc078785f48efa70
4
- data.tar.gz: e1e9c68239d2fd2b912561b521d64d97429d2f52af2a664351773cafeb35f546
3
+ metadata.gz: 92590bdbb35e07a65cd7b8dbb244a276a5efdcb05c424b0a3372f562742dc79e
4
+ data.tar.gz: 73d29480cb94c937a465f31b3342ff7bc4cdb4df23a6ad9b6c47db624cdf8488
5
5
  SHA512:
6
- metadata.gz: 032a11a0ec0797c262e9dd19c9ddaec04ffd63223674273c9674c7de90d48fe48386700a2934b23e54423f79a7a530367802440237faa3f637457a9135151775
7
- data.tar.gz: bedf78c43c86ecb9b9de4f9c4560158a1666d6c19e8b7e05b7f8dbb803ac59d00bc14d8b590ce82ebf21e0074bcbff4a45f47010ee17716ae2dd742a83f6f82f
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
- return unless exchange_rate_value
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.6
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-14 00:00:00.000000000 Z
12
+ date: 2023-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: license_finder