mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug #464771: Investment Portfolio report: If there is no price for a particular holding, show a zero price instead of crashing the report.
BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17430 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
9085dadcfa
commit
937a738e31
@ -127,8 +127,16 @@
|
||||
(units (cadr (unit-collector 'getpair commodity #f)))
|
||||
|
||||
(price-info (price-fn commodity to-date))
|
||||
|
||||
(value (exchange-fn (gnc:make-gnc-monetary commodity units) currency)))
|
||||
(price (car price-info))
|
||||
(price-monetary (if price
|
||||
(gnc:make-gnc-monetary
|
||||
(gnc-price-get-currency price)
|
||||
(gnc-price-get-value price))
|
||||
(gnc:make-gnc-monetary
|
||||
currency
|
||||
(cdr price-info))))
|
||||
(value (exchange-fn (gnc:make-gnc-monetary commodity units)
|
||||
currency)))
|
||||
|
||||
(set! work-done (+ 1 work-done))
|
||||
(gnc:report-percent-done (* 100 (/ work-done work-to-do)))
|
||||
@ -145,10 +153,7 @@
|
||||
(xaccPrintAmount units share-print-info))
|
||||
(gnc:make-html-table-header-cell/markup
|
||||
"number-cell"
|
||||
(gnc:html-price-anchor
|
||||
(car price-info)
|
||||
(gnc:make-gnc-monetary (gnc-price-get-currency (car price-info))
|
||||
(gnc-price-get-value (car price-info)))))
|
||||
(gnc:html-price-anchor price price-monetary))
|
||||
(gnc:make-html-table-header-cell/markup
|
||||
"number-cell" value)))
|
||||
;;(display (sprintf #f "Shares: %6.6d " (gnc-numeric-to-double units)))
|
||||
|
Loading…
Reference in New Issue
Block a user