feat(web): referencia y RUT en las listas de ofertas y órdenes de venta y de compra
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6c127627f
commit
d926519f1b
4 files changed
+30
-9
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { TAX_DOCUMENT, type DocumentScreen, docDate, docNum, invoiceColumns, marketing, statusColumn, statusFilter, dateFilter } from '../screen-kit';
|
||||
import { TAX_DOCUMENT, type DocumentScreen, docDate, docNum, invoiceColumns, marketing, referenceColumns, statusColumn, statusFilter, dateFilter } from '../screen-kit';
|
||||
import { purchaseRequestLayout } from './compras.layouts';
|
||||
|
||||
/** Compras: solicitudes de compra y documentos de proveedor. */
|
||||
@@ -19,8 +19,8 @@ export const COMPRAS_SCREENS: readonly DocumentScreen[] = [
|
||||
],
|
||||
filters: [statusFilter, dateFilter],
|
||||
},
|
||||
marketing('/compras/ofertas', 'PurchaseQuotations', 'Nueva oferta', 'Proveedor'),
|
||||
marketing('/compras/ordenes', 'PurchaseOrders', 'Nueva orden', 'Proveedor'),
|
||||
marketing('/compras/ofertas', 'PurchaseQuotations', 'Nueva oferta', 'Proveedor', { columns: referenceColumns }),
|
||||
marketing('/compras/ordenes', 'PurchaseOrders', 'Nueva orden', 'Proveedor', { columns: referenceColumns }),
|
||||
marketing('/compras/recepcion', 'PurchaseDeliveryNotes', 'Nueva recepción', 'Proveedor', TAX_DOCUMENT),
|
||||
marketing('/compras/facturas', 'PurchaseInvoices', 'Nueva factura', 'Proveedor', { ...TAX_DOCUMENT, columns: invoiceColumns }),
|
||||
marketing('/compras/devoluciones', 'PurchaseReturns', 'Nueva devolución', 'Proveedor'),
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('DOCUMENT_SCREENS', () => {
|
||||
|
||||
it('las columnas con texto calculado (estado, total) no son buscables', () => {
|
||||
const orders = DOCUMENT_SCREENS.find((s) => s.resource === 'Orders')!;
|
||||
expect(orders.columns.filter((c) => isSearchable(c)).map((c) => c.key)).toEqual(['DocNum', 'CardCode', 'CardName']);
|
||||
expect(orders.columns.filter((c) => isSearchable(c)).map((c) => c.key)).toEqual(['DocNum', 'NumAtCard', 'FederalTaxID', 'CardCode', 'CardName']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,3 +102,19 @@ describe('columnas de las facturas', () => {
|
||||
expect(col.format!({ FolioNumber: 198837 })).toBe('198837');
|
||||
});
|
||||
});
|
||||
|
||||
describe('referencia y RUT en las listas de ofertas y órdenes', () => {
|
||||
const keys = (r: string) => DOCUMENT_SCREENS.find((s) => s.resource === r)!.columns.map((c) => c.key);
|
||||
|
||||
it('las ofertas y órdenes de venta y de compra los muestran, sin folio', () => {
|
||||
for (const r of ['Quotations', 'Orders', 'PurchaseQuotations', 'PurchaseOrders']) {
|
||||
expect(keys(r), r).toEqual(expect.arrayContaining(['NumAtCard', 'FederalTaxID']));
|
||||
expect(keys(r), r).not.toContain('FolioNumber');
|
||||
}
|
||||
});
|
||||
|
||||
it('las facturas conservan sus columnas y las entregas no cambian', () => {
|
||||
expect(keys('Invoices')).toEqual(expect.arrayContaining(['FolioPrefixString', 'FolioNumber', 'NumAtCard', 'FederalTaxID']));
|
||||
expect(keys('DeliveryNotes')).not.toContain('NumAtCard');
|
||||
});
|
||||
});
|
||||
@@ -70,6 +70,12 @@ export const docNum: ListColumn = {
|
||||
searchable: true,
|
||||
format: (r) => String(r['DocNum'] ?? ''),
|
||||
};
|
||||
/** Referencia del documento y RUT del socio (ofertas y órdenes). */
|
||||
export const referenceColumns: readonly ListColumn[] = [
|
||||
{ key: 'NumAtCard', title: 'Nº referencia', width: '130px', searchable: true },
|
||||
{ key: 'FederalTaxID', title: 'RUT', width: '110px', mono: true, searchable: true },
|
||||
];
|
||||
|
||||
/** Facturas: folio tributario (en el Service Layer `FolioPrefixString` y `FolioNumber`), referencia y RUT. */
|
||||
export const invoiceColumns: readonly ListColumn[] = [
|
||||
{ key: 'FolioPrefixString', title: 'Folio pref.', width: '90px', mono: true, searchable: true },
|
||||
@@ -83,8 +89,7 @@ export const invoiceColumns: readonly ListColumn[] = [
|
||||
searchable: true,
|
||||
format: (r) => String(r['FolioNumber'] ?? ''),
|
||||
},
|
||||
{ key: 'NumAtCard', title: 'Nº referencia', width: '130px', searchable: true },
|
||||
{ key: 'FederalTaxID', title: 'RUT', width: '110px', mono: true, searchable: true },
|
||||
...referenceColumns,
|
||||
];
|
||||
|
||||
export const docDate: ListColumn = { key: 'DocDate', title: 'Fecha contab.', type: 'date', align: 'center', width: '115px' };
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { TAX_DOCUMENT, type DocumentScreen, invoiceColumns, marketing } from '../screen-kit';
|
||||
import { TAX_DOCUMENT, type DocumentScreen, invoiceColumns, marketing, referenceColumns } from '../screen-kit';
|
||||
|
||||
/** Ventas: ofertas, órdenes, entregas, facturas, devoluciones y notas de crédito de cliente. */
|
||||
export const VENTAS_SCREENS: readonly DocumentScreen[] = [
|
||||
] = [
|
||||
// Ventas
|
||||
marketing('/ventas/ofertas', 'Quotations', 'Nueva oferta', 'Cliente'),
|
||||
marketing('/ventas/ordenes', 'Orders', 'Nueva orden', 'Cliente'),
|
||||
marketing('/ventas/ofertas', 'Quotations', 'Nueva oferta', 'Cliente', { columns: referenceColumns }),
|
||||
marketing('/ventas/ordenes', 'Orders', 'Nueva orden', 'Cliente', { columns: referenceColumns }),
|
||||
marketing('/ventas/entrega', 'DeliveryNotes', 'Nueva entrega', 'Cliente', TAX_DOCUMENT),
|
||||
marketing('/ventas/facturas', 'Invoices', 'Nueva factura', 'Cliente', { ...TAX_DOCUMENT, columns: invoiceColumns }),
|
||||
marketing('/ventas/devoluciones', 'Returns', 'Nueva devolución', 'Cliente'),
|
||||
|
||||
Reference in new issue
Block a user