2023-03-13 14:00:35 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{ printf ( pgettext "Edit Invoice “%s”" "title" ) .Number }}
|
|
|
|
{{- end }}
|
|
|
|
|
2023-03-20 12:09:52 +00:00
|
|
|
{{ define "breadcrumbs" -}}
|
2023-03-13 14:00:35 +00:00
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.editInvoicePage*/ -}}
|
|
|
|
<nav>
|
|
|
|
<p>
|
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a href="{{ companyURI "/invoices"}}">{{( pgettext "Invoices" "title" )}}</a> /
|
|
|
|
<a>{{ .Number }}</a>
|
|
|
|
</p>
|
|
|
|
</nav>
|
2023-03-20 12:09:52 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.editInvoicePage*/ -}}
|
2023-03-31 11:01:26 +00:00
|
|
|
<section class="dialog-content" id="invoice-dialog-content" data-hx-target="this">
|
2023-03-13 14:00:35 +00:00
|
|
|
<h2>{{ printf (pgettext "Edit Invoice “%s”" "title") .Number }}</h2>
|
2023-03-31 11:01:26 +00:00
|
|
|
<form method="POST" action="{{ companyURI "/invoices/" }}{{ .Slug }}" data-hx-boost="true" data-hx-select="#invoice-dialog-content">
|
2023-03-13 14:00:35 +00:00
|
|
|
{{ csrfToken }}
|
|
|
|
|
|
|
|
{{ with .Form -}}
|
|
|
|
{{ template "select-field" .Customer }}
|
|
|
|
{{ template "hidden-field" .Date }}
|
2023-03-19 22:11:40 +00:00
|
|
|
{{ template "tags-field" .Tags }}
|
2023-03-13 14:00:35 +00:00
|
|
|
{{ template "select-field" .PaymentMethod }}
|
|
|
|
{{ template "select-field" .InvoiceStatus }}
|
|
|
|
{{ template "input-field" .Notes }}
|
|
|
|
|
|
|
|
{{- range $product := .Products }}
|
|
|
|
<fieldset class="new-invoice-product">
|
|
|
|
{{ template "hidden-field" .InvoiceProductId }}
|
|
|
|
{{ template "hidden-field" .ProductId }}
|
|
|
|
{{ template "input-field" .Name }}
|
|
|
|
{{ template "input-field" .Price }}
|
|
|
|
{{ template "input-field" .Quantity }}
|
|
|
|
{{ template "input-field" .Discount }}
|
|
|
|
{{ template "input-field" .Description }}
|
|
|
|
{{ template "select-field" .Tax }}
|
|
|
|
</fieldset>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{{(pgettext "Subtotal" "title")}}</th>
|
|
|
|
<td class="numeric">{{ .Subtotal | formatPrice }}</td>
|
|
|
|
</tr>
|
|
|
|
{{- range $tax := .Taxes }}
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{{ index . 0 }}</th>
|
|
|
|
<td class="numeric">{{ index . 1 | formatPrice }}</td>
|
|
|
|
</tr>
|
|
|
|
{{- end }}
|
|
|
|
<tr>
|
|
|
|
<th scope="row">{{(pgettext "Total" "title")}}</th>
|
|
|
|
<td class="numeric">{{ .Total | formatPrice }}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
<button formnovalidate formaction="{{ companyURI "/invoices" }}/{{ .Slug }}/edit"
|
|
|
|
name="action" value="select-products"
|
|
|
|
type="submit">{{( pgettext "Add products" "action" )}}</button>
|
|
|
|
<button formnovalidate formaction="{{ companyURI "/invoices" }}/{{ .Slug }}/edit"
|
|
|
|
name="action" value="update"
|
|
|
|
type="submit">{{( pgettext "Update" "action" )}}</button>
|
|
|
|
<button class="primary" name="_method" value="PUT"
|
|
|
|
type="submit">{{( pgettext "Edit invoice" "action" )}}</button>
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
{{- end }}
|