forgot files
This commit is contained in:
parent
c625d65c41
commit
d4609d1cbe
2 changed files with 38 additions and 0 deletions
27
Handler/CashCheck.hs
Normal file
27
Handler/CashCheck.hs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
module Handler.CashCheck where
|
||||||
|
|
||||||
|
import Import
|
||||||
|
import Handler.Common
|
||||||
|
|
||||||
|
getCashCheckR :: Handler Html
|
||||||
|
getCashCheckR = do
|
||||||
|
(cashCheckWidget, enctype) <- generateFormPost createCashierForm
|
||||||
|
defaultLayout $ do
|
||||||
|
$(widgetFile "cashCheck")
|
||||||
|
|
||||||
|
postCashCheckR :: Handler Html
|
||||||
|
postCashCheckR = do
|
||||||
|
((res, _), _) <- runFormPost createCashierForm
|
||||||
|
case res of
|
||||||
|
FormSuccess c -> do
|
||||||
|
runDB $ insert_ c
|
||||||
|
setMessage "Kassensturz durchgeführt. Kasse aktualisiert"
|
||||||
|
redirect $ HomeR
|
||||||
|
_ -> do
|
||||||
|
setMessage "Fehler im Kassensturz"
|
||||||
|
redirect $ CashCheckR
|
||||||
|
|
||||||
|
createCashierForm :: Form Cashier
|
||||||
|
createCashierForm = renderDivs $ Cashier
|
||||||
|
<$> areq currencyField "Gezählter Betrag" Nothing
|
||||||
|
<*> lift (liftIO getCurrentTime)
|
11
templates/cashCheck.hamlet
Normal file
11
templates/cashCheck.hamlet
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
$doctype 5
|
||||||
|
|
||||||
|
<h3>Kassensturz
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Bitte Kasse zählen und gezählten Betrag in unten stehendes Feld eintragen.
|
||||||
|
|
||||||
|
<form method=post enctype=#{enctype}>
|
||||||
|
^{cashCheckWidget}
|
||||||
|
<div>
|
||||||
|
<input type=submit value="Absenden">
|
Loading…
Reference in a new issue