ynab_convert 1.0.4 → 1.0.5

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: 7ad8f2a7b8c6b00d895032525413d35d4879da80be21e0b9fc852e1d413dbaa0
4
- data.tar.gz: 99b9168cb23390fe15deec8f0c9c3c27cda183f95867b2849d79fa4e4a704c4d
3
+ metadata.gz: 58ad75b7f1c6b3093257d8ffb95068967324a621be48bc6e08063548d4a9f2bd
4
+ data.tar.gz: 70bc35076e068aece838b52853f5b7f7656199b67e5b2f3ca78a4aec66037ffb
5
5
  SHA512:
6
- metadata.gz: 630775dd15ab4f65a32c6dbe9617bea36c0721ff9d5cca49ee986f4e04831fa9335b41b996b2b3f69bbce630e452ae9045d3d98ec9b3d6862c84f6fb0077a1a6
7
- data.tar.gz: 3bdf9b06d5327815fc31b8b3b9a9f6fb52e606ae6dc900501ff8fdf0671c110effe02dd5ca625fed0c3bbeb884b9572ff18ce7b9e46b8c21dd61d0a4b685956c
6
+ metadata.gz: 56621762f02d97515a0f3ce829d5b7bfe9ffb1fe862a6b0e92197ac2b555abe84102900f7eef28f67c7c0570efdf0bc3ea8005c8adb68f9c598a7f0fba94f6e9
7
+ data.tar.gz: 86a99a7d007c05b7aa3f6e6f3ed211ac009989bd8e31fefbef0db3d9a503dc765ecea825b9e1f6d237d2e26c7c59a455010f975183085037cf8bd2dcb95e8a04
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ynab_convert (1.0.4)
4
+ ynab_convert (1.0.5)
5
5
  i18n
6
6
  slop
7
7
 
@@ -59,12 +59,22 @@ module Processor
59
59
  end
60
60
 
61
61
  def transaction_payee(row)
62
- # Transaction description is spread over 3 columns
62
+ # Transaction description is spread over 3 columns.
63
+ # Moreover, UBS thought wise to append a bunch of junk information after
64
+ # the transaction details within the third description field. *Most* of
65
+ # this junk starts after the meaningful data and starts with ", OF",
66
+ # ", ON", ", ESR", two digits then five groups of five digits then ", TN"
67
+ # so we discard it; YNAB4 being unable to automatically categorize new
68
+ # transactions at the same store/payee because the payee always looks
69
+ # different (thanks to the variable nature of the appended junk).
70
+ # See `spec/fixtures/ubs_chequing/statement.csv` L18 and L2.
71
+ junk_desc_regex = /, (O[FN]|ESR|\d{2} \d{5} \d{5} \d{5} \d{5} \d{5}, TN)/
72
+
63
73
  [
64
74
  row[headers[:payee_line_1]],
65
75
  row[headers[:payee_line_2]],
66
76
  row[headers[:payee_line_3]]
67
- ].join(' ')
77
+ ].join(' ').split(junk_desc_regex).first
68
78
  end
69
79
 
70
80
  def register_custom_converters
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YnabConvert
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
5
5
  end
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
4
+ version: 1.0.5
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-05 00:00:00.000000000 Z
11
+ date: 2022-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler