diff options
author | cos <cos> | 2012-05-12 15:59:42 +0200 |
---|---|---|
committer | cos <cos> | 2012-12-17 21:12:06 +0100 |
commit | 19180c698d7a008c298424177706305319df94b8 (patch) | |
tree | d7a87b276dbcfc71e09d057c9a1406af1823c74e | |
parent | 35a096df3dde0dacdcb83a8b3972776e7c7d76fb (diff) | |
download | mat-19180c698d7a008c298424177706305319df94b8.zip |
Have shoppinglist check state of entries.
Only add ingredients to shoppinglist for planned meals that are not ready,
frozen or already shopped for.
-rwxr-xr-x | mat | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -409,7 +409,10 @@ sub cmd_shoppinglist { # } my $entries = $db->selectall_arrayref("SELECT recipe_id FROM plan WHERE date ". - "BETWEEN '".$startdate."' and '".$enddate."'", { Slice => {} }); + "BETWEEN '".$startdate."' and '".$enddate."' and ". + "IFNULL(state, 'null') != 'frozen' and ". + "IFNULL(state, 'null') != 'ready' and ". + "IFNULL(state, 'null') != 'sourced'", { Slice => {} }); my %recipe_count; for my $entry ( @$entries ) { $recipe_count{$entry->{recipe_id}}++; |