Add engagement closure checklist workflow

This commit is contained in:
A R R R Associates
2026-07-07 14:18:30 +05:30
parent 91b1811eb8
commit c3b11fb9fc
5 changed files with 545 additions and 1 deletions
@@ -105,6 +105,53 @@
</section>
{% endif %}
{% if closure_checklist %}
<section class="rounded-2xl border border-emerald-200 bg-emerald-50 p-5 shadow-soft">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<h3 class="text-sm font-semibold text-emerald-950">Engagement Closure Checklist</h3>
<p class="mt-1 text-sm text-emerald-800">Closure uses existing AQMM acceptance, AQMM-tagged tasks, task evidence/review notes, final document release and UDIN controls. Only final delivery confirmations are manual.</p>
</div>
<span class="rounded-full px-3 py-1 text-xs font-semibold {% if closure_checklist.closure_status == 'closed' %}bg-emerald-600 text-white{% elif closure_checklist.closure_status == 'ready_for_partner_closure' %}bg-sky-100 text-sky-800{% elif closure_checklist.closure_status == 'reopened' %}bg-amber-100 text-amber-800{% else %}bg-white text-slate-700{% endif %}">{{ closure_checklist.closure_status|replace('_',' ')|title }}</span>
</div>
{% if closure_checklist.closure_block_reason %}<div class="mt-3 rounded-xl border border-amber-200 bg-white px-4 py-3 text-sm text-amber-800">Closure pending: {{ closure_checklist.closure_block_reason }}</div>{% endif %}
<div class="mt-4 grid gap-3 md:grid-cols-3 lg:grid-cols-6">
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">Tasks</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.normal_tasks_completed else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.normal_tasks_completed else 'Pending' }}</div></div>
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">AQMM Acceptance</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.aqmm_acceptance_completed else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.aqmm_acceptance_completed else 'Pending' }}</div></div>
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">AQMM Tasks</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.aqmm_tasks_completed else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.aqmm_tasks_completed else 'Pending' }}</div></div>
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">Evidence / Reviews</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.evidence_review_completed else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.evidence_review_completed else 'Pending' }}</div></div>
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">Final Release</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.final_documents_released else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.final_documents_released else 'Pending' }}</div></div>
<div class="rounded-xl bg-white px-4 py-3 border border-emerald-100"><div class="text-xs font-semibold uppercase text-slate-500">UDIN</div><div class="mt-1 text-sm font-medium {{ 'text-emerald-700' if closure_checklist.udin_completed else 'text-amber-700' }}">{{ 'Completed' if closure_checklist.udin_completed else 'Pending' }}</div></div>
</div>
<form method="post" action="/services/engagements/{{ row.id }}/closure/update" class="mt-5 rounded-2xl bg-white p-4 border border-emerald-100">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<h4 class="text-sm font-semibold text-slate-900">Manual Closure Confirmations</h4>
<div class="mt-3 grid gap-3 md:grid-cols-2">
<label class="flex items-center gap-2 rounded-xl border border-slate-200 px-3 py-2 text-sm"><input type="checkbox" name="deliverables_sent_to_client" {% if closure_checklist.deliverables_sent_to_client %}checked{% endif %} {% if row.is_locked and closure_checklist.closure_status == 'closed' %}disabled{% endif %}> Deliverables sent to client</label>
<label class="flex items-center gap-2 rounded-xl border border-slate-200 px-3 py-2 text-sm"><input type="checkbox" name="billing_reviewed" {% if closure_checklist.billing_reviewed %}checked{% endif %} {% if row.is_locked and closure_checklist.closure_status == 'closed' %}disabled{% endif %}> Billing / fee status reviewed</label>
<label class="flex items-center gap-2 rounded-xl border border-slate-200 px-3 py-2 text-sm"><input type="checkbox" name="open_points_closed" {% if closure_checklist.open_points_closed %}checked{% endif %} {% if row.is_locked and closure_checklist.closure_status == 'closed' %}disabled{% endif %}> Open points / rework items closed</label>
<label class="flex items-center gap-2 rounded-xl border border-slate-200 px-3 py-2 text-sm"><input type="checkbox" name="client_communication_completed" {% if closure_checklist.client_communication_completed %}checked{% endif %} {% if row.is_locked and closure_checklist.closure_status == 'closed' %}disabled{% endif %}> Client communication completed</label>
</div>
<textarea name="closure_note" rows="3" placeholder="Partner closure note / file completion remarks" class="mt-3 w-full rounded-xl border border-slate-300 px-3 py-2 text-sm" {% if row.is_locked and closure_checklist.closure_status == 'closed' %}disabled{% endif %}>{{ closure_checklist.closure_note or '' }}</textarea>
{% if can_manage and closure_checklist.closure_status != 'closed' %}<div class="mt-3 flex flex-wrap gap-2"><button class="rounded-xl border border-emerald-300 bg-white px-4 py-2 text-sm font-medium text-emerald-700 hover:bg-emerald-50">Save Closure Confirmations</button></div>{% endif %}
</form>
{% if can_manage %}
<div class="mt-4 flex flex-wrap gap-2">
{% if closure_checklist.closure_status != 'closed' %}
<form method="post" action="/services/engagements/{{ row.id }}/closure/sync"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><button class="rounded-xl border border-emerald-300 bg-white px-4 py-2 text-sm font-medium text-emerald-700 hover:bg-emerald-50">Recalculate Closure Readiness</button></form>
<form method="post" action="/services/engagements/{{ row.id }}/closure/approve"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><button class="rounded-xl bg-emerald-600 px-4 py-2 text-sm font-medium text-white hover:bg-emerald-700">Approve Closure & Lock</button></form>
{% else %}
<form method="post" action="/services/engagements/{{ row.id }}/closure/reopen" class="flex flex-wrap gap-2"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><input name="reason" required placeholder="Reason to reopen" class="rounded-xl border border-slate-300 px-3 py-2 text-sm"><button class="rounded-xl bg-amber-600 px-4 py-2 text-sm font-medium text-white hover:bg-amber-700">Reopen Engagement</button></form>
{% endif %}
</div>
{% endif %}
</section>
{% endif %}
{% if can_manage and not row.is_locked %}<form method="post" action="/services/engagements/{{ row.id }}/lock" class="rounded-2xl border border-amber-200 bg-white p-5 shadow-soft"><input type="hidden" name="csrf_token" value="{{ csrf_token }}"><h3 class="text-sm font-semibold text-slate-900">Year-end Lock</h3><p class="mt-2 text-sm text-slate-600">Lock this engagement when the year is complete. After locking, it becomes read-only history.</p><button class="mt-4 rounded-xl bg-amber-600 px-4 py-2 text-sm font-medium text-white hover:bg-amber-700">Lock Engagement</button></form>{% endif %}
<section class="overflow-hidden rounded-2xl bg-white shadow-soft">