From f1a294e5ddb8ae0ccdcef1a12561e603ff996cfe Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Mon, 22 Apr 2013 17:41:15 -0400 Subject: journal-query-based monthly reports (p&l, assets, liabilities) --- Foundation.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Foundation.hs') 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 -- cgit v1.2.3