penny- Extensible double-entry accounting system

Safe HaskellNone



Examining a Posting for a particular component of the main posting (as opposed to the sibling postings) in the Posting. For some components, such as the payee, the posting might have one piece of data while the TopLine has something else. These functions will examine the Posting first and, if it has no information, use the data from the TopLine if it is there.



best :: (TopLineData -> Maybe a) -> (Ents PostingData -> Maybe a) -> Posting -> Maybe aSource

Uses the data from the Posting if it is set; otherwise, use the data from the TopLine.

qty :: Posting -> QtySource

Every Posting either has a Qty or it can be computed from its QtyRep.