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.
47 lines
3.0 KiB
HTML
47 lines
3.0 KiB
HTML
{% extends "base.html" %}
|
|
{% import "_fields.html" as fm %}
|
|
{% import "_journal.html" as jn %}
|
|
{% block main %}
|
|
<div class="pagehead">
|
|
<h1><span class="pcode mono">{{ o.code }}</span> {{ r.kind }}</h1>
|
|
<div class="actions"><a class="btn sm" href="/originals/{{ o.id }}/label" target="_blank" rel="noopener" id="print-label">Label</a></div>
|
|
</div>
|
|
<p class="meta">Of <a href="{{ r.owner_href }}">{{ r.owner }}</a>. <span class="chip {% if o.state == "held" %}ok{% elif o.state == "out" %}warn{% else %}plain{% endif %}">{{ r.state_label }}</span> {{ r.place }}{% if r.chip %} <span class="chip {{ r.chip[0] }}">{{ r.chip[1] }}</span>{% endif %}</p>
|
|
<div class="cols">
|
|
<section class="card" id="details">
|
|
<header><h2>The original</h2></header>
|
|
<dl class="kv">
|
|
<dt>What it is</dt><dd>{{ o.what }}</dd>
|
|
<dt>Kind</dt><dd>{{ r.kind }}</dd>
|
|
{% if r.contract_code %}<dt>Contract</dt><dd><a href="/contracts/{{ o.contract_id }}">{{ r.contract_code }}</a></dd>{% endif %}
|
|
<dt>Received</dt><dd>{{ received }}, from {{ o.received_from }}, taken in by {{ o.received_by }}</dd>
|
|
<dt>Belongs in</dt><dd>{{ o.location }}</dd>
|
|
</dl>
|
|
</section>
|
|
<section class="card" id="move">
|
|
<header><h2>Where it is now</h2></header>
|
|
<form method="post" action="/originals/{{ o.id }}/move" class="form" id="move-form">
|
|
<input type="hidden" name="csrf" value="{{ csrf }}">
|
|
{%- if errors %}
|
|
<div class="notice warn">Correct what is marked; nothing was saved yet.</div>
|
|
{%- endif %}
|
|
<div class="grid">
|
|
{{ fm.select("state", "State", form.state, states, err=errors.state, blank="Choose", req=true) }}
|
|
<div class="when" data-shown-when="state:held">{{ fm.text("location", "Where it lies", form.location, err=errors.location, list="locations", ph="Office, safe, tray 2") }}</div>
|
|
<div class="when" data-shown-when="state:out">{{ fm.text("holder", "With whom", form.holder, err=errors.holder, list="holders") }}</div>
|
|
<div class="when" data-shown-when="state:out,held">{{ fm.text("due_on", "Back by, or goes back to the client by", due_on, err=errors.due_on, type="date") }}</div>
|
|
<div class="when" data-shown-when="state:returned">{{ fm.text("returned_to", "Returned to", form.holder if form.state == "returned" else "", err=errors.holder) }}</div>
|
|
{{ fm.text("note", "Note", form.note, err=errors.note, cls="wide", ph="Such as: filed with the extension application") }}
|
|
</div>
|
|
<div class="formactions"><button type="submit" class="btn pri" id="save-move">Save</button></div>
|
|
</form>
|
|
<datalist id="locations">{% for l in locations %}<option value="{{ l }}"></option>{% endfor %}</datalist>
|
|
<datalist id="holders">{% for h in holders %}<option value="{{ h }}"></option>{% endfor %}</datalist>
|
|
</section>
|
|
</div>
|
|
<section class="card" id="history">
|
|
<header><h2>History</h2><a class="small" href="/journal">The journal</a></header>
|
|
{% if history %}{{ jn.list(history) }}{% else %}<p class="empty-inline">Nothing yet.</p>{% endif %}
|
|
</section>
|
|
{% endblock %}
|