X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank2ledger;a=blobdiff_plain;f=lib%2FApp%2FHomeBank2Ledger%2FFormatter%2FBeancount.pm;fp=lib%2FApp%2FHomeBank2Ledger%2FFormatter%2FBeancount.pm;h=ca1510876a032a77fb766800d429d09aac0a3c75;hp=dc9893499e9a8c3186e03410237dcef7e668282d;hb=2761fbe1d147a87c4294277078eb6a14080de99d;hpb=c98b44648f2abff9b21d994f6c94c837ac612d41 diff --git a/lib/App/HomeBank2Ledger/Formatter/Beancount.pm b/lib/App/HomeBank2Ledger/Formatter/Beancount.pm index dc98934..ca15108 100644 --- a/lib/App/HomeBank2Ledger/Formatter/Beancount.pm +++ b/lib/App/HomeBank2Ledger/Formatter/Beancount.pm @@ -172,7 +172,7 @@ sub _format_transaction { my $date = $transaction->{date}; my $status = $transaction->{status}; my $payee = $transaction->{payee} || ''; - my $memo = $transaction->{memo} || ''; + my $memo = $transaction->{note} // $transaction->{memo} // ''; my @postings = @{$transaction->{postings}}; my @out; @@ -220,9 +220,10 @@ sub _format_transaction { push @line, ' '; if (defined $posting->{amount}) { push @line, $self->_format_amount($posting->{amount}, $posting->{commodity}); - my $lot_price = $posting->{lot_price}; - my $lot_date = $posting->{lot_date}; - my $lot_ref = $posting->{lot_ref}; + my $lot = $posting->{lot} || {}; + my $lot_price = $lot->{price} // $posting->{lot_price}; + my $lot_date = $lot->{date} // $posting->{lot_date}; + my $lot_ref = $lot->{ref} // $posting->{lot_ref}; if ($lot_price || $lot_date || $lot_ref) { push @line, ' {', join(', ',