');
}
function onStockDiffInputChange(input) {
if ($(input).val() < 0 || isNaN(parseInt($(input).val()))) {
$(input).val(0);
}
}
async function generateList() {
fetchedData = await AjaxManager.getAll();
displayedItems = [];
listContainer.html('');
for (let i = 0; i < fetchedData['articles'].length; i++) {
let listItem = getListItem(fetchedData['articles'][i]);
displayedItems.push($(listItem));
listContainer.append(displayedItems[i]);
}
}
function getValues() {
let values = [];
for (let i = 0; i < displayedItems.length; i++) {
let value = displayedItems[i].find('input').val();
let id = fetchedData['articles'][i]['id'];
values.push({id: id, value: value});
}
return values;
}
function getFormattedValues(values) {
let newValues = [];
for (let i = 0; i < values.length; i++) {
if (values[i]['value'] > 0)
newValues.push(values[i]);
}
return newValues;
}