summaryrefslogtreecommitdiff
path: root/mat
diff options
context:
space:
mode:
authorcos <cos>2014-01-18 14:59:28 +0100
committercos <cos>2014-01-18 14:59:28 +0100
commit9a9ccd11e0fe68232cc605f9bfdd883f4c0afe4f (patch)
tree24cea60d497fa07b656e232679aae4c9a73dbfb0 /mat
parent3e7f9000c6868549b1b9cf8d447aa30bb54624f8 (diff)
downloadmat-9a9ccd11e0fe68232cc605f9bfdd883f4c0afe4f.zip
Store preparation dates in inventory table.
Diffstat (limited to 'mat')
-rwxr-xr-xmat5
1 files changed, 3 insertions, 2 deletions
diff --git a/mat b/mat
index 9ee730a..2f103db 100755
--- a/mat
+++ b/mat
@@ -346,8 +346,9 @@ sub print_label {
sub cmd_storeportion {
my ( $recipe_id, $amount, $storage ) = @_;
- my $sql = "INSERT INTO inventory (recipe_id, amount, storage ) VALUES (".
- "$recipe_id, $amount, '$storage' );";
+ my $sql = "INSERT INTO inventory (recipe_id, preparation_date, amount, ".
+ "storage ) VALUES ($recipe_id, ".`date +%Y%m%d|tr -d '\n'`.", $amount, ".
+ "'$storage' );";
$db->do($sql);
my $inventory_id = $db->last_insert_id(undef, undef, undef, undef);