ynab_convert 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +1 -1
- data/lib/ynab_convert/processor/ubs_chequing.rb +28 -6
- data/lib/ynab_convert/version.rb +1 -1
- 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: '01824e596b5db266fa8e21210a6ec3bb6742f2ead99a38a9b3ad94cb05f2c8f2'
|
4
|
+
data.tar.gz: d85fe2a7025389684640282aec1ea75ec7d933aac9c3940b38839bd156c9aa12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2215ad54cc79274403b940459c50b287789f3c4b7df632187381d97bb99c55ba4f96df372e8bfb2087fd20eef70d0e47d2a8fd1b5d4ecc2d008826230aa74a00
|
7
|
+
data.tar.gz: a1486eb5cfba186a661e8f0458c5b78bf985093812e02f551051047b8fd45ca58266cc4b18622b5d00a3e5e17a44286cd366cf01493aab68f24f8bb9eda031a7
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -59,7 +59,29 @@ module Processor
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def transaction_payee(row)
|
62
|
+
raw_payee_line = [
|
63
|
+
row[headers[:payee_line_2]],
|
64
|
+
row[headers[:payee_line_3]]
|
65
|
+
]
|
66
|
+
|
62
67
|
# Transaction description is spread over 3 columns.
|
68
|
+
# There are two types of entries:
|
69
|
+
# 1. only the first column contains data
|
70
|
+
# 2. all three columns contain data, most of it junk
|
71
|
+
#
|
72
|
+
# Cleaning them up means dropping the first column if there is anything
|
73
|
+
# in the other columns;
|
74
|
+
# removing the CARD 00000000-0 0000 at the beginning of debit card
|
75
|
+
# payment entries;
|
76
|
+
# removing the rest of the junk appended after the worthwhile data (see
|
77
|
+
# below for details on that)
|
78
|
+
if row[headers[:payee_line_2]].nil?
|
79
|
+
# Make it an Array, for consistency
|
80
|
+
raw_payee_line = [row[headers[:payee_line_1]]]
|
81
|
+
end
|
82
|
+
|
83
|
+
concat_payee_line = raw_payee_line.join(' ')
|
84
|
+
|
63
85
|
# Moreover, UBS thought wise to append a bunch of junk information after
|
64
86
|
# the transaction details within the third description field. *Most* of
|
65
87
|
# this junk starts after the meaningful data and starts with ", OF",
|
@@ -71,14 +93,14 @@ module Processor
|
|
71
93
|
# See `spec/fixtures/ubs_chequing/statement.csv` L2 and L18--22
|
72
94
|
|
73
95
|
# rubocop:disable Metrics/LineLength
|
74
|
-
junk_desc_regex = /,? (O[FN]|ESR|QRR|\d{2} \d{5} \d{5} \d{5} \d{5} \d{5}, TN)
|
96
|
+
junk_desc_regex = /,? (O[FN]|ESR|QRR|\d{2} \d{5} \d{5} \d{5} \d{5} \d{5}, TN).*/
|
75
97
|
# rubocop:enable Metrics/LineLength
|
76
98
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
99
|
+
# Of course, it wouldn't be complete with more junk information at the
|
100
|
+
# beginning of *some* lines (debit card payments)
|
101
|
+
debit_card_junk_regex = /CARD \d{8}\-\d \d{4} /
|
102
|
+
|
103
|
+
concat_payee_line.sub(junk_desc_regex, '').sub(debit_card_junk_regex, '')
|
82
104
|
end
|
83
105
|
|
84
106
|
def register_custom_converters
|
data/lib/ynab_convert/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ynab_convert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- coaxial
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|