Safe Haskell | None |
---|---|
Language | Haskell2010 |
- readcsv :: Char -> T.Text -> [[T.Text]]
- readcsvrow :: Char -> T.Text -> [T.Text]
- p_csvrow :: Char -> T.Parser [T.Text]
- p_csvfield :: Char -> T.Parser T.Text
- p_csvstring :: T.Parser String
- escapedDoubleQuotes :: IsString t => t
- parens :: Parsec T.Text () Int
- testdbacl :: IO ()
- dbacl_parse :: [AccountName] -> String -> Either ParseError [(AccountName, String)]
- dbacl_parser :: [AccountName] -> Parsec String () [(AccountName, [String])]
- idx :: (Eq a, Show a) => [a] -> a -> Int
- saveChanges :: (MonadReader (Options User config env) m, MonadIO m) => (Journal -> (Journal, Integer)) -> m Journal
- mixed' :: Amount -> MixedAmount
- showTransactions :: Journal -> [Char]
- jTrans :: Lens' Journal [Transaction]
- tPosts :: Lens' Transaction [Posting]
- pAcc :: Lens' Posting AccountName
- changeTransaction :: [(Transaction, Transaction)] -> Journal -> (Journal, Integer)
- countUpdates :: Traversal' s a -> (a -> Maybe a) -> s -> (s, Integer)
- data WithSource a = WithSource {}
- extractSource :: ImportTag -> Transaction -> Either String (WithSource ())
- injectSource :: ImportTag -> Source -> Transaction -> Transaction
- commentPrefix :: ImportTag -> T.Text
- trimnl :: T.Text -> T.Text
- type MyRecord = HM.HashMap T.Text T.Text
- parseCsv :: Char -> TL.Text -> ([T.Text], [MyRecord])
- getCsvConcat :: [T.Text] -> MyRecord -> T.Text
- getCsv :: T.Text -> MyRecord -> T.Text
- data ImportedEntry' a s = ImportedEntry {
- ieT :: Transaction
- iePostings :: a
- ieSource :: s
- type ImportedEntry = ImportedEntry' (AccountId, T.Text) Source
- type FilledEntry = ImportedEntry' () Source
- fromFilled :: FilledEntry -> Entry
- type Entry = ImportedEntry' () (Either String Source)
- genTrans :: Day -> Maybe Day -> T.Text -> Transaction
- normalizeMixedAmountWith :: (Amount -> Decimal) -> MixedAmount -> MixedAmount
- data Importer env = Importer {
- iModifyHandle :: Maybe (Handle -> IO ())
- iImport :: T.Text -> CommonM (env, Maybe Version) [ImportedEntry]
- windoof :: Maybe (Handle -> IO ())
- parseDatum :: T.Text -> Day
- type Getter a = MyRecord -> a
- data CsvImport a = CSV {}
- data CheckedCsvImport a = UnsafeCSV {}
- toVersionedCSV :: SFormat DefaultVersion -> [CsvImport a] -> VersionedCSV a
- type VersionedCSV a = forall m. MonadError Msg m => m (SFormat DefaultVersion, M.Map Version (CheckedCsvImport a))
- data DefaultVersion = DefaultVersion {}
- checkRawCSV :: SFormat b -> CsvImport a -> CheckedCsvImport a
- table :: [Int] -> [T.Text] -> [[T.Text]] -> P.Box
- table1 :: E.NonEmpty [P.Box] -> P.Box
- table2 :: [Int] -> [T.Text] -> [[T.Text]] -> E.NonEmpty [P.Box]
- mlen :: ListLike l e => [l] -> Int
- text' :: T.Text -> P.Box
- module Buchhaltung.Utils
- module Buchhaltung.Types
- textstrip :: T.Text -> T.Text
CONFIGURATION
CSV PARSER
escapedDoubleQuotes :: IsString t => t Source #
dbacl output parser
dbacl_parse :: [AccountName] -> String -> Either ParseError [(AccountName, String)] Source #
parse dbacl output (see testdbacl for the format of dbacl's output)
Utilities
Dates
:: (MonadReader (Options User config env) m, MonadIO m) | |
=> (Journal -> (Journal, Integer)) | modifier, returning number of changed |
-> m Journal |
Read the journal file again, before applying Changes (to not overwrite possible changes, that were made in the mean time) saveChanges :: String -- ^ journal path -> (Journal-> (Journal, Integer)) -> IO Journal
showTransactions :: Journal -> [Char] Source #
Lenses
changeTransaction :: [(Transaction, Transaction)] -> Journal -> (Journal, Integer) Source #
replaces every matching transaction in the given journal counts the number of changed transactions
countUpdates :: Traversal' s a -> (a -> Maybe a) -> s -> (s, Integer) Source #
Update a traversal and count the number of updates
data WithSource a Source #
extractSource :: ImportTag -> Transaction -> Either String (WithSource ()) Source #
extracts the source line from a Transaction
injectSource :: ImportTag -> Source -> Transaction -> Transaction Source #
commentPrefix :: ImportTag -> T.Text Source #
make CSV data easier to handle
Import Types
data ImportedEntry' a s Source #
ImportedEntry | |
|
type ImportedEntry Source #
= ImportedEntry' (AccountId, T.Text) Source | postings of [acount,amount]: only ImportedEntry with one
posting is currently implemented in the statists functionality of
Add.hs (See PROBLEM1) as well in the duplicates algorithm in |
type FilledEntry = ImportedEntry' () Source Source #
fromFilled :: FilledEntry -> Entry Source #
genTrans :: Day -> Maybe Day -> T.Text -> Transaction Source #
helper function to create transaction for ImportedEntry
normalizeMixedAmountWith :: (Amount -> Decimal) -> MixedAmount -> MixedAmount Source #
parseDatum :: T.Text -> Day Source #
CSV | |
|
toVersionedCSV :: SFormat DefaultVersion -> [CsvImport a] -> VersionedCSV a Source #
type VersionedCSV a Source #
= MonadError Msg m | |
=> m (SFormat DefaultVersion, M.Map Version (CheckedCsvImport a)) | (format with default version, _) |
checkRawCSV :: SFormat b -> CsvImport a -> CheckedCsvImport a Source #
Pretty Printing
:: E.NonEmpty [P.Box] | list of rows |
-> P.Box |
:: [Int] | max width |
-> [T.Text] | Header |
-> [[T.Text]] | list of cols |
-> E.NonEmpty [P.Box] | list of rows |
module Buchhaltung.Utils
module Buchhaltung.Types