summaryrefslogtreecommitdiff
path: root/Foundation.hs
diff options
context:
space:
mode:
authorClint Adams <clint@softwarefreedom.org>2013-04-22 17:41:15 -0400
committerClint Adams <clint@softwarefreedom.org>2013-04-22 17:41:15 -0400
commitf1a294e5ddb8ae0ccdcef1a12561e603ff996cfe (patch)
tree14d4df6383db09051ef9631dbf09c9ed6a2039d3 /Foundation.hs
parent514ff2acff2ba9ad9f809e22fc8ed5a986410e5d (diff)
journal-query-based monthly reports (p&l, assets, liabilities)
Diffstat (limited to 'Foundation.hs')
-rw-r--r--Foundation.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Foundation.hs b/Foundation.hs
index 49acd52..4ce89c8 100644
--- a/Foundation.hs
+++ b/Foundation.hs
@@ -29,9 +29,18 @@ import Web.ClientSession (getKey)
import Text.Hamlet (hamletFile)
import qualified Data.Text
import Data.Map (Map)
+import Hledger.JournalCSVs (JReportType(..))
type Ledger = Data.Text.Text
+instance PathPiece JReportType where
+ fromPathPiece "pandl" = Just PandL
+ fromPathPiece "assets" = Just Assets
+ fromPathPiece "liabilities" = Just Liabilities
+ fromPathPiece "everything" = Just Everything
+ fromPathPiece _ = Nothing
+ toPathPiece = Data.Text.toLower . Data.Text.pack . show
+
-- | The site argument for your application. This can be a good place to
-- keep settings and values requiring initialization before your application
-- starts running, such as database connections. Every handler will have