From 4ea7ddc5c5393a9e6493dee172c5e3ae8a0f89c9 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Sat, 17 Aug 2019 12:38:42 -0600 Subject: [PATCH] do not add duplicate "unknown" accounts --- lib/App/HomeBank2Ledger.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/App/HomeBank2Ledger.pm b/lib/App/HomeBank2Ledger.pm index cc7a3e9..022f2c3 100644 --- a/lib/App/HomeBank2Ledger.pm +++ b/lib/App/HomeBank2Ledger.pm @@ -162,7 +162,8 @@ sub convert_homebank_to_ledger { if ($opts->{accounts}) { my @accounts = map { $_->{ledger_name} } grep { !$_->{excluded} } @$accounts, @$categories; - push @accounts, $default_account_income, $default_account_expenses; + push @accounts, $default_account_income if !grep { $_ eq $default_account_income } @accounts; + push @accounts, $default_account_expenses if !grep { $_ eq $default_account_expenses } @accounts; push @accounts, $OPENING_BALANCES_ACCOUNT if $has_initial_balance; $ledger->add_accounts(@accounts); -- 2.45.2