+sub get_chart_balances {
+  my ($self, @chart_ids) = @_;
+
+  return () unless @chart_ids;
+
+  my $placeholders = join ', ', ('?') x scalar(@chart_ids);
+  my $query = qq|SELECT chart_id, SUM(amount) AS sum
+                 FROM acc_trans
+                 WHERE chart_id IN (${placeholders})
+                 GROUP BY chart_id|;
+
+  my %balances = selectall_as_map($::form, $::form->get_standard_dbh(\%::myconfig), $query, 'chart_id', 'sum', @chart_ids);
+
+  return %balances;
+}
+
+sub get_active_taxes_for_chart {
+  my ($self, $chart_id, $transdate) = @_;
+
+  my $chart         = SL::DB::Chart->new(id => $chart_id)->load;
+  my $active_taxkey = $chart->get_active_taxkey($transdate);
+  my $taxes         = SL::DB::Manager::Tax->get_all(
+    where   => [ chart_categories => { like => '%' . $chart->category . '%' }],
+    sort_by => 'taxkey, rate',
+  );
+
+  my $default_tax            = first { $active_taxkey->tax_id == $_->id } @{ $taxes };
+  $default_tax->{is_default} = 1 if $default_tax;
+
+  return @{ $taxes };