require "bin/mozilla/reportgenerator.pl";
+use strict;
+
1;
# end of main
# $locale->text('Dec')
sub chart_of_accounts {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('report');
+ $main::auth->assert('report');
$form->{title} = $locale->text('Chart of Accounts');
- if ($eur) {
+ if ($main::eur) {
$form->{method} = "cash";
}
$report->generate_with_headers();
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub list {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('report');
+ $main::auth->assert('report');
$form->{title} = $locale->text('List Transactions');
$form->{title} .= " - " . $locale->text('Account') . " $form->{accno}";
- $year = (localtime)[5] + 1900;
+ my $year = (localtime)[5] + 1900;
# get departments
$form->all_departments(\%myconfig);
} (@{ $form->{all_departments} });
}
- $department = qq|
+ my $department = qq|
<tr>
<th align=right nowrap>| . $locale->text('Department') . qq|</th>
<td colspan=3><select name=department>$form->{selectdepartment}</select></td>
</tr>
| if $form->{selectdepartment};
- $accrual = ($eur) ? "" : "checked";
- $cash = ($eur) ? "checked" : "";
+ my $accrual = ($main::eur) ? "" : "checked";
+ my $cash = ($main::eur) ? "checked" : "";
- $name_1 = "fromdate";
- $id_1 = "fromdate";
- $value_1 = "$form->{fromdate}";
- $trigger_1 = "trigger1";
- $name_2 = "todate";
- $id_2 = "todate";
- $value_2 = "";
- $trigger_2 = "trigger2";
+ my $name_1 = "fromdate";
+ my $id_1 = "fromdate";
+ my $value_1 = "$form->{fromdate}";
+ my $trigger_1 = "trigger1";
+ my $name_2 = "todate";
+ my $id_2 = "todate";
+ my $value_2 = "";
+ my $trigger_2 = "trigger2";
+ my ($button1, $button1_2, $button2, $button2_2, $jsscript);
# with JavaScript Calendar
if ($form->{jsscript}) {
}
$form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
$form->header;
- $onload = qq|focus()|;
+ my $onload = qq|focus()|;
$onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
$onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
<input type=hidden name=accno value=$form->{accno}>
<input type=hidden name=description value="$form->{description}">
<input type=hidden name=sort value=transdate>
-<input type=hidden name=eur value=$eur>
+<input type=hidden name=eur value=$main::eur>
<input type=hidden name=accounttype value=$form->{accounttype}>
<table border=0 width=100%>
</tr>
|;
+ our $checked;
print qq|
<tr>
<td align=right>
</html>
|;
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub format_debit_credit {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
my $dc = shift;
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
my $formatted_dc = $form->format_amount(\%myconfig, abs($dc), 2) . ' ';
$formatted_dc .= ($dc > 0) ? $locale->text('Credit (one letter abbreviation)') : $locale->text('Debit (one letter abbreviation)');
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
return $formatted_dc;
}
sub list_transactions {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
- $auth->assert('report');
+ $main::auth->assert('report');
$form->{title} = $locale->text('Account') . " $form->{accno} - $form->{description}";
$form->{fromdate} = "1.2.$form->{year}";
#this works from 1901 to 2099, 1900 and 2100 fail.
- $leap = ($form->{year} % 4 == 0) ? "29" : "28";
+ my $leap = ($form->{year} % 4 == 0) ? "29" : "28";
$form->{todate} = "$leap.2.$form->{year}";
last SWITCH;
};
my %column_alignment = map { $_ => 'right' } qw(debit credit);
- @custom_headers = ();
+ my @custom_headers = ();
# Zeile 1:
push @custom_headers, [
{ 'text' => 'Letzte Buchung', },
$report->set_sort_indicator($form->{sort}, 1);
- $column_defs->{balance}->{visible} = 1;
+ $column_defs{balance}->{visible} = 1;
my $ml = ($form->{category} =~ /(A|E)/) ? -1 : 1;
$report->add_separator();
- my $row = {
+ $row = {
'transdate' => {
'data' => "",
'class' => 'listtotal',
$report->add_data($row);
my $saldo_new = format_debit_credit($form->{saldo_new});
- my $row = {
+ $row = {
'transdate' => {
'data' => "",
'class' => 'listtotal',
$report->generate_with_headers();
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
}
sub create_subtotal_row {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
my ($totals, $columns, $column_alignment, $class) = @_;
map { $totals->{$_} = 0 } qw(debit credit);
- $lxdebug->leave_sub();
+ $main::lxdebug->leave_sub();
return $row;
}