Skip to content

Commit

Permalink
Changes to files: database/migrations/2024_08_03_080116_create_bill_b…
Browse files Browse the repository at this point in the history
…ill_table.php

database/migrations/2024_08_03_080127_create_bill_item_table.php
database/migrations/2024_08_03_080133_create_bill_item_rate_table.php
database/migrations/2024_09_03_132429_add_deleted_at_to_bill_bill_table.php
database/migrations/2024_09_03_132436_add_deleted_at_to_bill_item_table.php
database/migrations/2024_09_03_132441_add_deleted_at_to_bill_item_rate_table.php
  • Loading branch information
dedanirungu committed Sep 27, 2024
1 parent b769639 commit 37d4fe4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up(): void

$table->string('title');
$table->char('bill_no', 100);
$table->foreignId('partner_id')->constrained('partner_partner')->onDelete('cascade')->index('bill_bill_partner_id');
$table->foreignId('partner_id')->nullable()->constrained('partner_partner')->onDelete('set null');
$table->date('due_date');
$table->string('module')->default('Account');
$table->string('model')->default('Invoice');
Expand All @@ -25,7 +25,12 @@ public function up(): void
$table->tinyInteger('is_posted')->default(0);
$table->decimal('total', 20, 2)->nullable();

$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');

$table->timestamps();
$table->softDeletes();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ public function up(): void
$table->id();

$table->string('title');
$table->foreignId('bill_id')->constrained('bill_bill')->onDelete('cascade')->index('bill_bill_bill_id');
$table->foreignId('ledger_id')->constrained('account_ledger')->onDelete('cascade')->index('bill_bill_ledger_id');
$table->foreignId('bill_id')->nullable()->constrained('bill_bill')->onDelete('set null');
$table->foreignId('ledger_id')->nullable()->constrained('account_ledger')->onDelete('set null');
$table->decimal('price', 20, 2)->default(0.00);
$table->decimal('amount', 20, 2)->default(0.00);
$table->string('module')->nullable();
$table->string('model')->nullable();
$table->bigInteger('item_id')->nullable();
$table->integer('quantity')->nullable();

$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');

$table->timestamps();
$table->softDeletes();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,20 @@ public function up(): void

$table->string('title');
$table->string('slug');
$table->foreignId('rate_id')->constrained('account_rate')->onDelete('cascade')->index('bill_item_rate_rate_id');
$table->foreignId('bill_item_id')->constrained('bill_item')->onDelete('cascade')->index('bill_item_rate_bill_item_id');
$table->foreignId('rate_id')->nullable()->constrained('account_rate')->onDelete('set null');
$table->foreignId('bill_item_id')->nullable()->constrained('bill_item')->onDelete('set null');
$table->enum('method', ['+', '+%', '-', '-%'])->default('+');
$table->decimal('value', 20, 2)->default(0.00);
$table->string('params')->nullable();
$table->tinyInteger('ordering')->nullable();
$table->tinyInteger('on_total')->default(false);

$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');

$table->timestamps();
$table->softDeletes();
});
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 37d4fe4

Please sign in to comment.