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

Safe HaskellNone
LanguageHaskell2010

Buchhaltung.Common

Contents

Synopsis

CONFIGURATION

CSV PARSER

dbacl output parser

dbacl_parse :: [AccountName] -> String -> Either ParseError [(AccountName, String)] Source #

parse dbacl output (see testdbacl for the format of dbacl's output)

dbacl_parser :: [AccountName] -> Parsec String () [(AccountName, [String])] Source #

Utilities

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

Dates

saveChanges Source #

Arguments

:: (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

mixed' :: Amount -> MixedAmount Source #

showTransactions :: Journal -> [Char] Source #

Lenses

jTrans :: Lens' Journal [Transaction] Source #

tPosts :: Lens' Transaction [Posting] Source #

pAcc :: Lens' Posting AccountName Source #

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

injectSource :: ImportTag -> Source -> Transaction -> Transaction Source #

make CSV data easier to handle

parseCsv Source #

Arguments

:: Char

separator

-> TL.Text 
-> ([T.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, 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 addNew

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

helper function to create transaction for ImportedEntry

normalizeMixedAmountWith :: (Amount -> Decimal) -> MixedAmount -> MixedAmount Source #

data Importer env Source #

Constructors

Importer 

type Getter a = MyRecord -> a Source #

retrieval function

data CsvImport a Source #

Constructors

CSV 

Fields

data CheckedCsvImport a Source #

Constructors

UnsafeCSV 

Fields

type VersionedCSV a Source #

Arguments

 = MonadError Msg m 
=> m (SFormat DefaultVersion, M.Map Version (CheckedCsvImport a))

(format with default version, _)

Pretty Printing

table Source #

Arguments

:: [Int]

max width

-> [T.Text]

Header

-> [[T.Text]]

list of cols

-> P.Box 

table1 Source #

Arguments

:: E.NonEmpty [P.Box]

list of rows

-> P.Box 

table2 Source #

Arguments

:: [Int]

max width

-> [T.Text]

Header

-> [[T.Text]]

list of cols

-> E.NonEmpty [P.Box]

list of rows

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

text' :: T.Text -> P.Box Source #