From 2cb8cd6b61921ef8f051f9066411deb4c829b68d Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Sat, 17 Aug 2019 15:34:12 -0600 Subject: [PATCH] skip posting payee if it matches transaction --- lib/App/HomeBank2Ledger.pm | 8 ++++---- lib/App/HomeBank2Ledger/Formatter/Ledger.pm | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/App/HomeBank2Ledger.pm b/lib/App/HomeBank2Ledger.pm index 8b29dee..cd3e0db 100644 --- a/lib/App/HomeBank2Ledger.pm +++ b/lib/App/HomeBank2Ledger.pm @@ -303,7 +303,7 @@ sub convert_homebank_to_ledger { amount => $amount, commodity => $commodities{$account->{currency}}, payee => $payee->{name}, - memo => $memo, + note => $memo, status => $status, tags => $tags, }; @@ -332,7 +332,7 @@ sub convert_homebank_to_ledger { amount => $paired_transaction->{amount} || -$transaction->{amount}, commodity => $commodities{$dst_account->{currency}}, payee => $paired_payee->{name}, - memo => $paired_transaction->{wording} || '', + note => $paired_transaction->{wording} || '', status => $STATUS_SYMBOLS{$paired_transaction->{status} || ''} || $status, tags => _split_tags($paired_transaction->{tags}), }; @@ -355,7 +355,7 @@ sub convert_homebank_to_ledger { commodity => $commodities{$account->{currency}}, amount => $amount, payee => $payee->{name}, - memo => $memo, + note => $memo, status => $status, tags => $tags, }; @@ -373,7 +373,7 @@ sub convert_homebank_to_ledger { commodity => $commodities{$account->{currency}}, amount => $amount, payee => $payee->{name}, - memo => $memo, + note => $memo, status => $status, tags => $tags, }; diff --git a/lib/App/HomeBank2Ledger/Formatter/Ledger.pm b/lib/App/HomeBank2Ledger/Formatter/Ledger.pm index e4ecb2a..677facb 100644 --- a/lib/App/HomeBank2Ledger/Formatter/Ledger.pm +++ b/lib/App/HomeBank2Ledger/Formatter/Ledger.pm @@ -247,12 +247,13 @@ sub _format_transaction { push @out, join('', @line); - if (my $payee = $posting->{payee}) { - push @out, ' ; Payee: '.$self->_format_string($payee); + if (my $posting_payee = $posting->{payee}) { + $posting_payee = $self->_format_string($posting_payee); + push @out, " ; Payee: $posting_payee" if $posting_payee ne $payee; } if (my @tags = @{$posting->{tags} || []}) { - push @out, " ; :".join(':', @tags).":"; + push @out, ' ; :'.join(':', @tags).':'; } } -- 2.45.2