Files
visa/templates/company.html
T
grabowski a2cedcdd7e
CI / secret scan (push) Successful in 5s
CI / fmt, clippy, tests (push) Successful in 39s
Phase 5: the Immigration Bureau's forms, filled in from the records
A Forms tab on each person fills in TM.7, STM.2, STM.9, STM.11 and STM.1
for an extension of stay, TM.47 for a 90-day report and TM.8 for a re-entry
permit. The Bureau's blank pages (forms/, with their sources and checksums)
go unchanged into a new PDF, and the values are written on the dotted lines
in Sarabun; boxes are ticked and the title circled where a form asks.
scripts/gen_layout.py measures the blanks into src/papers/layout.rs.

The tab says what would stay blank and links to where it is added. What only
the application says (the date, the office, the reason, the days, a trip) is
carried in the links and never stored. The extension's five forms also come
in one PDF. Opening or downloading a form is audited as entity "form" with
the forms' codes, never their values.

Migration 0005 adds what STM.1 and STM.11 ask of the company (capital,
revenue, equity, staff, a coordinator), a work permit's salary and contract
dates, and where an arrival came from. The Nix package now takes forms/.
2026-11-18 12:30:03 +07:00

132 lines
8.1 KiB
HTML

{% extends "base.html" %}
{% import "_documents.html" as dm %}
{% block main %}
<div class="phead">
<div class="crumbs"><a href="/companies">Companies</a></div>
<div class="pagehead">
<h1>{{ c.name }}</h1>
<div class="actions">
<a class="btn sm" href="/companies/{{ c.id }}/edit">Edit</a>
{% if c.archived %}
<form method="post" action="/companies/{{ c.id }}/restore" class="inline-form"><input type="hidden" name="csrf" value="{{ csrf }}"><button type="submit" class="btn sm">Restore</button></form>
{% else %}
<form method="post" action="/companies/{{ c.id }}/archive" class="inline-form" data-confirm="Archive {{ c.name }}? It is no longer offered as an employer; existing records keep it."><input type="hidden" name="csrf" value="{{ csrf }}"><button type="submit" class="btn sm ghost">Archive</button></form>
{% endif %}
</div>
</div>
<p class="meta">
{%- if c.name_th %}{{ c.name_th }}{% endif %}
{%- if c.registration_no %}{% if c.name_th %}<span class="sep">·</span>{% endif %}registration <span class="mono">{{ c.registration_no }}</span>{% endif %}
</p>
</div>
{% if c.archived %}
<div class="notice warn">Archived on {{ c.archived_on }}. It is no longer offered as an employer; Restore brings it back.</div>
{% endif %}
<div class="cols">
<section class="card" id="details">
<header><h2>Company details</h2></header>
<dl class="kv">
<dt>Name in English</dt><dd>{{ c.name }}</dd>
<dt>Name in Thai</dt><dd>{% if c.name_th %}{{ c.name_th }}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Registration number</dt><dd>{% if c.registration_no %}<span class="mono">{{ c.registration_no }}</span>{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Type of business</dt><dd>{% if c.business %}{{ c.business }}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Address</dt><dd>{% if c.address %}{{ c.address }}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Phone</dt><dd>{% if c.phone %}{{ c.phone }}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Email</dt><dd>{% if c.email %}{{ c.email }}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
<dt>Authorized director</dt><dd>{% if c.signatory %}{{ c.signatory }}{% if c.signatory_position %}, {{ c.signatory_position }}{% endif %}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
{% if c.notes %}<dt>Notes</dt><dd class="pre">{{ c.notes }}</dd>{% endif %}
</dl>
<h3 class="fsec">For the forms</h3>
{%- if c.figures %}
<dl class="kv">
{%- for f in c.figures %}
<dt>{{ f[0] }}</dt><dd>{{ f[1] }}</dd>
{%- endfor %}
</dl>
{%- else %}
<p class="empty-inline">The employer's certificate (STM.1) states the capital, the latest revenue and equity, and the staff; STM.11 names a coordinator. <a href="/companies/{{ c.id }}/edit#f-capital_thb">Add them</a>.</p>
{%- endif %}
</section>
<section class="card" id="people">
<header><h2>People employed</h2>{% if employees %}<a class="btn sm ghost" href="/people?company={{ c.id }}">In the people list</a>{% endif %}</header>
{% for e in employees %}
<div class="item">
<div class="row"><a class="strong" href="/people/{{ e.id }}">{{ e.name }}</a><span class="muted">{{ e.nationality }}</span></div>
<div class="row">
<span class="chip {{ e.permit.level }}">{{ e.permit.label }}</span>
<form method="post" action="/companies/{{ c.id }}/employees/{{ e.id }}/remove" class="inline-form" data-confirm="Remove {{ e.name }} from the people employed here? The person's record stays."><input type="hidden" name="csrf" value="{{ csrf }}"><button type="submit" class="linkbtn">Remove</button></form>
</div>
</div>
{% else %}
<p class="empty-inline">No one is recorded as employed here yet.</p>
{% endfor %}
{% if candidates and not c.archived %}
<form method="post" action="/companies/{{ c.id }}/employees" class="hire" id="hire-form">
<input type="hidden" name="csrf" value="{{ csrf }}">
<label for="f-person">Add a person</label>
<div class="hire-row">
<select id="f-person" name="person" required>
<option value="">Choose a person</option>
{%- for o in candidates %}
<option value="{{ o[0] }}">{{ o[1] }}</option>
{%- endfor %}
</select>
<button type="submit" class="btn sm">Add</button>
</div>
<p class="hint">This makes the company the person's employer. Someone new is first added under People.</p>
</form>
{% endif %}
</section>
<section class="card span2" id="office">
<header><h2>Office</h2><a class="btn sm ghost" href="/companies/{{ c.id }}/edit#f-office_gps">{% if c.gps %}Change the position{% else %}Add the GPS position{% endif %}</a></header>
<div class="office">
<div class="office-pic">
{%- if office.photo %}
<a href="{{ office.photo.href }}" target="_blank" rel="noopener"><img src="{{ office.photo.href }}" alt="Photo of the office of {{ c.name }}"></a>
<p class="muted small">{% if office.photo.dated_on %}Taken {{ office.photo.dated_on }}{% else %}Added {{ office.photo.uploaded }}{% endif %}{% if office.more %} · {{ office.more }} more under <a href="#documents">Company documents</a>{% endif %}</p>
{%- else %}
<div class="office-none">No photo of the office yet</div>
{%- if office.more %}
<p class="muted small">{{ office.more }} as PDF under <a href="#documents">Company documents</a></p>
{%- endif %}
{%- endif %}
</div>
<div class="office-info">
<dl class="kv">
<dt>GPS position</dt>
<dd>{% if c.gps %}<span class="mono">{{ c.gps }}</span>{% if c.osm %}<span class="maplinks"><a href="{{ c.osm }}" target="_blank" rel="noopener noreferrer">OpenStreetMap</a><a href="{{ c.gmaps }}" target="_blank" rel="noopener noreferrer">Google Maps</a></span>{% endif %}{% else %}<span class="muted">not recorded</span>{% endif %}</dd>
</dl>
<p class="hint">The position and the photo help the officers who visit the workplace, and go into the extension packs of the people employed here.</p>
{%- if office.files_on %}
<form method="post" action="/companies/{{ c.id }}/documents" enctype="multipart/form-data" class="upload office-up" id="office-upload">
<input type="hidden" name="csrf" value="{{ csrf }}">
<input type="hidden" name="kind" value="office-photo">
<input type="hidden" name="back" value="office">
{%- if office.errors %}
<div class="notice warn">Nothing was uploaded. {{ office.errors.file or office.errors.kind or office.errors.note or "Choose the photo again." }}</div>
{%- endif %}
<div class="drop{% if office.errors.file %} has-err{% endif %}" data-max="{{ office.file_limit }}">
<input type="file" id="f-office-file" name="file" required accept="image/jpeg,image/png,image/webp" aria-describedby="h-office-file">
<span class="drop-icon" aria-hidden="true">+</span>
<label for="f-office-file"><b>{% if office.photo %}Add a newer photo{% else %}Add a photo of the office{% endif %}</b> or drop it here</label>
<span class="drop-names" data-drop-names></span>
<span class="hint" id="h-office-file">JPEG, PNG or WebP, up to {{ office.file_limit_mb }} MB</span>
</div>
<button type="submit" class="btn pri">Upload</button>
</form>
{%- endif %}
</div>
</div>
</section>
<section class="card span2" id="documents">
<header><h2>Company documents</h2><span class="muted small">for the extension packs of the people employed here</span></header>
{{ dm.upload(upload, csrf, person=false) }}
{%- if docs %}
{{ dm.table(docs, person=false) }}
{%- else %}
<p class="empty-inline">No company documents yet: the company certificate and the list of shareholders (certified within six months), the tax and social security returns, a map and photos of the office.</p>
{%- endif %}
</section>
</div>
{% endblock %}