X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=c06e79b4d34c16f85f5fdf989bb83192033caeb3;hb=3f4a45a96efc9e44bc3cd58874128dc36cc667cf;hp=5772e1697e0a49fade7a48efbe06f107b77f82a1;hpb=d319704a66e9be64da837ccea10af6774c2b0838;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 5772e1697..c06e79b4d 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -35,10 +35,17 @@ # #====================================================================== -require "$form->{path}/arap.pl"; +use POSIX qw(strftime); use SL::PE; use SL::RP; +use SL::USTVA; +use SL::Iconv; +use SL::ReportGenerator; + +require "bin/mozilla/arap.pl"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -108,9 +115,7 @@ sub report { $accrual = ($eur) ? "" : "checked"; $cash = ($eur) ? "checked" : ""; - ($null, $null, $null, $null, $null, $year, $null, $null, $null) = - localtime(); - $year += 1900; + $year = (localtime)[5] + 1900; # get departments $form->all_departments(\%myconfig); @@ -130,20 +135,35 @@ sub report { | if $form->{selectdepartment}; + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %project_labels = (); + my @project_values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@project_values, $item->{"id"}); + $project_labels{$item->{"id"}} = $item->{"projectnumber"}; + } + + my $projectnumber = + NTI($cgi->popup_menu('-name' => "project_id", + '-values' => \@project_values, + '-labels' => \%project_labels)); + # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{report} eq "ustva") { $department = ""; } else { if ($form->{report} eq "balance_sheet") { - $name_1 = "compareasofdate"; - $id_1 = "compareasofdate"; - $value_1 = ""; + $name_1 = "asofdate"; + $id_1 = "asofdate"; + $value_1 = "$form->{asofdate}"; $trigger_1 = "trigger1"; - $name_2 = "asofdate"; - $id_2 = "asofdate"; - $value_2 = "$form->{asofdate}"; + $name_2 = "compareasofdate"; + $id_2 = "compareasofdate"; + $value_2 = "$form->{compareasofdate}"; $trigger_2 = "trigger2"; } elsif ($form->{report} =~ /(receipts|payments)$/) { $name_1 = "fromdate"; @@ -183,24 +203,23 @@ sub report { if ($name_1 eq "") { $button1 = qq| - |; + |; $button1_2 = qq| text('button') . qq|>|; #write Trigger $jsscript = - Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2", "", - "", ""); + Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2"); } else { $button1 = qq| - |; + |; $button1_2 = qq| text('button') . qq|>|; $button2 = qq| - |; - $button2_2 = qq| + |; + $button2_2 = qq| text('button') . qq|> |; @@ -215,19 +234,21 @@ sub report { # without JavaScript Calendar if ($name_1 eq "") { $button1 = - qq||; + qq||; } else { $button1 = - qq||; + qq||; $button2 = - qq||; + qq||; } } - + $form->{javascript} .= qq||; $form->header; - + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; + $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; print qq| -
+ + $report->set_options_from_form(); - - -|; + $report->generate_with_headers(); $lxdebug->leave_sub(); } @@ -1944,66 +1596,6 @@ sub select_all { $lxdebug->leave_sub(); } -sub print_options { - $lxdebug->enter_sub(); - - $form->{sendmode} = "attachment"; - $form->{copies} = 2 unless $form->{copies}; - - $form->{PD}{ $form->{type} } = "selected"; - $form->{DF}{ $form->{format} } = "selected"; - $form->{OP}{ $form->{media} } = "selected"; - $form->{SM}{ $form->{sendmode} } = "selected"; - - $type = qq| -