feat: Enhance invoice management with operation and invoice type filters, update dialog defaults, and modify routes for improved functionality

This commit is contained in:
2025-12-12 08:44:09 -06:00
parent e5f6162ffb
commit a07aeb7b12
11 changed files with 238 additions and 60 deletions

View File

@@ -9,6 +9,7 @@ export interface InvoiceType {
description: string;
note?: string;
type?: string;
operation?: string;
}
export interface InvoiceTypeListResponse {
@@ -40,11 +41,20 @@ export const invoiceTypesApi = {
* Lista todos los tipos de factura con paginación
* @param page - Número de página (por defecto 1)
* @param pageSize - Tamaño de página (por defecto 50)
* @param operation - Filtrar por tipo de operación (imp, exp)
*/
list: (page = 1, pageSize = 50) =>
api.get<InvoiceTypeListResponse>(
`/v1/public/refrence_data/invoice-types?page=${page}&page_size=${pageSize}`
),
list: (page = 1, pageSize = 50, operation?: string) => {
const params = new URLSearchParams({
page: page.toString(),
page_size: pageSize.toString()
});
if (operation) {
params.append('operation', operation);
}
return api.get<InvoiceTypeListResponse>(
`/v1/public/refrence_data/invoice-types?${params.toString()}`
);
},
/**
* Obtiene un tipo de factura por key