Link Accounting Mirror metadata and Tally paths to Client FY

This commit is contained in:
A R R R Associates
2026-09-20 14:59:14 +05:30
parent 827231a135
commit 0e12ccfe4e
8 changed files with 318 additions and 171 deletions
@@ -15,61 +15,40 @@
<div class="rounded-2xl border border-indigo-200 bg-indigo-50 p-4">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<div class="text-xs font-semibold uppercase tracking-wide text-indigo-600">Client / FY Accounting Data</div>
<div class="mt-1 font-semibold text-indigo-950">Tally data and Accounting Mirror</div>
<p class="mt-1 text-xs text-indigo-700">These resources are linked by client and financial year, so the same data can be reused across this client's engagements.</p>
<div class="text-xs font-semibold uppercase tracking-wide text-indigo-600">Accounting Intelligence</div>
<div class="mt-1 font-semibold text-indigo-950">Client accounting .act path</div>
{% if resources.registered_mirror %}
<div class="mt-1 text-xs text-indigo-700">Registered mirror · FY {{ resources.registered_mirror.financial_year }} · v{{ resources.registered_mirror.version_no }}{% if resources.registered_mirror.company_name %} · {{ resources.registered_mirror.company_name }}{% endif %}</div>
{% endif %}
</div>
{% if resources.storage_node_name %}<span class="rounded-full bg-white px-2.5 py-1 text-xs font-semibold text-indigo-700">{{ resources.storage_node_name }}</span>{% endif %}
</div>
<div class="mt-4 space-y-3">
{% for year_row in resources.accounting_years %}
<div class="rounded-xl border border-indigo-200 bg-white p-3">
<div class="flex flex-wrap items-center justify-between gap-2">
<div class="text-sm font-semibold text-slate-900">FY {{ year_row.financial_year }}{% if year_row.is_engagement_year %} <span class="text-xs font-medium text-indigo-600">· engagement year</span>{% else %} <span class="text-xs font-medium text-slate-500">· previous year</span>{% endif %}</div>
<div class="flex flex-wrap gap-1.5">
<span class="rounded-full px-2 py-1 text-[11px] font-semibold {{ 'bg-emerald-100 text-emerald-700' if year_row.tally and year_row.tally.local_path else 'bg-amber-100 text-amber-700' }}">Tally {{ 'Available' if year_row.tally and year_row.tally.local_path else 'Not available' }}</span>
<span class="rounded-full px-2 py-1 text-[11px] font-semibold {{ 'bg-emerald-100 text-emerald-700' if year_row.mirror and year_row.mirror.available else 'bg-slate-100 text-slate-600' }}">Mirror {{ 'Linked' if year_row.mirror and year_row.mirror.available else 'Not linked' }}</span>
</div>
</div>
<div class="mt-3 grid gap-3 xl:grid-cols-2">
<div class="rounded-lg border border-emerald-200 bg-emerald-50 p-2.5">
<div class="text-xs font-semibold uppercase tracking-wide text-emerald-700">Tally Data Storage Path</div>
{% if year_row.tally and year_row.tally.local_path %}
<div class="mt-2 flex gap-2">
<input id="client-tally-path-{{ loop.index }}" readonly value="{{ year_row.tally.local_path }}" class="min-w-0 flex-1 rounded-lg border border-emerald-200 bg-white px-2.5 py-2 font-mono text-[11px] text-slate-700">
<button type="button" data-copy-target="client-tally-path-{{ loop.index }}" class="rounded-lg bg-emerald-600 px-2.5 py-2 text-xs font-semibold text-white hover:bg-emerald-700">Copy Path</button>
</div>
<p class="mt-1 text-[11px] text-emerald-700">Paste this storage/extracted-data path into TallyPrime when working with this FY.</p>
{% if year_row.tally.latest_filename %}<div class="mt-1 text-[11px] text-slate-500">{{ year_row.tally.latest_filename }} · v{{ year_row.tally.version_no }}</div>{% endif %}
{% else %}
<p class="mt-2 text-xs text-amber-700">No usable Tally storage path is registered for this client/FY yet.</p>
{% endif %}
</div>
<div class="rounded-lg border border-indigo-200 bg-indigo-50 p-2.5">
<div class="text-xs font-semibold uppercase tracking-wide text-indigo-700">Accounting Mirror (.act)</div>
{% if year_row.mirror and year_row.mirror.available %}
{% if year_row.mirror.local_path %}
<div class="mt-2 flex gap-2">
<input id="client-mirror-path-{{ loop.index }}" readonly value="{{ year_row.mirror.local_path }}" class="min-w-0 flex-1 rounded-lg border border-indigo-200 bg-white px-2.5 py-2 font-mono text-[11px] text-slate-700">
<button type="button" data-copy-target="client-mirror-path-{{ loop.index }}" class="rounded-lg bg-indigo-600 px-2.5 py-2 text-xs font-semibold text-white hover:bg-indigo-700">Copy Path</button>
</div>
{% elif year_row.mirror.relative_path %}
<div class="mt-2 break-all rounded-lg border border-indigo-200 bg-white px-2.5 py-2 font-mono text-[11px] text-slate-700">{{ year_row.mirror.relative_path }}</div>
{% endif %}
<div class="mt-1 text-[11px] text-slate-500">{% if year_row.mirror.company_name %}{{ year_row.mirror.company_name }} · {% endif %}v{{ year_row.mirror.version_no }}{% if year_row.mirror.last_synced_at_utc %} · synced {{ year_row.mirror.last_synced_at_utc }}{% endif %}</div>
{% else %}
<p class="mt-2 text-xs text-slate-600">No active Accounting Mirror is linked to this client/FY.</p>
{% endif %}
</div>
</div>
<div class="flex flex-wrap items-center gap-2">
{% if resources.registered_mirror %}<span class="rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-semibold text-emerald-700">Mirror Available</span>{% endif %}
{% if resources.storage_node_name %}<span class="rounded-full bg-white px-2.5 py-1 text-xs font-semibold text-indigo-700">{{ resources.storage_node_name }}</span>{% endif %}
</div>
{% else %}
<div class="rounded-xl border border-dashed border-indigo-200 bg-white p-4 text-sm text-slate-500">Financial-year accounting resources are unavailable for this engagement.</div>
{% endfor %}
</div>
{% if resources.accounting_local_path %}
<div class="mt-3 flex gap-2">
<input id="engagement-accounting-path" readonly value="{{ resources.accounting_local_path }}" class="min-w-0 flex-1 rounded-xl border border-indigo-200 bg-white px-3 py-2 font-mono text-xs text-slate-700">
<button type="button" data-copy-target="engagement-accounting-path" class="rounded-xl bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-700">Copy Path</button>
</div>
<p class="mt-2 text-xs text-indigo-700">This is the existing .act accounting/intelligence database path used by the Local Agent. Uploaded Tally data paths are shown separately on the right.</p>
{% elif resources.accounting_relative_path %}
<div class="mt-3 rounded-xl border border-indigo-200 bg-white px-3 py-2 font-mono text-xs text-slate-700">{{ resources.accounting_relative_path }}</div>
<p class="mt-2 text-xs text-amber-700">The relative accounting path is known, but this branch does not currently expose a configured local storage root.</p>
{% else %}
<p class="mt-3 text-sm text-slate-600">Accounting path is unavailable for this engagement.</p>
{% endif %}
{% if resources.registered_mirror and resources.registered_mirror.tally_data_local_path %}
<div class="mt-4 border-t border-indigo-200 pt-3">
<div class="text-xs font-semibold uppercase tracking-wide text-indigo-600">Tally Working Data Path</div>
<div class="mt-2 flex gap-2">
<input id="engagement-tally-working-path" readonly value="{{ resources.registered_mirror.tally_data_local_path }}" class="min-w-0 flex-1 rounded-xl border border-indigo-200 bg-white px-3 py-2 font-mono text-xs text-slate-700">
<button type="button" data-copy-target="engagement-tally-working-path" class="rounded-xl bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-700">Copy Path</button>
</div>
<p class="mt-2 text-xs text-indigo-700">This path is stored with the Client + FY mirror metadata and is reused by the engagement workspace.</p>
</div>
{% endif %}
</div>
<div>