buchhaltung-0.0.7: Automates most of your plain text accounting data entry in ledger format.

Safe HaskellNone
LanguageHaskell2010

Buchhaltung.Common

Contents

Synopsis

CONFIGURATION

CSV PARSER

readcsv :: Char -> Text -> [[Text]] 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

idx :: (Eq a, Show a) => [a] -> a -> Int Source #

Dates

saveChanges Source #

Arguments

:: (MonadReader (Options User config env) m, MonadIO m) 
=> Maybe Journal 
-> (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

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 #

Constructors

WithSource 

Fields

Instances

Functor WithSource Source # 

Methods

fmap :: (a -> b) -> WithSource a -> WithSource b #

(<$) :: a -> WithSource b -> WithSource a #

extractSource :: ImportTag -> Transaction -> Either String (WithSource ()) Source #

extracts the source line from a Transaction

make CSV data easier to handle

stripCsv :: ([Text], [MyRecord]) -> ([Text], [MyRecord]) Source #

parseCsv Source #

Arguments

:: Char

separator

-> Text 
-> ([Text], [MyRecord]) 

Import Types

data ImportedEntry' a s Source #

Constructors

ImportedEntry 

Fields

  • ieT :: Transaction

    transaction without postings (they will be inserted later)

  • iePostings :: a
     
  • ieSource :: s

    source to check for duplicates and for Bayesian matching

Instances

type ImportedEntry Source #

Arguments

 = ImportedEntry' [(AccountId, Text, Maybe Text, Bool)] 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 addNew

genTrans :: Day -> Maybe Day -> Text -> Transaction Source #

helper function to create transaction for ImportedEntry

data Importer env Source #

Constructors

Importer 

type Getter a = MyRecord -> a Source #

retrieval function

data CsvPostingImport Source #

Constructors

CsvPosting 

Fields

data CsvImport env Source #

Constructors

CSV 

Fields

data Description env Source #

Constructors

Field Text 
Const Text 
Read (env -> Text) 

data CheckedCsvImport a Source #

Constructors

UnsafeCSV 

Fields

type VersionedCSV env Source #

Arguments

 = MonadError Msg m 
=> m (SFormat DefaultVersion, Map Version (CheckedCsvImport env))

(format with default version, _)

Pretty Printing

table Source #

Arguments

:: [Int]

max width

-> [Text]

Header

-> [[Text]]

list of cols

-> Box 

table1 Source #

Arguments

:: NonEmpty [Box]

list of rows

-> Box 

table2 Source #

Arguments

:: [Int]

max width

-> [Text]

Header

-> [[Text]]

list of cols

-> NonEmpty [Box]

list of rows

mlen :: ListLike l e => [l] -> Int Source #

textstrip :: Text -> Text #

Remove leading and trailing whitespace.