X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fca.pl;h=8aeabdce5ecea2297568b40a1d8143e2853672af;hb=dbd0ae115bd9a6ba0ede24f9655a29df6bf7dc3b;hp=1d431916ad2fa3e2b36fc2af1b7d552572761e41;hpb=8e9ede8f7ca6895f8d68d0637b9ba0a84d6515bf;p=kivitendo-erp.git diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index 1d431916a..8aeabdce5 100644 --- a/bin/mozilla/ca.pl +++ b/bin/mozilla/ca.pl @@ -39,6 +39,8 @@ use SL::ReportGenerator; require "bin/mozilla/reportgenerator.pl"; +use strict; + 1; # end of main @@ -72,12 +74,20 @@ require "bin/mozilla/reportgenerator.pl"; # $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 ($main::eur) { + $form->{method} = "cash"; + } + CA->all_accounts(\%myconfig, \%$form); my @columns = qw(accno description debit credit); @@ -107,6 +117,7 @@ sub chart_of_accounts { my %totals = ('debit' => 0, 'credit' => 0); foreach my $ca (@{ $form->{CA} }) { + next unless defined $ca->{amount}; my $row = { }; foreach (qw(debit credit)) { @@ -132,47 +143,52 @@ sub chart_of_accounts { $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); - if (@{ $form->{all_departments} }) { + if (@{ $form->{all_departments} || [] }) { $form->{selectdepartment} = "\n"; map { $form->{selectdepartment} .= "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} }); + } (@{ $form->{all_departments} || [] }); } - $department = qq| + my $department = qq| - | . $locale->text('Department') . qq| - $form->{selectdepartment} - + | . $locale->text('Department') . qq| + $form->{selectdepartment} + | if $form->{selectdepartment}; - $accrual = ($eur) ? "" : "checked"; - $cash = ($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 $accrual = ($main::eur) ? "" : "checked"; + my $cash = ($main::eur) ? "checked" : ""; + 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}) { @@ -220,7 +236,7 @@ sub list { } $form->{javascript} .= qq||; $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|')|; @@ -237,7 +253,7 @@ sub list { {accno}> - + {accounttype}> @@ -247,112 +263,92 @@ sub list { - - | + + | . $locale->text('Customized Report') . qq| - - - | . $locale->text('Year') . qq| - text('YYYY') . qq|" value="$year"> - + |; + our $checked; print qq| - - + + | . $locale->text('Yearly') . qq| - | . $locale->text('Quarterly') . qq| - | . $locale->text('Monthly') . qq| - - - | . $locale->text('Quarterly') . qq| + | . $locale->text('Monthly') . qq| + + + - 1. | - . $locale->text('Quarter') . qq| + 1. | . $locale->text('Quarter') . qq| |; $checked = "checked"; print qq| - | - . $locale->text('January') . qq| + | . $locale->text('January') . qq| |; $checked = ""; print qq| - | - . $locale->text('May') . qq| - | - . $locale->text('September') . qq| - - - - - 2. | - . $locale->text('Quarter') . qq| - | - . $locale->text('February') . qq| - | - . $locale->text('June') . qq| - | - . $locale->text('October') . qq| - - - - 3. | - . $locale->text('Quarter') . qq| - | - . $locale->text('March') . qq| - | - . $locale->text('July') . qq| - | - . $locale->text('November') . qq| - - - - - 4. | - . $locale->text('Quarter') . qq| - | - . $locale->text('April') . qq| - | - . $locale->text('August') . qq| - | - . $locale->text('December') . qq| - - - - - - - | - . $locale->text('Free report period') . qq| - | . $locale->text('From') . qq| - $button1 + | . $locale->text('May') . qq| + | . $locale->text('September') . qq| + + + + + 2. | . $locale->text('Quarter') . qq| + | . $locale->text('February') . qq| + | . $locale->text('June') . qq| + | . $locale->text('October') . qq| + + + + 3. | . $locale->text('Quarter') . qq| + | . $locale->text('March') . qq| + | . $locale->text('July') . qq| + | . $locale->text('November') . qq| + + + + + 4. | . $locale->text('Quarter') . qq| + | . $locale->text('April') . qq| + | . $locale->text('August') . qq| + | . $locale->text('December') . qq| + + + + + + + | . $locale->text('Free report period') . qq| + | . $locale->text('From') . qq| + $button1 $button1_2 - | . $locale->text('Bis') . qq| - $button2 + | . $locale->text('Bis') . qq| + $button2 $button2_2 - - - - - | . $locale->text('Method') . qq| - | - . $locale->text('Accrual') . qq| - | - . $locale->text('EUR') . qq| - - | - . $locale->text('Decimalplaces') - . qq| + + + + | . $locale->text('Method') . qq| + | . $locale->text('Accrual') . qq| + | . $locale->text('EUR') . qq| + + + | . $locale->text('Decimalplaces') . qq| | . $locale->text('Subtotal') . qq| - + $jsscript @@ -365,27 +361,35 @@ $jsscript