X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=fb0de34e94e94bc2a96e789b74129e53b69de362;hb=fbbbc3408edb8fee7e8afaf9c51fcebd8497d6eb;hp=5417918fd88ab2b6bb77f411fb3695a0c6fe0dcf;hpb=6a8787147ad643549eb26cb4f9a373b5b354b8b9;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 5417918fd..fb0de34e9 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -211,201 +211,22 @@ sub edit { sub search { - $main::lxdebug->enter_sub(); - - $main::auth->assert('general_ledger'); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - my $cgi = $main::cgi; - - $form->{title} = $locale->text('Journal'); - - $form->all_departments(\%myconfig); - - # departments - if (@{ $form->{all_departments} || [] }) { - $form->{selectdepartment} = "\n"; - - map { - $form->{selectdepartment} .= - "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} || [] }); - } - - my $department = qq| - - | . $locale->text('Department') . qq| - $form->{selectdepartment} - -| if $form->{selectdepartment}; - - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }); + $::lxdebug->enter_sub; + $::auth->assert('general_ledger'); - 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} = 1; - my $jsscript = ""; - my ($button1, $button2, $onload); - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - text('button') . qq|> - |; - $button2 = qq| - - text('button') . qq|> - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1", - "dateto", "BL", "trigger2"); - } else { - - # without JavaScript Calendar - $button1 = - qq||; - $button2 = - 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| - - - - - - - - - $form->{title} - - - - - - - | . $locale->text('Reference') . qq| - - | . $locale->text('Source') . qq| - - - $department - - | . $locale->text('Description') . qq| - - | . $locale->text('Account Number') . qq| - - - - | . $locale->text('Notes') . qq| - - - - | . $locale->text('Project Number') . qq| - $projectnumber - - - | . $locale->text('From') . qq| - $button1 - | . $locale->text('To (time)') . qq| - $button2 - - - | . $locale->text('Include in Report') . qq| - - - - - | - . $locale->text('All') . qq| - | - . $locale->text('Asset') . qq| - | - . $locale->text('Liability') . qq| - | - . $locale->text('Revenue') . qq| - | - . $locale->text('Expense') . qq| - - - - - - - | . $locale->text('ID') . qq| - - | . $locale->text('Date') . qq| - - | . $locale->text('Reference') . qq| - - | . $locale->text('Description') . qq| - - | . $locale->text('Notes') . qq| - - - - | . $locale->text('Debit') . qq| - - | . $locale->text('Credit') . qq| - - | . $locale->text('Source') . qq| - - | . $locale->text('Account') . qq| - - - - | . $locale->text('Subtotal') . qq| - - | . $locale->text('Project Number') . qq| - - - - - - - - - - - - - -$jsscript + $::form->all_departments(\%::myconfig); + $::form->get_lists( + projects => { key => "ALL_PROJECTS", all => 1 }, + ); + $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); - + $::form->header; + print $::form->parse_html_template('gl/search', { + department_label => sub { ("$_[0]{description}--$_[0]{id}")x2 }, + employee_label => sub { "$_[0]{id}--$_[0]{name}" }, + }); - - - - - -