feat(web): columnas de las listas de valores (cliente, artículo, almacén, impuesto) configurables por documento
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b3b47c34a3
commit
0d5a3074c8
6 files changed
+141
-12
No files matched your search
@@ -26,7 +26,7 @@ import {
|
||||
updatePayload,
|
||||
validateLayout,
|
||||
} from './document-model';
|
||||
import { type ComputedSource, WAREHOUSE_LOOKUP, hasFolio, headerKeysOf, requiredHeaderOf } from './document-layouts';
|
||||
import { type ComputedSource, PARTNER_COLUMNS, WAREHOUSE_LOOKUP, hasFolio, headerKeysOf, requiredHeaderOf } from './document-layouts';
|
||||
import { type CopyOrigin, copyFromDocument, copySources, copyTargets } from './document-copy';
|
||||
import { DOCUMENT_SCREENS, type DocumentScreen, docNum, documentStatus, menuLabel } from './document-screens';
|
||||
import { ITEMS_MULTI_ADD } from './line-columns';
|
||||
@@ -253,22 +253,24 @@ export class DocumentFormPage {
|
||||
// --- configuración de la vista --------------------------------------------------------------
|
||||
|
||||
protected readonly columns = this.layout.columns;
|
||||
private readonly itemColumn = this.layout.columns.find((c) => c.key === 'ItemCode') ?? this.layout.columns[0];
|
||||
protected readonly newLine = () => this.layout.newLine(this.header());
|
||||
protected readonly recalc = this.layout.recalc;
|
||||
protected readonly multi: GridMultiAdd = {
|
||||
...ITEMS_MULTI_ADD,
|
||||
toLine: (item) => this.layout.columns[0].lookup!.apply(item, this.layout.newLine(this.header())),
|
||||
lookup: this.itemColumn.lookup!.config,
|
||||
toLine: (item) => this.itemColumn.lookup!.apply(item, this.layout.newLine(this.header())),
|
||||
};
|
||||
protected readonly warehouseLookup: VhLookup = {
|
||||
...WAREHOUSE_LOOKUP,
|
||||
columns: this.layout.lookups?.warehouse ?? WAREHOUSE_LOOKUP.columns,
|
||||
};
|
||||
protected readonly warehouseLookup = WAREHOUSE_LOOKUP;
|
||||
protected readonly partnerLookup: VhLookup = {
|
||||
title: this.partner?.type === 'cSupplier' ? 'Proveedores' : 'Clientes',
|
||||
resource: 'BusinessPartners',
|
||||
baseFilter: `CardType eq '${this.partner?.type ?? 'cCustomer'}'`,
|
||||
orderby: 'CardCode',
|
||||
columns: [
|
||||
{ key: 'CardCode', title: 'Código', width: '130px', mono: true },
|
||||
{ key: 'CardName', title: 'Nombre' },
|
||||
],
|
||||
columns: this.layout.lookups?.partner ?? PARTNER_COLUMNS,
|
||||
extraFields: ['FederalTaxID'],
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user