LP1904036 Historical xacts/payments sort newest to oldest
authorBill Erickson <berickxx@gmail.com>
Tue, 20 Jul 2021 15:20:03 +0000 (11:20 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:35 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts

index d231be0..41d4527 100644 (file)
@@ -86,6 +86,10 @@ export class BillingHistoryComponent implements OnInit {
 
         this.xactsDataSource.getRows = (pager: Pager, sort: any[]) => {
 
+            if (sort.length === 0) {
+                sort = [{name: 'xact_start', dir: 'DESC'}];
+            }
+
             const query: any = {
                usr: this.patronId,
                xact_start: {between: [this.xactsStart, this.xactsEnd]},
@@ -105,6 +109,10 @@ export class BillingHistoryComponent implements OnInit {
                payment_ts: {between: [this.paymentsStart, this.paymentsEnd]},
             };
 
+            if (sort.length === 0) {
+                sort = [{name: 'payment_ts', dir: 'DESC'}];
+            }
+
             return this.flatData.getRows(
                 this.paymentsGrid.context, query, pager, sort);
         };