<ul>
<li ng-repeat="badBarcode in context.itemsNotFound">{{badBarcode}}</li>
</ul>
+ <span ng-show="context.itemsNotFoundBad > 0">[% l('Summary of file load, {{context.itemsNotFoundBad}} bad barcodes, {{context.itemsNotFoundGood}} good barcodes, {{context.itemsNotFoundTotal}} total barcodes.') %]</span>
</div>
</div>
</div>
$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
if (!line) return;
barcodes.push(line);
});
+ var totalbarcodes=barcodes.length;
// Serialize copy retrieval since there may be many, many copies.
function fetch_next_copy() {
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();
})