mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-29 05:11:33 +03:00
journal: ignore transaction comments in auto posting rules (#745)
Previously they were misparsed as account names.
This commit is contained in:
parent
05073e9f9d
commit
41c985b5fb
@ -469,13 +469,15 @@ commodityconversiondirectivep = do
|
|||||||
|
|
||||||
--- ** transactions
|
--- ** transactions
|
||||||
|
|
||||||
|
-- TODO transactionmodifierp ? transactionrewritep ?
|
||||||
modifiertransactionp :: JournalParser m ModifierTransaction
|
modifiertransactionp :: JournalParser m ModifierTransaction
|
||||||
modifiertransactionp = do
|
modifiertransactionp = do
|
||||||
char '=' <?> "modifier transaction"
|
char '=' <?> "modifier transaction"
|
||||||
lift (skipMany spacenonewline)
|
lift (skipMany spacenonewline)
|
||||||
valueexpr <- T.pack <$> lift restofline
|
querytxt <- T.pack <$> lift restofline -- TODO should not consume a same-line comment
|
||||||
|
(_cmt, _tags) <- lift transactioncommentp -- TODO apply these to modified txns ?
|
||||||
postings <- postingsp Nothing
|
postings <- postingsp Nothing
|
||||||
return $ ModifierTransaction valueexpr postings
|
return $ ModifierTransaction querytxt postings
|
||||||
|
|
||||||
-- | Parse a periodic transaction
|
-- | Parse a periodic transaction
|
||||||
periodictransactionp :: MonadIO m => JournalParser m PeriodicTransaction
|
periodictransactionp :: MonadIO m => JournalParser m PeriodicTransaction
|
||||||
@ -648,7 +650,7 @@ postingsp mTransactionYear = many (postingp mTransactionYear) <?> "postings"
|
|||||||
|
|
||||||
postingp :: Maybe Year -> JournalParser m Posting
|
postingp :: Maybe Year -> JournalParser m Posting
|
||||||
postingp mTransactionYear = do
|
postingp mTransactionYear = do
|
||||||
-- dbgparse 0 "postingp"
|
-- lift $ dbgparse 0 "postingp"
|
||||||
(status, account) <- try $ do
|
(status, account) <- try $ do
|
||||||
lift (skipSome spacenonewline)
|
lift (skipSome spacenonewline)
|
||||||
status <- lift statusp
|
status <- lift statusp
|
||||||
|
Loading…
Reference in New Issue
Block a user