From: Josh Stompro Date: Fri, 13 Sep 2019 14:54:18 +0000 (-0500) Subject: LP1739288 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fstompro%2Flp1739288_report_invalid_barcodes_in_item_status;p=working%2FEvergreen.git LP1739288 Add a summary report to the list of bad barcodes. Lists count of bad barcodes, good barcodes and total barcodes. Signed-off-by: Josh Stompro --- diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2 index 55951b9f9d..003dc0c173 100644 --- a/Open-ILS/src/templates/staff/cat/item/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/item/index.tt2 @@ -156,6 +156,7 @@ + [% l('Summary of file load, {{context.itemsNotFoundBad}} bad barcodes, {{context.itemsNotFoundGood}} good barcodes, {{context.itemsNotFoundTotal}} total barcodes.') %] diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 94e7024fb6..e033f5d6d7 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -360,9 +360,15 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD $scope.$watch('barcodesFromFile', function(newVal, oldVal) { $scope.context.itemsNotFound = []; + $scope.context.itemsNotFoundBad = 0; + $scope.context.itemsNotFoundTotal = 0; + $scope.context.itemsNotFoundGood = 0; + if (newVal && newVal != oldVal) { $scope.args.barcode = ''; var barcodes = []; + var badbarcodes = 0; + var goodbarcodes = 0; angular.forEach(newVal.split(/\r?\n/), function(line) { //remove all whitespace and commas @@ -374,6 +380,7 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD if (!line) return; barcodes.push(line); }); + var totalbarcodes=barcodes.length; // Serialize copy retrieval since there may be many, many copies. function fetch_next_copy() { @@ -386,12 +393,21 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD if(itemSvc.copies[0]){ // Were any copies actually retrieved copyGrid.selectItems([itemSvc.copies[0].index]); } + + if(badbarcodes > 0){ // summarize load if badbarcodes found + $scope.context.itemsNotFoundTotal=totalbarcodes; + $scope.context.itemsNotFoundGood=totalbarcodes - badbarcodes; + $scope.context.itemsNotFoundBad=badbarcodes; + + console.log('barcodesFromFile: badbarcodes',badbarcodes); + } return; } itemSvc.fetch(barcode).then(function(item) { if (!item) { $scope.context.itemsNotFound.push(barcode); + badbarcodes++; } fetch_next_copy(); })