Storno nur anzeigen wenn keine Zahlungen vorhanden sind.
[kivitendo-erp.git] / bin / mozilla / gl.pl
index fd75c2e..a086f57 100644 (file)
@@ -241,7 +241,7 @@ sub search {
                          '-labels' => \%project_labels));
 
   # use JavaScript Calendar or not
-  $form->{jsscript} = $jscalendar;
+  $form->{jsscript} = 1;
   $jsscript = "";
   if ($form->{jsscript}) {
 
@@ -1153,7 +1153,7 @@ sub display_rows {
 
     if ($init) {
       $korrektur =
-        qq|<td><input type="checkbox" name="korrektur_$i" value="1"</td>|;
+        qq|<td><input type="checkbox" name="korrektur_$i" value="1"></td>|;
       if ($form->{transfer}) {
         $fx_transaction = qq|
         <td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td>
@@ -1343,6 +1343,9 @@ sub form_header {
       qq|<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" $readonly onBlur=\"check_right_date_format(this)\"></td>|;
   }
 
+  $form->{previous_id}     ||= "--";
+  $form->{previous_gldate} ||= "--";
+
   $form->header;
 
   print qq|
@@ -1351,7 +1354,7 @@ sub form_header {
 <form method=post name="gl" action=$form->{script}>
 |;
 
-  $form->hide_form(qw(id closedto locked storno storno_id));
+  $form->hide_form(qw(id closedto locked storno storno_id previous_id previous_gldate));
 
   print qq|
 <input type=hidden name=title value="$title">
@@ -1365,6 +1368,14 @@ sub form_header {
   <tr>
     <td>
       <table width=100%>
+        <tr>
+          <td colspan="6" align="left">|
+    . $locale->text("Previous transnumber text")
+    . " $form->{previous_id} "
+    . $locale->text("Previous transdate text")
+    . " $form->{previous_gldate}"
+    . qq|</td>
+        </tr>
        <tr>
          <th align=right>| . $locale->text('Reference') . qq|</th>
          <td><input name=reference size=20 value="$form->{reference}" $readonly></td>
@@ -1480,8 +1491,7 @@ sub form_footer {
   $radieren = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
 
   map {
-    $form->{$_} =
-      $form->format_amount(\%myconfig, $form->{$_}, 2, "&nbsp;")
+    $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, 2, "&nbsp;")
   } qw(totaldebit totalcredit);
 
   print qq|
@@ -1510,30 +1520,21 @@ sub form_footer {
   if ($form->{id}) {
 
     if (!$form->{storno}) {
-      print qq|<input class=submit type=submit name=action value="|
-        . $locale->text('Storno') . qq|">|;
+      print qq|<input class=submit type=submit name=action value="| . $locale->text('Storno') . qq|">|;
     }
 
     # Löschen und Ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
-
     if (!$form->{locked} && $radieren) {
       print qq|
-               <input class=submit type=submit name=action value="|
-        . $locale->text('Post') . qq|" accesskey="b">
-               <input class=submit type=submit name=action value="|
-        . $locale->text('Delete') . qq|">|;
+        <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|" accesskey="b">
+        <input class=submit type=submit name=action value="| . $locale->text('Delete') . qq|">|;
     }
 
-    #  if ($transdate > $closedto) {
-    #          print qq|
-    #          <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">|;
-    #  }
   } else {
     if ($transdate > $closedto) {
-      print qq|<input class=submit type=submit name=action id=update_button value="|
-        . $locale->text('Update') . qq|">
-                <input class=submit type=submit name=action value="|
-        . $locale->text('Post') . qq|">|;
+      print qq|
+        <input class=submit type=submit name=action id=update_button value="| . $locale->text('Update') . qq|">
+        <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|">|;
     }
   }