You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1016 B
PHTML
39 lines
1016 B
PHTML
3 years ago
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreatePayrollsTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('payrolls', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->foreignId('employee_id')->constrained();
|
||
|
$table->date('date')->nullable();
|
||
|
$table->decimal('amount', 12, 2)->default(0);
|
||
|
$table->decimal('cuts', 12, 2)->default(0);
|
||
|
$table->decimal('bonus', 12, 2)->default(0);
|
||
|
$table->decimal('item_count', 12, 2)->default(0);
|
||
|
$table->decimal('recived', 12, 2)->default(0)->comment('amount + bonus - cuts');
|
||
|
$table->timestamps();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('payrolls');
|
||
|
}
|
||
|
}
|