cashiers should know, when they were created
This commit is contained in:
parent
ac433a683d
commit
0242b31e22
3 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -19,6 +19,7 @@ Transaction
|
|||
deriving Typeable Show
|
||||
Cashier
|
||||
balance Int
|
||||
created UTCTime
|
||||
deriving Typeable Show
|
||||
CashCheck
|
||||
balance Int
|
||||
|
|
Loading…
Reference in a new issue