Generate the models and migrations for incoming invoices.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?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('suppliers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('registration_name')->nullable();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->string('zip')->nullable();
|
||||
$table->string('country_code')->default('DE')->nullable();
|
||||
$table->string('tax_fc')->nullable();
|
||||
$table->string('tax_vat')->nullable();
|
||||
$table->string('contact_name')->nullable();
|
||||
$table->string('contact_phone')->nullable();
|
||||
$table->string('contact_email')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('suppliers');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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('incomings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('supplier_id')->constrained();
|
||||
|
||||
$table->string('invoice_number');
|
||||
$table->date('issue_date');
|
||||
$table->date('due_date')->nullable();
|
||||
$table->string('invoice_type_code')->default('380');
|
||||
$table->string('currency_code')->default('EUR');
|
||||
$table->decimal('net');
|
||||
$table->decimal('gross');
|
||||
$table->decimal('tax');
|
||||
$table->date('pay_date')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('incomings');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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('incomingitems', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('incoming_id')->constrained();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('article_number')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->decimal('amount', 8, 2);
|
||||
$table->decimal('discount', 8, 2)->nullable();
|
||||
$table->decimal('tax', 8, 2);
|
||||
$table->decimal('price', 8, 2);
|
||||
$table->decimal('total', 8, 2);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('incomingitems');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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('incomingtaxes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->foreignId('incoming_id')->constrained();
|
||||
|
||||
$table->decimal('taxable_amount', 8, 2)->default(0);
|
||||
$table->decimal('amount', 8, 2)->default(0);
|
||||
$table->decimal('percentage', 8, 2)->default(0);
|
||||
$table->string('currency')->default('EUR');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('incomingtaxes');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user