From 1a6314e10867f9c42b617cee2ef3ed87e05a404b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 21 Sep 2019 20:39:16 +0800 Subject: [PATCH] [account-summary] tag col headers properly to fix formatting With this commit the col headers are now properly formatted. Change tests because the tag is now th instead of td therefore sxml (looking for td) can't find them anymore. --- .../standard-reports/account-summary.scm | 19 +++++++++++-------- .../test/test-account-summary.scm | 8 ++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gnucash/report/standard-reports/account-summary.scm b/gnucash/report/standard-reports/account-summary.scm index dbc701bedc..83a08a50f8 100644 --- a/gnucash/report/standard-reports/account-summary.scm +++ b/gnucash/report/standard-reports/account-summary.scm @@ -278,8 +278,7 @@ (gnc:report-starting reportname) - (let* ( - (report-title (get-option gnc:pagename-general optname-report-title)) + (let* ((report-title (get-option gnc:pagename-general optname-report-title)) (company-name (get-option gnc:pagename-general optname-party-name)) (from-date (and sx? (gnc:time64-start-day-time @@ -393,16 +392,20 @@ (rowloop (1+ row)))) (set! cur-col (1+ cur-col))) + (define (make-header str) + (gnc:make-html-table-cell/markup "number-header" str)) + (gnc:html-table-add-account-balances hold-table chart-table params) ;; place the column headers (gnc:html-table-append-row! build-table - (append - (if show-code? (list (_ "Code")) '()) - (if show-type? (list (_ "Type")) '()) - (if show-desc? (list (_ "Description")) '()) - (list (_ "Account title")))) + (map make-header + (append + (if show-code? (list (_ "Code")) '()) + (if show-type? (list (_ "Type")) '()) + (if show-desc? (list (_ "Description")) '()) + (list (_ "Account title"))))) ;; add any fields to be displayed before the account name (if show-code? (add-col 'account-code)) (if show-type? (add-col 'account-type-string)) @@ -429,7 +432,7 @@ (set! cur-col (+ cur-col hold-table-width)) (when show-notes? (gnc:html-table-set-cell/tag! - build-table 0 cur-col "text-cell" (_ "Notes")) + build-table 0 cur-col "number-header" (_ "Notes")) (add-col 'account-notes)) (gnc:html-document-add-object! doc build-table) diff --git a/gnucash/report/standard-reports/test/test-account-summary.scm b/gnucash/report/standard-reports/test/test-account-summary.scm index 0144ef9e92..3d6b87ca10 100644 --- a/gnucash/report/standard-reports/test/test-account-summary.scm +++ b/gnucash/report/standard-reports/test/test-account-summary.scm @@ -53,10 +53,10 @@ (let* ((options (default-testing-options accsum-uuid)) (sxml (options->sxml accsum-uuid options "accsum"))) (test-equal "accsum col 1" - '("Code" "#608.00" "-#612.00" "#608.00" "-#612.00" "#608.00" "-#612.00") + '("#608.00" "-#612.00" "#608.00" "-#612.00" "#608.00" "-#612.00") (sxml->table-row-col sxml 1 #f 1)) (test-equal "accsum col 2" - '("Account title" "Root" "Asset" "Bank" "GBP Bank" "Wallet" + '("Root" "Asset" "Bank" "GBP Bank" "Wallet" "Liabilities" "Income" "Income-GBP" "Expenses" "Equity") (sxml->table-row-col sxml 1 #f 2)) (test-equal "accsum col 3" @@ -69,10 +69,10 @@ (let* ((options (default-testing-options fsts-uuid)) (sxml (options->sxml fsts-uuid options "fsts"))) (test-equal "fsts col 1" - '("Code") + '() (sxml->table-row-col sxml 1 #f 1)) (test-equal "fsts col 2" - '("Account title" "Root" "Asset" "Bank" "GBP Bank" "Wallet" + '("Root" "Asset" "Bank" "GBP Bank" "Wallet" "Liabilities" "Income" "Income-GBP" "Expenses" "Equity") (sxml->table-row-col sxml 1 #f 2)) (test-equal "fsts col 3"