balance, register: fix --date2 with report intervals

This commit is contained in:
Simon Michael 2014-04-19 15:54:58 -07:00
parent 06ad1b0a5d
commit c9d60fab73
3 changed files with 5 additions and 2 deletions

View File

@ -401,6 +401,7 @@ queryIsDepth _ = False
queryIsDate :: Query -> Bool
queryIsDate (Date _) = True
queryIsDate (Date2 _) = True
queryIsDate _ = False
queryIsDesc :: Query -> Bool

View File

@ -78,7 +78,8 @@ multiBalanceReport opts q j = MultiBalanceReport (displayspans, items, totals)
intervalspans = dbg "intervalspans" $ splitSpan (intervalFromOpts opts) requestedspan' -- interval spans enclosing it
reportspan = dbg "reportspan" $ DateSpan (maybe Nothing spanStart $ headMay intervalspans) -- the requested span enlarged to a whole number of intervals
(maybe Nothing spanEnd $ lastMay intervalspans)
reportq = dbg "reportq" $ depthless $ And [datelessq, Date reportspan] -- user's query enlarged to whole intervals and with no depth limit
newdatesq = dbg "newdateq" $ (if date2_ opts then Date2 else Date) reportspan
reportq = dbg "reportq" $ depthless $ And [datelessq, newdatesq] -- user's query enlarged to whole intervals and with no depth limit
ps :: [Posting] =
dbg "ps" $

View File

@ -60,7 +60,8 @@ postingsReport opts q j = (totallabel, items)
intervalspans = dbg "intervalspans" $ splitSpan (intervalFromOpts opts) requestedspan' -- interval spans enclosing it
reportspan = dbg "reportspan" $ DateSpan (maybe Nothing spanStart $ headMay intervalspans) -- the requested span enlarged to a whole number of intervals
(maybe Nothing spanEnd $ lastMay intervalspans)
reportq = dbg "reportq" $ depthless $ And [dateless q, Date reportspan] -- user's query enlarged to whole intervals and with no depth limit
newdatesq = dbg "newdateq" $ (if date2_ opts then Date2 else Date) reportspan
reportq = dbg "reportq" $ depthless $ And [dateless q, newdatesq] -- user's query enlarged to whole intervals and with no depth limit
(precedingps, displayableps, _) =
dbg "ps5" $ postingsMatchingDisplayExpr displayexpr opts $ -- filter and group by the -d display expression