2023-05-03 10:46:25 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.expensesIndexPage*/ -}}
|
|
|
|
{{( pgettext "Expenses" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "breadcrumbs" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.expensesIndexPage*/ -}}
|
|
|
|
<nav data-hx-boost="true" data-hx-target="main">
|
|
|
|
<p>
|
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a>{{( pgettext "Expenses" "title" )}}</a>
|
|
|
|
</p>
|
|
|
|
<p>
|
2023-05-24 10:13:09 +00:00
|
|
|
{{ template "filters-toggle" }}
|
2023-05-03 10:46:25 +00:00
|
|
|
<a class="primary button"
|
|
|
|
href="{{ companyURI "/expenses/new" }}">{{( pgettext "New expense" "action" )}}</a>
|
|
|
|
</p>
|
|
|
|
</nav>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.expensesIndexPage*/ -}}
|
2023-05-24 10:13:09 +00:00
|
|
|
<form class="filters" method="GET" action="{{ companyURI "/expenses"}}"
|
|
|
|
data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit"
|
|
|
|
aria-labelledby="filters-toggle"
|
|
|
|
>
|
|
|
|
{{ with .Filters }}
|
2023-06-20 09:17:07 +00:00
|
|
|
{{ template "select-field" .Contact }}
|
2023-05-24 10:13:09 +00:00
|
|
|
{{ template "input-field" .FromDate }}
|
|
|
|
{{ template "input-field" .ToDate }}
|
|
|
|
{{ template "input-field" .InvoiceNumber }}
|
|
|
|
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
|
|
|
|
{{ template "toggle-field" .TagsCondition }}
|
|
|
|
{{ end }}
|
|
|
|
<noscript>
|
|
|
|
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
|
|
|
|
</noscript>
|
|
|
|
</form>
|
2023-05-03 10:46:25 +00:00
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-05-06 09:08:21 +00:00
|
|
|
<th>{{( pgettext "All" "expense" )}}</th>
|
2023-05-03 10:46:25 +00:00
|
|
|
<th>{{( pgettext "Contact" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Invoice Date" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Invoice Number" "title" )}}</th>
|
2023-05-06 09:08:21 +00:00
|
|
|
<th>{{( pgettext "Tags" "title" )}}</th>
|
2023-05-03 10:46:25 +00:00
|
|
|
<th>{{( pgettext "Amount" "title" )}}</th>
|
2023-05-14 16:46:16 +00:00
|
|
|
<th>{{( pgettext "Download" "title" )}}</th>
|
2023-05-06 09:08:21 +00:00
|
|
|
<th>{{( pgettext "Actions" "title" )}}</th>
|
2023-05-03 10:46:25 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ with .Expenses }}
|
|
|
|
{{- range . }}
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
2023-05-06 09:08:21 +00:00
|
|
|
<td>{{ .InvoicerName }}</td>
|
2023-05-03 10:46:25 +00:00
|
|
|
<td>{{ .InvoiceDate|formatDate }}</td>
|
|
|
|
<td>{{ .InvoiceNumber }}</td>
|
2023-05-08 10:58:54 +00:00
|
|
|
<td
|
|
|
|
data-hx-get="{{companyURI "/expenses/"}}{{ .Slug }}/tags/edit"
|
|
|
|
data-hx-target="this"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
2023-05-03 10:46:25 +00:00
|
|
|
{{- range $index, $tag := .Tags }}
|
|
|
|
{{- if gt $index 0 }}, {{ end -}}
|
|
|
|
{{ . }}
|
|
|
|
{{- end }}
|
|
|
|
</td>
|
|
|
|
<td class="numeric">{{ .Amount | formatPrice }}</td>
|
2023-05-14 16:46:16 +00:00
|
|
|
<td class="invoice-download">
|
|
|
|
{{ if .OriginalFileName }}
|
|
|
|
<a href="{{ companyURI "/expenses/"}}{{ .Slug }}/download/{{.OriginalFileName}}"
|
|
|
|
title="{{( pgettext "Download expense attachment" "action" )}}"
|
|
|
|
aria-label="{{( pgettext "Download expense attachment" "action" )}}"><i
|
|
|
|
class="ri-download-line"></i></a>
|
|
|
|
{{ end }}
|
|
|
|
</td>
|
2023-05-06 09:08:21 +00:00
|
|
|
<td class="actions">
|
|
|
|
<details class="menu">
|
|
|
|
<summary><i class="ri-more-line"></i></summary>
|
|
|
|
<ul role="menu" class="action-menu">
|
|
|
|
<li role="presentation">
|
|
|
|
<a role="menuitem" href="{{ companyURI "/expenses"}}/{{ .Slug }}"
|
|
|
|
data-hx-target="main" data-hx-boost="true"
|
|
|
|
>
|
|
|
|
<i class="ri-edit-line"></i>
|
|
|
|
{{( pgettext "Edit" "action" )}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</td>
|
2023-05-03 10:46:25 +00:00
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
{{ else }}
|
|
|
|
<tr>
|
2023-05-14 16:46:16 +00:00
|
|
|
<td colspan="8">{{( gettext "No expenses added yet." )}}</td>
|
2023-05-03 10:46:25 +00:00
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
2023-06-20 09:33:28 +00:00
|
|
|
{{ if .Expenses }}
|
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" colspan="5">{{( gettext "Total" )}}</th>
|
|
|
|
<td class="numeric">{{ .TotalAmount|formatPrice }}</td>
|
|
|
|
<td colspan="2"></td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
{{ end }}
|
2023-05-03 10:46:25 +00:00
|
|
|
</table>
|
|
|
|
{{- end }}
|