214 lines
4.2 KiB
Markdown
214 lines
4.2 KiB
Markdown
# DIRECTIVA-INVENTARIO-SUCURSALES
|
|
|
|
**Version:** 1.0
|
|
**Fecha:** 2025-12-08
|
|
**Vertical:** Retail / POS
|
|
**Nivel:** 2B.2
|
|
|
|
---
|
|
|
|
## PROPOSITO
|
|
|
|
Define las directrices para la gestion de inventario multi-sucursal en retail.
|
|
|
|
---
|
|
|
|
## ALCANCE
|
|
|
|
- Control de stock por sucursal
|
|
- Transferencias entre sucursales
|
|
- Reabastecimiento centralizado
|
|
- Conteos ciclicos
|
|
|
|
---
|
|
|
|
## PRINCIPIOS
|
|
|
|
### 1. Visibilidad en Tiempo Real
|
|
|
|
- Stock actualizado inmediatamente con cada venta
|
|
- Dashboard centralizado de todas las sucursales
|
|
- Alertas de stock bajo automaticas
|
|
|
|
### 2. Control Centralizado
|
|
|
|
- Politicas de inventario desde central
|
|
- Transferencias autorizadas
|
|
- Precios unificados
|
|
|
|
### 3. Autonomia Operativa
|
|
|
|
- Cada sucursal opera independiente
|
|
- Conteos locales permitidos
|
|
- Ajustes menores autorizados
|
|
|
|
---
|
|
|
|
## MODELO DE DATOS
|
|
|
|
### branches (sucursales)
|
|
```yaml
|
|
campos:
|
|
- id: uuid
|
|
- code: string (ej: SUC001)
|
|
- name: string
|
|
- address: text
|
|
- manager_id: FK -> auth.users
|
|
- location_id: FK -> inventory.locations
|
|
- status: enum(active, inactive)
|
|
- is_warehouse: boolean
|
|
```
|
|
|
|
### branch_stock
|
|
```yaml
|
|
campos:
|
|
- id: uuid
|
|
- branch_id: FK -> branches
|
|
- product_id: FK -> retail.products
|
|
- quantity_available: decimal
|
|
- quantity_reserved: decimal
|
|
- minimum_stock: decimal
|
|
- reorder_point: decimal
|
|
- last_count_date: date
|
|
```
|
|
|
|
### stock_transfers
|
|
```yaml
|
|
campos:
|
|
- id: uuid
|
|
- transfer_number: string
|
|
- origin_branch_id: FK -> branches
|
|
- destination_branch_id: FK -> branches
|
|
- status: enum(draft, requested, approved, in_transit, received, cancelled)
|
|
- requested_by: FK -> auth.users
|
|
- approved_by: FK -> auth.users
|
|
- requested_at: timestamp
|
|
- shipped_at: timestamp
|
|
- received_at: timestamp
|
|
```
|
|
|
|
---
|
|
|
|
## FLUJO DE TRANSFERENCIA
|
|
|
|
```
|
|
1. Sucursal A solicita productos
|
|
|
|
|
2. Central aprueba transferencia
|
|
|
|
|
3. Almacen prepara envio
|
|
|
|
|
4. Registro de salida (origen)
|
|
|
|
|
5. Transito
|
|
|
|
|
6. Sucursal B recibe productos
|
|
|
|
|
7. Registro de entrada (destino)
|
|
```
|
|
|
|
### Estados de Transferencia
|
|
|
|
```
|
|
draft --> requested --> approved --> in_transit --> received
|
|
| | |
|
|
v v v
|
|
cancelled rejected lost
|
|
```
|
|
|
|
---
|
|
|
|
## REABASTECIMIENTO
|
|
|
|
### Tipos de Reabastecimiento
|
|
|
|
| Tipo | Trigger | Proceso |
|
|
|------|---------|---------|
|
|
| Automatico | Stock < reorder_point | Sistema genera solicitud |
|
|
| Manual | Solicitud de sucursal | Manager aprueba |
|
|
| Push | Decision central | Central envia sin solicitud |
|
|
|
|
### Algoritmo de Reabastecimiento
|
|
|
|
```python
|
|
# Pseudocodigo
|
|
for product in products_below_reorder:
|
|
needed = max_stock - current_stock
|
|
available_in_warehouse = get_warehouse_stock(product)
|
|
|
|
if available_in_warehouse >= needed:
|
|
create_transfer(warehouse, branch, product, needed)
|
|
else:
|
|
create_purchase_order(product, needed - available_in_warehouse)
|
|
create_transfer(warehouse, branch, product, available_in_warehouse)
|
|
```
|
|
|
|
---
|
|
|
|
## CONTEOS CICLICOS
|
|
|
|
### Frecuencia por Clasificacion ABC
|
|
|
|
| Clasificacion | Frecuencia | Productos |
|
|
|---------------|------------|-----------|
|
|
| A | Semanal | Alta rotacion/valor |
|
|
| B | Quincenal | Rotacion media |
|
|
| C | Mensual | Baja rotacion |
|
|
|
|
### Proceso de Conteo
|
|
|
|
```
|
|
1. Sistema genera lista de conteo
|
|
|
|
|
2. Encargado realiza conteo fisico
|
|
|
|
|
3. Registra cantidades en sistema
|
|
|
|
|
4. Sistema calcula diferencias
|
|
|
|
|
5. Aprobacion de ajustes
|
|
|
|
|
6. Actualizacion de stock
|
|
```
|
|
|
|
---
|
|
|
|
## INTEGRACION CON CORE
|
|
|
|
### Herencia de Specs
|
|
|
|
| Spec Core | Aplicacion |
|
|
|-----------|------------|
|
|
| SPEC-INVENTARIOS-CICLICOS | Conteos por sucursal |
|
|
| SPEC-VALORACION-INVENTARIO | Costeo centralizado |
|
|
| SPEC-TRAZABILIDAD-LOTES-SERIES | Caducidades |
|
|
|
|
### Mapeo con Core
|
|
|
|
- `branches` extiende `inventory.locations`
|
|
- `branch_stock` extiende `inventory.quants`
|
|
- `stock_transfers` usa `inventory.stock_moves`
|
|
|
|
---
|
|
|
|
## REPORTES
|
|
|
|
| Reporte | Frecuencia | Destinatario |
|
|
|---------|------------|--------------|
|
|
| Stock por sucursal | Diario | Managers |
|
|
| Movimientos | Semanal | Central |
|
|
| Diferencias | Por conteo | Auditoria |
|
|
| Rotacion | Mensual | Compras |
|
|
|
|
---
|
|
|
|
## REFERENCIAS
|
|
|
|
- SPEC-INVENTARIOS-CICLICOS.md (core)
|
|
- SPEC-VALORACION-INVENTARIO.md (core)
|
|
- DIRECTIVA-PUNTO-VENTA.md
|
|
|
|
---
|
|
|
|
**Documento de directiva oficial**
|