mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[report-utilities] can strify records
srfi-9 records can contain complex objects eg lists/vectors also
gnc:monetary or gnc:html-table objects. previously gnc:strify would
use the default printer; this commit modifies so that they are
prettified.
example output; a :col-datum record from balsheet-pnl. the record's
split-balance contains a $0 monetary object.
Rec::col-datum{last-split=#f, split-balance=[$0.00]}
this last pretty-printer must be the last one before object->string,
because we want previous printers which may be records too
eg. monetary->str etc to use their own printer.
This commit is contained in:
@@ -1284,6 +1284,13 @@ flawed. see report-utilities.scm. please update reports.")
|
||||
(try owner->str)
|
||||
(try invoice->str)
|
||||
(try lot->str)
|
||||
(and (record? d)
|
||||
(let ((rtd (record-type-descriptor d)))
|
||||
(define (fld->str fld)
|
||||
(format #f "~a=~a" fld (gnc:strify ((record-accessor rtd fld) d))))
|
||||
(format #f "Rec:~a{~a}"
|
||||
(record-type-name rtd)
|
||||
(string-join (map fld->str (record-type-fields rtd)) ", "))))
|
||||
(object->string d)))
|
||||
|
||||
(define (pair->num pair)
|
||||
|
||||
Reference in New Issue
Block a user