Improve work without category
authorJoey Schulze <joey@infodrom.org>
Wed, 1 Nov 2017 20:52:59 +0000 (21:52 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 1 Nov 2017 20:52:59 +0000 (21:52 +0100)
src/InfoCon/buch/infocon

index 843b378..c10413b 100755 (executable)
@@ -168,7 +168,7 @@ sub sales_list
        $where .= sprintf("year = %d", $opt_year);
     }
 
        $where .= sprintf("year = %d", $opt_year);
     }
 
-    if (defined $data{category}) {
+    if (defined $data{category} && length $data{category}) {
        $where .= " AND " if $where;
        $where .= sprintf("category = %s", $dbh->quote($data{category}));
     }
        $where .= " AND " if $where;
        $where .= sprintf("category = %s", $dbh->quote($data{category}));
     }
@@ -623,11 +623,7 @@ if (defined $data{mailto}) {
 }
 
 if (defined $data{category}) {
 }
 
 if (defined $data{category}) {
-    if (length($data{category})) {
-       sales_list("category = '".$data{category}."'");
-    } else {
-       sales_list;
-    }
+    sales_list;
     exit;
 } elsif (defined $data{'list-categories'}) {
     list_categories;
     exit;
 } elsif (defined $data{'list-categories'}) {
     list_categories;