]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IS.pm
Überflüssigen/unwirksamen Code entfernt.
[mfinanz.git] / SL / IS.pm
index e5d61193d0b12ec6450e330f77b0ce9e3b0317e2..1ee47f20990f363c61a7bb3c86448697abfe895e 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -2226,13 +2226,17 @@ sub get_pricegroups_for_parts {
 sub has_storno {
   $main::lxdebug->enter_sub();
 
-  my ($self, $myconfig, $form) = @_;
+  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 ar WHERE id = ?|;
+  my $query = qq|SELECT storno FROM $table WHERE id = ?|;
   my ($result) = selectrow_query($form, $dbh, $query, $form->{id});
 
   $dbh->disconnect();