enable upstocking of zero crates

This commit is contained in:
nek0 2016-02-02 20:05:18 +01:00
parent 6d36bbbf7c
commit 5b9bcfc641

View file

@ -47,7 +47,7 @@ postUpstockR bId = do
$ renderBootstrap3 BootstrapBasicForm upstockForm $ renderBootstrap3 BootstrapBasicForm upstockForm
case res of case res of
FormSuccess c -> FormSuccess c ->
if upstockSingles c > 0 && upstockCrates c > 0 if upstockSingles c > 0 && upstockCrates c >= 0
then do then do
let total = upstockSingles c + (upstockCrates c * (fromMaybe 0 $ beveragePerCrate bev)) let total = upstockSingles c + (upstockCrates c * (fromMaybe 0 $ beveragePerCrate bev))
runDB $ update bId [BeverageAmount +=. total] runDB $ update bId [BeverageAmount +=. total]