Originals in our care (phase 12, step 1)
CI / secret scan (push) Successful in 8s
CI / fmt, clippy, tests (push) Successful in 1m23s
CI / release (push) Skipped

What clients hand Lanna Desk for a while (a passport for an extension, a
signed contract, a title deed) gets a code and a label (OR-2026-0001), and
a record of where it is: held at a place in the office, out with someone
such as Chiang Mai Immigration until a date, or returned.

- Migration 0013: table originals, owned by a client or a person; the
  database refuses a delete and a change of what it is, whose it is and
  how it came.
- Every intake and move is a journal entry starting with the code; the
  item's page reads its history from there. The audit log has the new
  entity "original", with a view when a person's original is shown.
- Pages: Legal, Originals (in our care, out, held, returned, all; a find
  box for a typed or scanned code), the item's page with the move form,
  intake from a client's or a person's page, and the label with a QR code
  to the item's page. Cards on the client's and the person's pages.
- A field can show only for some choices of a selection
  (data-shown-when), so the move form asks "Where it lies", "With whom"
  or "Returned to" as fits.
- Demo data: a passport out at Immigration, a title deed and a house
  registration held, a company certificate returned.
- PLAN: phase 12, with step 2 (the inbox that files a pile of scans) and
  step 3 planned.
This commit is contained in:
grabowski committed 2026-11-23 14:06:50 +07:00
1 parent 329b181c4f
commit ff716eb9d3
23 files changed
+1815 -3

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
{% extends "base.html" %}
{% import "_fields.html" as fm %}
{% block main %}
<div class="pagehead">
<h1>Take in an original</h1>
</div>
<p class="meta">Of <a href="{{ owner_href }}">{{ owner_name }}</a>. It gets a code and a label; the journal records who took it in, from whom, and where it lies.</p>
<form method="post" action="/originals" class="form" id="original-form">
<input type="hidden" name="csrf" value="{{ csrf }}">
<input type="hidden" name="owner" value="{{ owner }}">
{%- if errors %}
<div class="notice warn">Correct what is marked; nothing was saved yet.</div>
{%- endif %}
<section class="card">
<div class="grid">
{{ fm.select("kind", "Kind", form.kind, kinds, err=errors.kind, blank="Choose", req=true) }}
{{ fm.text("what", "What it is", form.what, err=errors.what, req=true, cls="wide", ph="Passport C01X00T47, Germany", hint="As anyone in the office would recognize it: its number, its issuer, how many pages.") }}
{{ fm.text("received_from", "Received from", form.received_from, err=errors.received_from, req=true, hint="Who handed it over: the client, a family member, a courier.") }}
{{ fm.text("location", "Where it lies now", form.location, err=errors.location, req=true, list="locations", ph="Office, safe, tray 2") }}
{{ fm.text("due_on", "Goes back to the client by", due_on, err=errors.due_on, type="date", hint="If it was agreed; the list then shows when it is due.") }}
{%- if contracts %}
{{ fm.select("contract", "Belongs to the contract", contract, contracts, err=errors.contract, blank="None") }}
{%- endif %}
</div>
<div class="formactions"><button type="submit" class="btn pri" id="take-in">Take it in</button><a class="btn ghost" href="{{ owner_href }}">Cancel</a></div>
</section>
<datalist id="locations">{% for l in locations %}<option value="{{ l }}"></option>{% endfor %}</datalist>
</form>
{% endblock %}