abo_parser 1.0.6 → 1.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9348b282479e8d0c1aee18b96fa5447b306e1eacc0bb6caadf507bfba9ce2c5
4
- data.tar.gz: cf7c527a3e7a491ee112076c49ca506c07ec69d748fb3601d1d010e23e064b99
3
+ metadata.gz: 2a1ee6dbe807abc8102c8392196634a1fad6c4419ace52407da0a05a8bae7a95
4
+ data.tar.gz: 2c5f38776a8976d04a9589b0896812ec425f87237f8f9c175ff72236ef99fc85
5
5
  SHA512:
6
- metadata.gz: 0bd3461f71c419329f541f0f21afcd5e94e01607838bd47c872662759647ab7be41597b0f5032971f8fc0b5fca7c75c650acc6197d6dc7fc09b0f9bc03f45d3a
7
- data.tar.gz: b9551ce3429abc3380cfcaf70c274220a836615588f3ebe3ef19301474d400cfe8df5e24ebec89e5320caf85d992449deeb682edff5adffc1faacb1720834e2e
6
+ metadata.gz: 3b7a087843121a2b62a71ec705ad89e55b0396ccb45591c673794a28a4fd099d944e077b1c7665bcd629ecc6aa748b5fd097f434bc26d3e035eb40822f3c7fa1
7
+ data.tar.gz: c868f6fc8baa91e5403009c988db355101b9d453deabd990302a4c0114a4503f270060ac79512ef86d998a4facda2f5c06e70ff46a1fdfd44d51a4656381caec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Released]
2
2
 
3
+ ## [1.0.8] - 2023-08-14
4
+
5
+ - Fix potential error when exprting bank statement with transactions that have no counter bank account
6
+
3
7
  ## [1.0.6] - 2023-06-11
4
8
 
5
9
  - strip empty spaces from bank statement lines
data/lib/abo.rb CHANGED
@@ -113,10 +113,10 @@ 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
- gpc += (transaction[:counter_account_bank_code].rjust(4, "0") +
119
- transaction[:constant_symbol].rjust(4, "0")).rjust(
118
+ gpc += (transaction[:counter_account_bank_code].to_s.rjust(4, "0") +
119
+ transaction[:constant_symbol].to_s.rjust(4, "0")).rjust(
120
120
  10, "0"
121
121
  )
122
122
  gpc += transaction[:specific_symbol].to_s.rjust(10, "0")
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AboParser
4
- VERSION = "1.0.6"
4
+ VERSION = "1.0.8"
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.6
4
+ version: 1.0.8
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-07 00:00:00.000000000 Z
11
+ date: 2023-08-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: