Finalizacion de la primera version del proyecto
This commit is contained in:
@@ -11,7 +11,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('estado_ventas', function (Blueprint $table) {
|
||||
Schema::create('estado_movimientos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nombre');
|
||||
$table->timestamps();
|
||||
@@ -23,6 +23,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('estado_ventas');
|
||||
Schema::dropIfExists('estado_movimientos');
|
||||
}
|
||||
};
|
||||
@@ -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('movimientos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('codigo',20);
|
||||
$table->float('precio_venta',30)->nullable();
|
||||
$table->float('pago_efectivo',30)->nullable();
|
||||
$table->float('pago_tarjeta',30)->nullable();
|
||||
$table->float('pago_vales',30)->nullable();
|
||||
$table->float('pago_transferencia',30)->nullable();
|
||||
$table->unsignedBigInteger('estado_movimiento_id');
|
||||
$table->foreign('estado_movimiento_id')->on('estado_movimientos')->references('id');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('movimientos');
|
||||
}
|
||||
};
|
||||
@@ -1,38 +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('ventas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('codigo',20);
|
||||
$table->string('pago_efectivo',30)->nullable();
|
||||
$table->string('pago_tarjeta_debito',30)->nullable();
|
||||
$table->string('pago_tarjeta_credito',30)->nullable();
|
||||
$table->string('pago_vales',30)->nullable();
|
||||
|
||||
$table->string('precio_venta')->nullable();
|
||||
|
||||
$table->unsignedBigInteger('estado_venta_id');
|
||||
$table->foreign('estado_venta_id')->on('estado_ventas')->references('id');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('ventas');
|
||||
}
|
||||
};
|
||||
@@ -11,11 +11,12 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ventas', function (Blueprint $table) {
|
||||
Schema::table('movimientos', function (Blueprint $table) {
|
||||
//
|
||||
$table->unsignedBigInteger('user_id')->after('precio_venta');
|
||||
$table->unsignedBigInteger('user_id')->after('estado_movimiento_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->boolean('is_liquidado')->nullable();
|
||||
$table->string('motivo')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,7 +25,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ventas', function (Blueprint $table) {
|
||||
Schema::table('movimientos', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('estado_caja_movimientos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nombre');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('estado_caja_movimientos');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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('caja_movimientos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->float('cantidad');
|
||||
|
||||
$table->unsignedBigInteger('estado_caja_movimiento_id');
|
||||
$table->foreign('estado_caja_movimiento_id')->references('id')->on('estado_caja_movimientos');
|
||||
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('caja_movimientos');
|
||||
}
|
||||
};
|
||||
@@ -14,7 +14,8 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$this->call([
|
||||
EstadoVentaSeeder::class,
|
||||
EstadoMovimientoSeeder::class,
|
||||
EstadoCajaMovimientoSeeder::class,
|
||||
RoleSeeder::class,
|
||||
UserSeeder::class,
|
||||
]);
|
||||
|
||||
30
database/seeders/EstadoCajaMovimientoSeeder.php
Normal file
30
database/seeders/EstadoCajaMovimientoSeeder.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EstadoCajaMovimientoSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('estado_caja_movimientos')->insert([
|
||||
[
|
||||
'nombre' => 'Caja Inicial',
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now()
|
||||
],
|
||||
[
|
||||
'nombre' => 'Retiro',
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now()
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EstadoVentaSeeder extends Seeder
|
||||
class EstadoMovimientoSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
@@ -16,7 +16,7 @@ class EstadoVentaSeeder extends Seeder
|
||||
{
|
||||
//
|
||||
|
||||
DB::table('estado_ventas')->insert([
|
||||
DB::table('estado_movimientos')->insert([
|
||||
[
|
||||
'nombre' => 'Venta',
|
||||
'created_at' => Carbon::now(),
|
||||
Reference in New Issue
Block a user