]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Model/Filter.hs
Ajout : Hcompta.Format.Text
[comptalang.git] / lib / Hcompta / Model / Filter.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 module Hcompta.Model.Filter where
3
4 import Data.Data
5 import Data.Typeable ()
6
7 import qualified Hcompta.Model.Account as Account ()
8 import Hcompta.Model.Account (Account)
9 import qualified Hcompta.Model.Amount as Amount ()
10 import Hcompta.Model.Amount (Amount)
11 import qualified Hcompta.Model.Date as Date
12 import qualified Hcompta.Model.Transaction.Tag as Tag
13
14 -- * The 'Filter' type
15
16 data Filter
17 = Account Comparison_String Account
18 | Account_Tag Comparison_String String (Maybe (Comparison_String, String))
19 | Amount (Comparison_Num, Comparison_Num_Absolute) Amount
20 | And Filter Filter
21 | Any
22 | Balance (Comparison_Num, Comparison_Num_Absolute) Amount
23 | Commodity Comparison_String String
24 | Date Date.Span
25 | Date2 Date.Span
26 | Depth Comparison_Num Int
27 | Description Comparison_String String
28 | None
29 | Not Filter
30 | Or Filter Filter
31 | Real Bool
32 | Status Bool
33 | Tag Comparison_String Tag.Name (Maybe (Comparison_String, Tag.Value))
34 deriving (Data, Eq, Show, Typeable)
35
36 data Comparison_Num
37 = Comparison_Num_Lt
38 | Comparison_Num_Lt_Eq
39 | Comparison_Num_Gt
40 | Comparison_Num_Gt_Eq
41 | Comparison_Num_Eq
42 deriving (Data, Eq, Show, Typeable)
43
44 type Comparison_Num_Absolute
45 = Bool
46
47 data Comparison_String
48 = Comparison_String_Eq
49 | Comparison_String_Regexp
50 deriving (Data, Eq, Show, Typeable)
51