- client and invoice scaffolding

This commit is contained in:
Peter Papp
2021-04-21 15:22:54 +02:00
parent aa585b60d5
commit 5a9583be5b
14 changed files with 648 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateInvoicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('invoices', function (Blueprint $table) {
$table->uuid('id')->primary()->index();
$table->uuid('user_id')->index();
$table->uuid('client_id')->index();
$table->enum('invoice_type', ['invoice', 'advance_invoice']);
$table->text('invoice_number')->nullable();
$table->text('variable_number')->nullable();
$table->longText('client');
$table->longText('user');
$table->longText('items');
$table->dateTime('delivery_at')->nullable();
$table->dateTime('due_at')->nullable();
$table->enum('discount_type', ['percent', 'value'])->nullable();
$table->integer('discount_rate')->nullable();
$table->text('currency');
$table->integer('total_discount')->nullable();
$table->integer('total_net')->nullable();
$table->integer('total_tax')->nullable();
$table->text('author_stamp')->nullable();
$table->text('author_name')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('invoices');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateClientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clients', function (Blueprint $table) {
$table->uuid('id')->primary()->index();
$table->uuid('user_id')->index();
$table->text('name');
$table->text('avatar')->nullable();
$table->text('email')->nullable();
$table->text('phone_number')->nullable();
$table->text('address')->nullable();
$table->text('city')->nullable();
$table->text('postal_code')->nullable();
$table->text('country')->nullable();
$table->text('ico')->nullable();
$table->text('dic')->nullable();
$table->text('ic_dph')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('clients');
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddBankDetailsToUserSettingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_settings', function (Blueprint $table) {
$table->text('registration_notes')->nullable();
$table->text('dic')->nullable();
$table->text('ic_dph')->nullable();
$table->text('bank_name')->nullable();
$table->text('iban')->nullable();
$table->text('swift')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('user_settings', function (Blueprint $table) {
$table->dropColumn(['bank_name','iban','swift']);
});
}
}