CVar: Dokumentation um Lieferadressen-CVars ergänzt
[kivitendo-erp.git] / SL / IC.pm
index 45604b0..1a02c59 100644 (file)
--- a/SL/IC.pm
+++ b/SL/IC.pm
@@ -399,6 +399,8 @@ sub save {
   );
   do_query($form, $dbh, $query, @values);
 
+  $form->new_lastmtime('parts');
+
   # delete translation records
   do_query($form, $dbh, qq|DELETE FROM translation WHERE parts_id = ?|, conv_i($form->{id}));
 
@@ -570,6 +572,8 @@ sub update_assembly {
              $qty * ($form->{weight} - $weight), conv_i($id));
   do_query($form, $dbh, $query, @values);
 
+  $form->new_lastmtime('parts') if $id == $form->{id};
+
   $main::lxdebug->leave_sub();
 }
 
@@ -868,6 +872,13 @@ sub all_parts {
     }
   }
 
+  # special case smart search
+  if ($form->{all}) {
+    $form->{"l_$_"} = 1 for qw(partnumber description unit sellprice lastcost cvar_packaging linetotal);
+    push @where_tokens, "p.partnumber ILIKE ? OR p.description ILIKE ?";
+    push @bind_vars,    "%$form->{all}%", "%$form->{all}%";
+  }
+
   # special case insertdate
   if (grep { $form->{$_} } qw(insertdatefrom insertdateto)) {
     $form->{"l_insertdate"} = 1;