feat(web): el stock por almacén muestra el nombre del almacén y la lista de artículos el nombre del grupo (columna nameOf en las tablas de filas)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GeorgeandClaude Sonnet 5.5 committed 2026-10-19 18:59:56 -05:00
1 parent 5253ef4cb7
commit 8af3b11ac2
4 files changed
+29 -3

No files matched your search

@@ -26,10 +26,11 @@ export const ARTICULOS_SCREENS: readonly MasterScreen[] = [
createLabel: 'Nuevo artículo',
orderby: 'ItemCode',
extraFields: ['Frozen'],
listNames: [{ key: 'ItemsGroupCode', resource: 'ItemGroups', valueField: 'Number', labelField: 'GroupName' }],
columns: [
{ key: 'ItemCode', title: 'Nº de artículo', width: '170px', mono: true, searchable: true },
{ key: 'ItemName', title: 'Descripción', searchable: true },
{ key: 'ItemsGroupCode', title: 'Grupo', type: 'number', align: 'left', width: '90px', format: (r) => String(r['ItemsGroupCode'] ?? '') },
{ key: 'ItemsGroupCode', title: 'Grupo', type: 'number', align: 'left', width: '200px', format: (r) => String(r['ItemsGroupCode'] ?? '') },
{ key: 'QuantityOnStock', title: 'En stock', type: 'number', width: '110px' },
{
key: 'Frozen',
@@ -149,6 +150,7 @@ export const ARTICULOS_SCREENS: readonly MasterScreen[] = [
identity: ['WarehouseCode'],
columns: [
{ key: 'WarehouseCode', title: 'Almacén', type: 'text', width: '110px' },
{ key: 'WarehouseName', title: 'Nombre', type: 'text', width: '260px', nameOf: { codeKey: 'WarehouseCode', resource: 'Warehouses', valueField: 'WarehouseCode', labelField: 'WarehouseName' } },
{ key: 'InStock', title: 'En stock', type: 'number', width: '110px' },
{ key: 'Committed', title: 'Comprometido', type: 'number', width: '110px' },
{ key: 'Ordered', title: 'Pedido', type: 'number', width: '110px' },
@@ -252,7 +252,7 @@ describe('formulario con tablas', () => {
await open('/inventario/articulos', 'A1', item());
const tab = el().querySelectorAll('sbo-tab')[5];
const inputs = [...tab.querySelectorAll<HTMLInputElement>('tbody input')];
expect(inputs.map((i) => i.value)).toEqual(['01', '990', '2', '1', '0', '0']);
expect(inputs.map((i) => i.value)).toEqual(['01', '', '990', '2', '1', '0', '0']); // la segunda es el nombre del almacén (llega del catálogo)
expect(inputs.every((i) => i.readOnly)).toBe(true);
expect(tab.querySelector('.addrow')).toBeNull();
expect(page().dirty()).toBe(false);