]> Dogcows Code - chaz/homebank2ledger/blobdiff - lib/App/HomeBank2Ledger.pm
do not add duplicate "unknown" accounts
[chaz/homebank2ledger] / lib / App / HomeBank2Ledger.pm
index 367f42597343ab036d4a6baf2825d8eed7d27fd4..022f2c310ecae417437bde7f5223bd5702c6b39e 100644 (file)
@@ -11,7 +11,7 @@ This module is part of the L<homebank2ledger> script.
 
 =cut
 
-use warnings FATAL => 'all';    # temp fatal all
+use warnings;
 use strict;
 
 use App::HomeBank2Ledger::Formatter;
@@ -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.017054 seconds and 4 git commands to generate.