diff --git a/pkg/invoices.go b/pkg/invoices.go index c892503..a74b02a 100644 --- a/pkg/invoices.go +++ b/pkg/invoices.go @@ -997,6 +997,8 @@ func HandleEditInvoiceAction(w http.ResponseWriter, r *http.Request, params http slug := params[0].Value actionUri := fmt.Sprintf("/invoices/%s/edit", slug) handleInvoiceAction(w, r, actionUri, func(w http.ResponseWriter, r *http.Request, form *invoiceForm) { + conn := getConn(r) + form.Number = conn.MustGetText(r.Context(), "", "select invoice_number from invoice where slug = $1", slug) mustRenderEditInvoiceForm(w, r, slug, form) }) }