<% if ($display eq 'statement') { %> <% if ( scalar keys %{$settings->{$display . '_displays'}} > 0) { %> <% } %> <% } %>
Balances

<% my $total_balance; %> Count: <%= scalar @{$transactions} %> <% foreach my $account ( sort keys %{$accounts} ) { %> <%= &subs::format_name($accounts->{$account}->{'app'}) %>: <%= &subs::price_formatter($accounts->{$account}->{'balance'}) %> <% $total_balance = $total_balance + $accounts->{$account}->{'balance'}; %> <% } %> Total: <%= &subs::price_formatter($total_balance) %>
<% if ($display eq 'statement') { %> <% foreach my $d (qw/income expense transfer/) { %> <% foreach my $col ( @{$columns} ) { %> <% unless ($col eq 'all') { %> <% } %> <% } %> <% foreach my $app ( sort keys %{$tally} ) { %> <% if (eval {scalar @{$tally->{$app}->{$d}}} > 0) { %> <% if (grep { $_ eq 'app' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'when' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'occurences' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'occurence_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration_percent' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'total_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'manufacturer' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'item' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'vendor' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'account' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'project' } @{$columns}) { %> <% } %> <% foreach my $cash ( @{$dollas} ) { %> <% if (grep { $_ eq $cash } @{$columns}) { %> <% } %> <% } %> <% foreach my $t ( @{$tally->{$app}->{$d}} ) { %> <% if (grep { $_ eq 'app' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'when' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'occurences' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'occurence_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'duration_percent' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'total_budget' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'manufacturer' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'item' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'vendor' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'account' } @{$columns}) { %> <% } %> <% if (grep { $_ eq 'project' } @{$columns}) { %> <% } %> <% foreach my $cash (@{$dollas}) { %> <% if (grep { $_ eq $cash } @{$columns}) { %> <% } %> <% } %> <% } %> <% } %> <% } %> <% foreach my $col ( @{$columns} ) { %> <% unless ($col eq 'app') { %> <% } %> <% } %> <% } %> <% foreach my $col ( @{$columns} ) { %> <% unless ($col eq 'app') { %> <% } %> <% } %>
<%= &subs::format_name($d) %>
<%= &subs::format_name($col) %>
<%= &subs::format_name($app) %><%= $tally->{$app}->{'totals'}->{'occurences'} %><%= $tally->{$app}->{'budget'}->{'occurences'}->{'formatted_budget'} %><%= &subs::duration_sayer($tally->{$app}->{'totals'}->{'duration'} / 1000) %><%= $tally->{$app}->{'budget'}->{'duration'}->{'formatted_budget'} %><%= abs &subs::percent_formatter($tally->{$app}->{'totals'}->{$d}->{'duration'} / $total_duration) %><%= $tally->{$app}->{'budget'}->{'total'}->{'formatted_budget'} %><%= &subs::format_name($tally->{$app}->{'budget'}->{'total'}->{$d}->{'manufacturer'}) %><%= &subs::format_name($tally->{$app}->{'budget'}->{'total'}->{$d}->{'item'}) %><%= &subs::format_name($tally->{$app}->{'budget'}->{'total'}->{$d}->{'vendor'}) %><%= &subs::price_formatter($tally->{$app}->{'totals'}->{$d}->{$cash}) %>
Total <%= &subs::format_name($d) %> <% if (grep { $_ eq $col } @{$dollas}) { %> <%= &subs::price_formatter($totals->{$d}->{$col}) %> <% } else { %> <%= $totals->{$d}->{$col} %> <% } %>
Total <% if (grep { $_ eq $col } @{$dollas}) { %> <%= &subs::price_formatter($totals->{'total'}->{$col}) %> <% } elsif (grep { $_ eq $col } qw/duration/) { %> <%= &subs::duration_sayer($totals->{'total'}->{$col} / 1000) %> <% } else { %> <%= $totals->{'total'}->{$col} %> <% } %>
<% } elsif ($display eq 'budgets') { %> <% foreach my $dr ( sort keys %{$gb::budget_modes} ) { %> <% } %> <% foreach my $b ( sort keys %{$tally} ) { %> <% foreach my $dr ( sort keys %{$gb::budget_modes} ) { %> <% } %> <% } %>
App<%= &subs::format_name($dr) %>
<%= &subs::format_name($b) %>
<% } elsif ($display eq 'daily_sheet') { %> <% foreach my $d ( @{$dollas} ) { %><% } %> <% my $starter = {}; %> <% foreach my $cat ( sort { $a cmp $b } keys %{$categories} ) { %> <% foreach my $ca ( grep { $_ ne 'info' } keys %{$categories->{$cat}} ) { %> <% foreach my $d ( @{$dollas} ) { %> <% } %> <% foreach my $l ( sort { $a->{'timestamp'} <=> $b->{'timestamp'} } @{$categories->{$cat}->{$ca}->{'list'}} ) { %> <% unless ($starter->{$l->{'app'}}) { $starter->{$l->{'app'}} = $start; } %> <% my $current_appts = &subs::db_query('select * from appointments where app=? and ( type=? or type = ? or type = ? or type = ? ) and timestamp >= ? and timestamp <= ?', $l->{'app'}, 'stop', 'start', 'record','usual', $starter->{$l->{'app'}}, $l->{'timestamp'})->hashes; %> <% $starter->{$l->{'app'}} = $l->{'timestamp'}; %> <% } %> <% } %> <% } %>
CatApp<%= &subs::format_name($d) %>
<% for (my $count = 0; $count < $categories->{$cat}->{$ca}->{'ca'} || 0; $count++ ) { %>  <% } %> <%= $cat %> <%= $ca %> <%= &subs::price_formatter($categories->{$cat}->{$ca}->{$d}) %>
-- <%= scalar @{$current_appts} %> <%= &subs::format_name($l->{'app'}) %> <%= $l->{'quantity'} || -1 %> <%= $l->{'unit'} || '' %> <%= $l->{'type'} %>
<% } elsif ($display eq 'invoices') { %> <% foreach my $d ( qw/income expense inventory transfer/ ) { %> <% foreach my $app ( sort keys %{$tally} ) { %> <% if (eval {scalar @{$tally->{$app}->{$d}}} > 0) { %> <%= $d %> <%= $app %> <% } %> <% } %> <% } %> <% } %>