X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=5c07ca06599d9ea70af27016f7d267ba12d78fae;hb=805e8da4fc4c631f7d62286fa63d8a5e69e769ab;hp=62869394a739be274fd19503e0e63def621fdaab;hpb=0b8580e2a6e53102b619eb36a059a6d5be9e28c9;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 62869394a..5c07ca065 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -2131,6 +2131,29 @@ sub has_storno { my $dbh = $form->dbconnect($myconfig); + my $query = qq|SELECT storno FROM $table WHERE storno_id = ?|; + my ($result) = selectrow_query($form, $dbh, $query, $form->{id}); + + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); + + return $result; +} + +sub is_storno { + $main::lxdebug->enter_sub(); + + my ($self, $myconfig, $form, $table) = @_; + + $main::lxdebug->leave_sub() and return 0 unless ($form->{id}); + + # make sure there's no funny stuff in $table + # ToDO: die when this happens and throw an error + $main::lxdebug->leave_sub() and return 0 if ($table =~ /\W/); + + my $dbh = $form->dbconnect($myconfig); + my $query = qq|SELECT storno FROM $table WHERE id = ?|; my ($result) = selectrow_query($form, $dbh, $query, $form->{id});