bookkeeping-0.2.0.1: A module for bookkeeping by double entry.

CopyrightKadzuya Okamoto 2017
LicenseMIT
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Business.Bookkeeping

Contents

Description

This module exports core functions and types for bookkeeping.

Synopsis

Usage examples

>>> :{
let
  advance :: CategoryName -> SubDescription -> Amount -> DateTransactions
  advance name = dateTrans
    (DebitCategory $ Category name Expenses)
    (CreditCategory $ Category "Deposit" Assets)
  sample =
    year 2015 $ do
      month 1 $ do
        activity 1 "Constant expenses" $
          advance "Communication" "Mobile phone" 3000
        activity 3 "Mail a contract" $ do
          advance "Communication" "Stamp" 50
          advance "Office supplies" "Envelope" 100
      month 2 $
        activity 1 "Constant expenses" $
          advance "Communication" "Mobile phone" 3000
:}

Pritty printers

ppr :: Transactions -> IO () Source #

A pretty printer for Transactions.

>>> ppr sample
tDay: 2015-01-01
tDescription: Constant expenses
tSubDescription: Mobile phone
tDebit: Communication (Expenses)
tCredit: Deposit (Assets)
tAmount: 3000

tDay: 2015-01-03
tDescription: Mail a contract
tSubDescription: Stamp
tDebit: Communication (Expenses)
tCredit: Deposit (Assets)
tAmount: 50

tDay: 2015-01-03
tDescription: Mail a contract
tSubDescription: Envelope
tDebit: Office supplies (Expenses)
tCredit: Deposit (Assets)
tAmount: 100

tDay: 2015-02-01
tDescription: Constant expenses
tSubDescription: Mobile phone
tDebit: Communication (Expenses)
tCredit: Deposit (Assets)
tAmount: 3000

Constructors

Converters

Types

type Transactions = Trans Transaction Source #

A type for handling Transaction values.

newtype Year Source #

Constructors

Year 

Fields

Instances

Eq Year Source # 

Methods

(==) :: Year -> Year -> Bool #

(/=) :: Year -> Year -> Bool #

Num Year Source # 

Methods

(+) :: Year -> Year -> Year #

(-) :: Year -> Year -> Year #

(*) :: Year -> Year -> Year #

negate :: Year -> Year #

abs :: Year -> Year #

signum :: Year -> Year #

fromInteger :: Integer -> Year #

Ord Year Source # 

Methods

compare :: Year -> Year -> Ordering #

(<) :: Year -> Year -> Bool #

(<=) :: Year -> Year -> Bool #

(>) :: Year -> Year -> Bool #

(>=) :: Year -> Year -> Bool #

max :: Year -> Year -> Year #

min :: Year -> Year -> Year #

Read Year Source # 
Show Year Source # 

Methods

showsPrec :: Int -> Year -> ShowS #

show :: Year -> String #

showList :: [Year] -> ShowS #

newtype Date Source #

Constructors

Date 

Fields

Instances

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Num Date Source # 

Methods

(+) :: Date -> Date -> Date #

(-) :: Date -> Date -> Date #

(*) :: Date -> Date -> Date #

negate :: Date -> Date #

abs :: Date -> Date #

signum :: Date -> Date #

fromInteger :: Integer -> Date #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Read Date Source # 
Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #