projects
/
infodrom.org
/
service.infodrom.org
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e12645b
)
Support category from commandline on all actions
author
Joey Schulze
<joey@infodrom.org>
Wed, 3 May 2017 23:40:39 +0000
(
01:40
+0200)
committer
Joey Schulze
<joey@infodrom.org>
Sun, 9 Jul 2017 11:56:00 +0000
(13:56 +0200)
src/InfoCon/buch/infocon
patch
|
blob
|
history
diff --git
a/src/InfoCon/buch/infocon
b/src/InfoCon/buch/infocon
index
b0d6961
..
843b378
100755
(executable)
--- a/
src/InfoCon/buch/infocon
+++ b/
src/InfoCon/buch/infocon
@@
-168,6
+168,11
@@
sub sales_list
$where .= sprintf("year = %d", $opt_year);
}
$where .= sprintf("year = %d", $opt_year);
}
+ if (defined $data{category}) {
+ $where .= " AND " if $where;
+ $where .= sprintf("category = %s", $dbh->quote($data{category}));
+ }
+
if ($opt_direction) {
if ($opt_direction eq "in") {
$d = "price >= 0"
if ($opt_direction) {
if ($opt_direction eq "in") {
$d = "price >= 0"
@@
-587,9
+592,9
@@
my %options = (
'verbose' => \$opt_verbose,
'help' => \&usage,
'dm' => sub {$table = "sales_dm"},
'verbose' => \$opt_verbose,
'help' => \&usage,
'dm' => sub {$table = "sales_dm"},
- 'buchung-input|bi' => \
$data{'buchung-input'}
,
- 'buchung-unpaid|bu' => \
$data{'buchung-unpaid'}
,
- 'buchung-hidden|bh' => \
$data{'buchung-hidden'}
,
+ 'buchung-input|bi' => \
&buchung_input
,
+ 'buchung-unpaid|bu' => \
&buchung_unpaid
,
+ 'buchung-hidden|bh' => \
&buchung_hidden
,
'list-categories|lc' => \$data{'list-categories'},
);
'list-categories|lc' => \$data{'list-categories'},
);
@@
-624,12
+629,6
@@
if (defined $data{category}) {
sales_list;
}
exit;
sales_list;
}
exit;
-} elsif (defined $data{'buchung-input'}) {
- buchung_input;
-} elsif (defined $data{'buchung-unpaid'}) {
- buchung_unpaid;
-} elsif (defined $data{'buchung-hidden'}) {
- buchung_hidden;
} elsif (defined $data{'list-categories'}) {
list_categories;
} elsif (defined $data{pay}) {
} elsif (defined $data{'list-categories'}) {
list_categories;
} elsif (defined $data{pay}) {