ynab-bank-importer
ynab-bank-importer copied to clipboard
inaccurate payee_name for Sparkasse transactions (fints dumper)
Hi,
It seems that for many transactions I a get a generic payee called Landesbank Hessen-Thuringen. If I look more closely at the transactions, I can find the actual name of the business in a different position on the source string, so that if I change these rows in fints.rb:
def payee_name(transaction)
parse_transaction_at(32, transaction).try(:strip)
end
To this:
def payee_name(transaction)
name = parse_transaction_at(32, transaction).try(:strip)
return name unless name.include? "Landesbank Hessen-Thuringen"
parse_transaction_at(22, transaction).try(:strip).split("+").last
end
I get a much nicer output. Did anyone else encounter this? Is there a better way to find out where the payee is located in the source string?
Hi @yuvke can you try the latest master? I merged https://github.com/schurig/ynab-bank-importer/pull/53 the other day and it could be that it works with this.
https://github.com/railslove/cmxl/blob/master/lib/cmxl/fields/statement_details.rb#L45-L47
Hey @schurig, it doesn't solve it. But it does simplify the code a bit... The main issue as I see it is that sometimes the payee is a service like PaySquare or the payment is to Landesbank Hessen-Thuringen even though the actual transaction occurred at one of their clients. The only problem is I don't know the list of such possible Payments Aggregators (is that even the right name?)... My current code is something like this:
def isPaymentAggregator?(str)
aggs = ["Landesbank Hessen-Thuringen", "PaySquare"]
aggs.select {|agg| str.include? agg }.length > 0
end
def payee_name(transaction)
name = transaction.name.try(:strip)
return name unless name !=nil && isPaymentAggregator?(name)
name = transaction.sub_fields['22'].try { |str| str.split("+").last }
end