- my $amount = -$amounts[$i];
- my $category = $homebank->find_category_by_key($categories[$i]);
- my $memo = $memos[$i] || '';
- my $other_account = $category ? $category->{ledger_name} : $opts->{default_account};
+ my $amount = -$amounts[$i];
+ my $category = $homebank->find_category_by_key($categories[$i]);
+ my $memo = $memos[$i] || '';
+ my $other_account = $category ? $category->{ledger_name}
+ : $amount < 0 ? $default_account_income
+ : $default_account_expenses;