2023-02-11 21:16:48 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "New Invoice" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.invoiceForm*/ -}}
|
|
|
|
<nav>
|
|
|
|
<p>
|
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a href="{{ companyURI "/invoices"}}">{{( pgettext "Invoices" "title" )}}</a> /
|
|
|
|
<a>{{( pgettext "New Invoice" "title" )}}</a>
|
|
|
|
</p>
|
|
|
|
</nav>
|
|
|
|
<section class="dialog-content">
|
|
|
|
<h2>{{(pgettext "New Invoice" "title")}}</h2>
|
|
|
|
<form method="POST" action="{{ companyURI "/invoices" }}">
|
|
|
|
{{ csrfToken }}
|
|
|
|
|
2023-02-23 14:31:57 +00:00
|
|
|
{{ with .Form -}}
|
|
|
|
{{ template "select-field" .Customer }}
|
|
|
|
{{ template "input-field" .Number }}
|
|
|
|
{{ template "input-field" .Date }}
|
|
|
|
{{ template "input-field" .Notes }}
|
2023-03-04 21:15:52 +00:00
|
|
|
{{ template "select-field" .PaymentMethod }}
|
2023-02-11 21:16:48 +00:00
|
|
|
|
2023-02-23 14:31:57 +00:00
|
|
|
{{- range $product := .Products }}
|
|
|
|
<fieldset class="new-invoice-product">
|
|
|
|
{{ 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 }}
|
2023-02-11 21:16:48 +00:00
|
|
|
{{- end }}
|
|
|
|
|
2023-02-23 14:31:57 +00:00
|
|
|
<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>
|
|
|
|
|
2023-02-11 21:16:48 +00:00
|
|
|
<fieldset>
|
2023-02-27 12:13:28 +00:00
|
|
|
<button formnovalidate formaction="{{ companyURI "/invoices/new" }}"
|
|
|
|
name="action" value="select-products"
|
2023-02-14 11:55:19 +00:00
|
|
|
type="submit">{{( pgettext "Add products" "action" )}}</button>
|
2023-02-27 12:13:28 +00:00
|
|
|
<button formnovalidate formaction="{{ companyURI "/invoices/new" }}"
|
|
|
|
name="action" value="update"
|
2023-02-14 11:55:19 +00:00
|
|
|
type="submit">{{( pgettext "Update" "action" )}}</button>
|
2023-02-12 20:06:48 +00:00
|
|
|
<button class="primary" name="action" value="add"
|
|
|
|
type="submit">{{( pgettext "New invoice" "action" )}}</button>
|
2023-02-11 21:16:48 +00:00
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
{{- end }}
|