do not add duplicate "unknown" accounts
[chaz/homebank2ledger] / lib / App / HomeBank2Ledger.pm
index cc7a3e9ec9794bb7c8e1304200367f0a04e29a8a..022f2c310ecae417437bde7f5223bd5702c6b39e 100644 (file)
@@ -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);
This page took 0.018232 seconds and 4 git commands to generate.