Browse Source

Bump to v3.0.2 edit invoice save and send

main
def 3 weeks ago
parent
commit
467bdc9c72
  1. 14
      PROJECT_STATE.md
  2. 14
      README.md
  3. 2
      VERSION
  4. 5
      backend/app.py
  5. 3
      templates/invoices/edit.html

14
PROJECT_STATE.md

@ -1,3 +1,17 @@
## v3.0.2 edit invoice Save and Send - 2026-06-01 UTC
- Added a second button on the admin Edit Invoice page: “Save and Send”.
- “Save Invoice” keeps the existing save-only behavior.
- “Save and Send” saves the invoice first, then reuses the existing invoice email workflow.
- The email workflow continues to generate and attach the invoice PDF.
- Successful sends redirect back to the invoice view with `email_sent=1`.
- Failed sends redirect back to the invoice view with `email_failed=1`.
- Works with the v3.0.1 multi-line invoice edit workflow.
Verified:
- Save Invoice still saves without sending.
- Save and Send saves the invoice and sends the client invoice email.
## v3.0.1 multi-line invoice edit safety - 2026-06-01 UTC ## v3.0.1 multi-line invoice edit safety - 2026-06-01 UTC
- Updated admin invoice edit workflow to preserve multi-line invoice items. - Updated admin invoice edit workflow to preserve multi-line invoice items.

14
README.md

@ -1,3 +1,17 @@
## v3.0.2 edit invoice Save and Send - 2026-06-01 UTC
- Added a second button on the admin Edit Invoice page: “Save and Send”.
- “Save Invoice” keeps the existing save-only behavior.
- “Save and Send” saves the invoice first, then reuses the existing invoice email workflow.
- The email workflow continues to generate and attach the invoice PDF.
- Successful sends redirect back to the invoice view with `email_sent=1`.
- Failed sends redirect back to the invoice view with `email_failed=1`.
- Works with the v3.0.1 multi-line invoice edit workflow.
Verified:
- Save Invoice still saves without sending.
- Save and Send saves the invoice and sends the client invoice email.
## v3.0.1 multi-line invoice edit safety - 2026-06-01 UTC ## v3.0.1 multi-line invoice edit safety - 2026-06-01 UTC
- Updated admin invoice edit workflow to preserve multi-line invoice items. - Updated admin invoice edit workflow to preserve multi-line invoice items.

2
VERSION

@ -1 +1 @@
v3.0.1 v3.0.2

5
backend/app.py

@ -4553,6 +4553,7 @@ def edit_invoice(invoice_id):
) )
if request.method == "POST": if request.method == "POST":
submit_action = request.form.get("submit_action", "save").strip()
due_at = request.form.get("due_at", "").strip() due_at = request.form.get("due_at", "").strip()
notes = request.form.get("notes", "").strip() notes = request.form.get("notes", "").strip()
@ -4570,6 +4571,8 @@ def edit_invoice(invoice_id):
)) ))
conn.commit() conn.commit()
conn.close() conn.close()
if submit_action == "save_send":
return email_invoice(invoice_id)
return redirect(f"/invoices/view/{invoice_id}") return redirect(f"/invoices/view/{invoice_id}")
client_id = request.form.get("client_id", "").strip() client_id = request.form.get("client_id", "").strip()
@ -4746,6 +4749,8 @@ def edit_invoice(invoice_id):
conn.commit() conn.commit()
conn.close() conn.close()
if submit_action == "save_send":
return email_invoice(invoice_id)
return redirect(f"/invoices/view/{invoice_id}") return redirect(f"/invoices/view/{invoice_id}")
rendered = _render([]) rendered = _render([])

3
templates/invoices/edit.html

@ -207,7 +207,8 @@ Notes<br>
</p> </p>
<p> <p>
<button type="submit">Save Invoice</button> <button type="submit" name="submit_action" value="save">Save Invoice</button>
<button type="submit" name="submit_action" value="save_send">Save and Send</button>
</p> </p>
</form> </form>

Loading…
Cancel
Save