mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 01:15:03 +00:00
feat(billing): filter invoices and manual payments by invoice type
Adds a free-form `types` CSV filter to the invoice list DTO and query (same treatment as `paymentMethods` — each billing source mints its own type string, so an IsIn would drop real values), carries it into the invoices export dataset, and surfaces a Type column plus filter pill on both the Invoices and Manual Payments tables.
This commit is contained in:
@@ -123,6 +123,7 @@ export const invoicesDataset: ExportDataset = {
|
||||
// on-screen filter actually carries into the export.
|
||||
{ key: 'status', label: 'Status (single)', type: 'text' },
|
||||
{ key: 'sources', label: 'Source', type: 'multiselect' },
|
||||
{ key: 'types', label: 'Type', type: 'multiselect' },
|
||||
{ key: 'eimsStatuses', label: 'EIMS status', type: 'multiselect' },
|
||||
{ key: 'paymentMethods', label: 'Payment method', type: 'multiselect' },
|
||||
{ key: 'currency', label: 'Currency', type: 'select', options: [
|
||||
@@ -151,6 +152,8 @@ export const invoicesDataset: ExportDataset = {
|
||||
if (params.status) qb.andWhere('i.status = :status', { status: params.status });
|
||||
const sources = params.sources as string[] | null;
|
||||
if (sources?.length) qb.andWhere('i.source IN (:...sources)', { sources });
|
||||
const types = params.types as string[] | null;
|
||||
if (types?.length) qb.andWhere('i.type IN (:...types)', { types });
|
||||
const eimsStatuses = params.eimsStatuses as string[] | null;
|
||||
if (eimsStatuses?.length) qb.andWhere('i.eims_status IN (:...eimsStatuses)', { eimsStatuses });
|
||||
const paymentMethods = params.paymentMethods as string[] | null;
|
||||
|
||||
Reference in New Issue
Block a user