fix: areg: Make sure aregister sorts first by transaction register date,
then by parse order to break any ties. (#1642)
This commit is contained in:
parent
3270a4f0d7
commit
23b0cad6ef
@ -152,9 +152,9 @@ accountTransactionsReport rspec@ReportSpec{_rsReportOpts=ropts} j thisacctq = it
|
|||||||
|
|
||||||
items =
|
items =
|
||||||
accountTransactionsReportItems reportq thisacctq startbal maNegate
|
accountTransactionsReportItems reportq thisacctq startbal maNegate
|
||||||
-- sort by the transaction's register date, for accurate starting balance
|
-- sort by the transaction's register date, then index, for accurate starting balance
|
||||||
. ptraceAtWith 5 (("ts4:\n"++).pshowTransactions.map snd)
|
. ptraceAtWith 5 (("ts4:\n"++).pshowTransactions.map snd)
|
||||||
. sortBy (comparing $ Down . fst)
|
. sortBy (comparing (Down . fst) <> comparing (Down . tindex . snd))
|
||||||
. map (\t -> (transactionRegisterDate reportq thisacctq t, t))
|
. map (\t -> (transactionRegisterDate reportq thisacctq t, t))
|
||||||
$ jtxns acctJournal
|
$ jtxns acctJournal
|
||||||
|
|
||||||
|
|||||||
@ -42,15 +42,36 @@ $ hledger -f- areg a aaa
|
|||||||
Transactions in a and subaccounts:
|
Transactions in a and subaccounts:
|
||||||
2021-01-03 a:aa:aaa 100 100
|
2021-01-03 a:aa:aaa 100 100
|
||||||
|
|
||||||
# 5. Same-day transactions are displayed in parse order, as usual. (#1642)
|
# 5. Sorts transactions first by transaction date (earliest date of the
|
||||||
# <
|
# matching postings) then by parse order. (#1642)
|
||||||
# 2021-01-01 first
|
# Also, make sure to use the posting date of matching transactions, if it
|
||||||
# (a) 1
|
# differs from the transaction date.
|
||||||
|
<
|
||||||
|
2021-01-03 fifth
|
||||||
|
(a) 5
|
||||||
|
|
||||||
# 2021-01-01 second
|
2021-01-02 third
|
||||||
# (a) 2
|
(a) 3
|
||||||
|
|
||||||
# $ hledger -f- areg a -w80
|
2021-01-02 fourth
|
||||||
# Transactions in a and subaccounts:
|
(a) 4
|
||||||
# 2021-07-31 first a 1 1
|
|
||||||
# 2021-07-31 second a 2 3
|
2021-01-01 first
|
||||||
|
(a) 1
|
||||||
|
|
||||||
|
2021-01-03 second, because of posting date
|
||||||
|
(a) 2 ; date:2021-01-01
|
||||||
|
|
||||||
|
2021-01-04 sixth, because posting date is not matching
|
||||||
|
(a) 6
|
||||||
|
(b) 0 ; date:2021-01-01
|
||||||
|
|
||||||
|
|
||||||
|
$ hledger -f- areg a -w80
|
||||||
|
Transactions in a and subaccounts:
|
||||||
|
2021-01-01 first a 1 1
|
||||||
|
2021-01-01 second, because o.. a 2 3
|
||||||
|
2021-01-02 third a 3 6
|
||||||
|
2021-01-02 fourth a 4 10
|
||||||
|
2021-01-03 fifth a 5 15
|
||||||
|
2021-01-04 sixth, because po.. b 6 21
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user