abo_parser 1.0.5 → 1.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: 773712f42277729a75eedb1f1c515e0136c7fff8d7571764a2b3bfefda52231c
4
- data.tar.gz: b9af11dd27ffd1fd9244bd6529258722cb02761e9f6286ffccb0013066baf749
3
+ metadata.gz: bedd61dfabcfdb6282d302036eea42424235150758b28483466cd264b6aceaa2
4
+ data.tar.gz: 883e4e3be76cff14c19685ea9a1d0309ed7b92808e8c8c97412732143c13a722
5
5
  SHA512:
6
- metadata.gz: cf3b958d78cc79de1b584a5d350424a2d4a31ed504f6d5e38b877e0c6734d9864c0036ea87c4708b283d0b413b474699e1e1b7ce307057bd081de7b9e495ad6e
7
- data.tar.gz: 248a7629f21a98d2c1a3e20e200733bef816af9f17c5550bf3d1da2f39b2f6d955e782d6d985b7e3e81a5647daf72ad9daf03bb0b4caac71e9bb3e75a0fd1c5c
6
+ metadata.gz: c45668baf21904f20f5ebed9d2d87cb8e433ad64387d74dc3f47bdba51c51258c0ddefae07905c843c58248ec92066040b6ad15e63f30e0fc8fdeeee7a6aa679
7
+ data.tar.gz: 5c32caa4958cdc9a83d921109bb1e41c10a31809174e623cefee13e6fa3936c9d7896353d8bd70020fd961bf853c799d2b5095ba2b066e626dc3dffba79ab410
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ## [Released]
2
2
 
3
- ## [1.0.4] - 2023-06-11
3
+ ## [1.0.6] - 2023-06-11
4
+
5
+ - strip empty spaces from bank statement lines
6
+
7
+ ## [1.0.5] - 2023-06-11
4
8
 
5
9
  - Fixed parsing 078 lines in bank statement
6
10
 
data/lib/abo.rb CHANGED
@@ -113,7 +113,7 @@ class Abo
113
113
  gpc += transaction[:counter_account_number].to_s.rjust(10, "0")
114
114
  gpc += transaction[:document_number].to_s.ljust(13, " ")
115
115
  gpc += (transaction[:amount] * 100).to_i.to_s.rjust(12, "0")
116
- gpc += transaction[:posting_code].to_s.rjust(1, "0")
116
+ gpc += transaction[:posting_code].to_s
117
117
  gpc += transaction[:variable_symbol].to_s.rjust(10, "0")
118
118
  gpc += (transaction[:counter_account_bank_code].rjust(4, "0") +
119
119
  transaction[:constant_symbol].rjust(4, "0")).rjust(
@@ -274,16 +274,14 @@ class Abo
274
274
  case transaction.posting_code
275
275
  when POSTING_CODE_DEBIT
276
276
  transaction.debit = transaction.amount
277
- transaction.posting_code = "Debit"
277
+ transaction.amount = transaction.amount * -1.0
278
278
  when POSTING_CODE_CREDIT
279
279
  transaction.credit = transaction.amount
280
- transaction.posting_code = "Credit"
281
280
  when POSTING_CODE_DEBIT_REVERSAL
282
- transaction.debit = transaction.amount * -1.0
283
- transaction.posting_code = "Debit Reversal"
281
+ transaction.debit = transaction.amount
284
282
  when POSTING_CODE_CREDIT_REVERSAL
285
- transaction.credit = transaction.amount * -1.0
286
- transaction.posting_code = "Credit Reversal"
283
+ transaction.credit = transaction.amount
284
+ transaction.amount = transaction.amount * -1.0
287
285
  end
288
286
 
289
287
  transaction
@@ -294,7 +292,7 @@ class Abo
294
292
  length = 3
295
293
 
296
294
  # rubocop:disable Lint/UselessAssignment
297
- transaction.note = line[pos += length, length = 70]
295
+ transaction.note = line[pos += length, length = 70].rstrip
298
296
  # rubocop:enable Lint/UselessAssignment
299
297
  end
300
298
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AboParser
4
- VERSION = "1.0.5"
4
+ VERSION = "1.0.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abo_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rhemery
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-03 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: