X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank2ledger;a=blobdiff_plain;f=lib%2FApp%2FHomeBank2Ledger.pm;h=2075bd80e2227547b41cde202b2a7b62f0f120f0;hp=52f426783dbbc815757b1f661953ebcd7df421a8;hb=acbf9960f68f612f5ba8cfaaec2fb7fda27e20e2;hpb=2752b344bcd543f73fceea80dcdbb11c20dc592a diff --git a/lib/App/HomeBank2Ledger.pm b/lib/App/HomeBank2Ledger.pm index 52f4267..2075bd8 100644 --- a/lib/App/HomeBank2Ledger.pm +++ b/lib/App/HomeBank2Ledger.pm @@ -11,13 +11,6 @@ This module is part of the L script. =cut -# TODO - add posting memo -# TODO - transaction description ("narration" in beancount) -# TODO - payees -# TODO - budget/scheduled -# TODO - consolidate tags on transaction -# TODO - consolidate payees on transaction - use warnings FATAL => 'all'; # temp fatal all use strict; @@ -198,7 +191,7 @@ sub convert_homebank_to_ledger { } if ($has_initial_balance) { - # transactions are sorted, so the first transaction is the earliest + # transactions are sorted, so the first transaction is the oldest my $first_date = $opts->{opening_date} || $transactions->[0]{date}; if ($first_date !~ /^\d{4}-\d{2}-\d{2}$/) { die "Opening date must be in the form YYYY-MM-DD.\n"; @@ -313,7 +306,7 @@ sub convert_homebank_to_ledger { commodity => $commodities{$account->{currency}}, amount => -$transaction->{amount}, payee => $payee->{name}, - memo => '', # TODO + memo => $memo, status => $status, tags => $tags, }; @@ -328,7 +321,8 @@ sub convert_homebank_to_ledger { $ledger->add_transactions({ date => $transaction->{date}, - payee => 'Payee TODO', + payee => $payee->{name}, + memo => $memo, postings => \@postings, }); }