diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm index c1333d5592..6e3db8876d 100644 --- a/gnucash/report/report-system/commodity-utilities.scm +++ b/gnucash/report/report-system/commodity-utilities.scm @@ -487,14 +487,14 @@ ;; resolve the exchange rate to this currency. (warn "gnc:resolve-unknown-comm:" "can't calculate rate for " - (gnc-commodity-value->string - (list (car pair) ((caadr pair) 'total #f))) + (gnc:monetary->string + (gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f))) " = " - (gnc-commodity-value->string - (list (car otherlist) ((cdadr pair) 'total #f))) + (gnc:monetary->string + (gnc:make-gnc-monetary (car otherlist) ((cdadr pair) 'total #f))) " to " - (gnc-commodity-value->string - (list report-commodity (gnc-numeric-zero)))) + (gnc:monetary->string + (gnc:make-gnc-monetary report-commodity (gnc-numeric-zero)))) (if (and pair-a pair-b) ;; If both currencies are found then something ;; went wrong inside @@ -502,11 +502,11 @@ ;; better thing to do in this case. (warn "gnc:resolve-unknown-comm:" "Oops - exchange rate ambiguity error: " - (gnc-commodity-value->string - (list (car pair) ((caadr pair) 'total #f))) + (gnc:monetary->string + (gnc:make-gnc-monetary (car pair) ((caadr pair) 'total #f))) " = " - (gnc-commodity-value->string - (list (car otherlist) + (gnc:monetary->string + (gnc:make-gnc-monetary (car otherlist) ((cdadr pair) 'total #f)))) (let ;; Usual case: one of pair-{a,b} was found @@ -520,23 +520,12 @@ (list (car pair) (make-newrate (caadr pair) (cdadr pair) pair-a))))) - ;; (warn "created new rate: " - ;; (gnc-commodity-value->string (list (car - ;; newrate) ((caadr newrate) 'total #f))) " - ;; = " (gnc-commodity-value->string (list - ;; report-commodity ((cdadr newrate) 'total - ;; #f)))) (set! reportlist (cons newrate reportlist)))))) ;; Huh, the report-currency showed up on the wrong side ;; -- we will just add it to the reportlist on the ;; right side. (let ((newrate (list (car otherlist) (cons (cdadr pair) (caadr pair))))) - ;; (warn "created new rate: " - ;; (gnc-commodity-value->string (list (car newrate) - ;; ((caadr newrate) 'total #f))) " = " - ;; (gnc-commodity-value->string (list - ;; report-commodity ((cdadr newrate) 'total #f)))) (set! reportlist (cons newrate reportlist))))) (cadr otherlist)))) sumlist) diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm index 288f47bcd7..655c8aff3a 100644 --- a/gnucash/report/report-system/report-utilities.scm +++ b/gnucash/report/report-system/report-utilities.scm @@ -41,6 +41,7 @@ ;; pair is a list of one gnc:commodity and one gnc:numeric ;; value. Deprecated -- use instead. (define (gnc-commodity-value->string pair) + (issue-deprecation-warning "gnc-commodity-value->string deprecated") (xaccPrintAmount (cadr pair) (gnc-commodity-print-info (car pair) #t))) diff --git a/gnucash/report/standard-reports/advanced-portfolio.scm b/gnucash/report/standard-reports/advanced-portfolio.scm index 0f382eeccc..b834d5b4b2 100644 --- a/gnucash/report/standard-reports/advanced-portfolio.scm +++ b/gnucash/report/standard-reports/advanced-portfolio.scm @@ -473,10 +473,10 @@ by preventing negative stock balances.
") (exchange-fn fromunits tocurrency))) (gnc:debug "Starting account " (xaccAccountGetName current) ", initial price: " - (if price - (gnc-commodity-value->string - (list (gnc-price-get-currency price) (gnc-price-get-value price))) - #f)) + (and price + (gnc:monetary->string + (gnc:make-gnc-monetary + (gnc-price-get-currency price) (gnc-price-get-value price))))) ;; If we have a price that can't be converted to the report currency ;; don't use it