dev: web: Use entriesReport instead of transactionReport.

This produces identical results. The only fields used in the TransactionReport were torig, split, and amt.
- torig is the same as in entriesReport
- since transactionsReport calls accountTransactionsReportItems with
  None as thisacctq, all accounts are considered ‘other accounts’, so
  amt is always zero, and ($if not split && not (mixedAmountLooksZero amt)) never fires.
- So the only thing used is torig, and we can just get that from the
  entriesReport.
This commit is contained in:
Stephen Morgan 2021-06-23 11:43:12 +10:00 committed by Simon Michael
parent 58516eea77
commit acfbd36fb8
2 changed files with 3 additions and 4 deletions

View File

@ -27,7 +27,8 @@ getJournalR = do
Just (a, inclsubs) -> "Transactions in " <> a <> if inclsubs then "" else " (excluding subaccounts)"
title' = title <> if m /= Any then ", filtered" else ""
acctlink a = (RegisterR, [("q", replaceInacct q $ accountQuery a)])
items = transactionsReport (reportspec_ $ cliopts_ opts) j m
rspec = (reportspec_ $ cliopts_ opts){rsQuery = m}
items = reverse $ entriesReport rspec j
transactionFrag = transactionFragment j
defaultLayout $ do

View File

@ -14,15 +14,13 @@ $if elem CapAdd caps
<th .account style="text-align:left;">Account
<th .amount style="text-align:right;">Amount
$forall (torig, _, split, _, amt, _) <- items
$forall torig <- items
<tr .title ##{transactionFrag torig} title="#{showTransaction torig}">
<td .date nowrap>
#{show (tdate torig)}
<td colspan=2>
#{textElideRight 60 (tdescription torig)}
<td .amount style="text-align:right;">
$if not split && not (mixedAmountLooksZero amt)
^{mixedAmountAsHtml amt}
$forall Posting { paccount = acc, pamount = amt } <- tpostings torig
<tr .posting>