From 505ab1fbb2ecde0a05d6b6e0b10f7393b7b3d6f1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 26 Feb 2021 16:16:07 -0500 Subject: [PATCH] LP1904036 Claims never checked out Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../eg2/src/app/staff/share/circ/circ.service.ts | 1 + .../src/app/staff/share/circ/grid.component.html | 9 +++++++ .../eg2/src/app/staff/share/circ/grid.component.ts | 29 ++++++++++++++++++++++ .../staff/share/circ/precat-dialog.component.ts | 6 +++++ 4 files changed, 45 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index c7d3d8c2a9..3bcaa29d54 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -43,6 +43,7 @@ export interface CheckinParams { noop?: boolean; copy_id?: number; copy_barcode?: string; + claims_never_checked_out?: boolean; } export interface CheckinResult { diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html index 4cd4d90277..df1910401b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.html @@ -12,6 +12,11 @@ dialogTitle="Items Checked Out" dialogBody="The selected items are checked out. Check them in before continuing?"> + + @@ -61,6 +66,10 @@ (onClick)="claimsReturned($event)"> + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts index 519c29a7b2..32393fb0d3 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts @@ -89,6 +89,7 @@ export class CircGridComponent implements OnInit { cellTextGenerator: GridCellTextGenerator; rowFlair: (row: CircGridEntry) => GridRowFlairEntry; rowClass: (row: CircGridEntry) => string; + claimsNeverCount = 0; nowDate: number = new Date().getTime(); @@ -105,6 +106,8 @@ export class CircGridComponent implements OnInit { private itemsOutConfirm: ConfirmDialogComponent; @ViewChild('claimsReturnedConfirm') private claimsReturnedConfirm: ConfirmDialogComponent; + @ViewChild('claimsNeverConfirm') + private claimsNeverConfirm: ConfirmDialogComponent; @ViewChild('progressDialog') private progressDialog: ProgressDialogComponent; @ViewChild('claimsReturnedDialog') @@ -456,5 +459,31 @@ export class CircGridComponent implements OnInit { } ); } + + claimsNeverCheckedOut(rows: CircGridEntry[]) { + const dialog = this.openProgressDialog(rows); + + this.claimsNeverCount = rows.length; + + this.claimsNeverConfirm.open().subscribe(confirmed => { + this.claimsNeverCount = 0; + + if (!confirmed) { + dialog.close(); + return; + } + + this.circ.checkinBatch( + this.getCopyIds(rows), {claims_never_checked_out: true} + ).subscribe( + result => dialog.increment(), + err => console.error(err), + () => { + dialog.close(); + this.emitReloadRequest(); + } + ); + }); + } } diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts index 3b9ce8fea5..e69f59241a 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/precat-dialog.component.ts @@ -36,6 +36,12 @@ export class PrecatCheckoutDialogComponent extends DialogComponent implements On ngOnInit() { this.onOpen$.subscribe(_ => { + + this.values.dummy_title = null; + this.values.dummy_author = null; + this.values.dummy_isbn = null; + this.values.circ_modifier = null; + this.perm.hasWorkPermHere('CREATE_PRECAT') .then(perms => this.hasPerm = perms['CREATE_PRECAT']); -- 2.11.0