Refactor the invoice product form template
I was using the exact same form from edit and new pages of invoice, which is not too bad considering it won’t change very often, but i now want to be able to add new empty product lines with the add product button, and i will need to have a template for that form, which would mean a third copy.
This commit is contained in:
parent
90982b49ff
commit
c2f6d299b4
|
@ -109,3 +109,14 @@
|
|||
</label>
|
||||
</fieldset>
|
||||
{{- 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 }}
|
||||
|
|
|
@ -32,13 +32,7 @@
|
|||
{{- 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 }}
|
||||
{{ template "invoice-product-form" . }}
|
||||
</fieldset>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -31,13 +31,7 @@
|
|||
|
||||
{{- 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 }}
|
||||
{{ template "invoice-product-form" . }}
|
||||
</fieldset>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in New Issue