diff --git a/application/receipts/__pycache__/receipts_api.cpython-313.pyc b/application/receipts/__pycache__/receipts_api.cpython-313.pyc index 710b213..8643a43 100644 Binary files a/application/receipts/__pycache__/receipts_api.cpython-313.pyc and b/application/receipts/__pycache__/receipts_api.cpython-313.pyc differ diff --git a/application/receipts/static/js/receiptHandler.js b/application/receipts/static/js/receiptHandler.js index 1810335..91d4ded 100644 --- a/application/receipts/static/js/receiptHandler.js +++ b/application/receipts/static/js/receiptHandler.js @@ -366,11 +366,13 @@ async function getReceipt(id) { // SKU Modal functions let items_limit = 50; +var ItemsModal_search_string = "" async function getItems() { console.log("getting items") const url = new URL('/receipts/api/getItems', window.location.origin); url.searchParams.append('page', pagination_current); url.searchParams.append('limit', items_limit); + url.searchParams.append('search_string', ItemsModal_search_string); const response = await fetch(url); data = await response.json(); pagination_end = data.end @@ -385,6 +387,15 @@ async function setPage(page) { await updateItemsPaginationElement() } +async function ItemsModalSearch(event) { + if (event.key === "Enter"){ + ItemsModal_search_string = document.getElementById('ItemsModalSearchInput').value + let items = await getItems() + await replenishItemsTable(items) + await updateItemsPaginationElement() + } +} + async function updateItemsPaginationElement() { let paginationElement = document.getElementById("itemsPage"); paginationElement.innerHTML = ""; @@ -463,6 +474,8 @@ async function updateItemsPaginationElement() { async function openSKUModal() { pagination_current = 1 + ItemsModal_search_string = "" + document.getElementById('ItemsModalSearchInput').value = "" let items = await getItems() await replenishItemsTable(items) await updateItemsPaginationElement() diff --git a/application/receipts/templates/receipt.html b/application/receipts/templates/receipt.html index 220bb0a..471d05b 100644 --- a/application/receipts/templates/receipt.html +++ b/application/receipts/templates/receipt.html @@ -271,6 +271,10 @@

Select Item

Select an Item from the system...

+