X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fca.pl;h=31c77da100a9663f993fbebea054763753cec9be;hb=95ecb4289e58990f441f0273182c55f45f26bfb6;hp=c6070fbd1d8a5a45de22e845d662ab5d7cce203d;hpb=4654d9931a51aaa867c425c1fc63618337df67e9;p=kivitendo-erp.git diff --git a/bin/mozilla/ca.pl b/bin/mozilla/ca.pl index c6070fbd1..31c77da10 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); @@ -96,6 +106,7 @@ sub chart_of_accounts { 'std_column_visibility' => 1, ); $report->set_options_from_form(); + $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; $report->set_columns(%column_defs); $report->set_column_order(@columns); @@ -107,6 +118,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 +144,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 +237,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 +254,7 @@ sub list { {accno}> - + {accounttype}> @@ -247,112 +264,84 @@ sub list { - - | + + | . $locale->text('Customized Report') . qq| - - - | . $locale->text('Year') . qq| - text('YYYY') . qq|" value="$year"> - + |; print qq| - - + + | . $locale->text('Yearly') . qq| - | . $locale->text('Quarterly') . qq| - | . $locale->text('Monthly') . qq| - - - - 1. | - . $locale->text('Quarter') . qq| -|; - $checked = "checked"; - print 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('Quarterly') . qq| + | . $locale->text('Monthly') . qq| + + + + 1. | . $locale->text('Quarter') . qq| + | . $locale->text('January') . 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 $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 +354,35 @@ $jsscript