- Empezada nueva vista y modelo gastos.
This commit is contained in:
Bryam105
2026-05-29 11:42:05 -03:00
parent 1f07d1b53f
commit 74a38420d8
13 changed files with 699 additions and 4 deletions
@@ -0,0 +1,36 @@
<?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('expenses', function (Blueprint $table) {
$table->id();
$table->foreignId('supplier_id')->nullable()->constrained('suppliers')->nullOnDelete();
$table->string('description');
$table->enum('expense_category', ['Mercadería', 'Servicios', 'Impuestos', 'Logística', 'Otros'])->default('Otros');
$table->enum('type', ['Compra', 'Pedido', 'Factura'])->default('Compra');
$table->enum('status', ['Pendiente', 'Pagado', 'Cancelado'])->default('Pendiente');
$table->decimal('total_amount', 10, 2)->default(0);
$table->string('document_number')->nullable();
$table->date('expense_date')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('expenses');
}
};