diff --git a/SPEC.md b/SPEC.md index 249cce7..8a88685 100644 --- a/SPEC.md +++ b/SPEC.md @@ -86,7 +86,7 @@ One table for quotes, invoices and credit notes. `document` FK, `paid_on`, `amount_cents`, `method`, `note`. Payment state (unpaid, partial, paid, credited) is derived, not stored: an invoice is settled by its payments plus the issued credit notes against it; "credited" when the credit notes alone cover the total. Outstanding = invoice total − issued credit notes − payments. ### Attachment -`document` or `expense` FK, `file`, `kind` (`original_pdf`, `receipt`, `other`), `sha256`, `source`. Never both. Neither only for a receipt waiting for an expense, fetched from the receipts folder (`source` `bonnetjesmap`, M20). +`document` or `expense` FK, `file`, `kind` (`original_pdf`, `receipt`, `other`), `sha256`, `source`. Never both. Neither only for a receipt waiting for an expense, fetched from the receipts folder (`source` `bonnetjesmap`, M20) or taken with a phone's camera (`source` `telefoon`, M20). ### Expense `date`, `supplier`, `description`, `amount_cents` (**gross amount paid**, always stored gross: invariant 7 of CLAUDE.md), `vat_info_cents` (under the KOR informational; with the KOR off the input VAT, decided by the owner 2026-11-06, not built yet: issue "Voorbelasting op uitgaven"), `source`, `external_id`. Has lines, as in Moneybird (decided 2026-11-02, `huismus-intern/besluiten.md`): `amount_cents` and `vat_info_cents` are the sums of its lines, stored by one function (`huismus/expenses/lines.py`). @@ -308,6 +308,7 @@ Decided by the owner on 2026-11-04 (`huismus-intern/backlog.md`); build choices - **Never paid twice:** a receipt counts as read once the service answered, whatever the answer, and after a timeout (3 minutes; the work may have been done). Errors where the service did no work (unreachable, key refused, unknown model, busy or out of credit, a server error) are red above the tray and on Bonnetjes lezen, not on the overview, and the receipts wait for the next look. - **What the user sees:** under each receipt in the tray "Huismus leest dit bonnetje…" while it waits for its turn, or "Niet gelezen: " when it stayed (a similar expense links to it); "Uitgave maken" stays. On the overview, below "n nieuwe bonnetjes" (which then counts only receipts that stay in the tray, or wait while the service fails), "n nieuwe uitgaven om na te kijken" with "Bekijken →" to Verwerken, counted from the last visit to Verwerken or the Nakijken list. While reading, nothing else changes on the overview. Code: `huismus/expenses/reading.py`, which `expenses.inbox` calls after each look. - **Verwerken** (`/uitgaven/verwerken/`, `huismus/expenses/process_views.py`; decided by the product-owner agent on 2026-11-06, `huismus-intern/besluiten.md`, "Verwerken: één stapel, het bonnetje groot naast de velden"). One stack of everything that waits, one at a time: first the expenses to check (the order of Nakijken, date newest first), then the receipts without an expense (the tray's order, newest first), whether Huismus left them with a reason, is still reading them, or no service is set up (`huismus/expenses/batch.py`). Reached by the button "Verwerken (n)" on Uitgaven (n the whole stack, gone at 0; "Bonnetjes (n)" stays), "Bekijken →" of "n nieuwe uitgaven om na te kijken" on the overview, "Uitgave maken" in the tray, and "Klopt"/"Overslaan" on an expense's own page. On a wide screen (the 980px breakpoint) the receipt is large on the left, half the width, staying in view while the fields scroll: a photo whole, a PDF in the browser's own viewer with every page (the file may be framed by Huismus's own pages only, `X-Frame-Options: SAMEORIGIN`; app.js sets the frame's address on a wide screen only). On a phone the receipt is above the fields, a photo at most half the screen high, a PDF as its name (an iPhone shows only the first page of a frame); everywhere "Bonnetje openen" opens the file in a new tab. No PDF rendering on the server. An expense without a receipt shows "Geen bonnetje bij deze uitgave." with the expense page's upload. On the right the expense page's fields and lines: an expense with its notice ("Huismus las dit bonnetje met …" or the assistant's) and **Klopt**; a receipt with empty fields, the tray's line ("Niet gelezen: …" or "Huismus leest dit bonnetje…") in that same notice (none without one) and **Opslaan**. Both save through the expense page's code, take the mark away and go on to the next one (the first after this one in the stack as it was, else the top one left); **Overslaan** goes there without saving. At the top "3 van 24": the ones done in this round plus where this one is in what is left, of the ones done plus what is left; the number done (`?klaar=`, a hidden field in the form) counts only Klopt and Opslaan and is never stored. An error stays on the same item with the same count; "Regel toevoegen" without JS shows the same item with one line more, saving nothing. After the last one, or with nothing to do, "Niets meer te verwerken." and "Naar Uitgaven". No "Verwijderen" here: in the tray or on the expense. With the KOR off, VAT per line stays required, via Klopt and via Opslaan. The new-expense form without a receipt is unchanged; `/uitgaven/nieuw/?bonnetje=` opens Verwerken at that receipt. +- **The photo first, on a phone** (#188; the step chosen by the owner on 2026-11-15 with the new house style, build choices by the product-owner agent the same day, `huismus-intern/besluiten.md`). On a phone (JS: `(max-width: 760px) and (pointer: coarse)`) every link to the new-expense form opens the camera instead (`capture="environment"`); cancelling it opens the ordinary form, a browser that doesn't say "cancel" leaves the user where they tapped. The photo is sent at once with "Bonnetje uploaden…" (`/uitgaven/nieuw/foto/`, `huismus/expenses/photo_views.py`) and goes into the tray (`source` `telefoon`), so walking away never loses it; a refused file (too big, not a receipt) goes to the ordinary form with the upload's reason. Without a connection the page stays, with "Huismus is niet bereikbaar. Probeer het opnieuw als je verbinding hebt." and "Opnieuw proberen", which sends the same photo again. Then `/uitgaven/nieuw/foto//`, "Nieuwe uitgave": the photo with "Opnieuw" (a new photo; the old one goes only once the new one is in, and only a photo taken this way that still waits in the tray), then one line: "Bedrag, zoals je het betaalde" (large), without the KOR "Btw" and "Btw-tarief" right under it, "Leverancier", "Datum" (today) and "Categorie". **Uitgave opslaan** saves through Verwerken's code, the receipt onto the expense, and goes to Uitgaven ("Uitgave opgeslagen."); **Alleen de foto bewaren** leaves it in the tray, starts Bonnetjes lezen if that is on, and goes to Uitgaven ("Bonnetje bewaard. Je vindt het bij Verwerken."). "Meer regels of een omschrijving" opens Verwerken at that receipt with what was typed and one line more, saving nothing. A wide screen or a mouse, the desktop app (never, even in a narrow window on a touch screen) and no JS keep the ordinary form. - Not in part 2: a scheduled task in the Claude app, a notice from macOS or Windows (`huismus-intern/backlog.md`). *Done when:* tests cover fetching (new, the same twice, a name taken in `Opgehaald`, files left with a reason, a file still syncing, a folder that's gone, saving or moving failing, the sample data), Dropbox and WebDAV against the fakes (the folder, unlinking, backups leaving it alone; on WebDAV also a name taken in `Opgehaald`, a file still being written, a refused password), the pages, making an expense from a receipt, looking sooner (a new file in a folder, the minute's wait, a skipped file once, a folder gone, the restore gate, Dropbox's wait against the fake with backoff and a forgotten cursor), the notice (new, seen, singular, off, sample data, only reading), and HEIC (a JPG with the original's name, upright and without metadata, at most 4032 px, the same JPG every time so it is fetched once and a failed move only moves next time, a damaged one or one of too many pixels left with a reason, the upload field); the pages are in `test_every_page.py`; a browser test sets up a folder, picks up now and makes an expense; strings exist in Dutch and English; `docs/hulp/bonnetjes.*.md` explains it. *Part 2:* tests cover the list, a photo (smaller, upright, PNG with transparency), a PDF with text, a scanned PDF, an unreadable PDF, an image of too many pixels, other attachments refused, and the receipt going onto the expense or nothing saved; `docs/hulp/bonnetjes.*.md` and `ai-assistenten.*.md` explain it. *Part 2b:* tests cover the mark from `add_expense`, the pill, the button and its count, the filter, "Klopt" (onward, the last one, an error keeps the mark), "Overslaan", the order, and saving; browser tests check three expenses with "Klopt" and "Overslaan", and three receipts made into expenses one after the other. *Verwerken:* tests cover the order of the stack, next after a save and round again, the count with `klaar`, Klopt, Opslaan with the receipt, Overslaan, an error, "Regel toevoegen" without JS, the KOR off, an expense without a receipt and its upload, items gone meanwhile, the empty stack, the PDF frame header, and English; browser tests process a photo, a PDF and a receipt at 1440 px (beside the fields, in view while scrolling, the PDF in a frame) and at 390 px (above the fields, no frame); the pages are in `test_every_page.py` with the demo receipts (`huismus/core/demo_receipts.py`). *Part 3:* tests against a fake service (never a real one) cover the page (a known service filled in, the address and key rules, saving tested first, the key never shown, kept when left empty, testing, turning off, left out of backups), and reading (an expense with the mark and the receipt, each reason to leave a receipt, VAT without the KOR, a duplicate, failures that retry and a timeout that doesn't, a receipt taken meanwhile, the sample data); browser tests choose a service and see a receipt become an expense; `docs/hulp/bonnetjes.*.md` and `ai-assistenten.*.md` explain it. diff --git a/docs/hulp/telefoon.en.md b/docs/hulp/telefoon.en.md index d10964d..b91bf61 100644 --- a/docs/hulp/telefoon.en.md +++ b/docs/hulp/telefoon.en.md @@ -29,6 +29,23 @@ home screen there's **Share**: use it to mail the PDF or save it to Files. In the browser there's **Download**, and **Share** too if the browser can share files. +## An expense with the camera + +Tap **+** and then **Expense**, or **New expense** under Expenses: the camera +opens. Take a photo of the receipt. Huismus keeps it at once. Then fill in the +amount, then the supplier, the date and the category, and tap **Save +expense**. + +No time? Tap **Just keep the photo**. The receipt then waits under +**Process** on the Expenses page, where you make it into an expense later. +Photo didn't work out? Tap **Retake**. + +Can't reach Huismus, for example in a shop without your VPN? The photo stays +on your screen. Tap **Try again** once you're connected. + +Rather use a photo from your library or a PDF? Close the camera: you get the +ordinary form. + ## What's on your phone Your records aren't on it. Everything stays on the server, and the app only diff --git a/docs/hulp/telefoon.nl.md b/docs/hulp/telefoon.nl.md index e47f4f2..dfbb672 100644 --- a/docs/hulp/telefoon.nl.md +++ b/docs/hulp/telefoon.nl.md @@ -29,6 +29,24 @@ beginscherm staat daar **Delen**: zo mail je de pdf of bewaar je hem in Bestanden. In de browser staat er **Downloaden**, en als de browser kan delen ook **Delen**. +## Een uitgave met de camera + +Tik op **+** en dan op **Uitgave**, of op **Nieuwe uitgave** bij Uitgaven: de +camera gaat open. Maak een foto van het bonnetje. Huismus bewaart hem meteen. +Daarna vul je het bedrag in, dan de leverancier, de datum en de categorie, en +tik je op **Uitgave opslaan**. + +Geen tijd? Tik op **Alleen de foto bewaren**. Het bonnetje staat dan bij +**Verwerken** op de pagina Uitgaven, en daar maak je er later een uitgave van. +Is de foto mislukt, tik dan op **Opnieuw**. + +Huismus is niet bereikbaar, bijvoorbeeld in de winkel zonder VPN? Dan blijft de +foto op je scherm staan. Tik op **Opnieuw proberen** als je weer verbinding +hebt. + +Wil je liever een foto uit je fotobibliotheek of een pdf? Sluit dan de camera: +je krijgt het gewone formulier. + ## Wat er op je telefoon staat Niets van je administratie. Alles blijft op de server, en de app laat alleen diff --git a/docs/hulp/uitgaven.en.md b/docs/hulp/uitgaven.en.md index b87c356..0ee2485 100644 --- a/docs/hulp/uitgaven.en.md +++ b/docs/hulp/uitgaven.en.md @@ -29,6 +29,9 @@ or a PDF. Huismus keeps a HEIC photo as a JPG. For a new expense you can do this **Save**. An expense can have more than one receipt: add the others after saving. +On your phone a new expense starts with the camera. See [On your +phone](telefoon.en.md). + Receipts from the road can also go in a folder that Huismus picks up itself. See [Receipts on the road](bonnetjes.en.md). diff --git a/docs/hulp/uitgaven.nl.md b/docs/hulp/uitgaven.nl.md index 2b7e211..09c9a75 100644 --- a/docs/hulp/uitgaven.nl.md +++ b/docs/hulp/uitgaven.nl.md @@ -30,6 +30,9 @@ HEIC) of een pdf. Een HEIC-foto bewaart Huismus als JPG. Bij een nieuwe uitgave **Opslaan** klikt. Een uitgave kan meer bonnetjes hebben: de rest voeg je toe na het opslaan. +Op je telefoon begint een nieuwe uitgave met de camera. Zie [Op je +telefoon](telefoon.nl.md). + Bonnetjes van onderweg kun je ook in een map zetten die Huismus zelf ophaalt. Zie [Bonnetjes onderweg](bonnetjes.nl.md). diff --git a/huismus/core/static/core/app.js b/huismus/core/static/core/app.js index 4e7c14c..2dd7fda 100644 --- a/huismus/core/static/core/app.js +++ b/huismus/core/static/core/app.js @@ -674,3 +674,85 @@ function showReceiptPdfs(root) { wideScreen.addEventListener("change", () => showReceiptPdfs(document)); if (window.htmx) window.htmx.onLoad(showReceiptPdfs); else showReceiptPdfs(document); + +// The photo first (#188, expenses/photo_views.py): on a phone, a link to the +// new-expense form opens the camera instead. The photo is sent at once; +// Huismus puts it with the receipts and opens the page with the amount. +// Cancelling the camera opens the ordinary form, where a photo from the +// library, a PDF or no receipt at all is possible. On a wide screen, in the +// desktop app and without JS, the link is the ordinary form. +const phone = window.matchMedia("(max-width: 760px) and (pointer: coarse)"); + +// Capture, and no further: htmx's boost listens on the link itself. +document.addEventListener( + "click", + (event) => { + const camera = document.getElementById("camera"); + const link = event.target.closest?.("a[href]"); + if (!camera || !link || !phone.matches || event.defaultPrevented) return; + if (link.pathname !== camera.dataset.newExpense || link.search) return; + event.preventDefault(); + event.stopPropagation(); + link.closest("[popover]")?.hidePopover(); + const input = camera.querySelector("input[type=file]"); + input.value = ""; + // Browsers that don't say "cancel" leave the user where they tapped. + input.oncancel = () => window.location.assign(link.href); + input.click(); + }, + true, +); + +// A photo taken, from that hidden form or from "Opnieuw" on the photo page: +// sent with fetch, so a failed connection leaves the photo here to send +// again. A photo from the camera isn't always in the library too: a +// browser error page would lose it. +let unsent = null; + +function cameraToast(id) { + for (const toast of document.querySelectorAll("[data-camera-toast]")) toast.remove(); + const template = document.getElementById(id); + if (template) document.getElementById("toasts")?.append(template.content.cloneNode(true)); +} + +async function sendPhoto(form, file) { + unsent = { form, file }; + cameraToast("camera-busy"); + const data = new FormData(form); + data.set("file", file); + let response; + try { + // The header asks Huismus to say where to go (X-Huismus-Go) rather than + // to redirect: following a redirect here would use up the next page's + // message, such as why it refused the file (expenses/photo_views.py). + response = await fetch(form.action, { + method: "POST", + body: data, + headers: { "X-Huismus-Camera": "1" }, + }); + } catch { + // No answer at all: no connection with Huismus. + cameraToast("camera-offline"); + return; + } + if (!response.ok) { + // Huismus answered, with an error. + cameraToast("camera-failed"); + return; + } + unsent = null; + // Where Huismus sends it: the photo page, or the ordinary form with the + // reason it refused the file. Signed out meanwhile: the login page. + window.location.assign(response.headers.get("X-Huismus-Go") || response.url); +} + +document.addEventListener("change", (event) => { + const input = event.target; + if (!input.matches?.("input[type=file][data-camera]") || !input.files.length) return; + input.oncancel = null; + sendPhoto(input.form, input.files[0]); +}); + +document.addEventListener("click", (event) => { + if (event.target.closest?.("[data-camera-retry]") && unsent) sendPhoto(unsent.form, unsent.file); +}); diff --git a/huismus/core/static/core/huismus.css b/huismus/core/static/core/huismus.css index 5fb555e..861b375 100644 --- a/huismus/core/static/core/huismus.css +++ b/huismus/core/static/core/huismus.css @@ -809,6 +809,16 @@ div.hint-banner:hover { border-color: var(--border); } .process-receipt { position: static; } .process-img { max-height: 50dvh; } } +/* A new expense on a phone, the photo first (#188, expenses/photo.html): + the photo with "Opnieuw" on it, then the amount, large. */ +.photo-shot { position: relative; padding: var(--s-3); } +.photo-shot .process-img { max-height: min(30dvh, 260px); } +.photo-again { position: absolute; right: var(--s-5); bottom: var(--s-5); } +.amount-xl .input { height: 60px; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); } +.amount-xl .money::before { font-size: var(--fs-lg); } +/* Its bar: "Uitgave opslaan" with "Alleen de foto bewaren" under it. */ +.actionbar.photo-actions { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; } +.actionbar.photo-actions .btn { flex: none; } .report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; } .report + .report { margin-top: var(--s-3); } diff --git a/huismus/expenses/photo_views.py b/huismus/expenses/photo_views.py new file mode 100644 index 0000000..e282f90 --- /dev/null +++ b/huismus/expenses/photo_views.py @@ -0,0 +1,124 @@ +# SPDX-FileCopyrightText: 2026 Huismus contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +"""A new expense on a phone, the photo first (#188; huismus-intern/besluiten.md, +2026-11-15, "Nieuwe huisstijl", and the plan of #188). + +On a phone app.js turns "Uitgave" into the camera. The photo is sent to +photo_upload(), which puts it in the tray at once, as a receipt from the +receipts folder would be: walking away never loses it. photo_expense() +then shows it above the few fields of one line, the amount first. "Uitgave +opslaan" makes the expense with the receipt on it, as Verwerken does; +"Alleen de foto bewaren" leaves it in the tray, where Verwerken has it. + +Without JS, or on a wide screen, "Uitgave" is the ordinary form +(views._expense_form); nothing here is needed for that. +""" + +from django.contrib import messages +from django.contrib.auth.decorators import login_required +from django.http import HttpResponse +from django.shortcuts import redirect, render +from django.urls import reverse +from django.utils import timezone +from django.utils.translation import gettext as _ + +from huismus.core.models import Attachment + +from . import batch, reading +from .adding import RECEIPT_GONE +from .forms import ExpenseForm, ExpenseLineFormSet, ReceiptUploadForm +from .models import Expense +from .receipts import sha256_of +from .views import TrayReceiptGone, all_valid, save_expense + +# Attachment.source of a photo taken here. +SOURCE = "telefoon" +# The request header app.js sends the photo with, and the response header +# with the page to open (_go). +CAMERA, GO = "X-Huismus-Camera", "X-Huismus-Go" + + +@login_required +def photo_upload(request): + """The photo from the camera, into the tray. With `vervangt` + ("Opnieuw"), the photo it replaces goes, if it still waits.""" + if request.method != "POST": + return redirect("expenses:create") + form = ReceiptUploadForm(request.POST, request.FILES) + if not form.is_valid(): + # The form's own reason: "Dit bonnetje is groter dan 10 MB. …". The + # ordinary form can take a photo from the library or a PDF. + messages.error(request, form.errors["file"][0]) + return _go(request, reverse("expenses:create")) + uploaded = form.cleaned_data["file"] + receipt = Attachment.objects.create( + file=uploaded, kind="receipt", sha256=sha256_of(uploaded), source=SOURCE + ) + # The old one goes only now the new one is in. Only a photo taken here + # that still waits in the tray: one on an expense meanwhile (another + # tab) or one from the receipts folder stays. Anything else than a + # number replaces nothing. + replaces = request.POST.get("vervangt", "") + if replaces.isdigit(): + replaced = Attachment.objects.in_tray().filter(source=SOURCE, pk=int(replaces)) + for old in replaced: + old.file.delete(save=False) + old.delete() + return _go(request, reverse("expenses:photo", kwargs={"pk": receipt.pk})) + + +def _go(request, url): + """Where the page goes next. To app.js's upload (the header CAMERA) a + 204 with the address: had fetch() followed a redirect, it would have + shown the next page's message to nobody, and the page that opens after + it wouldn't have it any more. To a plain form, a redirect.""" + if CAMERA not in request.headers: + return redirect(url) + response = HttpResponse(status=204) + response[GO] = url + return response + + +@login_required +def photo_expense(request, pk): + """The photo above the amount, where, date and category of one line.""" + receipt = Attachment.objects.in_tray().filter(pk=pk).first() + if receipt is None: + # Made into an expense or removed meanwhile, in another tab. + messages.error(request, str(RECEIPT_GONE)) + return redirect("expenses:list") + if request.method == "POST" and "alleen_foto" in request.POST: + # It is in the tray already. Read now, if the AI service is on. + reading.read_in_background() + messages.success(request, _("Bonnetje bewaard. Je vindt het bij Verwerken.")) + return redirect("expenses:list") + + # A new expense's amount 0 lasts only until save_lines() sets it. + instance = Expense(amount_cents=0) + if request.method == "POST": + form = ExpenseForm(request.POST, instance=instance) + formset = ExpenseLineFormSet(request.POST, instance=instance, prefix="lines") + if all_valid(form, formset): + try: + save_expense(form, formset, tray_receipt=receipt) + except TrayReceiptGone: + messages.error(request, str(RECEIPT_GONE)) + return redirect("expenses:list") + messages.success(request, _("Uitgave opgeslagen.")) + return redirect("expenses:list") + else: + form = ExpenseForm(instance=instance, initial={"date": timezone.localdate()}) + formset = ExpenseLineFormSet(instance=instance, prefix="lines") + return render( + request, + "expenses/photo.html", + { + "receipt": receipt, + "form": form, + "formset": formset, + "line_form": formset.forms[0], + # More lines or a description: the whole form, in Verwerken. + "full_form_url": batch.Item(batch.RECEIPT, receipt.pk).url(), + "upload_url": reverse("expenses:photo_upload"), + }, + ) diff --git a/huismus/expenses/urls.py b/huismus/expenses/urls.py index 8184223..0d53f5b 100644 --- a/huismus/expenses/urls.py +++ b/huismus/expenses/urls.py @@ -3,13 +3,16 @@ from django.urls import path from django.views.generic import RedirectView -from . import inbox_views, process_views, views +from . import inbox_views, photo_views, process_views, views app_name = "expenses" urlpatterns = [ path("", views.expense_list, name="list"), path("nieuw/", views.expense_create, name="create"), + # On a phone, the photo first (#188). + path("nieuw/foto/", photo_views.photo_upload, name="photo_upload"), + path("nieuw/foto//", photo_views.photo_expense, name="photo"), path("verwerken/", process_views.process, name="process"), path( "verwerken///", diff --git a/huismus/locale/en/LC_MESSAGES/django.po b/huismus/locale/en/LC_MESSAGES/django.po index f6332bf..11ff955 100644 --- a/huismus/locale/en/LC_MESSAGES/django.po +++ b/huismus/locale/en/LC_MESSAGES/django.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: huismus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 10:32+0100\n" +"POT-Creation-Date: 2026-11-15 11:03+0100\n" "PO-Revision-Date: 2026-09-25 08:36+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -2210,12 +2210,15 @@ msgstr "expense line" msgid "uitgaveregels" msgstr "expense lines" -msgid "Uitgave nagekeken." -msgstr "Expense checked." +msgid "Bonnetje bewaard. Je vindt het bij Verwerken." +msgstr "Receipt saved. You'll find it under Process." msgid "Uitgave opgeslagen." msgstr "Expense saved." +msgid "Uitgave nagekeken." +msgstr "Expense checked." + msgid "Niet gelezen: dit lijkt geen bonnetje." msgstr "Not read: this doesn't look like a receipt." @@ -2970,6 +2973,18 @@ msgstr "Shortcuts:" msgid "nieuw" msgstr "new" +msgid "Bonnetje uploaden…" +msgstr "Uploading receipt…" + +msgid "Huismus is niet bereikbaar. Probeer het opnieuw als je verbinding hebt." +msgstr "Can't reach Huismus. Try again when you're connected." + +msgid "Opnieuw proberen" +msgstr "Try again" + +msgid "Het uploaden is mislukt. Probeer het nog een keer." +msgstr "The upload failed. Please try once more." + msgid "Niet gekoppeld" msgstr "Not connected" @@ -4066,9 +4081,6 @@ msgid "" msgstr "" "This device can't connect to Huismus. Check your Wi-Fi or VPN and try again." -msgid "Opnieuw proberen" -msgstr "Try again" - #, python-format msgid "Stap %(number)s van %(total)s" msgstr "Step %(number)s of %(total)s" @@ -5131,6 +5143,24 @@ msgstr "No expense matches your search and filters." msgid "betekent dat er een bonnetje bij de uitgave zit." msgstr "means the expense has a receipt." +msgid "Opnieuw" +msgstr "Retake" + +msgid "Foto versturen" +msgstr "Send photo" + +msgid "Bedrag, zoals je het betaalde" +msgstr "Amount, as you paid it" + +msgid "Meer regels of een omschrijving" +msgstr "More lines or a description" + +msgid "Uitgave opslaan" +msgstr "Save expense" + +msgid "Alleen de foto bewaren" +msgstr "Just keep the photo" + msgid "Verwerken" msgstr "Process" diff --git a/huismus/locale/nl/LC_MESSAGES/django.po b/huismus/locale/nl/LC_MESSAGES/django.po index 8a698e4..a143f81 100644 --- a/huismus/locale/nl/LC_MESSAGES/django.po +++ b/huismus/locale/nl/LC_MESSAGES/django.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: huismus\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 10:32+0100\n" +"POT-Creation-Date: 2026-11-15 11:03+0100\n" "PO-Revision-Date: 2026-09-25 08:36+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -2116,12 +2116,15 @@ msgstr "" msgid "uitgaveregels" msgstr "" -msgid "Uitgave nagekeken." +msgid "Bonnetje bewaard. Je vindt het bij Verwerken." msgstr "" msgid "Uitgave opgeslagen." msgstr "" +msgid "Uitgave nagekeken." +msgstr "" + msgid "Niet gelezen: dit lijkt geen bonnetje." msgstr "" @@ -2796,6 +2799,18 @@ msgstr "" msgid "nieuw" msgstr "" +msgid "Bonnetje uploaden…" +msgstr "" + +msgid "Huismus is niet bereikbaar. Probeer het opnieuw als je verbinding hebt." +msgstr "" + +msgid "Opnieuw proberen" +msgstr "" + +msgid "Het uploaden is mislukt. Probeer het nog een keer." +msgstr "" + msgid "Niet gekoppeld" msgstr "" @@ -3798,9 +3813,6 @@ msgid "" "en probeer het opnieuw." msgstr "" -msgid "Opnieuw proberen" -msgstr "" - #, python-format msgid "Stap %(number)s van %(total)s" msgstr "" @@ -4794,6 +4806,24 @@ msgstr "" msgid "betekent dat er een bonnetje bij de uitgave zit." msgstr "" +msgid "Opnieuw" +msgstr "" + +msgid "Foto versturen" +msgstr "" + +msgid "Bedrag, zoals je het betaalde" +msgstr "" + +msgid "Meer regels of een omschrijving" +msgstr "" + +msgid "Uitgave opslaan" +msgstr "" + +msgid "Alleen de foto bewaren" +msgstr "" + msgid "Verwerken" msgstr "" diff --git a/huismus/templates/base.html b/huismus/templates/base.html index b9df5bd..8d33c57 100644 --- a/huismus/templates/base.html +++ b/huismus/templates/base.html @@ -116,6 +116,19 @@
{% translate "Facturen en uitgaven voor zzp'ers, met of zonder KOR" %}{% translate "Sneltoetsen:" %} N {% translate "nieuw" %}{% block shortcut_search %}{% endblock %}
+{% if user.is_authenticated and not desktop %} +{% comment %}On a phone every "Uitgave" opens the camera, and the photo goes +here (#188; app.js, "The photo first"; expenses/photo_views.py). Without JS +this stays hidden and unused: the link goes to the ordinary form. Never in +the desktop app, even in a narrow window on a touch screen.{% endcomment %} + + + + +{% endif %} {% include "core/_toasts.html" %} {% endblock %} diff --git a/huismus/templates/expenses/form.html b/huismus/templates/expenses/form.html index 8620bf6..042903b 100644 --- a/huismus/templates/expenses/form.html +++ b/huismus/templates/expenses/form.html @@ -93,7 +93,7 @@

{% translate "Dit bonnetje verw Bonnetjes section above the form, with its own upload.{% endcomment %} {% if new_receipt_form %}{% with field=new_receipt_form.file %}
-

{% translate "Bonnetje" %} ({% translate "optioneel" %})

+

{% translate "Bonnetje" %}