Add payable filter to sales invoices and enhance invoice status handling

- Introduced a new `payable` filter in the `ListSalesInvoicesFilters` and `ListSalesInvoicesQuery` types to allow querying of invoices based on their payable status.
- Updated the `SalesInvoicesRepository` to incorporate logic for filtering invoices that are payable, checking both status and balance.
- Enhanced the `SalesInvoicesService` to support the new `payable` filter in query handling.
- Modified the `SalesInvoiceDto` to include the `payable` property for better API response representation.
- Added unit tests to validate the new filter functionality and ensure proper handling of invoice statuses during updates.
- Updated e2e tests to cover scenarios involving the new payable filter and status transitions for invoices.
This commit is contained in:
shancheas
2026-08-31 15:15:06 +07:00
parent afed5ff0f5
commit 5579cf6566
11 changed files with 141 additions and 9 deletions
@@ -94,6 +94,7 @@ export type ListSalesInvoicesFilters = {
readonly salesOrderId?: string;
readonly packingSlipId?: string;
readonly search?: string;
readonly payable?: boolean;
readonly orderBy?: string;
readonly orderType?: string;
readonly limit: number;