X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=ce1d1a9dd440229232e21d7b425d6b0490158c8e;hb=67079598f8f98a12e12a8acddc3afbf12bb58c5d;hp=b422829470a2414b9548ff10d903e0befdafa228;hpb=d1123673cfe71c596e4518f8fd1f93916010717d;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index b42282947..ce1d1a9dd 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -217,8 +217,8 @@ sub search { $::form->all_departments(\%::myconfig); $::form->get_lists( projects => { key => "ALL_PROJECTS", all => 1 }, - employees => "ALL_EMPLOYEES", ); + $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); my $onload = "focus()" . qq|;setupDateFormat('|. $::myconfig{dateformat} . qq|', '| . $::locale->text("Falsches Datumsformat!") . qq|')| @@ -897,99 +897,25 @@ sub form_header { } sub form_footer { - $main::lxdebug->enter_sub(); - - $main::auth->assert('general_ledger'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - my $cgi = $::request->{cgi}; - - my $follow_ups_block; - if ($form->{id}) { - my $follow_ups = FU->follow_ups('trans_id' => $form->{id}); - - if (@{ $follow_ups} ) { - my $num_due = sum map { $_->{due} * 1 } @{ $follow_ups }; - $follow_ups_block = qq|

| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq|

|; - } - } - - my ($dec) = ($form->{totaldebit} =~ /\.(\d+)/); - $dec = length $dec; - my $decimalplaces = ($dec > 2) ? $dec : 2; - my $radieren = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; - - map { - $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, 2, " ") - } qw(totaldebit totalcredit); - - print qq| - - $form->{totaldebit} - $form->{totalcredit} - - - - - - - - - -$follow_ups_block - -
-|; - - my $transdate = $form->datetonum($form->{transdate}, \%myconfig); - my $closedto = $form->datetonum($form->{closedto}, \%myconfig); - - if ($form->{id}) { - - if (!$form->{storno}) { - print qq||; - } - - # Löschen und Ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich - if (!$form->{locked} && $radieren) { - print qq| - - |; - } - - print qq| - - |; + $::lxdebug->enter_sub; + $::auth->assert('general_ledger'); - } else { - if ($form->{draft_id}) { - my $remove_draft_checked = $form->{remove_draft} ? 'checked' : ''; - print qq|

\n| - . qq| | - . qq| \n| - . qq|

\n|; - } + my ($follow_ups, $follow_ups_due); - print qq| - - | - . NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit')) - . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) - . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]); + if ($::form->{id}) { + $follow_ups = FU->follow_ups('trans_id' => $::form->{id}); + $follow_ups_due = sum map { $_->{due} * 1 } @{ $follow_ups || [] }; } - print " - + my $radieren = $::form->current_date(\%::myconfig) eq $::form->{gldate}; - - -"; - $main::lxdebug->leave_sub(); + print $::form->parse_html_template('gl/form_footer', { + radieren => $radieren, + follow_ups => $follow_ups, + follow_ups_due => $follow_ups_due, + }); + $::lxdebug->leave_sub; } sub delete {