From 5b9bcfc641b61ebed9020f014f0f30c605c6a338 Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 2 Feb 2016 20:05:18 +0100 Subject: [PATCH] enable upstocking of zero crates --- Handler/Restock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Handler/Restock.hs b/Handler/Restock.hs index 83fd279..bd18ecf 100644 --- a/Handler/Restock.hs +++ b/Handler/Restock.hs @@ -47,7 +47,7 @@ postUpstockR bId = do $ renderBootstrap3 BootstrapBasicForm upstockForm case res of FormSuccess c -> - if upstockSingles c > 0 && upstockCrates c > 0 + if upstockSingles c > 0 && upstockCrates c >= 0 then do let total = upstockSingles c + (upstockCrates c * (fromMaybe 0 $ beveragePerCrate bev)) runDB $ update bId [BeverageAmount +=. total]