X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fca.pl;h=b35b66495ce2c35c52c5856fcf1a89f6b08674c3;hb=7886b2fe17ddc184789bda2aca7f92998c6fc6cb;hp=08856b9ca712b9673d7ffbfb8bad61f34f8e76a2;hpb=b3bcbbe95b29ae60ac00589d944d97c288671da6;p=kivitendo-erp.git diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index 08856b9ca..b35b66495 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} | 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}> @@ -258,6 +274,7 @@ sub list { |; + our $checked; print qq| @@ -349,7 +366,10 @@ $checked> . qq| - + + | . $locale->text('Subtotal') . qq| + + $jsscript @@ -362,13 +382,35 @@ $jsscript