implementd search in stock items

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-12-03 18:45:46 +01:00
parent 4cb9c6bd2f
commit 74a1d526ae
4 changed files with 30 additions and 9 deletions

View File

@@ -105,7 +105,7 @@
}
}
async function handleStock(resp){
async function handleStock(resp){
if (resp.ok){
const res = await resp.json();
stock = Object.keys(res).length ? res : null;
@@ -219,6 +219,23 @@
</ul>
</fieldset>
{/if}
{#if stock}
<fieldset>
<legend>
{t('stock')}
</legend>
<ul>
{#each Object.values(stock) as item}
<li>
<a href="/stock/{item.owner.type}/{item.owner.id}/item/{item.owner_number}" {onclick} >
{item.name} [{t('code')}: <span class="code">{item.code}</span>]
</a>
{@html item.description.rendered}
</li>
{/each}
</ul>
</fieldset>
{/if}
{#if notes}
<fieldset>
<legend>