CAMBIOS: Creado un "ProductSeeder" Para la carga de productos del excel. Falta cargar los productos.
This commit is contained in:
@@ -77,5 +77,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'problem_description' => 'Service completo y ajuste de cambios',
|
'problem_description' => 'Service completo y ajuste de cambios',
|
||||||
'status' => 'pending'
|
'status' => 'pending'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$this->call(ProductSeeder::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\Product;
|
||||||
|
|
||||||
|
class ProductSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
// Productos del Excel
|
||||||
|
$products = [
|
||||||
|
// 1. BICICLETAS
|
||||||
|
[
|
||||||
|
'name' => 'Bicicleta Venzo Loki R29',
|
||||||
|
'sku' => 'BIC-VEN-001',
|
||||||
|
'price' => 450000,
|
||||||
|
'cost' => 300000,
|
||||||
|
'stock_quantity' => 2,
|
||||||
|
'min_stock_alert' => 1,
|
||||||
|
'type' => 'bike', // bike, accessory, clothing, spare
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'Cámara 29 Valvula Auto',
|
||||||
|
'sku' => 'CAM-29-A',
|
||||||
|
'price' => 5000,
|
||||||
|
'cost' => 2500,
|
||||||
|
'stock_quantity' => 50,
|
||||||
|
'min_stock_alert' => 10,
|
||||||
|
'type' => 'accessory',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'name' => 'Servicio de Lavado',
|
||||||
|
'sku' => 'SRV-LAV',
|
||||||
|
'price' => 3000,
|
||||||
|
'cost' => 0,
|
||||||
|
'stock_quantity' => 999,
|
||||||
|
'min_stock_alert' => 0,
|
||||||
|
'type' => 'service',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// BUCLE DE CARGA
|
||||||
|
foreach ($products as $item) {
|
||||||
|
Product::updateOrCreate(
|
||||||
|
['sku' => $item['sku']],
|
||||||
|
[
|
||||||
|
'name' => $item['name'],
|
||||||
|
'price' => $item['price'],
|
||||||
|
'cost' => $item['cost'] ?? 0,
|
||||||
|
'stock_quantity' => $item['stock_quantity'] ?? 0,
|
||||||
|
'min_stock_alert' => $item['min_stock_alert'] ?? 5,
|
||||||
|
'type' => $item['type'] ?? 'accessory',
|
||||||
|
'description' => $item['description'] ?? null,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{ url('/dashboard') }}"
|
<a href="{{ url('/dashboard') }}"
|
||||||
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
class="block py-2 px-3 md:p-0 transition-colors {{ request()->is('dashboard') ? 'text-neon-lime border-b-2 border-neon-lime' : 'text-white hover:text-neon-lime' }}">
|
||||||
Dashboard
|
Inicio
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -9,9 +9,13 @@
|
|||||||
|
|
||||||
<!-- Grid de Tarjetas -->
|
<!-- Grid de Tarjetas -->
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 w-full mb-12">
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 w-full mb-12">
|
||||||
|
|
||||||
<!-- Tarjeta Catálogo -->
|
<!-- Tarjeta Catálogo -->
|
||||||
<x-ui.card href="{{ url('/catalogo') }}" title="Catálogo" description="Administrar bicicletas y repuestos." linkText="Ir al stock">
|
<x-ui.card href="{{ url('/catalogo') }}" title="Catálogo" description="Ver productos." linkText="Ir al catalogo">
|
||||||
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
|
||||||
|
</x-ui.card>
|
||||||
|
|
||||||
|
<!-- Tarjeta Productos -->
|
||||||
|
<x-ui.card href="{{ url('/productos') }}" title="Stock" description="Administrar bicicletas y repuestos." linkText="Ir al stock">
|
||||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z" /></svg>
|
||||||
</x-ui.card>
|
</x-ui.card>
|
||||||
|
|
||||||
@@ -21,18 +25,25 @@
|
|||||||
</x-ui.card>
|
</x-ui.card>
|
||||||
|
|
||||||
<!-- Tarjeta Clientes -->
|
<!-- Tarjeta Clientes -->
|
||||||
<x-ui.card href="{{ url('/clients') }}" title="Clientes" description="Base de datos de ciclistas." linkText="Buscar usuario">
|
<x-ui.card href="{{ url('/clients') }}" title="Clientes" description="Base de datos de ciclistas." linkText="Ver Clientes">
|
||||||
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||||
|
</x-ui.card>
|
||||||
|
|
||||||
|
<!-- Tarjeta Proveedores -->
|
||||||
|
<x-ui.card href="#" title="Proveedores" description="Base de datos de proveedores." linkText="Ver Proveedores">
|
||||||
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||||
|
</x-ui.card>
|
||||||
|
|
||||||
|
<!-- Tarjeta Ventas -->
|
||||||
|
<x-ui.card href="{{ url('/sales') }}" title="Ventas" description="Registro de Ventas" linkText="Ver Ventas">
|
||||||
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||||
|
</x-ui.card>
|
||||||
|
|
||||||
|
<!-- Tarjeta Compras -->
|
||||||
|
<x-ui.card href="#" title="Gastos" description="Registro de compras y pedidos a proovedores." linkText="Ver Gastos">
|
||||||
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
<svg class="w-12 h-12 text-neon-lime" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z" /></svg>
|
||||||
</x-ui.card>
|
</x-ui.card>
|
||||||
|
|
||||||
<!-- Estadísticas (Sin template) -->
|
|
||||||
<div class="p-6 bg-gradient-to-br from-neutral-800 to-neutral-900 border border-neutral-700 rounded-xl flex flex-col justify-center items-center text-center">
|
|
||||||
<span class="text-4xl font-black text-white">85%</span>
|
|
||||||
<span class="text-xs uppercase tracking-widest text-gray-500 mt-1">Eficiencia Taller</span>
|
|
||||||
<div class="w-full bg-gray-700 rounded-full h-1.5 mt-4">
|
|
||||||
<div class="bg-neon-lime h-1.5 rounded-full" style="width: 85%"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Botón de Logout -->
|
<!-- Botón de Logout -->
|
||||||
|
|||||||
Reference in New Issue
Block a user