[customer-summary] fix no-owner sorting of entries

Previous 9ed0174cb would place any entry with customername == "No
Customer" last, including genuine customers with this particular
name. This commit modifies to test on presence of owner-report-url to
detect owner/no-owner entries. This is reliable for this report.
This commit is contained in:
Christopher Lam 2019-06-29 14:18:59 +08:00
parent f82058e026
commit 3a927ce2ac

View File

@ -428,14 +428,14 @@
(op (if (eq? sort-order 'descend) > <))) (op (if (eq? sort-order 'descend) > <)))
(define (<? key) (define (<? key)
(case key (case key
;; customername sorting is handled differently; ;; customername sorting is handled differently; this
;; this conditional ensures "No Customer" lines ;; conditional ensures "No Customer" entries,
;; are printed last. ;; i.e. without owner-report url, are printed last.
((customername) ((customername)
(lambda (a b) (lambda (a b)
(cond (cond
((string=? (vector-ref b 0) (_ "No Customer")) #t) ((vector-ref b 6) #t)
((string=? (vector-ref a 0) (_ "No Customer")) #f) ((vector-ref a 6) #f)
(else (str-op (vector-ref a 0) (vector-ref b 0)))))) (else (str-op (vector-ref a 0) (vector-ref b 0))))))
;; currency sorting always alphabetical a-z ;; currency sorting always alphabetical a-z
((currency) ((currency)