Add quantity selector to 'move items' modal form

This commit is contained in:
Oliver Walters 2019-05-10 23:51:26 +10:00
parent 9ba91a9d80
commit 99c0921113

View File

@ -267,21 +267,38 @@ function moveStockItems(items, options) {
html += "<p class='warning-msg' id='note-warning'><i>Note field must be filled</i></p>"; html += "<p class='warning-msg' id='note-warning'><i>Note field must be filled</i></p>";
html += "<hr>The following stock items will be moved:<br><ul class='list-group'>\n"; html += "<hr>The following stock items will be moved:<hr>";
html += `
<table class='table table-striped table-condensed'>
<tr>
<th>Part</th>
<th>Location</th>
<th>Available</th>
<th>Moving</th>
</tr>
`;
for (i = 0; i < items.length; i++) { for (i = 0; i < items.length; i++) {
parts.push(items[i].pk); parts.push(items[i].pk);
html += "<li class='list-group-item'>" + items[i].quantity + " &times " + items[i].part.name; var item = items[i];
if (items[i].location) { html += "<tr>";
html += " (" + items[i].location.name + ")";
html += "<td>" + item.part.name + "</td>";
html += "<td>" + item.location.pathstring + "</td>";
html += "<td>" + item.quantity + "</td>";
html += "<td>";
html += "<input class='form-control' min='0' max='" + item.quantity + "'";
html += " value='" + item.quantity + "'";
html += "type='number' id='q-" + item.pk + "'/></td>";
html += "</tr>";
} }
html += "</li>\n"; html += "</table>";
}
html += "</ul>\n";
openModal({ openModal({
modal: modal, modal: modal,