]> wagnertech.de Git - kivitendo-erp.git/blobdiff - bin/mozilla/ir.pl
Einkaufsrechnungen: Vor dem Stornieren die Daten aus der Datenbank holen und nicht...
[kivitendo-erp.git] / bin / mozilla / ir.pl
index bb419895642d5cc20fe2c8e43a95061e22bceace..f5fd32f58d5f55033cf48f7adc2fc9a348495813 100644 (file)
@@ -559,7 +559,7 @@ sub form_footer {
         $tax .= qq|
                <tr>
                  <th align=right>$form->{"${item}_description"}&nbsp;|
-                                 . $form->{"${item}_rate"} * 100 .qq|%</th>
+                    . $form->{"${item}_rate"} * 100 .qq|%</th>
                  <td align=right>$form->{"${item}_total"}</td>
                </tr>
 |;
@@ -601,7 +601,7 @@ sub form_footer {
         $tax .= qq|
              <tr>
                <th align=right>Enthaltene $form->{"${item}_description"}&nbsp;|
-                               . $form->{"${item}_rate"} * 100 .qq|%</th>
+                                   . $form->{"${item}_rate"} * 100 .qq|%</th>
                <td align=right>$form->{"${item}_total"}</td>
              </tr>
              <tr>
@@ -881,7 +881,7 @@ sub update {
   }
 
   $i            = $form->{rowcount};
-  $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+  $exchangerate = ($form->{exchangerate} * 1) ? $form->{exchangerate} * 1 : 1;
 
   if (   ($form->{"partnumber_$i"} eq "")
       && ($form->{"description_$i"} eq "")
@@ -972,6 +972,14 @@ sub storno {
     $form->error($locale->text('Cannot storno storno invoice!'));
   }
 
+  if (IR->has_storno(\%myconfig, $form)) {
+    $form->error($locale->text("Invoice has already been storno'd!"));
+  }
+
+  invoice_links();
+  prepare_invoice();
+  relink_accounts();
+
   $form->{storno_id} = $form->{id};
   $form->{storno} = 1;
   $form->{id} = "";
@@ -1088,7 +1096,7 @@ sub post {
                $form->save_history($form->dbconnect(\%myconfig));
        }
        # /saving the history
-    remove_draft();
+    remove_draft() if $form->{remove_draft};
        $form->redirect(  $locale->text('Invoice')
                   . " $form->{invnumber} "
                   . $locale->text('posted!'));