Add supplier and imporve inventory frontend

This commit is contained in:
Urtzi Alfaro
2025-09-18 23:32:53 +02:00
parent ae77a0e1c5
commit d61056df33
40 changed files with 2022 additions and 629 deletions

View File

@@ -207,6 +207,7 @@ const InventoryPage: React.FC = () => {
);
}
// Sort by priority: expired → out of stock → low stock → normal → overstock
// Within each priority level, sort by most critical items first
return items.sort((a, b) => {
@@ -263,22 +264,8 @@ const InventoryPage: React.FC = () => {
// Helper function to get category display name
const getCategoryDisplayName = (category?: string): string => {
const categoryMappings: Record<string, string> = {
'flour': 'Harina',
'dairy': 'Lácteos',
'eggs': 'Huevos',
'sugar': 'Azúcar',
'yeast': 'Levadura',
'fats': 'Grasas',
'spices': 'Especias',
'croissants': 'Croissants',
'pastries': 'Pastelería',
'beverages': 'Bebidas',
'bread': 'Pan',
'other': 'Otros'
};
return categoryMappings[category?.toLowerCase() || ''] || category || 'Sin categoría';
if (!category) return 'Sin categoría';
return category;
};
// Focused action handlers