1 # @tag: defaults_show_bestbefore
 
   2 # @description: Einstellung, ob Mindesthaltbarkeitsdatum angezeigt wird, vom Config-File in die DB verlagern.
 
   3 # @depends: release_2_7_0
 
   4 package SL::DBUpgrade2::defaults_show_bestbefore;
 
   9 use parent qw(SL::DBUpgrade2::Base);
 
  14   # this query will fail if column already exist (new database)
 
  15   $self->db_query(qq|ALTER TABLE defaults ADD COLUMN show_bestbefore boolean DEFAULT false|, may_fail => 1);
 
  17   # check current configuration and set default variables accordingly, so that
 
  18   # kivitendo behaviour isn't changed by this update
 
  19   # if show_best_before is not set in config set it to 0
 
  20   my $show_bestbefore = 0;
 
  21   if ($::lx_office_conf{features}->{show_best_before}) {
 
  25   my $update_column = "UPDATE defaults SET show_bestbefore = '$show_bestbefore';";
 
  26   $self->db_query($update_column);