1 # @tag: defaults_posting_config
2 # @description: Einstellung, ob und wann Zahlungen änderbar sind, vom Config-File in die DB verlagern.
3 # @depends: release_2_7_0
4 package SL::DBUpgrade2::defaults_posting_config;
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 payments_changeable integer NOT NULL DEFAULT 0|, 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 payments_changeable is not set in config set it to 0
20 my $payments_changeable = 0;
21 if ($::lx_office_conf{features}->{payments_changeable} == 1 ) {
22 $payments_changeable = 1;
23 } elsif ($::lx_office_conf{features}->{payments_changeable} == 2 ) {
24 $payments_changeable = 2;
27 my $update_column = "UPDATE defaults SET payments_changeable = '$payments_changeable';";
28 $self->db_query($update_column);