From: Charles McGarvey Date: Sat, 17 Aug 2019 21:34:12 +0000 (-0600) Subject: skip posting payee if it matches transaction X-Git-Tag: v0.005~4 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=2cb8cd6b61921ef8f051f9066411deb4c829b68d;p=chaz%2Fhomebank2ledger skip posting payee if it matches transaction --- 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).':'; } }