Receipt {receipt?.Status ?? receipt?.id ?? "—"} – Stackq
Back

Receipt

{#if receipt} {@const url = currentImageUrl}
Receipt image {#if imageOpen} {:else} {/if} {imageOpen ? "Hide image" : "Show image"}
{#if url}
{#if imageError}

Image could not be loaded.

Download image
{:else} Receipt {/if}
{:else}

No image. Add one in the form and save.

{/if}
{ if (selectedImageFile) fd.set("Image", selectedImageFile); return async ({ update, result }) => { await update(); if (result.type === "success" && (result.data as { success?: boolean } | undefined)?.success) { selectedImageFile = null; imageFileName = null; } }; }} class="flex flex-col gap-4" >
{#if imageConverting}
Processing image…
{:else} {/if} {#if imageFileName} New: {imageFileName} {/if}
{#each formData.lineItems as row, i} {/each}
Item Description Qty Price
Subtotal
${subtotal.toFixed(2)}
Tax
${(Number(tax) || 0).toFixed(2)}
Total
${total.toFixed(2)}
Receipt total
${(Number(receiptTotal) || 0).toFixed(2)}
Diff
{totalDelta >= 0 ? "+" : ""}{totalDelta.toFixed(2)}
{#if form?.error && form?.form === "update"}

{form.error}

{/if}

User: {receipt.expand?.User?.name ?? receipt.expand?.User?.email ?? "—"} · Created {formatDate(receipt.created)} · Updated {formatDate(receipt.updated)}

{ if (!confirm("Delete this receipt? This cannot be undone.")) { e.preventDefault(); } }} >
{:else}

Receipt not found.

{/if}