feat(web): facturas y boletas filtran y se crean por su DocumentSubType exacto (bod_None / bod_Bill)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
52dc1957b7
commit
751857d737
2 files changed
+24
-16
No files matched your search
@@ -1,10 +1,15 @@
|
||||
import { TAX_DOCUMENT, type DocumentScreen, invoiceColumns, marketing, referenceColumns } from '../screen-kit';
|
||||
|
||||
/** Filtros que separan las cuatro pantallas de `Invoices`. */
|
||||
/**
|
||||
* Filtros que separan las cuatro pantallas de `Invoices`: `ReserveInvoice` (reserva sí/no) y el subtipo
|
||||
* exacto de `DocumentSubType` (`bod_None` = factura, `bod_Bill` = boleta). Los demás subtipos de SAP
|
||||
* (`bod_InvoiceExempt`, `bod_DebitMemo`, `bod_ExemptBill`, `bod_ExportInvoice`…) no se mezclan aquí:
|
||||
* tendrán su propia pantalla si se necesitan.
|
||||
*/
|
||||
const RESERVE = `ReserveInvoice eq 'tYES'`;
|
||||
const NOT_RESERVE = `ReserveInvoice eq 'tNO'`;
|
||||
const INVOICE = `DocumentSubType eq 'bod_None'`;
|
||||
const BILL = `DocumentSubType eq 'bod_Bill'`;
|
||||
const NOT_BILL = `DocumentSubType ne 'bod_Bill'`;
|
||||
|
||||
/** Ventas: ofertas, órdenes, entregas, facturas, devoluciones y notas de crédito de cliente. */
|
||||
export const VENTAS_SCREENS: readonly DocumentScreen[] = [
|
||||
@@ -13,13 +18,13 @@ export const VENTAS_SCREENS: readonly DocumentScreen[] = [
|
||||
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),
|
||||
// Facturas, boletas y sus reservas son el mismo recurso (`Invoices`); se separan por dos campos:
|
||||
// `DocumentSubType` (`bod_Bill` = boleta) y `ReserveInvoice` (`tYES` = de reserva). La factura excluye
|
||||
// solo las boletas (`ne`, no `eq bod_None`, para no perder notas de débito u otros subtipos).
|
||||
// Facturas, boletas y sus reservas son el mismo recurso (`Invoices`); cada pantalla filtra por su
|
||||
// `DocumentSubType` exacto y por `ReserveInvoice`, y envía ambos al crear.
|
||||
marketing('/ventas/facturas', 'Invoices', 'Nueva factura', 'Cliente', {
|
||||
...TAX_DOCUMENT,
|
||||
columns: invoiceColumns,
|
||||
baseFilter: `${NOT_RESERVE} and ${NOT_BILL}`,
|
||||
baseFilter: `${NOT_RESERVE} and ${INVOICE}`,
|
||||
fixed: { DocumentSubType: 'bod_None' },
|
||||
}),
|
||||
marketing('/ventas/boletas', 'Invoices', 'Nueva boleta', 'Cliente', {
|
||||
...TAX_DOCUMENT,
|
||||
@@ -30,8 +35,8 @@ export const VENTAS_SCREENS: readonly DocumentScreen[] = [
|
||||
marketing('/ventas/facturas-reserva', 'Invoices', 'Nueva factura de reserva', 'Cliente', {
|
||||
...TAX_DOCUMENT,
|
||||
columns: invoiceColumns,
|
||||
baseFilter: `${RESERVE} and ${NOT_BILL}`,
|
||||
fixed: { ReserveInvoice: 'tYES' },
|
||||
baseFilter: `${RESERVE} and ${INVOICE}`,
|
||||
fixed: { ReserveInvoice: 'tYES', DocumentSubType: 'bod_None' },
|
||||
}),
|
||||
marketing('/ventas/boletas-reserva', 'Invoices', 'Nueva boleta de reserva', 'Cliente', {
|
||||
...TAX_DOCUMENT,
|
||||
|
||||
Reference in new issue
Block a user