push @{$cur_ary}, $token;
} else {
- push @{$cur_ary}, $self->{RIGHTS}->{$login}->{$token} * 1;
+ push @{$cur_ary}, ($self->{RIGHTS}->{$login}->{$token} // 0) * 1;
}
}
my $fill_char = shift;
my $alignment = shift || 'right';
- my $text_len = length $text;
+ my $text_len = length($text // '');
if ($field_len < $text_len) {
$text = substr $text, 0, $field_len;
my %hash;
if ('' eq ref $value_col) {
while (my $ref = $sth->fetchrow_hashref()) {
- $hash{$ref->{$key_col}} = $ref->{$value_col};
+ $hash{$ref->{$key_col} // ''} = $ref->{$value_col};
}
} else {
while (my $ref = $sth->fetchrow_hashref()) {
- $hash{$ref->{$key_col}} = { map { $_ => $ref->{$_} } @{ $value_col } };
+ $hash{$ref->{$key_col} // ''} = { map { $_ => $ref->{$_} } @{ $value_col } };
}
}
my %by_parent;
# order them by parent
for my $node ($self->nodes) {
- push @{ $by_parent{ $node->{parent} } //= [] }, $node;
+ push @{ $by_parent{ $node->{parent} // '' } //= [] }, $node;
}
my $tree = { };
# kivitendo's behaviour isn't changed by this update
# if checks are not set in config set it to true
foreach my $check (qw(check_on_sales_invoice check_on_purchase_invoice check_on_ar_transaction check_on_ap_transaction check_on_gl_transaction)) {
- my $check_set = 1;
- if ($::lx_office_conf{datev_check}->{$check} == 0 && defined ($::lx_office_conf{datev_check}->{$check})) {
- $check_set = 0;
- }
-
+ my $check_set = defined($::lx_office_conf{datev_check}->{$check}) && ($::lx_office_conf{datev_check}->{$check} == 0) ? 0 : 1;
my $update_column = "UPDATE defaults SET datev_$check = '$check_set';";
$self->db_query($update_column);
}