diff --git a/cfonb.gemspec b/cfonb.gemspec index 5f84c71..bb45117 100644 --- a/cfonb.gemspec +++ b/cfonb.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = 'cfonb' - s.version = '0.0.4' + s.version = '0.0.5' s.required_ruby_version = '>= 3.2.2' s.summary = 'CFONB parser' s.description = 'An easy to use CFONB format parser' diff --git a/lib/cfonb/operation_detail/fee.rb b/lib/cfonb/operation_detail/fee.rb index dc7790c..d4b4f2a 100644 --- a/lib/cfonb/operation_detail/fee.rb +++ b/lib/cfonb/operation_detail/fee.rb @@ -8,9 +8,8 @@ class FEE def self.apply(operation, line) operation.fee_currency = line.detail[0..2] scale = line.detail[3].to_i - sign = operation.amount <=> 0 # the detail amount is unsigned - operation.fee = sign * BigDecimal(line.detail[4..17]) / (10**scale) + operation.fee = BigDecimal(line.detail[4..17]) / (10**scale) end CFONB::OperationDetail.register('FEE', self) diff --git a/spec/cfonb/operation_spec.rb b/spec/cfonb/operation_spec.rb index b5428f5..52b14d6 100644 --- a/spec/cfonb/operation_spec.rb +++ b/spec/cfonb/operation_spec.rb @@ -159,7 +159,7 @@ operation.merge_detail(detail) expect(operation.fee_currency).to eq('EUR') - expect(operation.fee).to eq(-7.4) + expect(operation.fee).to eq(7.4) end end end