yammat/Handler/Journal.hs
2015-04-04 08:25:10 +02:00

14 lines
373 B
Haskell

module Handler.Journal where
import Import as I
import Data.List as L
import Handler.Common
getJournalR :: Handler Html
getJournalR = do
master <- getYesod
entries <- runDB $ selectList [] [Asc TransactionId]
total <- return $ L.sum $ I.map (transactionAmount . entityVal) entries
cashBalance <- getCashierBalance
defaultLayout $ do
$(widgetFile "journal")