From: Bill Erickson Date: Tue, 7 Feb 2012 19:40:19 +0000 (-0500) Subject: Tpac (etc): improve payment history sorting/paging X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3038e2a1f75a49cf29a4544d0eefac2c1d58a441;p=working%2FEvergreen.git Tpac (etc): improve payment history sorting/paging Payments within a transaction will have the same timestamp. With a large enough set of such payments, sorting by timestamp alone when retrieving payments is not enough to guarantee unique pages of payments. This adds a secondary sort on payment ID as a tie-breaker. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 42ff3bfb74..ac4c54d8b9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -3670,11 +3670,18 @@ sub user_payments { } } }, - order_by => [{ # by default, order newest payments first - class => 'mp', - field => 'payment_ts', - direction => 'desc' - }] + order_by => [ + { # by default, order newest payments first + class => 'mp', + field => 'payment_ts', + direction => 'desc' + }, { + # secondary sort in ID as a tie-breaker, since payments created + # within the same transaction will have identical payment_ts's + class => 'mp', + field => 'id' + } + ] }; for (qw/order_by limit offset/) {