Add the payments section
This actually should be the “payments and receivables” section, however
this is quite a mouthful; a “receivable” is a payment made **to** you,
therefore “payments” is ok.
In fact, there is still no receivables in there, as they should be in
a separate relation, to constraint them to invoices instead of expenses.
It will be done in a separate commit.
Since this section will be, in a sense, sort of simplified accounting,
i needed to introduce the “payment account” concept. There is no way,
yet, for users to add them, because i have to revamp the “tax details”
section, but this commit started to grow too big already.
The same reasoning for the attachment payment slips as PDF to payment:
something i have to add, but not yet in this commit.
2024-08-10 02:34:07 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentIndexPage*/ -}}
|
|
|
|
{{( pgettext "Payments" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "breadcrumbs" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentIndexPage*/ -}}
|
|
|
|
<nav data-hx-target="main">
|
|
|
|
<p data-hx-boost="true">
|
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a>{{( pgettext "Payments" "title" )}}</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<a class="primary button"
|
|
|
|
data-hx-boost="true"
|
|
|
|
href="{{ companyURI "/payments/new" }}">{{( pgettext "New payment" "action" )}}</a>
|
|
|
|
</nav>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.PaymentIndexPage*/ -}}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{( pgettext "Payment Date" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Description" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Status" "title" )}}</th>
|
|
|
|
<th>{{( pgettext "Tags" "title" )}}</th>
|
|
|
|
<th class="numeric">{{( pgettext "Total" "title" )}}</th>
|
2024-08-11 22:08:18 +00:00
|
|
|
<th>{{( pgettext "Download" "title" )}}</th>
|
2024-08-11 01:22:37 +00:00
|
|
|
<th>{{( pgettext "Actions" "title" )}}</th>
|
Add the payments section
This actually should be the “payments and receivables” section, however
this is quite a mouthful; a “receivable” is a payment made **to** you,
therefore “payments” is ok.
In fact, there is still no receivables in there, as they should be in
a separate relation, to constraint them to invoices instead of expenses.
It will be done in a separate commit.
Since this section will be, in a sense, sort of simplified accounting,
i needed to introduce the “payment account” concept. There is no way,
yet, for users to add them, because i have to revamp the “tax details”
section, but this commit started to grow too big already.
The same reasoning for the attachment payment slips as PDF to payment:
something i have to add, but not yet in this commit.
2024-08-10 02:34:07 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ with .Payments }}
|
2024-08-11 01:22:37 +00:00
|
|
|
{{ $confirm := (gettext "Are you sure you wish to delete this payment?")}}
|
Add the payments section
This actually should be the “payments and receivables” section, however
this is quite a mouthful; a “receivable” is a payment made **to** you,
therefore “payments” is ok.
In fact, there is still no receivables in there, as they should be in
a separate relation, to constraint them to invoices instead of expenses.
It will be done in a separate commit.
Since this section will be, in a sense, sort of simplified accounting,
i needed to introduce the “payment account” concept. There is no way,
yet, for users to add them, because i have to revamp the “tax details”
section, but this commit started to grow too big already.
The same reasoning for the attachment payment slips as PDF to payment:
something i have to add, but not yet in this commit.
2024-08-10 02:34:07 +00:00
|
|
|
{{- range $payment := . }}
|
|
|
|
<tr>
|
|
|
|
<td>{{ .PaymentDate|formatDate }}</td>
|
|
|
|
<td><a href="{{ companyURI "/payments/"}}{{ .Slug }}">{{ .Description }}</a></td>
|
|
|
|
<td class="payment-status-{{ .Status }}">{{ .StatusLabel }}</td>
|
|
|
|
<td
|
|
|
|
data-hx-get="{{companyURI "/payments/"}}{{ .Slug }}/tags/edit"
|
|
|
|
data-hx-target="this"
|
|
|
|
data-hx-swap="outerHTML"
|
|
|
|
>
|
|
|
|
{{- range $index, $tag := .Tags }}
|
|
|
|
{{- if gt $index 0 }}, {{ end -}}
|
|
|
|
{{ . }}
|
|
|
|
{{- end }}
|
|
|
|
</td>
|
|
|
|
<td class="numeric">{{ .Total | formatPrice }}</td>
|
2024-08-11 22:08:18 +00:00
|
|
|
<td class="invoice-download">
|
|
|
|
{{ if .OriginalFileName }}
|
|
|
|
<a href="{{ companyURI "/payments/"}}{{ .Slug }}/download/{{.OriginalFileName}}"
|
|
|
|
title="{{( pgettext "Download payment attachment" "action" )}}"
|
|
|
|
aria-label="{{( pgettext "Download payment attachment" "action" )}}"><i
|
|
|
|
class="ri-download-line"></i></a>
|
|
|
|
{{ end }}
|
|
|
|
</td>
|
2024-08-11 01:22:37 +00:00
|
|
|
<td class="actions">
|
|
|
|
<details class="menu">
|
|
|
|
{{- $label := .Description | printf (gettext "Actions for payment %s") -}}
|
|
|
|
<summary aria-label="{{ $label }}"><i class="ri-more-line"></i></summary>
|
|
|
|
<ul role="menu" class="action-menu">
|
|
|
|
<li role="presentation">
|
|
|
|
<a role="menuitem" href="{{ companyURI "/payments"}}/{{ .Slug }}"
|
|
|
|
data-hx-target="main" data-hx-boost="true"
|
|
|
|
>
|
|
|
|
<i class="ri-edit-line"></i>
|
|
|
|
{{( pgettext "Edit" "action" )}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li role="presentation">
|
|
|
|
<button role="menuitem"
|
|
|
|
data-hx-delete="{{ companyURI "/payments"}}/{{ .Slug }}"
|
|
|
|
data-hx-confirm="{{ $confirm }}"
|
|
|
|
data-hx-headers='{ {{ csrfHeader }} }'
|
|
|
|
data-hx-target="main"
|
|
|
|
>
|
|
|
|
<i class="ri-delete-back-2-line"></i>
|
|
|
|
{{( pgettext "Remove" "action" )}}
|
|
|
|
</button>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</td>
|
Add the payments section
This actually should be the “payments and receivables” section, however
this is quite a mouthful; a “receivable” is a payment made **to** you,
therefore “payments” is ok.
In fact, there is still no receivables in there, as they should be in
a separate relation, to constraint them to invoices instead of expenses.
It will be done in a separate commit.
Since this section will be, in a sense, sort of simplified accounting,
i needed to introduce the “payment account” concept. There is no way,
yet, for users to add them, because i have to revamp the “tax details”
section, but this commit started to grow too big already.
The same reasoning for the attachment payment slips as PDF to payment:
something i have to add, but not yet in this commit.
2024-08-10 02:34:07 +00:00
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
{{ else }}
|
|
|
|
<tr>
|
|
|
|
<td colspan="5">{{( gettext "No payments added yet." )}}</td>
|
|
|
|
</tr>
|
|
|
|
{{ end }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{- end }}
|