X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7712480e4a082f84a2229f5b1a90d79a6c01255b..d18a84dfd90b91c60093c77bbc5900408e0c5697:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index 6b69bb249..1ee47f209 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -2223,5 +2223,28 @@ sub get_pricegroups_for_parts { $main::lxdebug->leave_sub(); } +sub has_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}); + + $dbh->disconnect(); + + $main::lxdebug->leave_sub(); + + return $result; +} + 1;