Ajout : Hcompta.CLI
[comptalang.git] / lib / Hcompta / Model / Transaction.hs
index ad4f2038bf7e8b828c4fd39de986336c9ea18045..456f1291121c1e6a7e726f38bf986d2ace0586a7 100644 (file)
@@ -19,20 +19,23 @@ import qualified Hcompta.Model.Transaction.Tag as Tag
 
 data Transaction
  =   Transaction
- { code            :: Code
- , comments_before :: [Comment]
- , comments_after  :: [Comment]
- , dates           :: (Date, [Date])
- , description     :: Description
- , postings        :: Posting.By_Account
- , sourcepos       :: SourcePos
- , status          :: Bool
- , tags            :: Tag.By_Name
+ { code                      :: Code
+ , comments_before           :: [Comment]
+ , comments_after            :: [Comment]
+ , dates                     :: (Date, [Date])
+ , description               :: Description
+ , postings                  :: Posting.By_Account
+ , virtual_postings          :: Posting.By_Account
+ , balanced_virtual_postings :: Posting.By_Account
+ , sourcepos                 :: SourcePos
+ , status                    :: Status
+ , tags                      :: Tag.By_Name
  } deriving (Data, Eq, Read, Show, Typeable)
 
 type Code = Text
 type Comment = Posting.Comment
 type Description = Text
+type Status = Bool
 
 nil :: Transaction
 nil =
@@ -43,6 +46,8 @@ nil =
         , dates = (Date.nil, [])
         , description = ""
         , postings = Data.Map.empty
+        , virtual_postings = Data.Map.empty
+        , balanced_virtual_postings = Data.Map.empty
         , sourcepos = initialPos ""
         , status = False
         , tags = Data.Map.empty