Skip to content

feat(invoices): add shipping address to sales invoices#361

Merged
nikhilb2 merged 1 commit into
mainfrom
feat/shipping-addres
May 27, 2026
Merged

feat(invoices): add shipping address to sales invoices#361
nikhilb2 merged 1 commit into
mainfrom
feat/shipping-addres

Conversation

@nikhilb2
Copy link
Copy Markdown
Owner

Summary

Adds shipping address support to sales invoices. Users can now:

  • Mark "Shipping address same as billing address" (default checked) on the invoice form
  • When unchecked, select a saved address from the ledger or enter a new one inline
  • New inline addresses are automatically saved to the ledger for future reuse
  • Manage saved addresses per ledger from the Ledger detail page
  • Invoice PDF renders a "Ship to" section alongside "Bill to" only when shipping differs from billing

Addresses are stored in a new ledger_addresses table. Invoices snapshot the shipping address at creation time (same pattern as existing billing address snapshot).

Type of change

  • feat (new feature)

How to test

  1. Apply migrations: DATABASE_URL=... python migrate.py up
  2. Open a sales invoice, select a ledger — checkbox "Shipping address same as billing address" should appear, checked by default
  3. Uncheck it — a dropdown should appear (empty if no saved addresses) plus label/address fields
  4. Enter a new address and create the invoice — the address should be saved to the ledger
  5. Create another invoice for the same ledger, uncheck shipping — the saved address should appear in the dropdown
  6. Go to the Ledger detail page — "Saved addresses" panel should show the saved address with edit/delete actions
  7. Download the invoice PDF — "Ship to" section should appear next to "Bill to" with the entered address
  8. Create an invoice with the checkbox checked — PDF should show only "Bill to" (no "Ship to")

Checklist

  • My code follows the project style and conventions
  • I added/updated tests where appropriate
  • I ran relevant checks locally
  • I verified this does not break existing behavior

Screenshots (if UI changes)

N/A — shipping section appears in invoice composer when checkbox is unchecked; "Ship to" block renders in PDF alongside "Bill to".

Related issue

Closes #

- Create ledger_addresses table for saving reusable addresses per ledger
- Add shipping_address + shipping_address_label snapshot columns to invoices
- Add 4 CRUD endpoints under /ledgers/{id}/addresses/
- Invoice processor auto-saves new inline addresses to the ledger
- PDF template renders 'Ship to' section alongside 'Bill to' when applicable
- Frontend: checkbox (default checked) + saved address selector + inline form
- LedgerViewPage: full address management (add / edit / delete)
@nikhilb2 nikhilb2 merged commit 2f85343 into main May 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant