Keep the invoice number when requesting an update while editing

This commit is contained in:
jordi fita mas 2023-05-26 14:02:39 +02:00
parent d8812ba2f1
commit 19f81128ec
1 changed files with 2 additions and 0 deletions

View File

@ -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)
})
}