From: Charles McGarvey Date: Sat, 17 Aug 2019 18:38:42 +0000 (-0600) Subject: do not add duplicate "unknown" accounts X-Git-Tag: v0.005~7 X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank2ledger;a=commitdiff_plain;h=4ea7ddc5c5393a9e6493dee172c5e3ae8a0f89c9;hp=f4e4bb40c65810f62b4c5fc5fa48a7d4df712918 do not add duplicate "unknown" accounts --- 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);