- Nuevo Icon.tsx (reemplaza emojis en toda la app), FieldTooltip, ConfirmModal, PageLoader, SecondaryButton, hook useSapCatalog, utils/errors (getErrorMessage). - App.tsx: code-splitting con lazy()+Suspense+PageLoader para todas las rutas. - MainLayout.tsx: menú usa Icon.tsx en vez de emojis. - FormattedField/SelectField: soporte de dbField+tooltip, multiline. - DenseTable/FilterBar/ListViewTemplate: onClear, mejoras varias. - PrimaryButton: variante de tamaño sm/md. - Renombres *View.tsx para uniformar el naming de vistas de detalle/mantenimiento (Dashboard, Items, BatchNumberDetails, Customers, Suppliers, Invoices, Orders, PurchaseOrders, PurchaseInvoices) y SapLogin -> SapLoginForm. - BatchNumberDetailsList: filtros y columna de descripción de artículo. - Configs de reportes e iconos de módulos actualizados a Icon.tsx. - Ajustes de paleta en los 4 temas CSS. - Docs actualizadas. Se excluyó explícitamente del backport (queda solo en cliente/tagumedica, no es reusable sin adaptar a los UDFs propios de cada cliente): - Vistas InmovilizarLotesView, LiberarLotesView, ConfirmarLiberacionLoteView y sus rutas/ítems de menú. - types/sapInventoryLock.ts (contrato con los UDFs U_SIS_MOVINV/U_EXX_TIPOOPER/U_SIS_TIPDESP/U_SIS_MOTALM de Tagumedica). - En BatchForm.tsx: los 3 campos U_SIS_MOTEST/U_SIS_COMEST/U_SIS_ACCTOM (Motivo/Comentario/Acción), manteniendo el resto de mejoras genéricas del archivo y reactivando el campo estándar "Detalles/Observaciones" que en tagumedica había quedado comentado sin justificación genérica. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
101 lines
3.0 KiB
TypeScript
101 lines
3.0 KiB
TypeScript
import type { F4Config } from "../types/reports";
|
|
|
|
export interface HtmlReportSelectOption {
|
|
value: string;
|
|
label: string;
|
|
}
|
|
|
|
export interface HtmlReportParameter {
|
|
name: string;
|
|
label: string;
|
|
inputType: "text" | "number" | "date" | "select" | "f4-modal";
|
|
required?: boolean;
|
|
placeholder?: string;
|
|
defaultValue?: any;
|
|
options?: HtmlReportSelectOption[];
|
|
f4Config?: F4Config;
|
|
}
|
|
|
|
export interface HtmlReportDefinition {
|
|
id: string;
|
|
title: string;
|
|
description?: string;
|
|
icon?: string;
|
|
/** Sufijo del endpoint bajo /api/reports/, ej. "stickers" -> POST /api/reports/stickers */
|
|
endpoint: string;
|
|
parameters: HtmlReportParameter[];
|
|
}
|
|
|
|
// Reportes propios (Jinja2 + HTML, con salida PDF vía WeasyPrint), en
|
|
// contraste con crystalReportsConfig que va vía APIGateway/Crystal Reports.
|
|
export const htmlReportsConfig: Record<string, HtmlReportDefinition[]> = {
|
|
socios: [],
|
|
ventas: [],
|
|
compras: [],
|
|
inventario: [
|
|
{
|
|
id: "stickers",
|
|
title: "Impresión de Etiquetas",
|
|
description: "Etiquetas de guía de remisión, generadas con plantilla propia (no pasa por Crystal Reports)",
|
|
icon: "tag",
|
|
endpoint: "stickers",
|
|
parameters: [
|
|
{
|
|
name: "doc_entry",
|
|
label: "Documento",
|
|
inputType: "f4-modal",
|
|
required: true,
|
|
f4Config: {
|
|
endpoint: "DeliveryNotes",
|
|
fields: ["DocNum", "FolioPrefixString", "FolioNumber", "CardCode", "CardName", "DocDate", "DocEntry"],
|
|
columns: [
|
|
{ key: "DocNum", title: "Número", width: "100px" },
|
|
{ key: "FolioPrefixString", title: "Serie", width: "50px" },
|
|
{ key: "FolioNumber", title: "Correlativo", width: "100px" },
|
|
{ key: "CardCode", title: "Código", width: "100px" },
|
|
{ key: "CardName", title: "Cliente", width: "200px" },
|
|
{ key: "DocDate", title: "Fecha", width: "100px", type: "date" },
|
|
{ key: "DocEntry", title: "Documento", width: "100px" },
|
|
],
|
|
baseFilter: "Cancelled eq 'tNO'",
|
|
orderby: "DocEntry desc",
|
|
valueField: "DocEntry",
|
|
labelField: "DocNum",
|
|
selectionMode: "unica",
|
|
},
|
|
},
|
|
{
|
|
name: "cantidad",
|
|
label: "Cantidad",
|
|
inputType: "number",
|
|
required: true,
|
|
placeholder: "0",
|
|
defaultValue: "1",
|
|
},
|
|
{
|
|
name: "formato",
|
|
label: "Formato de salida",
|
|
inputType: "select",
|
|
required: true,
|
|
defaultValue: "pdf",
|
|
options: [
|
|
{ value: "pdf", label: "PDF" },
|
|
{ value: "html", label: "HTML" },
|
|
],
|
|
},
|
|
{
|
|
name: "papel",
|
|
label: "Tamaño de papel",
|
|
inputType: "select",
|
|
required: true,
|
|
defaultValue: "Carta",
|
|
options: [
|
|
{ value: "A4", label: "A4" },
|
|
{ value: "Carta", label: "Carta" },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|