From 19f81128ec51777622f9dfb6b3b3dc5d398edc4e Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Fri, 26 May 2023 14:02:39 +0200 Subject: [PATCH] Keep the invoice number when requesting an update while editing --- pkg/invoices.go | 2 ++ 1 file changed, 2 insertions(+) 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) }) }