Beim Klonen eines einmal gelöschten users das deleted Flag resetten.
[kivitendo-erp.git] / SL / OE.pm
index cfe5e25..9694026 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -190,7 +190,7 @@ SQL
   }
 
   if ($form->{periodic_invoices_active} ne $form->{periodic_invoices_inactive}) {
-    my $not  = 'NOT' if ($form->{periodic_invoices_inactive});
+    my $not  = $form->{periodic_invoices_inactive} ? 'NOT' : '';
     $query  .= qq| AND ${not} COALESCE(pcfg.active, 'f')|;
   }
 
@@ -806,6 +806,9 @@ sub retrieve {
     if ($ref) {
       map { $form->{$_} = $ref->{$_} } keys %$ref;
 
+      # remove any trailing whitespace
+      $form->{currency} =~ s/\s*$//;
+
       $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"};
 
       # set all entries for multiple ids blank that yield different information