cashiers should know, when they were created

This commit is contained in:
nek0 2015-04-10 18:19:48 +02:00
parent ac433a683d
commit 0242b31e22
3 changed files with 5 additions and 2 deletions

View file

@ -14,8 +14,9 @@ postCashCheckR = do
((res, _), _) <- runFormPost createCashCheckForm
case res of
FormSuccess c -> do
currentTime <- liftIO getCurrentTime
runDB $ insert_ c
runDB $ insert_ $ Cashier (cashCheckBalance c)
runDB $ insert_ $ Cashier (cashCheckBalance c) currentTime
setMessage "Kassensturz durchgeführt. Kasse aktualisiert"
redirect $ HomeR
_ -> do

View file

@ -33,7 +33,8 @@ updateCashier amount desc = do
runDB $ update (entityKey entCash) [CashierBalance +=. amount]
runDB $ insert_ trans
Nothing -> do
runDB $ insert_ $ Cashier amount
currentTime <- liftIO getCurrentTime
runDB $ insert_ $ Cashier amount currentTime
runDB $ insert_ trans
getCashierBalance :: Handler Int

View file

@ -19,6 +19,7 @@ Transaction
deriving Typeable Show
Cashier
balance Int
created UTCTime
deriving Typeable Show
CashCheck
balance Int