feat(web): fila del flete (gastos adicionales) y toolbar de ancho completo; la configuración de pantallas se carga en diferido
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d3ab97cd2e
commit
d6c127627f
14 files changed
+360
-27
No files matched your search
@@ -24,6 +24,8 @@ export type HeaderField =
|
||||
| { type: 'partner'; key: string; label: string; required?: boolean; missing?: string }
|
||||
/** Prefijo y número del folio tributario en una misma fila (`FolioPrefixString` y `FolioNumber`). */
|
||||
| { type: 'folio'; label: string; prefixKey: string; numberKey: string }
|
||||
/** Flete: código del gasto adicional y su importe (`DocumentAdditionalExpenses`). */
|
||||
| { type: 'freight'; label: string }
|
||||
| { type: 'computed'; label: string; source: ComputedSource };
|
||||
|
||||
/** Las listas de valores (ventanas modales) de un formulario. */
|
||||
@@ -170,6 +172,8 @@ export function marketingLayout(opts: {
|
||||
lookups?: LookupColumns;
|
||||
/** Unidad de medida que se toma del artículo: la de venta o la de compra. */
|
||||
uom: 'sales' | 'purchase';
|
||||
/** Fila del flete en el pie (por defecto sí). */
|
||||
freight?: boolean;
|
||||
}): DocumentLayout {
|
||||
const columns = lineColumnsFor(opts.taxResource, opts.lineColumns).map((c) =>
|
||||
c.key === 'ItemCode' && c.lookup ? itemColumnWithUom(c, opts.uom) : c,
|
||||
@@ -191,6 +195,7 @@ export function marketingLayout(opts: {
|
||||
right: [
|
||||
{ type: 'computed', label: 'Total antes del descuento', source: 'subtotal' },
|
||||
{ type: 'number', key: 'DiscountPercent', label: 'Descuento %', decimals: 2 },
|
||||
...(opts.freight === false ? [] : [{ type: 'freight', label: 'Flete' } as const]),
|
||||
{ type: 'computed', label: 'Impuesto', source: 'tax' },
|
||||
{ type: 'computed', label: 'Total del documento', source: 'total' },
|
||||
],
|
||||
@@ -219,6 +224,8 @@ export const headerKeysOf = (layout: DocumentLayout): readonly string[] =>
|
||||
switch (f.type) {
|
||||
case 'computed':
|
||||
return [];
|
||||
case 'freight':
|
||||
return ['FreightExpense', 'FreightAmount'];
|
||||
case 'folio':
|
||||
return [f.prefixKey, f.numberKey];
|
||||
default:
|
||||
@@ -234,4 +241,6 @@ export const requiredHeaderOf = (layout: DocumentLayout): { key: string; label:
|
||||
: [],
|
||||
);
|
||||
|
||||
export const hasFreight = (layout: DocumentLayout): boolean => allFields(layout).some((f) => f.type === 'freight');
|
||||
|
||||
export const hasFolio = (layout: DocumentLayout): boolean => allFields(layout).some((f) => f.type === 'folio');
|
||||
Reference in new issue
Block a user