From a6685a4f2f3a82c55414a9d012523483d98176b9 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 20 Jul 2021 11:20:03 -0400 Subject: [PATCH] LP1904036 Historical xacts/payments sort newest to oldest Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../eg2/src/app/staff/circ/patron/billing-history.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts index d231be05b1..41d45277c5 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/billing-history.component.ts @@ -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); }; -- 2.11.0