[report-utilities] gnc:strify add lot printer

This commit is contained in:
Christopher Lam 2019-10-28 20:17:43 +08:00
parent 644cb4100e
commit 2e1b87e01f

View File

@ -1212,6 +1212,13 @@ flawed. see report-utilities.scm. please update reports.")
(monetary->string (gnc:make-gnc-monetary (monetary->string (gnc:make-gnc-monetary
(gncInvoiceGetCurrency inv) (gncInvoiceGetCurrency inv)
(gncInvoiceGetTotal inv))))) (gncInvoiceGetTotal inv)))))
(define (lot->str lot)
(format #f "Lot<Acc:~a,Title:~a,Notes:~a,Balance:~a,NSplits:~a>"
(gnc:strify (xaccAccountGetName (gnc-lot-get-account lot)))
(gnc-lot-get-title lot)
(gnc-lot-get-notes lot)
(gnc-lot-get-balance lot)
(gnc-lot-count-splits lot)))
(define (try proc) (define (try proc)
;; Try proc with d as a parameter, catching exceptions to return ;; Try proc with d as a parameter, catching exceptions to return
;; #f to the (or) evaluator below. ;; #f to the (or) evaluator below.
@ -1242,6 +1249,7 @@ flawed. see report-utilities.scm. please update reports.")
(try gnc-budget-get-name) (try gnc-budget-get-name)
(try owner->str) (try owner->str)
(try invoice->str) (try invoice->str)
(try lot->str)
(object->string d))) (object->string d)))
(define (pair->num pair) (define (pair->num pair)