Verzeichnis für Druckvorlagensätze von mastertemplates in print umbenannt.
[kivitendo-erp.git] / bin / mozilla / gl.pl
index b8c2881..625490d 100644 (file)
@@ -218,7 +218,7 @@ sub search {
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $form->{title} = $locale->text('Journal');
 
@@ -234,7 +234,8 @@ sub search {
     } (@{ $form->{all_departments} || [] });
   }
 
-  my $department = qq|
+  my $department;
+  $department = qq|
         <tr>
           <th align=right nowrap>| . $locale->text('Department') . qq|</th>
           <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
@@ -342,14 +343,12 @@ sub search {
           <th align=right>| . $locale->text('Project Number') . qq|</th>
           <td colspan=3>$projectnumber</td>
         </tr>
-        <tr>
-          <th align=right>| . $locale->text('From') . qq|</th>
  <tr>
     <th align=right>| . $locale->text('Employee') . qq|</th>
     <td colspan=3>$employeenumber</td>
   </tr>
   <tr>
-    <th align=right>| . $locale->text('Date Sorting') . qq|</th>
+    <th align=right>| . $locale->text('Filter date by') . qq|</th>
     <td colspan=3>
     <input name=datesort class=radio type=radio value=gldate checked>&nbsp;| . $locale->text('Booking Date') . qq|
     <input name=datesort class=radio type=radio value=transdate>&nbsp;| . $locale->text('Invoice Date') . qq|
@@ -509,9 +508,9 @@ sub generate_report {
 
   my @columns = qw(
     gldate         transdate        id             reference      description
-    notes          source           debit          debit_accno   
+    notes          source           debit          debit_accno
     credit         credit_accno     debit_tax      debit_tax_accno
-    credit_tax     credit_tax_accno projectnumbers balance
+    credit_tax     credit_tax_accno projectnumbers balance employee
   );
 
   # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table
@@ -658,9 +657,9 @@ sub generate_report {
     $row->{balance}->{data}        = $data;
     $row->{projectnumbers}->{data} = join ", ", sort { lc($a) cmp lc($b) } keys %{ $ref->{projectnumbers} };
 
-    map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes);
+    map { $row->{$_}->{data} = $ref->{$_} } qw(id reference description notes gldate employee);
 
-    map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate gldate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
+    map { $row->{$_}->{data} = \@{ $rows{$_} }; } qw(transdate debit credit debit_accno credit_accno debit_tax_accno credit_tax_accno source);
 
     foreach my $col (qw(debit_accno credit_accno debit_tax_accno credit_tax_accno)) {
       $row->{$col}->{link} = [ map { "${callback}&accno=" . E($_) } @{ $rows{$col} } ];
@@ -863,7 +862,7 @@ sub display_rows {
 
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   $form->{debit_1}     = 0 if !$form->{"debit_1"};
   $form->{totaldebit}  = 0;
@@ -1019,7 +1018,7 @@ sub display_rows {
     my $projectnumber_hidden = qq|
     <input type="hidden" name="project_id_$i" value="$form->{"project_id_$i"}">|;
 
-    my $copy2credit = 'onkeyup="copy_debit_to_credit()"' if $i == 1;
+    my $copy2credit = $i == 1 ? 'onkeyup="copy_debit_to_credit()"' : '';
 
     print qq|<tr valign=top>
     $accno
@@ -1081,10 +1080,9 @@ sub form_header {
   $form->{title} = $locale->text("$title General Ledger Transaction");
   my $readonly   = ($form->{id}) ? "readonly" : "";
 
-  my $show_details_checked = "checked" if $form->{show_details};
-
-  my $ob_transaction_checked = "checked" if $form->{ob_transaction};
-  my $cb_transaction_checked = "checked" if $form->{cb_transaction};
+  my $show_details_checked   = $form->{show_details}   ? "checked" : '';
+  my $ob_transaction_checked = $form->{ob_transaction} ? "checked" : '';
+  my $cb_transaction_checked = $form->{cb_transaction} ? "checked" : '';
 
   # $locale->text('Add General Ledger Transaction')
   # $locale->text('Edit General Ledger Transaction')
@@ -1349,7 +1347,7 @@ sub form_footer {
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my $follow_ups_block;
   if ($form->{id}) {
@@ -1412,7 +1410,7 @@ $follow_ups_block
 
   } else {
     if ($form->{draft_id}) {
-      my $remove_draft_checked = 'checked' if ($form->{remove_draft});
+      my $remove_draft_checked = $form->{remove_draft} ? 'checked' : '';
       print qq|<p>\n|
         . qq|  <input name="remove_draft" id="remove_draft" type="checkbox" class="checkbox" ${remove_draft_checked}>|
         . qq|  <label for="remove_draft">| . $locale->text('Remove Draft') . qq|</label>\n|