Skip to content

Commit

Permalink
[test-balsheet-pnl] tests reverse-chrono option
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed Dec 12, 2020
1 parent 200d4d8 commit cf5db5c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion gnucash/report/reports/standard/test/test-balsheet-pnl.scm
Expand Up @@ -541,6 +541,15 @@
"1 FUNDS $350.0000")
(sxml->table-row-col sxml 1 #f 4)))

(set-option! multi-bs-options "General" "Period order is most recent first" #t)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"multicol-balsheet-halfyear")))
(test-equal "bal-1/1/70-reverse-chrono"
'("Date" "01/01/72" "01/01/71" "01/01/70")
(sxml->table-row-col sxml 1 1 #f)))

(set-option! multi-bs-options "General" "Period order is most recent first" #f)

;; the following includes non-zero retained earnings of $1,270
(set-option! multi-bs-options "General" "End Date"
(cons 'absolute (gnc-dmy2time64 1 3 1980)))
Expand Down Expand Up @@ -599,4 +608,11 @@
(test-equal "pnl-3/80"
'("03/01/80" " to 03/31/80" "$0.00" "$0.00" "$0.00" "#0.00 "
"$0.00" "#1.00 $1.7000")
(sxml->table-row-col sxml 1 #f 4)))))
(sxml->table-row-col sxml 1 #f 4)))

(set-option! multi-bs-options "General" "Period order is most recent first" #t)
(let ((sxml (options->sxml multicol-balsheet-uuid multi-bs-options
"testing period reverse chrono order pnl")))
(test-equal "pnl-reverse chrono"
'("Date" "03/31/80" "03/01/80" "02/01/80" "01/01/80")
(sxml->table-row-col sxml 1 1 #f)))))

0 comments on commit cf5db5c

Please sign in to comment.