Merge branch 'bryam' of https://github.com/BryamE/ProyectoLauck into lucas
This commit is contained in:
@@ -10,8 +10,8 @@ class CatalogoController extends Controller
|
|||||||
|
|
||||||
public function catalogo()
|
public function catalogo()
|
||||||
{
|
{
|
||||||
$productos = Product::all();
|
$products = Product::all();
|
||||||
return view('catalogo', compact('productos'));
|
return view('catalogo', compact('products'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,28 +73,28 @@ class ProductosController extends Controller
|
|||||||
* Muestra el detalle de un producto.
|
* Muestra el detalle de un producto.
|
||||||
* Usamos Route Model Binding: Laravel busca el ID solo.
|
* Usamos Route Model Binding: Laravel busca el ID solo.
|
||||||
*/
|
*/
|
||||||
public function show(Product $producto)
|
public function show(Product $product)
|
||||||
{
|
{
|
||||||
return view('productos.show', compact('producto'));
|
return view('productos.show', compact('product'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Muestra el formulario de edición.
|
* Muestra el formulario de edición.
|
||||||
*/
|
*/
|
||||||
public function edit(Product $producto)
|
public function edit(Product $product)
|
||||||
{
|
{
|
||||||
return view('productos.edit', compact('producto'));
|
return view('productos.edit', compact('product'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Actualiza el producto existente.
|
* Actualiza el producto existente.
|
||||||
*/
|
*/
|
||||||
public function update(Request $request, Product $producto)
|
public function update(Request $request, Product $product)
|
||||||
{
|
{
|
||||||
$validated = $request->validate([
|
$validated = $request->validate([
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:255',
|
||||||
// Validamos que el SKU sea único PERO ignoramos el ID de este producto actual
|
// Validamos que el SKU sea único PERO ignoramos el ID de este producto actual
|
||||||
'sku' => ['nullable', 'string', Rule::unique('products')->ignore($producto->id)],
|
'sku' => ['nullable', 'string', Rule::unique('products')->ignore($product->id)],
|
||||||
'description' => 'nullable|string',
|
'description' => 'nullable|string',
|
||||||
'price' => 'required|numeric|min:0',
|
'price' => 'required|numeric|min:0',
|
||||||
'cost' => 'nullable|numeric|min:0',
|
'cost' => 'nullable|numeric|min:0',
|
||||||
@@ -104,7 +104,7 @@ class ProductosController extends Controller
|
|||||||
'serial_number' => 'nullable|string|max:100',
|
'serial_number' => 'nullable|string|max:100',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$producto->update($validated);
|
$product->update($validated);
|
||||||
|
|
||||||
return redirect()->route('productos.index')
|
return redirect()->route('productos.index')
|
||||||
->with('success', 'Producto actualizado exitosamente.');
|
->with('success', 'Producto actualizado exitosamente.');
|
||||||
@@ -113,9 +113,9 @@ class ProductosController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Elimina el producto.
|
* Elimina el producto.
|
||||||
*/
|
*/
|
||||||
public function destroy(Product $producto)
|
public function destroy(Product $product)
|
||||||
{
|
{
|
||||||
$producto->delete();
|
$product->delete();
|
||||||
return redirect()->route('productos.index')
|
return redirect()->route('productos.index')
|
||||||
->with('success', 'Producto eliminado.');
|
->with('success', 'Producto eliminado.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ class SaleController extends Controller
|
|||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
// Buscamos productos que tengan stock mayor a 0 para mostrar en el selector
|
// Buscamos productos que tengan stock mayor a 0 para mostrar en el selector
|
||||||
$products = Product::where('stock', '>', 0)->get();
|
$products = Product::where('stock_quantity', '>', 0)->get();
|
||||||
|
|
||||||
$clients = \App\Models\Client::orderBy('nombre')->get();
|
$clients = \App\Models\Client::orderBy('name')->get();
|
||||||
|
|
||||||
return view('sales.create', compact('products', 'clients'));
|
return view('sales.create', compact('products', 'clients'));
|
||||||
}
|
}
|
||||||
@@ -34,13 +34,13 @@ class SaleController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
DB::transaction(function () use ($request) {
|
DB::transaction(function () use ($request) {
|
||||||
$totalVenta = 0;
|
$totalSale = 0;
|
||||||
|
|
||||||
foreach ($request->items as $item) {
|
foreach ($request->items as $item) {
|
||||||
$product = Product::find($item['product_id']);
|
$product = Product::find($item['product_id']);
|
||||||
$totalVenta += $product->precio * $item['quantity'];
|
$totalSale += $product->precio * $item['quantity'];
|
||||||
|
|
||||||
if ($product->stock < $item['quantity']) {
|
if ($product->stock_quantity < $item['quantity']) {
|
||||||
throw new \Exception("No hay suficiente stock de " . $product->nombre);
|
throw new \Exception("No hay suficiente stock de " . $product->nombre);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ class SaleController extends Controller
|
|||||||
$sale = Sale::create([
|
$sale = Sale::create([
|
||||||
//'user_id' => auth()->id(), //empleado logueado
|
//'user_id' => auth()->id(), //empleado logueado
|
||||||
'client_id' => $request->client_id,
|
'client_id' => $request->client_id,
|
||||||
'total' => $totalVenta,
|
'total' => $totalSale,
|
||||||
'payment_method' => $request->payment_method,
|
'payment_method' => $request->payment_method,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@ class SaleController extends Controller
|
|||||||
SaleDetail::create([
|
SaleDetail::create([
|
||||||
'sale_id' => $sale->id,
|
'sale_id' => $sale->id,
|
||||||
'product_id' => $product->id,
|
'product_id' => $product->id,
|
||||||
'cantidad' => $item['quantity'],
|
'quantity' => $item['quantity'],
|
||||||
'precio' => $product->precio,
|
'price' => $product->price,
|
||||||
]);
|
]);
|
||||||
$nuevoStock = $product->stock - $item['quantity'];
|
$nuevoStock = $product->stock_quantity - $item['quantity'];
|
||||||
$product->stock = $nuevoStock;
|
$product->stock_quantity = $nuevoStock;
|
||||||
$product->save();
|
$product->save();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,13 +13,12 @@ class Product extends Model
|
|||||||
|
|
||||||
public function hasLowStock(): bool
|
public function hasLowStock(): bool
|
||||||
{
|
{
|
||||||
//cambiar
|
|
||||||
return $this->stock_quantity <= $this->min_stock_alert;
|
return $this->stock_quantity <= $this->min_stock_alert;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supplier()
|
public function supplier()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Suppliers::class);
|
return $this->belongsTo(Supplier::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Opción 1: Relación directa con los detalles (Renglones de ticket)
|
// Opción 1: Relación directa con los detalles (Renglones de ticket)
|
||||||
|
|||||||
@@ -6,11 +6,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class Supplier extends Model
|
class Supplier extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [ 'name', 'phone', 'email' ];
|
||||||
'nombre',
|
|
||||||
'telefono',
|
|
||||||
'email'
|
|
||||||
];
|
|
||||||
public function products()
|
public function products()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Product::class);
|
return $this->hasMany(Product::class);
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\View\Components;
|
|
||||||
|
|
||||||
use Closure;
|
|
||||||
use Illuminate\Contracts\View\View;
|
|
||||||
use Illuminate\View\Component;
|
|
||||||
|
|
||||||
class Alert2 extends Component
|
|
||||||
{
|
|
||||||
public $class;
|
|
||||||
//* Create a new component instance.
|
|
||||||
public function __construct($type = 'dark')
|
|
||||||
{
|
|
||||||
switch ($type) {
|
|
||||||
case 'info':
|
|
||||||
$class = 'text-blue-800 bg-blue-50 dark:text-blue-400';
|
|
||||||
break;
|
|
||||||
case 'danger':
|
|
||||||
$class = 'text-red-800 bg-red-50 dark:text-red-400';
|
|
||||||
break;
|
|
||||||
case 'success':
|
|
||||||
$class = 'text-green-800 bg-green-50 dark:text-green-400';
|
|
||||||
break;
|
|
||||||
case 'warning':
|
|
||||||
$class = 'text-yellow-800 bg-yellow-50 dark:text-yellow-300';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$class = 'text-gray-800 bg-gray-50 dark:text-gray-300';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->class = $class;
|
|
||||||
}
|
|
||||||
|
|
||||||
//* Get the view / contents that represent the component.
|
|
||||||
public function render(): View|Closure|string
|
|
||||||
{
|
|
||||||
return view('components.alert2');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,8 +13,8 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('suppliers', function (Blueprint $table) {
|
Schema::create('suppliers', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string('nombre');
|
$table->string('name');
|
||||||
$table->string('telefono');
|
$table->string('phone');
|
||||||
$table->string('email');
|
$table->string('email');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::create('clients', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->string('nombre');
|
|
||||||
$table->string('telefono');
|
|
||||||
$table->string('email');
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('clients');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -15,8 +15,8 @@ return new class extends Migration
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('sale_id')->constrained()->onDelete('cascade');
|
$table->foreignId('sale_id')->constrained()->onDelete('cascade');
|
||||||
$table->foreignId('product_id')->constrained();
|
$table->foreignId('product_id')->constrained();
|
||||||
$table->integer('cantidad');
|
$table->integer('quantity');
|
||||||
$table->decimal('precio', 10, 2);
|
$table->decimal('price', 10, 2);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::create('appointments', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->foreignId('client_id')->constrained();
|
|
||||||
$table->datetime('fecha_programada');
|
|
||||||
$table->string('modelo_bici')->nullable();
|
|
||||||
$table->string('descripcion')->nullable();
|
|
||||||
$table->string('estado')->default('pendiente');
|
|
||||||
$table->string('notas')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('appointments');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
<div class="max-w-6xl mx-auto px-4 py-8">
|
<div class="max-w-6xl mx-auto px-4 py-8">
|
||||||
<h1 class="text-center text-2xl font-bold mb-8">CATÁLOGO</h1>
|
<h1 class="text-center text-2xl font-bold mb-8">CATÁLOGO</h1>
|
||||||
|
|
||||||
@if ($productos->count() > 0)
|
@if ($products->count() > 0)
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
|
||||||
@foreach ($productos as $prod)
|
@foreach ($products as $prod)
|
||||||
<div class="p-4 border rounded-lg shadow-md bg-white hover:shadow-lg transition">
|
<div class="p-4 border rounded-lg shadow-md bg-white hover:shadow-lg transition">
|
||||||
{{-- Imagen si existe --}}
|
{{-- Imagen si existe --}}
|
||||||
@if (!empty($prod->imagen))
|
@if (!empty($prod->imagen))
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
<x-appc>
|
<x-appc>
|
||||||
<x-slot name="title">Lauck - Editar</x-slot>
|
<x-slot name="title">Lauck - Editar</x-slot>
|
||||||
<x-slot name="navTitle">Editar - {{$producto->nombre}}</x-slot>
|
<x-slot name="navTitle">Editar - {{$product->nombre}}</x-slot>
|
||||||
|
|
||||||
<div class="w-full h-fit flex flex-col justify-start items-center gap-3 p-18">
|
<div class="w-full h-fit flex flex-col justify-start items-center gap-3 p-18">
|
||||||
<form class="w-lg mx-auto" action="{{route('productos.update',$producto)}}" method="POST">
|
<form class="w-lg mx-auto" action="{{route('productos.update',$product)}}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="text" value="{{$producto->nombre}}" name="nombre" id="nombre" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="text" value="{{$product->nombre}}" name="nombre" id="nombre" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="nombre" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Titulo</label>
|
<label for="nombre" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Titulo</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="text" value="{{$producto->marca}}" name="marca" id="marca" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="text" value="{{$product->marca}}" name="marca" id="marca" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="marca" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Marca</label>
|
<label for="marca" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Marca</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="text" value="{{$producto->modelo}}" name="modelo" id="modelo" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="text" value="{{$product->modelo}}" name="modelo" id="modelo" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="modelo" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Modelo</label>
|
<label for="modelo" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Modelo</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<textarea type="text" name="descripcion" id="descripcion" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer">{{$producto->descripcion}}</textarea>
|
<textarea type="text" name="descripcion" id="descripcion" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer">{{$product->descripcion}}</textarea>
|
||||||
<label for="descripcion" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Descripcion</label>
|
<label for="descripcion" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Descripcion</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid md:grid-cols-2 md:gap-6">
|
<div class="grid md:grid-cols-2 md:gap-6">
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="number" value="{{$producto->rodado}}" name="rodado" id="rodado" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="number" value="{{$product->rodado}}" name="rodado" id="rodado" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="rodado" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Rodado</label>
|
<label for="rodado" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Rodado</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="text" value="{{$producto->color}}" name="color" id="color"class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="text" value="{{$product->color}}" name="color" id="color"class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="color" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Color</label>
|
<label for="color" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Color</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid md:grid-cols-2 md:gap-6">
|
<div class="grid md:grid-cols-2 md:gap-6">
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="text" value="{{$producto->tipo}}" name="tipo" id="tipo" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
<input type="text" value="{{$product->tipo}}" name="tipo" id="tipo" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer"/>
|
||||||
<label for="tipo" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Tipo</label>
|
<label for="tipo" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Tipo</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative z-0 w-full mb-5 group">
|
<div class="relative z-0 w-full mb-5 group">
|
||||||
<input type="number" value={{$producto->precio}} name="precio" id="precio" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" step="0.01"/>
|
<input type="number" value={{$product->precio}} name="precio" id="precio" class="block py-2.5 px-0 w-full text-sm text-gray-300 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" step="0.01"/>
|
||||||
<label for="precio" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Precio (Ej. $9999)</label>
|
<label for="precio" class="peer-focus:font-medium absolute text-sm text-gray-300 dark:text-gray-300 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6">Precio (Ej. $9999)</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<button type="submit" class="w-full sm:w-auto px-4 py-2 rounded-full text-white font-semibold bg-blue-700 hover:bg-blue-800 dark:bg-blue-700 dark:hover:bg-blue-800">
|
<button type="submit" class="w-full sm:w-auto px-4 py-2 rounded-full text-white font-semibold bg-blue-700 hover:bg-blue-800 dark:bg-blue-700 dark:hover:bg-blue-800">
|
||||||
Editar
|
Editar
|
||||||
</button>
|
</button>
|
||||||
<a href="{{route('productos.show',$producto)}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-stone-500">
|
<a href="{{route('productos.show',$product)}}" class="w-full sm:w-auto px-5 py-2 rounded-full text-white font-semibold bg-stone-500">
|
||||||
Volver
|
Volver
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -48,9 +48,3 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</x-layout>
|
</x-layout>
|
||||||
|
|
||||||
{{-- componente alerta --}}
|
|
||||||
{{-- <x-alert type="success">
|
|
||||||
<x-slot name="title">Jose!</x-slot>
|
|
||||||
<x-slot name="content">Lorem ipsum dolor sit amet consectetur adipisicing elit. Libero, vel omnis</x-slot>
|
|
||||||
</x-alert> --}}
|
|
||||||
@@ -1,131 +1,128 @@
|
|||||||
@extends('layouts.app')
|
<x-layout>
|
||||||
|
<div class="py-12 bg-gray-100 min-h-screen">
|
||||||
|
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||||
|
|
||||||
@section('title', 'Nueva Venta')
|
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
|
||||||
|
<div class="mb-6 border-b pb-2">
|
||||||
@section('main')
|
<h2 class="text-2xl font-bold text-gray-800">Nueva Venta en Mostrador</h2>
|
||||||
<div class="py-12 bg-gray-100 min-h-screen">
|
|
||||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
|
||||||
|
|
||||||
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg p-6">
|
|
||||||
<div class="mb-6 border-b pb-2">
|
|
||||||
<h2 class="text-2xl font-bold text-gray-800">Nueva Venta en Mostrador</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (session('success'))
|
|
||||||
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4">
|
|
||||||
<strong class="font-bold">¡Éxito!</strong> {{ session('success') }}
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
|
||||||
|
|
||||||
@if (session('error'))
|
@if (session('success'))
|
||||||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4">
|
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4">
|
||||||
<strong class="font-bold">Error:</strong> {{ session('error') }}
|
<strong class="font-bold">¡Éxito!</strong> {{ session('success') }}
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@if ($errors->any())
|
|
||||||
<div class="bg-red-50 text-red-600 p-4 mb-4 rounded border border-red-200">
|
|
||||||
<ul>
|
|
||||||
@foreach ($errors->all() as $error)
|
|
||||||
<li>• {{ $error }}</li>
|
|
||||||
@endforeach
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form action="{{ route('sales.store') }}" method="POST" id="sale-form">
|
|
||||||
@csrf
|
|
||||||
|
|
||||||
<div class="mb-6 bg-gray-50 p-4 rounded-lg border border-gray-200">
|
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Cliente</label>
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<select name="client_id" class="select2-enable w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border">
|
|
||||||
<option value="">-- Consumidor Final (Anónimo) --</option>
|
|
||||||
@foreach($clients as $client)
|
|
||||||
<option value="{{ $client->id }}">{{ $client->nombre }} ({{ $client->telefono }})</option>
|
|
||||||
@endforeach
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<a href="{{ route('clients.create') }}" target="_blank" class="bg-indigo-100 text-indigo-700 hover:bg-indigo-200 px-4 py-2 rounded-md font-bold flex items-center border border-indigo-200" title="Crear nuevo cliente">
|
|
||||||
+
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endif
|
||||||
|
|
||||||
<div id="items-container" class="space-y-4">
|
@if (session('error'))
|
||||||
<div class="item-row grid grid-cols-1 md:grid-cols-12 gap-4 items-end bg-gray-50 p-4 rounded-lg border border-gray-200">
|
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4">
|
||||||
<div class="md:col-span-6">
|
<strong class="font-bold">Error:</strong> {{ session('error') }}
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Producto</label>
|
</div>
|
||||||
<select name="items[0][product_id]" class="product-select select2-enable w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border" required onchange="calcularTotal()">
|
@endif
|
||||||
<option value="" data-price="0" selected disabled>Seleccione...</option>
|
|
||||||
@foreach($products as $product)
|
@if ($errors->any())
|
||||||
<option value="{{ $product->id }}" data-price="{{ $product->precio }}">
|
<div class="bg-red-50 text-red-600 p-4 mb-4 rounded border border-red-200">
|
||||||
{{ $product->codigo }} - {{ $product->nombre }} (${{ $product->precio }})
|
<ul>
|
||||||
</option>
|
@foreach ($errors->all() as $error)
|
||||||
|
<li>• {{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="{{ route('sales.store') }}" method="POST" id="sale-form">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="mb-6 bg-gray-50 p-4 rounded-lg border border-gray-200">
|
||||||
|
<label class="block text-sm font-medium text-gray-700 mb-1">Cliente</label>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<select name="client_id" class="select2-enable w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border">
|
||||||
|
<option value="">-- Consumidor Final (Anónimo) --</option>
|
||||||
|
@foreach($clients as $client)
|
||||||
|
<option value="{{ $client->id }}">{{ $client->name }} ({{ $client->phone }})</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<a href="{{ route('clients.create') }}" target="_blank" class="bg-indigo-100 text-indigo-700 hover:bg-indigo-200 px-4 py-2 rounded-md font-bold flex items-center border border-indigo-200" title="Crear nuevo cliente">
|
||||||
|
+
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="items-container" class="space-y-4">
|
||||||
|
<div class="item-row grid grid-cols-1 md:grid-cols-12 gap-4 items-end bg-gray-50 p-4 rounded-lg border border-gray-200">
|
||||||
|
<div class="md:col-span-6">
|
||||||
|
<label class="block text-sm font-medium text-gray-700 mb-1">Producto</label>
|
||||||
|
<select name="items[0][product_id]" class="product-select select2-enable w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border" required onchange="calcularTotal()">
|
||||||
|
<option value="" data-price="0" selected disabled>Seleccione...</option>
|
||||||
|
@foreach($products as $product)
|
||||||
|
<option value="{{ $product->id }}" data-price="{{ $product->price }}">
|
||||||
|
{{ $product->sku }} - {{ $product->name }} (${{ $product->price }})
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md:col-span-3">
|
||||||
|
<label class="block text-sm font-medium text-gray-700 mb-1">Cantidad</label>
|
||||||
|
<input type="number" name="items[0][quantity]" value="1" min="1" class="quantity-input w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border" required oninput="calcularTotal()">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md:col-span-2 text-right font-mono text-gray-600 self-center pt-6">
|
||||||
|
$<span class="row-subtotal">0.00</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="md:col-span-1 text-right">
|
||||||
|
<button type="button" class="text-gray-400 cursor-not-allowed" disabled>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 inline">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<button type="button" onclick="agregarFila()" class="flex items-center text-indigo-600 hover:text-indigo-800 font-semibold">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 mr-1">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
Agregar otro producto
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end mt-6 border-t pt-4">
|
||||||
|
<div class="text-2xl font-bold text-gray-800">
|
||||||
|
Total a Pagar: <span class="text-indigo-600">$<span id="total-display">0.00</span></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6 grid grid-cols-1 md:grid-cols-2 gap-6 items-center">
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700 mb-1">Método de Pago</label>
|
||||||
|
<select name="payment_method" class="w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border">
|
||||||
|
<option value="Efectivo">Efectivo</option>
|
||||||
|
<option value="Tarjeta de Débito">Tarjeta de Débito</option>
|
||||||
|
<option value="Tarjeta de Crédito">Tarjeta de Crédito</option>
|
||||||
|
<option value="Transferencia">Transferencia</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="md:col-span-3">
|
<div class="flex items-end gap-4 justify-end">
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Cantidad</label>
|
<a href="{{ route('sales.create') }}" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow">
|
||||||
<input type="number" name="items[0][quantity]" value="1" min="1" class="quantity-input w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border" required oninput="calcularTotal()">
|
Cancelar
|
||||||
</div>
|
</a>
|
||||||
|
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-6 rounded shadow-lg">
|
||||||
<div class="md:col-span-2 text-right font-mono text-gray-600 self-center pt-6">
|
Confirmar Venta
|
||||||
$<span class="row-subtotal">0.00</span>
|
</button>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="md:col-span-1 text-right">
|
|
||||||
<button type="button" class="text-gray-400 cursor-not-allowed" disabled>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 inline">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
</div>
|
||||||
<div class="mt-4">
|
|
||||||
<button type="button" onclick="agregarFila()" class="flex items-center text-indigo-600 hover:text-indigo-800 font-semibold">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 mr-1">
|
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
|
||||||
</svg>
|
|
||||||
Agregar otro producto
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex justify-end mt-6 border-t pt-4">
|
|
||||||
<div class="text-2xl font-bold text-gray-800">
|
|
||||||
Total a Pagar: <span class="text-indigo-600">$<span id="total-display">0.00</span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-6 grid grid-cols-1 md:grid-cols-2 gap-6 items-center">
|
|
||||||
<div>
|
|
||||||
<label class="block text-sm font-medium text-gray-700 mb-1">Método de Pago</label>
|
|
||||||
<select name="payment_method" class="w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2 px-3 border">
|
|
||||||
<option value="Efectivo">Efectivo</option>
|
|
||||||
<option value="Tarjeta de Débito">Tarjeta de Débito</option>
|
|
||||||
<option value="Tarjeta de Crédito">Tarjeta de Crédito</option>
|
|
||||||
<option value="Transferencia">Transferencia</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex items-end gap-4 justify-end">
|
|
||||||
<a href="{{ url('/') }}" class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow">
|
|
||||||
Cancelar
|
|
||||||
</a>
|
|
||||||
<button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-6 rounded shadow-lg">
|
|
||||||
Confirmar Venta
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</x-layout>
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
@@ -224,4 +221,3 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
@endsection
|
|
||||||
+5
-3
@@ -41,14 +41,16 @@ Route::post('register', RegisterController::class)->name('register.store');
|
|||||||
|
|
||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::resource('productos', ProductosController::class)->parameters([
|
Route::resource('productos', ProductosController::class)->parameters([
|
||||||
'productos' => 'producto'
|
'products' => 'product'
|
||||||
]);
|
]);
|
||||||
|
Route::resource('clients', ClientController::class);
|
||||||
|
Route::get('/checker', [ProductosController::class, 'checker'])->name('productos.checker');
|
||||||
Route::get('/productos/{id}', [ProductosController::class,'show'])->name('productos.show');
|
Route::get('/productos/{id}', [ProductosController::class,'show'])->name('productos.show');
|
||||||
Route::get('/productos/{id}/edit', [ProductosController::class,'edit'])->name('productos.edit');
|
Route::get('/productos/{id}/edit', [ProductosController::class,'edit'])->name('productos.edit');
|
||||||
Route::get('/checker', [ProductosController::class, 'checker'])->name('productos.checker');
|
|
||||||
//Route::get('/sales', [SaleController::class, 'index'])->name('sales.index');
|
//Route::get('/sales', [SaleController::class, 'index'])->name('sales.index');
|
||||||
Route::get('/sales/create', [SaleController::class, 'create'])->name('sales.create');
|
Route::get('/sales/create', [SaleController::class, 'create'])->name('sales.create');
|
||||||
Route::resource('clients', ClientController::class);
|
Route::get('/sales/store', [SaleController::class, 'store'])->name('sales.store');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user