]> Dogcows Code - chaz/homebank2ledger/commitdiff
skip posting payee if it matches transaction
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sat, 17 Aug 2019 21:34:12 +0000 (15:34 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sat, 17 Aug 2019 21:34:12 +0000 (15:34 -0600)
lib/App/HomeBank2Ledger.pm
lib/App/HomeBank2Ledger/Formatter/Ledger.pm

index 8b29dee923bf25ace43fa4bd9250e5b156dcf004..cd3e0dbfd26d5b1e0dc0c8a1e6fec39f16794bfa 100644 (file)
@@ -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,
             };
index e4ecb2a177c89daca2f22334f9cd6ae026ee364c..677facb02e72a5924617ca4e726424921d9497f7 100644 (file)
@@ -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).':';
         }
     }
 
This page took 0.033716 seconds and 4 git commands to generate.