mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[report] refactor gnc:define-report clearer logic
This commit is contained in:
parent
0cdb770f5e
commit
e1228c76a5
@ -131,14 +131,17 @@ not found.")))
|
|||||||
(report-name (gnc:report-template-name report-rec)))
|
(report-name (gnc:report-template-name report-rec)))
|
||||||
(cond
|
(cond
|
||||||
|
|
||||||
(report-guid
|
;; missing report-guid: is an error
|
||||||
;; ideal path: report is defined, and has guid
|
((not report-guid)
|
||||||
(if (hash-ref *gnc:_report-templates_* report-guid)
|
(gui-error (string-append rpterr-guid1 report-name rpterr-guid2)))
|
||||||
(gui-error (string-append rpterr-dupe report-guid))
|
|
||||||
(hash-set! *gnc:_report-templates_* report-guid report-rec)))
|
;; dupe: report-guid is a duplicate
|
||||||
|
((hash-ref *gnc:_report-templates_* report-guid)
|
||||||
|
(gui-error (string-append rpterr-dupe report-guid)))
|
||||||
|
|
||||||
|
;; good: new report definition, store into report-templates hash
|
||||||
(else
|
(else
|
||||||
;;reports without guid are no longer supported
|
(hash-set! *gnc:_report-templates_* report-guid report-rec)))))
|
||||||
(gui-error (string-append rpterr-guid1 report-name rpterr-guid2))))))
|
|
||||||
|
|
||||||
(define gnc:report-template-version
|
(define gnc:report-template-version
|
||||||
(record-accessor <report-template> 'version))
|
(record-accessor <report-template> 'version))
|
||||||
|
Loading…
Reference in New Issue
Block a user