X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fca.pl;h=8aeabdce5ecea2297568b40a1d8143e2853672af;hb=382e874cd5a9ffcf41643b2b8b3b34d1f4737421;hp=497ee6157483da95df7ec11567853eef6be8bd73;hpb=ec022a581e19d03e34ae31e7ba53ee4dde66ea73;p=kivitendo-erp.git diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index 497ee6157..8aeabdce5 100644 --- a/bin/mozilla/ca.pl +++ b/bin/mozilla/ca.pl @@ -37,7 +37,9 @@ use POSIX qw(strftime); use SL::CA; use SL::ReportGenerator; -require "bin/mozilla/report_generator.pl"; +require "bin/mozilla/reportgenerator.pl"; + +use strict; 1; @@ -72,10 +74,20 @@ require "bin/mozilla/report_generator.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; + + $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); @@ -105,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)) { @@ -130,75 +143,215 @@ 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; + + $main::auth->assert('report'); $form->{title} = $locale->text('List Transactions'); $form->{title} .= " - " . $locale->text('Account') . " $form->{accno}"; + my $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); - if (@{ $form->{all_departments} }) { + if (@{ $form->{all_departments} || [] }) { $form->{selectdepartment} = "