File: account.mli

package info (click to toggle)
misery 0.2-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 380 kB
  • ctags: 298
  • sloc: ml: 1,295; xml: 180; makefile: 94
file content (35 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(* Handling of a single account. *)

type account

type txn = { year : int;
             month : int;
             day : int;
             creditor : string;
             amount : Sumofmoney.amount;
             description : string;
             automatically_added : bool;
             do_not_symmetrise : bool;
             linked : bool }

val create : string -> string -> (string * string) list -> account
val create_virtual : string -> string -> (string * string) list -> account
val copy : account -> account -> string -> account
val short_name : account -> string
val full_name : account -> string
val is_virtual : account -> bool
val lookup_variable : string -> account -> string
val lookup_integer_variable : string -> account -> int
val lookup_boolean_variable : string -> account -> bool
val add_txn : txn -> account -> account
val add_txn_negated : txn -> account -> account
val iter_txns : (txn -> unit) -> account -> unit
val iter_txns_sorted : (txn -> unit) -> account -> unit
val map_txns : (txn -> txn) -> account -> account
val fold_txns : ('a -> txn -> 'a) -> 'a -> account -> 'a
val total : account -> Sumofmoney.default_units_amount
val create_account_from_channel : string -> in_channel -> account
val number_of_txns : account -> int
val income : account -> Sumofmoney.default_units_amount
val expenditure : account -> Sumofmoney.default_units_amount