diff --git a/web/template/form.gohtml b/web/template/form.gohtml index 5204f65..a9c6de9 100644 --- a/web/template/form.gohtml +++ b/web/template/form.gohtml @@ -109,3 +109,14 @@ {{- end }} + +{{ define "invoice-product-form" -}} + {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.invoiceProductForm*/ -}} + {{ 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 }} +{{- end }} diff --git a/web/template/invoices/edit.gohtml b/web/template/invoices/edit.gohtml index bcab216..39877d0 100644 --- a/web/template/invoices/edit.gohtml +++ b/web/template/invoices/edit.gohtml @@ -32,13 +32,7 @@ {{- range $product := .Products }}
{{ 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 }} + {{ template "invoice-product-form" . }}
{{- end }} {{- end }} diff --git a/web/template/invoices/new.gohtml b/web/template/invoices/new.gohtml index 118cdb2..5387237 100644 --- a/web/template/invoices/new.gohtml +++ b/web/template/invoices/new.gohtml @@ -31,13 +31,7 @@ {{- range $product := .Products }}
- {{ 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 }} + {{ template "invoice-product-form" . }}
{{- end }} {{- end }}