X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fgl.pl;h=f4f87cc8f23142c731edcfa2bef7c45a63917093;hb=3adb0cb772af4bcdbd867b5688b3e02356a2e613;hp=625490dc86958b6eb7b0eb393ef20dda90d6a692;hpb=74fca575d438232002756175338c23f55b8a6c12;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 625490dc8..f4f87cc8f 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -211,232 +211,27 @@ 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 = $::request->{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; - $department = qq| - - | . $locale->text('Department') . qq| - $form->{selectdepartment} - -| if $form->{selectdepartment}; - - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1}, - "employees" => "ALL_EMPLOYEES" ); - - 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)); - - my %employee_labels = (); - my @employee_values = (""); - foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) { - # value in Form "1234--Name" übergeben - my $id = "$item->{'id'}--$item->{'name'}"; - push(@employee_values, "$id"); - $employee_labels{$id} = $item->{"name"}; - } - - my $employeenumber = - NTI($cgi->popup_menu('-name' => "employee", - '-values' => \@employee_values, - '-labels' => \%employee_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| - + $::lxdebug->enter_sub; + $::auth->assert('general_ledger'); - - - - - - - $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('Employee') . qq| - $employeenumber - - - | . $locale->text('Filter date by') . qq| - - | . $locale->text('Booking Date') . qq| - | . $locale->text('Invoice Date') . qq| - - - - | . $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('Invoice Date') . qq| - - | . $locale->text('Booking 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| - - | . $locale->text('Employee') . qq| - - - - - - - - - - - - + $::form->all_departments(\%::myconfig); + $::form->get_lists( + projects => { key => "ALL_PROJECTS", all => 1 }, + employees => "ALL_EMPLOYEES", + ); -$jsscript + my $onload = "focus()" + . qq|;setupDateFormat('|. $::myconfig{dateformat} . qq|', '| . $::locale->text("Falsches Datumsformat!") . qq|')| + . qq|;setupPoints('|. $::myconfig{numberformat} . qq|', '| . $::locale->text("wrongformat") . qq|')|; - + $::form->header; + print $::form->parse_html_template('gl/search', { + onload => $onload, + department_label => sub { ("$_[0]{description}--$_[0]{id}")x2 }, + employee_label => sub { "$_[0]{id}--$_[0]{name}" }, + }); - - - - - -