[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) > <)))
(define (<? key)
(case key
;; customername sorting is handled differently;
;; this conditional ensures "No Customer" lines
;; are printed last.
;; customername sorting is handled differently; this
;; conditional ensures "No Customer" entries,
;; i.e. without owner-report url, are printed last.
((customername)
(lambda (a b)
(cond
((string=? (vector-ref b 0) (_ "No Customer")) #t)
((string=? (vector-ref a 0) (_ "No Customer")) #f)
((vector-ref b 6) #t)
((vector-ref a 6) #f)
(else (str-op (vector-ref a 0) (vector-ref b 0))))))
;; currency sorting always alphabetical a-z
((currency)