enable upstocking of zero crates

This commit is contained in:
nek0 2016-02-02 20:05:18 +01:00
parent 6d36bbbf7c
commit 5b9bcfc641
1 changed files with 1 additions and 1 deletions

View File

@ -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]