44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
import type { ListColumn } from '../../shared/list/list.types';
|
|||
|
|
import type { VhLookup } from '../../shared/value-help/value-help.types';
|
||
|
|
|
||
|
|
const col = (key: string, title: string, extra: Partial<ListColumn> = {}): ListColumn => ({ key, title, ...extra });
|
||
|
|
|
||
|
|
/** Ventanas de selección de los campos de código de los maestros. */
|
||
|
|
export const MASTER_LOOKUPS = {
|
||
|
|
/** Grupo de clientes o de proveedores. */
|
||
|
|
partnerGroup: (type: 'cCustomer' | 'cSupplier'): VhLookup => ({
|
||
|
|
title: type === 'cSupplier' ? 'Grupos de proveedores' : 'Grupos de clientes',
|
||
|
|
resource: 'BusinessPartnerGroups',
|
||
|
|
orderby: 'Code',
|
||
|
|
baseFilter: `Type eq '${type === 'cSupplier' ? 'bbpgt_VendorGroup' : 'bbpgt_CustomerGroup'}'`,
|
||
|
|
valueType: 'number',
|
||
|
|
columns: [col('Code', 'Código', { width: '90px', mono: true }), col('Name', 'Nombre')],
|
||
|
|
}),
|
||
|
|
currency: {
|
||
|
|
title: 'Monedas',
|
||
|
|
resource: 'Currencies',
|
||
|
|
orderby: 'Code',
|
||
|
|
columns: [col('Code', 'Código', { width: '90px', mono: true }), col('Name', 'Nombre')],
|
||
|
|
} satisfies VhLookup,
|
||
|
|
paymentTerms: {
|
||
|
|
title: 'Condiciones de pago',
|
||
|
|
resource: 'PaymentTermsTypes',
|
||
|
|
orderby: 'GroupNumber',
|
||
|
|
valueType: 'number',
|
||
|
|
columns: [col('GroupNumber', 'Código', { width: '90px', mono: true }), col('PaymentTermsGroupName', 'Nombre')],
|
||
|
|
} satisfies VhLookup,
|
||
|
|
priceList: {
|
||
|
|
title: 'Listas de precios',
|
||
|
|
resource: 'PriceLists',
|
||
|
|
orderby: 'PriceListNo',
|
||
|
|
valueType: 'number',
|
||
|
|
columns: [col('PriceListNo', 'Código', { width: '90px', mono: true }), col('PriceListName', 'Nombre')],
|
||
|
|
} satisfies VhLookup,
|
||
|
|
itemGroup: {
|
||
|
|
title: 'Grupos de artículos',
|
||
|
|
resource: 'ItemGroups',
|
||
|
|
orderby: 'Number',
|
||
|
|
valueType: 'number',
|
||
|
|
columns: [col('Number', 'Código', { width: '90px', mono: true }), col('GroupName', 'Nombre')],
|
||
|
|
} satisfies VhLookup,
|
||
|
|
} as const;
|