NUEVO:
- Empezada nueva vista y modelo gastos.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user