From 623b19a44059650e7a7dd9530e0677aaf1ef78cb Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 4 Apr 2015 08:25:10 +0200 Subject: [PATCH] more currency --- Handler/Journal.hs | 1 + templates/journal.hamlet | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Handler/Journal.hs b/Handler/Journal.hs index 75b704d..e7df105 100644 --- a/Handler/Journal.hs +++ b/Handler/Journal.hs @@ -6,6 +6,7 @@ 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 diff --git a/templates/journal.hamlet b/templates/journal.hamlet index 6092db1..8b74aa6 100644 --- a/templates/journal.hamlet +++ b/templates/journal.hamlet @@ -8,18 +8,18 @@ $if not $ L.null entries Zeit Beschreibung - Betrag + Betrag in #{appCurrency $ appSettings master} $forall (Entity eId entry) <- entries #{formatTime defaultTimeLocale "%A %F %H:%M" $ transactionTime entry} #{transactionDescription entry} - #{show ((fromIntegral (transactionAmount entry)) / 100)} + #{show ((fromIntegral (transactionAmount entry)) / 100)} #{appCurrency $ appSettings master} Gesamtbetrag: - #{show ((fromIntegral total) / 100)} + #{show ((fromIntegral total) / 100)} #{appCurrency $ appSettings master}

- Kassenbestand: #{show ((fromIntegral cashBalance) / 100)} + Kassenbestand: #{show ((fromIntegral cashBalance) / 100)} #{appCurrency $ appSettings master}