| Tabla | Registros | Status |
|---|---|---|
reception_agendas | 1 (AG-00000001) | DRAFT |
reception_agenda_refs | 1 (OC 10728, bpl_id=1) | PENDING |
reception_agenda_lines | N (líneas de la OC) | PENDING |
audit_log | 3 eventos | — |
rf.html con su usuario op_recepcionusers.last_activity_at actualizado4711228420285/PurchaseDeliveryNotes al Service LayercreateStockEntries → genera stock + movimientos| Tabla / SAP | Resultado |
|---|---|
reception_agendas | AG-00000001 CLOSED |
reception_agenda_refs | OC 10728 COMPLETED |
batches | L-BPL-OK QA (vto 2027-12-31) |
stock | 1 unidad en bin CEN-REC QA |
stock_movements | RECEIPT registrado |
sap_sync_log | DOC_RECEPTION_AGENDA SUCCESS |
| SAP B1 | PDN DocEntry 7310 / DocNum 2907 ✓ |
batches.status y todo el stock asociadoqa_decisionsQA_APPROVE en stock_movementsWT-XXXXXXXX tipo PUT (auto si auto_putaway=1)rf.html → Almacenamiento| Campo | Valor |
|---|---|
| bin | CEN-A01 (storage) |
| stock_status | AVAILABLE |
| quantity | 1 UND |
| batch | L-BPL-OK (vto 2027-12-31) |
| warehouse_task | COMPLETED |
| Etapa | Método | Endpoint | Propósito |
|---|---|---|---|
| 2 | GET | /api/sap/purchase-orders | Listar OCs abiertas en SAP |
| 2 | GET | /api/sap/purchase-orders/{e}/lines | Líneas de OC + BPL |
| 2 | GET | /api/users/online?role=op_recepcion | Op_recepcion online |
| 2 | POST | /api/agendas/import-sap-po | Crear agenda + ref + asign |
| 4 | GET | /api/agendas?warehouse_id=X | Lista agendas (rf filtra por user) |
| 4 | POST | /api/agendas/{id}/open | Abrir agenda |
| 5 | POST | /api/agendas/{id}/scan | Registrar escaneo |
| 6 | GET | /api/agendas/{id}/differences | Discrepancias para modal |
| 6 | POST | /api/agendas/{id}/close | Cerrar + crear PDN SAP |
| 6 | POST | /api/agenda-refs/{id}/retry-sap | Reintentar PDN si SAP rechazó |
| 8 | GET | /api/qa/pending | Lotes en cuarentena |
| 8 | POST | /api/qa/batches/{id}/approve | Liberar lote |
| 8 | POST | /api/qa/batches/{id}/reject | Rechazar lote |
| 8 | POST | /api/qa/batches/{id}/quarantine | Cuarentena extendida |
| 9 | POST | /api/tasks/{id}/complete | Cerrar tarea PUT |
| * | GET | /api/audit?table_name=X&record_id=Y | Audit trail por entidad |
| Sistema | URL | Auth |
|---|---|---|
| SAP B1 Service Layer | https://200.10.10.151:50000/b1s/v1 | izi / Sap1234. / DB COMFAR20260422 |
| SAP HANA | 200.10.10.151:30015 | SAPINST / CFR!Art205 |
| WMS público | https://comfar-middleware.duckdns.org:8443/WMS/ | JWT Bearer |
| Middleware webhook | /WebhookClient/Callback | HMAC + secret |
| # | Acción audit | Tabla | Cuándo | Quién |
|---|---|---|---|---|
| 1 | AGENDA_CREATE | reception_agendas | Importar OC SAP | importador |
| 2 | AGENDA_ADD_REF | reception_agenda_refs | Asociar OC a agenda | importador |
| 3 | AGENDA_ASSIGN | reception_agendas | Auto-asignar a op_recepcion | importador → asignee |
| 4 | AGENDA_OPEN | reception_agendas | Operador abre agenda RF | op_recepcion |
| 5 | AGENDA_SCAN | reception_agenda_lines | Cada escaneo de línea | op_recepcion |
| 6 | AGENDA_CLOSE | reception_agendas | Cierre de agenda | op_recepcion / supervisor |
| 7 | BATCH_INTO_QA | batches | Stock entra a cuarentena | sistema |
| 8 | QA_APPROVE / REJECT / QUARANTINE | qa_decisions | Decisión calidad | qa_liberador |
| 9 | BATCH_QA_APPROVED | batches | Espejo en timeline lote | qa_liberador |
| 10 | PUT_CONFIRM | warehouse_tasks | Tarea putaway completada | op_almacen |
table_name, record_id, action, old_values, new_values (JSON), user_id, ip_address, created_at. Listo para auditoría DINAVISA inmutable.