- $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} = "<option>\n";
-
- map {
- $form->{selectdepartment} .=
- "<option>$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} || [] });
- }
-
- my $department;
- $department = qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Department') . qq|</th>
- <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
- </tr>
-| 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|
- <td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
- <input type=button name=datefrom id="trigger1" value=|
- . $locale->text('button') . qq|></td>
- |;
- $button2 = qq|
- <td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
- <input type=button name=dateto id="trigger2" value=|
- . $locale->text('button') . qq|></td>
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1",
- "dateto", "BL", "trigger2");
- } else {
-
- # without JavaScript Calendar
- $button1 =
- qq|<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
- $button2 =
- qq|<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
- }
- $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
- $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|
-<body onLoad="$onload">
-
-<form method=post action=gl.pl>
-
-<input type=hidden name=sort value=datesort>