Fix invoicestatus enum case mismatch in invoice list filter
Frontend sends lowercase status (e.g. 'confirmed'), but the DB enum values are uppercase (CONFIRMED). Uppercase the parameter before comparison. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bc874ac9ff
commit
9cd1683572
1 changed files with 2 additions and 2 deletions
|
|
@ -857,7 +857,7 @@ async def list_invoices(
|
|||
Invoice.status == InvoiceStatus.REVIEWED
|
||||
))
|
||||
elif status:
|
||||
query = query.where(Invoice.status == status)
|
||||
query = query.where(Invoice.status == status.upper())
|
||||
if supplier_id:
|
||||
query = query.where(Invoice.supplier_id == supplier_id)
|
||||
if date_from:
|
||||
|
|
@ -880,7 +880,7 @@ async def list_invoices(
|
|||
Invoice.status == InvoiceStatus.REVIEWED
|
||||
))
|
||||
elif status:
|
||||
count_query = count_query.where(Invoice.status == status)
|
||||
count_query = count_query.where(Invoice.status == status.upper())
|
||||
if supplier_id:
|
||||
count_query = count_query.where(Invoice.supplier_id == supplier_id)
|
||||
if date_from:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue