test-transaction.scm (gnucash-5.0.tar.bz2) | : | test-transaction.scm (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 480 | skipping to change at line 480 | |||
(test-end "accounts selectors and filtering") | (test-end "accounts selectors and filtering") | |||
(test-begin "display options") | (test-begin "display options") | |||
(let ((options (default-testing-options))) | (let ((options (default-testing-options))) | |||
;; Disable most Display/* columns | ;; Disable most Display/* columns | |||
(for-each | (for-each | |||
(lambda (name) | (lambda (name) | |||
(set-option! options "Display" name #f)) | (set-option! options "Display" name #f)) | |||
(list "Date" "Reconciled Date" "Num" "Description" "Memo" "Notes" | (list "Date" "Reconciled Date" "Num" "Description" "Memo" "Notes" | |||
"Account Name" "Other Account Name" "Shares" "Price" "Running Balan ce" | "Account Name" "Other Account Name" "Shares" "Price" "Account Balan ce" | |||
"Totals")) | "Totals")) | |||
(let ((sxml (options->sxml options "all columns off"))) | (let ((sxml (options->sxml options "all columns off"))) | |||
(test-assert "all display columns off, except amount and subtotals are e nabled, there should be 2 columns" | (test-assert "all display columns off, except amount and subtotals are e nabled, there should be 2 columns" | |||
(= (length ((sxpath '(// (table 1) // (tr 1) // th)) sxml)) | (= (length ((sxpath '(// (table 1) // (tr 1) // th)) sxml)) | |||
(length ((sxpath '(// (table 1) // (tr 4) // td)) sxml)) | (length ((sxpath '(// (table 1) // (tr 4) // td)) sxml)) | |||
(length ((sxpath '(// (table 1) // (tr -1) // td)) sxml)) | (length ((sxpath '(// (table 1) // (tr -1) // td)) sxml)) | |||
2))) | 2))) | |||
(set-option! options "Sorting" "Primary Subtotal" #f) | (set-option! options "Sorting" "Primary Subtotal" #f) | |||
(set-option! options "Sorting" "Primary Subtotal for Date Key" 'none) | (set-option! options "Sorting" "Primary Subtotal for Date Key" 'none) | |||
skipping to change at line 538 | skipping to change at line 538 | |||
;; Reset to test with full columns | ;; Reset to test with full columns | |||
(set! options (default-testing-options)) | (set! options (default-testing-options)) | |||
(set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time6 4 01 01 1969))) | (set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time6 4 01 01 1969))) | |||
(set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 12 1970))) | (set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 12 1970))) | |||
(set-option! options "Sorting" "Primary Key" 'reconciled-status) | (set-option! options "Sorting" "Primary Key" 'reconciled-status) | |||
(set-option! options "Accounts" "Accounts" (gnc-account-get-descendants (g nc-account-get-root bank))) | (set-option! options "Accounts" "Accounts" (gnc-account-get-descendants (g nc-account-get-root bank))) | |||
(for-each | (for-each | |||
(lambda (name) | (lambda (name) | |||
(set-option! options "Display" name #t)) | (set-option! options "Display" name #t)) | |||
(list "Date" "Reconciled Date" "Num" "Description" "Memo" "Notes" | (list "Date" "Reconciled Date" "Num" "Description" "Memo" "Notes" | |||
"Account Name" "Other Account Name" "Shares" "Price" "Running Balan ce" | "Account Name" "Other Account Name" "Shares" "Price" "Account Balan ce" | |||
"Totals" "Use Full Other Account Name" "Use Full Account Name")) | "Totals" "Use Full Other Account Name" "Use Full Account Name")) | |||
(let* ((sxml (options->sxml options "all columns on"))) | (let* ((sxml (options->sxml options "all columns on"))) | |||
(test-equal "all display columns on, displays correct columns" | (test-equal "all display columns on, displays correct columns" | |||
(list "Date" "Reconciled Date" "Num" "Description" "Memo/Notes" "Accou nt" | (list "Date" "Reconciled Date" "Num" "Description" "Memo/Notes" "Accou nt" | |||
"Transfer from/to" "Shares" "Price" "Amount" "Running Balance") | "Transfer from/to" "Shares" "Price" "Amount" "Account Balance") | |||
(get-row-col sxml 0 #f)) | (get-row-col sxml 0 #f)) | |||
(test-assert "reconciled dates must be 01/03/70 or whitespace" | (test-assert "reconciled dates must be 01/03/70 or whitespace" | |||
(and-map | (and-map | |||
(lambda (reconcile-date-string) | (lambda (reconcile-date-string) | |||
(or (string=? (string-trim-both reconcile-date-string) | (or (string=? (string-trim-both reconcile-date-string) | |||
(qof-print-date (gnc-dmy2time64 01 03 1970))) | (qof-print-date (gnc-dmy2time64 01 03 1970))) | |||
(string-null? (string-trim-both reconcile-date-string)))) | (string-null? (string-trim-both reconcile-date-string)))) | |||
(get-row-col sxml #f 2))) | (get-row-col sxml #f 2))) | |||
(test-equal "reconciled status subtotal" | (test-equal "reconciled status subtotal" | |||
(list "Total For Unreconciled" "$0.00") | (list "Total For Unreconciled" "$0.00") | |||
skipping to change at line 682 | skipping to change at line 682 | |||
(test-equal "dual amount column, with original currency headers" | (test-equal "dual amount column, with original currency headers" | |||
(list "Date" "Num" "Description" "Memo/Notes" "Account" | (list "Date" "Num" "Description" "Memo/Notes" "Account" | |||
"Debit (USD)" "Credit (USD)" "Debit" "Credit") | "Debit (USD)" "Credit (USD)" "Debit" "Credit") | |||
(get-row-col sxml 0 #f)) | (get-row-col sxml 0 #f)) | |||
(test-equal "dual amount column, grand totals available" | (test-equal "dual amount column, grand totals available" | |||
(list "Grand Total" "$2,280.00" "$2,280.00") | (list "Grand Total" "$2,280.00" "$2,280.00") | |||
(get-row-col sxml -1 #f)) | (get-row-col sxml -1 #f)) | |||
(test-equal "dual amount column, first transaction correct" | (test-equal "dual amount column, first transaction correct" | |||
(list "$103 income" "Root.Asset.Bank" "$103.00" "$103.00") | (list "$103 income" "Root.Asset.Bank" "$103.00" "$103.00") | |||
(cdr (get-row-col sxml 1 #f)))) | (cdr (get-row-col sxml 1 #f)))) | |||
;; test account balance displayed as running balance | ||||
(set! options (default-testing-options)) | ||||
(set-option! options "Display" "Account Balance" #t) | ||||
(let* ((sxml (options->sxml options "running balance, default options"))) | ||||
(test-equal "running balance, default sort" | ||||
(list "Date" "Num" "Description" "Memo/Notes" "Account" "Amount" "Runn | ||||
ing Balance") | ||||
(get-row-col sxml 0 #f)) | ||||
(test-equal "running balance, showing Balance b/f" | ||||
(list "Bank: Balance b/f" "-$99.00") | ||||
(get-row-col sxml 1 #f))) | ||||
(set-option! options "Sorting" "Primary Key" 'account-code) | ||||
(set-option! options "Sorting" "Secondary Key" 'date) | ||||
(let* ((sxml (options->sxml options "running balance, primary sort by acco | ||||
unt code, secondary sort by date"))) | ||||
(test-equal "running balance, secondary sort by date" | ||||
(list "Date" "Num" "Description" "Memo/Notes" "Account" "Amount" "Runn | ||||
ing Balance") | ||||
(get-row-col sxml 0 #f)) | ||||
(test-equal "running balance, showing Balance b/f" | ||||
(list "Bank: Balance b/f" "-$99.00") | ||||
(get-row-col sxml 1 #f))) | ||||
) | ) | |||
(test-end "display options") | (test-end "display options") | |||
(test-begin "sorting options") | (test-begin "sorting options") | |||
(let ((options (default-testing-options))) | (let ((options (default-testing-options))) | |||
(set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time6 4 01 01 1969))) | (set-option! options "General" "Start Date" (cons 'absolute (gnc-dmy2time6 4 01 01 1969))) | |||
(set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 12 1970))) | (set-option! options "General" "End Date" (cons 'absolute (gnc-dmy2time64 31 12 1970))) | |||
;;(set-option! options "Accounts" "Accounts" (gnc-account-get-descendants (gnc-account-get-root bank))) | ;;(set-option! options "Accounts" "Accounts" (gnc-account-get-descendants (gnc-account-get-root bank))) | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 27 lines changed or added |