ERP/templates/ledger/journal_entries.html

82 lines
5.0 KiB
HTML
Raw Normal View History

2026-02-06 17:35:29 +01:00
{{define "content"}}
<div class="space-y-6">
<div class="sm:flex sm:items-center sm:justify-between">
<h1 class="text-2xl font-bold text-gray-900">Journal Entries</h1>
<div class="flex space-x-3">
<a href="/ledger/accounts" class="text-sm text-indigo-600 hover:text-indigo-500">Chart of Accounts</a>
<a href="/ledger/trial-balance" class="text-sm text-indigo-600 hover:text-indigo-500">Trial Balance</a>
<a href="/ledger/journal/new" class="inline-flex items-center rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500">
+ New Entry
</a>
</div>
</div>
<div class="overflow-hidden bg-white shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg">
<table class="min-w-full divide-y divide-gray-300">
<thead class="bg-gray-50">
<tr>
<th class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900">#</th>
<th class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Date</th>
<th class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Description</th>
<th class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Reference</th>
<th class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900">Debit</th>
<th class="px-3 py-3.5 text-right text-sm font-semibold text-gray-900">Credit</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 bg-white">
{{if .Entries}}
{{range .Entries}}
<tr class="hover:bg-gray-50">
<td class="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-indigo-600">
<a href="/ledger/journal/{{.ID}}">{{.ID}}</a>
</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{formatDate .EntryDate}}</td>
<td class="px-3 py-4 text-sm text-gray-900">{{.Description}}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-500">{{.Reference}}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 text-right font-mono">{{formatMoney .TotalDebit}}</td>
<td class="whitespace-nowrap px-3 py-4 text-sm text-gray-900 text-right font-mono">{{formatMoney .TotalCredit}}</td>
</tr>
{{end}}
{{else}}
<tr>
<td colspan="6" class="px-3 py-8 text-center text-sm text-gray-500">No journal entries yet. <a href="/ledger/journal/new" class="text-indigo-600 hover:text-indigo-500">Create one</a>.</td>
</tr>
{{end}}
</tbody>
</table>
</div>
2026-02-07 07:47:20 +01:00
<div class="mt-4 flex items-center justify-between border-t border-gray-200 bg-white px-4 py-3 sm:px-6">
<div class="hidden sm:flex sm:flex-1 sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700">
Page <span class="font-medium">{{.Page}}</span> of <span class="font-medium">{{.TotalPages}}</span>
</p>
</div>
<div>
<nav class="isolate inline-flex -space-x-px rounded-md shadow-sm" aria-label="Pagination">
{{if .HasPrev}}
<a href="/ledger/journal?page={{.PrevPage}}"
class="relative inline-flex items-center rounded-l-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">
<span class="sr-only">Previous</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" clip-rule="evenodd" />
</svg>
</a>
{{end}}
{{if .HasNext}}
<a href="/ledger/journal?page={{.NextPage}}"
class="relative inline-flex items-center rounded-r-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-20 focus:outline-offset-0">
<span class="sr-only">Next</span>
<svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" />
</svg>
</a>
{{end}}
</nav>
</div>
</div>
</div>
2026-02-06 17:35:29 +01:00
</div>
{{end}}