Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md

This commit is contained in:
2026-08-18 20:59:52 -04:00
commit 454973e269
5978 changed files with 2664094 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
FUNCTION clasificar_producto_abc(bodega_id)
DEFINE bodega_id STRING
-- Array para almacenar info por producto
DEFINE arr DYNAMIC ARRAY OF RECORD
producto_id STRING,
valor_total DECIMAL,
rotacion FLOAT,
porcentaje_acumulado FLOAT,
clase CHAR(1)
END RECORD
-- 1. Leer los productos de la bodega con existencia y costo
CALL cargar_valores_bodega(arr, bodega_id)
-- 2. Ordenar por valor_total descendente
CALL ordenar_array_por_valor(arr)
-- 3. Calcular porcentaje acumulado y asignar clase A, B, C
CALL asignar_clasificacion_abc(arr)
-- 4. Guardar la clasificación
CALL guardar_clasificacion_bodega(arr, bodega_id)
END FUNCTION