From a52d60f48e738ee4c91bfa03887dea1014f104fa Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 1 Dec 2019 22:30:45 +0800 Subject: [PATCH] [business-reports] compact gnc:owner-report-text --- .../business-reports/business-reports.scm | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/gnucash/report/business-reports/business-reports.scm b/gnucash/report/business-reports/business-reports.scm index 7c50821a9f..a9bb791eca 100644 --- a/gnucash/report/business-reports/business-reports.scm +++ b/gnucash/report/business-reports/business-reports.scm @@ -71,29 +71,17 @@ (define (gnc:owner-report-text owner acc) (let* ((end-owner (gncOwnerGetEndOwner owner)) - (type (gncOwnerGetType end-owner)) - (ref #f)) - - (cond - ((eqv? type GNC-OWNER-CUSTOMER) - (set! ref "owner=c:")) - - ((eqv? type GNC-OWNER-VENDOR) - (set! ref "owner=v:")) - - ((eqv? type GNC-OWNER-EMPLOYEE) - (set! ref "owner=e:")) - - (else (set! ref "unknown-type="))) - - (if ref - (begin - (set! ref (string-append ref (gncOwnerReturnGUID end-owner))) - (if (not (null? acc)) - (set! ref (string-append ref "&acct=" - (gncAccountGetGUID acc)))) - (gnc-build-url URL-TYPE-OWNERREPORT ref "")) - ref))) + (type (gncOwnerGetType end-owner))) + (gnc-build-url + URL-TYPE-OWNERREPORT + (string-append + (cond ((eqv? type GNC-OWNER-CUSTOMER) "owner=c:") + ((eqv? type GNC-OWNER-VENDOR) "owner=v:") + ((eqv? type GNC-OWNER-EMPLOYEE) "owner=e:") + (else "unknown-type=")) + (gncOwnerReturnGUID end-owner) + (if (null? acc) "" (string-append "&acct=" (gncAccountGetGUID acc)))) + ""))) ;; Creates a new report instance for the given invoice. The given ;; report-template-id must refer to an existing report template, which