2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 20:20:58 +00:00

Print test report for multiple stock items at once

This commit is contained in:
Oliver Walters
2021-01-18 21:42:55 +11:00
parent 0a566c062d
commit 952da19600
3 changed files with 24 additions and 1 deletions

View File

@ -29,8 +29,17 @@ function selectTestReport(reports, items, options={}) {
);
// Construct form
var html = `
var html = '';
if (items.length > 0) {
html += `
<div class='alert alert-block alert-info'>
${items.length} {% trans "stock items selected" %}
</div>`;
}
html += `
<form method='post' action='' class='js-modal-form' enctype='multipart/form-data'>
<div class='form-group'>
<label class='control-label requiredField' for='id_report'>

View File

@ -665,6 +665,7 @@ function loadStockTable(table, options) {
}
// Automatically link button callbacks
$('#multi-item-print-label').click(function() {
var selections = $('#stock-table').bootstrapTable('getSelections');
@ -677,6 +678,18 @@ function loadStockTable(table, options) {
printStockItemLabels(items);
});
$('#multi-item-print-test-report').click(function() {
var selections = $('#stock-table').bootstrapTable('getSelections');
var items = [];
selections.forEach(function(item) {
items.push(item.pk);
});
printTestReports(items);
})
$('#multi-item-stocktake').click(function() {
stockAdjustment('count');
});