From: Bill Erickson Date: Thu, 24 Feb 2022 16:38:39 +0000 (-0500) Subject: LP1904036 Refund shows styled neg. amount; other fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bc081602f0a7510bbb871e713514ec8472ce3549;p=evergreen%2Fmasslnc.git LP1904036 Refund shows styled neg. amount; other fixes Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html index 7e5a27bc7d..7d540cc12f 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html @@ -169,6 +169,7 @@ string; rowFlairCallback: (row: any) => GridRowFlairEntry; + cellClassCallback: (row: any, col: GridColumn) => string; nowTime: number = new Date().getTime(); @@ -96,6 +97,16 @@ export class BillsComponent implements OnInit, AfterViewInit { ngOnInit() { + this.cellClassCallback = (row: any, col: GridColumn): string => { + if (col.name === 'paymentPending') { + const val = this.billGrid.context.getRowColumnBareValue(row, col); + if (val < 0) { + return 'bg-warning p-1'; + } + } + return ''; + } + this.cellTextGenerator = { title: row => row.title, copy_barcode: row => row.copy_barcode, @@ -188,7 +199,10 @@ export class BillsComponent implements OnInit, AfterViewInit { // Recaclulate the amount owed per selected transaction as the // grid rows selections change. this.billGrid.context.rowSelector.selectionChange - .subscribe(_ => this.updatePendingColumn()); + .subscribe(_ => { + this.refunding = false; + this.updatePendingColumn(); + }); this.focusPayAmount(); } @@ -401,6 +415,9 @@ export class BillsComponent implements OnInit, AfterViewInit { // Reset... this.gridDataSource.data.forEach(row => row.paymentPending = 0); + // No actions pending. Reset and exit. + if (!this.paymentAmount && !this.refunding) { return; } + let amount = this.pendingPayment(); let done = false; @@ -617,6 +634,7 @@ export class BillsComponent implements OnInit, AfterViewInit { if (!confirmed) { return; } this.refunding = true; // clearen in applyPayment() this.paymentAmount = null; + this.updatePendingColumn(); }); }