Skip to content

feat(purchase_order_number): Add the new field to invoices and credit notes filtering#5950

Open
D1353L wants to merge 4 commits into
mainfrom
feat/purchase-order-number-filtering
Open

feat(purchase_order_number): Add the new field to invoices and credit notes filtering#5950
D1353L wants to merge 4 commits into
mainfrom
feat/purchase-order-number-filtering

Conversation

@D1353L

@D1353L D1353L commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Context

It should be possible to filter invoices and credit notes by purchase order number. Filtering should be an exact match and case-insensitive.

Description

  • Added a btree index to support fast case-insensitive filtering.
  • Added the new field to Meilisearch attributes.

Comment thread app/models/invoice.rb
attribute :number, :organization_id, :billing_entity_id, :currency, :customer_id,
:invoice_type, :status, :payment_status, :payment_overdue, :self_billed,
:total_amount_cents, :total_paid_amount_cents
:total_amount_cents, :total_paid_amount_cents, :purchase_order_number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need a complete invoice reindex on both cluster!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we currently have only 5 invoices per cluster with a PO number, do you think we can avoid a full reindex and backfill only those invoices?

Invoice.where.not(purchase_order_number: nil).find_each { |i| Invoices::SearchIndexJob.perform_later(i.id) }

@D1353L D1353L force-pushed the feat/purchase-order-number-filtering branch from 38bfa62 to f033b82 Compare July 16, 2026 10:19
@D1353L D1353L marked this pull request as ready for review July 16, 2026 13:18
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.

2 participants