[net-charts] CSV export uses ISO dates

* also add CSV export-error if no export-string
This commit is contained in:
Christopher Lam 2020-08-17 23:07:37 +08:00
parent 3296da001c
commit d149042d74

View File

@ -444,14 +444,19 @@
(cond
((eq? export-type 'csv)
(gnc:html-document-set-export-string
document
(gnc:lists->csv
(cons (if inc-exp?
(map G_ '("Date" "Income" "Expense" "Net Profit"))
(map G_ '("Date" "Assets" "Liabilities" "Net Worth")))
(map list date-string-list minuend-balances
subtrahend-balances difference-balances)))))))
(let ((old-fmt (qof-date-format-get)))
(qof-date-format-set QOF-DATE-FORMAT-ISO)
(gnc:html-document-set-export-string
document
(gnc:lists->csv
(cons (if inc-exp?
(map G_ '("Date" "Income" "Expense" "Net Profit"))
(map G_ '("Date" "Assets" "Liabilities" "Net Worth")))
(map list
(map qof-print-date dates-list)
minuend-balances
subtrahend-balances difference-balances))))
(qof-date-format-set old-fmt)))))
(gnc:html-document-add-object!
document
(gnc:html-make-empty-data-warning
@ -463,6 +468,9 @@
(gnc:html-make-no-account-warning
report-title (gnc:report-id report-obj))))
(unless (gnc:html-document-export-string document)
(gnc:html-document-set-export-error document (G_ "No exportable data")))
(gnc:report-finished)
document))