feat(web): serie, indicador y proyecto en la cabecera; dimensiones, proyecto, cuenta, referencia base y precio con IVA en el detalle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f003ee4bf
commit
f66ef108cf
22 files changed
+698
-100
No files matched your search
@@ -10,13 +10,16 @@ import {
|
||||
today,
|
||||
warehouseColumn,
|
||||
} from '../document-layouts';
|
||||
import type { GridColumn } from '../../../shared/grid/grid.types';
|
||||
import { ANALYTIC_COLUMNS, lineFieldsOf } from '../line-columns';
|
||||
|
||||
/** Entradas y salidas de mercancía: artículo, cantidad, almacén y precio (opcional: si falta, SAP usa el costo). */
|
||||
const goodsColumns: readonly GridColumn[] = [itemColumn, descriptionColumn, quantityColumn, { ...warehouseColumn, required: true }, priceColumn, ...ANALYTIC_COLUMNS];
|
||||
export const goodsLayout: DocumentLayout = {
|
||||
lines: { key: 'DocumentLines', fields: ['ItemCode', 'ItemDescription', 'Quantity', 'UoMEntry', 'WarehouseCode', 'Price'], base: false },
|
||||
header: { left: [FIELDS.docDate], right: [FIELDS.docNum] },
|
||||
lines: { key: 'DocumentLines', fields: [...lineFieldsOf(goodsColumns), 'UoMEntry'], base: false },
|
||||
header: { left: [FIELDS.docDate, FIELDS.indicator, FIELDS.project], right: [FIELDS.docNumber] },
|
||||
footer: commentsOnly,
|
||||
columns: [itemColumn, descriptionColumn, quantityColumn, { ...warehouseColumn, required: true }, priceColumn],
|
||||
columns: goodsColumns,
|
||||
newHeader: () => ({ DocDate: today() }),
|
||||
newLine: () => ({ ...blankLine(), Price: null }),
|
||||
immutable: true,
|
||||
@@ -24,11 +27,8 @@ export const goodsLayout: DocumentLayout = {
|
||||
};
|
||||
|
||||
/** Transferencias de stock y solicitudes de traslado: almacén origen y destino en la cabecera y en cada línea. */
|
||||
const transfer = (immutable: boolean): DocumentLayout => ({
|
||||
lines: { key: 'StockTransferLines', fields: ['ItemCode', 'ItemDescription', 'Quantity', 'FromWarehouseCode', 'WarehouseCode'], base: false },
|
||||
header: { left: [FIELDS.fromWarehouse, FIELDS.toWarehouse], right: [FIELDS.docNum, FIELDS.docDate] },
|
||||
footer: commentsOnly,
|
||||
columns: [
|
||||
const transfer = (immutable: boolean): DocumentLayout => {
|
||||
const columns: readonly GridColumn[] = [
|
||||
itemColumn,
|
||||
descriptionColumn,
|
||||
quantityColumn,
|
||||
@@ -40,19 +40,26 @@ const transfer = (immutable: boolean): DocumentLayout => ({
|
||||
lookup: { ...warehouseColumn.lookup!, apply: (wh, line) => ({ ...line, FromWarehouseCode: wh['WarehouseCode'] }) },
|
||||
},
|
||||
{ ...warehouseColumn, title: 'Almacén destino', required: true },
|
||||
],
|
||||
newHeader: () => ({ DocDate: today() }),
|
||||
newLine: (header) => ({
|
||||
...blankLine(),
|
||||
FromWarehouseCode: header['FromWarehouse'] ?? '',
|
||||
WarehouseCode: header['ToWarehouse'] ?? '',
|
||||
}),
|
||||
immutable,
|
||||
requiredLine: [
|
||||
{ key: 'FromWarehouseCode', label: 'el almacén origen' },
|
||||
{ key: 'WarehouseCode', label: 'el almacén destino' },
|
||||
],
|
||||
});
|
||||
...ANALYTIC_COLUMNS,
|
||||
];
|
||||
return {
|
||||
lines: { key: 'StockTransferLines', fields: [...lineFieldsOf(columns), 'UoMEntry'], base: false },
|
||||
header: { left: [FIELDS.fromWarehouse, FIELDS.toWarehouse, FIELDS.indicator, FIELDS.project], right: [FIELDS.docNumber, FIELDS.docDate] },
|
||||
footer: commentsOnly,
|
||||
columns,
|
||||
newHeader: () => ({ DocDate: today() }),
|
||||
newLine: (header) => ({
|
||||
...blankLine(),
|
||||
FromWarehouseCode: header['FromWarehouse'] ?? '',
|
||||
WarehouseCode: header['ToWarehouse'] ?? '',
|
||||
}),
|
||||
immutable,
|
||||
requiredLine: [
|
||||
{ key: 'FromWarehouseCode', label: 'el almacén origen' },
|
||||
{ key: 'WarehouseCode', label: 'el almacén destino' },
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
export const transferLayout: DocumentLayout = transfer(true);
|
||||
export const transferRequestLayout: DocumentLayout = transfer(false);
|
||||
Reference in new issue
Block a user