Lines 472-478
Link Here
|
472 |
</table> |
472 |
</table> |
473 |
|
473 |
|
474 |
<div class="form-group"> |
474 |
<div class="form-group"> |
475 |
<label for="verify-items-bundle-contents-barcodes">Barcodes</label> |
475 |
<label for="verify-items-bundle-contents-barcodes">Barcodes <span id="verify-progress" class="pull-right" style="display: none"><span id="verified">0</span> of <span id="expected"></span> verified</span></label> |
476 |
<textarea autocomplete="off" id="verify-items-bundle-contents-barcodes" name="verify-items-bundle-contents-barcodes" class="form-control"></textarea> |
476 |
<textarea autocomplete="off" id="verify-items-bundle-contents-barcodes" name="verify-items-bundle-contents-barcodes" class="form-control"></textarea> |
477 |
[% IF item.onloan %] |
477 |
[% IF item.onloan %] |
478 |
<div class="help-block">[% t('Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost') | html %]</div> |
478 |
<div class="help-block">[% t('Scan all barcodes of items found in the items bundle. If any items are missing, they will be marked as lost') | html %]</div> |
Lines 1290-1300
Link Here
|
1290 |
if ( char.match(/\n/) ) { |
1290 |
if ( char.match(/\n/) ) { |
1291 |
const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() }); |
1291 |
const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() }); |
1292 |
const expected = []; |
1292 |
const expected = []; |
|
|
1293 |
let found = 0; |
1293 |
$('#items-bundle-contents-table tr').each(function () { |
1294 |
$('#items-bundle-contents-table tr').each(function () { |
1294 |
const barcode = this.getAttribute('data-barcode'); |
1295 |
const barcode = this.getAttribute('data-barcode'); |
1295 |
expected.push(barcode); |
1296 |
expected.push(barcode); |
1296 |
if (barcodes.includes(barcode)) { |
1297 |
if (barcodes.includes(barcode)) { |
1297 |
this.classList.add('ok'); |
1298 |
this.classList.add('ok'); |
|
|
1299 |
found++; |
1298 |
} else { |
1300 |
} else { |
1299 |
this.classList.remove('ok'); |
1301 |
this.classList.remove('ok'); |
1300 |
} |
1302 |
} |
Lines 1313-1318
Link Here
|
1313 |
feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100); |
1315 |
feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100); |
1314 |
}); |
1316 |
}); |
1315 |
} |
1317 |
} |
|
|
1318 |
$('#verify-progress').show(); |
1319 |
$('#verified').text(found); |
1320 |
$('#expected').text(expected.length); |
1316 |
} |
1321 |
} |
1317 |
}); |
1322 |
}); |
1318 |
|
1323 |
|
1319 |
- |
|
|