refactor(web): pantallas y formularios separados por módulo (ventas, compras, inventario)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b0b8afc87
commit
c5368c7ad0
10 files changed
+358
-311
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import {
|
||||
type DocumentLayout,
|
||||
FIELDS,
|
||||
blankLine,
|
||||
commentsOnly,
|
||||
descriptionColumn,
|
||||
itemColumn,
|
||||
quantityColumn,
|
||||
today,
|
||||
warehouseColumn,
|
||||
} from '../document-layouts';
|
||||
|
||||
/** Solicitud de compra: solicitante (usuario de SAP), fecha requerida y, por línea, proveedor sugerido. */
|
||||
export const purchaseRequestLayout: DocumentLayout = {
|
||||
lines: { key: 'DocumentLines', fields: ['ItemCode', 'ItemDescription', 'Quantity', 'UoMEntry', 'WarehouseCode', 'LineVendor'], base: false },
|
||||
header: { left: [FIELDS.requester], right: [FIELDS.docNum, FIELDS.docDate, FIELDS.requiredDate] },
|
||||
footer: commentsOnly,
|
||||
columns: [
|
||||
itemColumn,
|
||||
descriptionColumn,
|
||||
quantityColumn,
|
||||
warehouseColumn,
|
||||
{
|
||||
key: 'LineVendor',
|
||||
title: 'Proveedor',
|
||||
width: '130px',
|
||||
mono: true,
|
||||
lookup: {
|
||||
config: {
|
||||
title: 'Proveedores',
|
||||
resource: 'BusinessPartners',
|
||||
baseFilter: `CardType eq 'cSupplier'`,
|
||||
orderby: 'CardCode',
|
||||
columns: [
|
||||
{ key: 'CardCode', title: 'Código', width: '130px', mono: true },
|
||||
{ key: 'CardName', title: 'Nombre' },
|
||||
],
|
||||
},
|
||||
apply: (bp, line) => ({ ...line, LineVendor: bp['CardCode'] }),
|
||||
},
|
||||
},
|
||||
],
|
||||
newHeader: () => ({ DocDate: today(), RequriedDate: today() }),
|
||||
newLine: blankLine,
|
||||
// El solicitante es un usuario de SAP (`ReqType` 12).
|
||||
beforeCreate: (h) => (h['Requester'] ? { ...h, ReqType: 12 } : h),
|
||||
requiredLine: [],
|
||||
};
|
||||
Reference in new issue
Block a user