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 1496-1506
Link Here
|
1496 |
if ( char.match(/\n/) ) { |
1496 |
if ( char.match(/\n/) ) { |
1497 |
const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() }); |
1497 |
const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() }); |
1498 |
const expected = []; |
1498 |
const expected = []; |
|
|
1499 |
let found = 0; |
1499 |
$('#items-bundle-contents-table tr').each(function () { |
1500 |
$('#items-bundle-contents-table tr').each(function () { |
1500 |
const barcode = this.getAttribute('data-barcode'); |
1501 |
const barcode = this.getAttribute('data-barcode'); |
1501 |
expected.push(barcode); |
1502 |
expected.push(barcode); |
1502 |
if (barcodes.includes(barcode)) { |
1503 |
if (barcodes.includes(barcode)) { |
1503 |
this.classList.add('ok'); |
1504 |
this.classList.add('ok'); |
|
|
1505 |
found++; |
1504 |
} else { |
1506 |
} else { |
1505 |
this.classList.remove('ok'); |
1507 |
this.classList.remove('ok'); |
1506 |
} |
1508 |
} |
Lines 1519-1524
Link Here
|
1519 |
feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100); |
1521 |
feedback.addClass('alert-success').removeClass('alert-danger').html(string).fadeIn(100); |
1520 |
}); |
1522 |
}); |
1521 |
} |
1523 |
} |
|
|
1524 |
$('#verify-progress').show(); |
1525 |
$('#verified').text(found); |
1526 |
$('#expected').text(expected.length); |
1522 |
} |
1527 |
} |
1523 |
}); |
1528 |
}); |
1524 |
|
1529 |
|
1525 |
- |
|
|