Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion hledger-lib/Hledger/Data/Posting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,14 @@ postingCommodities = map acommodity . filter (not . isMissingAmount) . amountsRa
where isMissingAmount a = acommodity a == "AUTO"

-- | Tags for this posting including any inherited from its parent transaction.
-- Explicitly-set posting tags override inherited transaction tags with the same name.
postingAllTags :: Posting -> [Tag]
postingAllTags p = ptags p ++ maybe [] ttags (ptransaction p)
postingAllTags p = postingTags ++ filteredTxnTags
where
postingTags = ptags p
txnTags = maybe [] ttags (ptransaction p)
postingTagNames = map fst postingTags
filteredTxnTags = filter ((`notElem` postingTagNames) . fst) txnTags

-- | Tags for this transaction including any from its postings (which includes any from the postings' accounts).
transactionAllTags :: Transaction -> [Tag]
Expand Down
Loading