feat(web): formularios de inventario y solicitudes de compra (entradas, salidas, transferencias, solicitudes de traslado)
Configuración declarativa en document-layouts.ts; las líneas de las transferencias van en StockTransferLines y las de compra/inventario llevan UoMEntry si el artículo tiene grupo de unidades. Probado contra SBODemoCL (solicitud de compra 2, solicitud de traslado 472, entrada 155). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
45c0ca536e
commit
155d18fce4
13 files changed
+550
-46
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { DOCUMENT_LINE_COLUMNS, ITEMS_MULTI_ADD, lineColumnsFor, newDocumentLine, recalcLine } from './line-columns';
|
||||
import { DOCUMENT_LINE_COLUMNS, ITEMS_MULTI_ADD, lineColumnsFor, newDocumentLine, recalcLine, uomEntryOf } from './line-columns';
|
||||
|
||||
describe('recalcLine', () => {
|
||||
it('total = cantidad × precio, redondeado a 2 decimales', () => {
|
||||
@@ -68,3 +68,14 @@ describe('lineColumnsFor', () => {
|
||||
expect(DOCUMENT_LINE_COLUMNS.find((c) => c.key === 'TaxCode')?.lookup?.config.resource).toBe('SalesTaxCodes');
|
||||
});
|
||||
});
|
||||
|
||||
describe('uomEntryOf', () => {
|
||||
it('usa la unidad de compra por defecto y, si no hay, la de inventario', () => {
|
||||
expect(uomEntryOf({ UoMGroupEntry: 1, DefaultPurchasingUoMEntry: 3, InventoryUoMEntry: 1 })).toBe(3);
|
||||
expect(uomEntryOf({ UoMGroupEntry: 1, DefaultPurchasingUoMEntry: null, InventoryUoMEntry: 1 })).toBe(1);
|
||||
});
|
||||
it('un artículo de unidad manual (sin grupo) no lleva unidad: SAP no la admite', () => {
|
||||
expect(uomEntryOf({ UoMGroupEntry: -1, InventoryUoMEntry: -1 })).toBeUndefined();
|
||||
expect(uomEntryOf({ InventoryUoMEntry: 1 })).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user