They are to complete the invoice, so it can be in an invalid date, but we do not want to force people to finish all required inputs before they can add products or update quantities, do we? Now had to add the empty option label for customer in all cases, because it could be empty, although that should be done regardless in case someone has a browser that does not validate fields.
48 lines
1.9 KiB
Plaintext
48 lines
1.9 KiB
Plaintext
{{ 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 }}
|
|
|
|
{{ template "select-field" .Customer }}
|
|
{{ template "input-field" .Number }}
|
|
{{ template "input-field" .Date }}
|
|
{{ template "input-field" .Notes }}
|
|
|
|
{{- range $product := .Products }}
|
|
<fieldset>
|
|
{{ template "hidden-field" .ProductId }}
|
|
{{ template "input-field" .Name }}
|
|
{{ template "input-field" .Description }}
|
|
{{ template "input-field" .Price }}
|
|
{{ template "input-field" .Quantity }}
|
|
{{ template "input-field" .Discount }}
|
|
{{ template "select-field" .Tax }}
|
|
</fieldset>
|
|
{{- end }}
|
|
|
|
<fieldset>
|
|
<button formnovalidate name="action" value="products"
|
|
type="submit">{{( pgettext "Add products" "action" )}}</button>
|
|
<button formnovalidate name="action" value="update"
|
|
type="submit">{{( pgettext "Update" "action" )}}</button>
|
|
<button class="primary" name="action" value="add"
|
|
type="submit">{{( pgettext "New invoice" "action" )}}</button>
|
|
</fieldset>
|
|
|
|
</form>
|
|
</section>
|
|
{{- end }}
|