From 0fc84ddbcb6bfca3de8bc0f84bcc4d49ff02164a Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Wed, 17 Oct 2018 01:20:52 +0800 Subject: [PATCH] Bug 796914 - Customer Summary is giving error Bugfix. div/0 was not producing an error previously. This is probably caused by changes to gnc_numeric_div. --- gnucash/report/business-reports/customer-summary.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnucash/report/business-reports/customer-summary.scm b/gnucash/report/business-reports/customer-summary.scm index f6e05c5cf6..139ef6dd58 100644 --- a/gnucash/report/business-reports/customer-summary.scm +++ b/gnucash/report/business-reports/customer-summary.scm @@ -650,8 +650,8 @@ (gnc:html-markup-br)))) (define (markup-percent profit sales) - (let ((m (gnc-numeric-div profit sales 1000 GNC-HOW-RND-ROUND))) - (* 100 (gnc-numeric-to-double m)))) + (if (zero? sales) 0 + (* 100 (gnc-numeric-div profit sales 1000 GNC-HOW-RND-ROUND)))) (define (query-split-value sub-query toplevel-query) (let ((splits (qof-query-run-subquery sub-query toplevel-query))