&get_accounts_g($dbh, $last_period, $kummfromdate, $kummtodate, $form, "pos_bwa");
}
+ my %charts_by_category =
+ partition_by { $_->{pos_bwa} }
+ sort_by { $_->{accno} }
+ map { $form->{charts}->{$_} }
+ keys %{ $form->{charts} };
+ $form->{"charts_by_category"} = \%charts_by_category;
+
+ # $main::lxdebug->dump(0, "charts_by_category", $form->{charts_by_category} );
+
+ $form->{category_names} = { selectall_as_map($form, $dbh, "select * from bwa_categories order by id", 'id', 'description') };
+
my @periods = qw(jetzt kumm);
my @gesamtleistung = qw(1 3);
my @gesamtkosten = qw (10 11 12 13 14 15 16 17 18 20);
[%- USE T8 %]
[%- USE HTML %]
[%- USE LxERP %]
+[%- USE L %]
<table border=0 cellpadding=0 cellspacing=0>
<tr class="headline">
</tr>
</table>
+
+<br>
+[% L.button_tag('', LxERP.t8('Show chart list'), id="show_chartlist_button", class="hide") %]
+[% L.button_tag('', LxERP.t8('Hide chart list'), id="hide_chartlist_button", class="hide") %]
+<div id="chartlist">
+<div>[% 'Chart list' | $T8 %]</div>
+<div>
+<table>
+<tr>
+ <th>[% 'Chart' | $T8 %]</th>
+ <th>[% 'Amount' | $T8 %]</th>
+ <th>[% 'Category' | $T8 %]</th>
+</tr>
+[% FOREACH key = charts.keys.sort %]
+[% UNLESS charts.$key.pos_bwa %]
+[% NEXT %]
+[% END %]
+<tr>
+ <td>[% charts.$key.accno %]</td>
+ <td class="numeric">[% LxERP.format_amount( charts.$key.amount, 2 ) %]</td>
+ <td>[% HTML.escape(category_names.item(charts.$key.pos_bwa)) %]</td>
+</tr>
+[% END %]
+</table>
+</div>
+</div>
+
+[% # L.dump(charts_by_category.item(1)) # Debug Umsatzerlöse %]
+
+<script language="javascript">
+$( document ).ready(function() {
+ $( "#hide_chartlist_button" ).hide();
+ $( "#chartlist" ).hide();
+
+ $( "#show_chartlist_button" ).click(function() {
+ $( "#chartlist" ).toggle();
+ $('html, body').animate({
+ scrollTop: $(this).offset().top
+ }, 500);
+ $(this).hide();
+ $("#hide_chartlist_button").show();
+ });
+
+ $( "#hide_chartlist_button" ).click(function() {
+ $( "#chartlist" ).toggle();
+ $('html, body').animate({
+ scrollTop: $(this).offset().top
+ }, 500);
+ $(this).hide();
+ $("#show_chartlist_button").show();
+ });
+
+})
+
+</script>