<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateEmployeePayrollManagersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('employee_payroll_managers', function (Blueprint $table) {
            $table->id();
            $table->integer('month')->nullable();
            $table->integer('year')->nullable();
            $table->integer('u_id')->nullable();
            $table->double('basic_salary')->nullable();
            $table->double('total_allowance')->nullable();
            $table->double('non_taxable_deductions')->nullable();
            $table->double('gross_salary')->nullable();
            $table->double('taxable_salary')->nullable();
            $table->double('income_tax')->nullable();
            $table->double('total_reliefs')->nullable();
            $table->double('paye')->nullable();
            $table->double('taxable_deductions')->nullable();
            $table->double('advance_salary')->nullable();
            $table->double('net_salary')->nullable();
            $table->integer('created_by')->nullable();
            $table->boolean('approved')->default(0);
            $table->integer('approved_by')->nullable();
            $table->dateTime('approved_at')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('employee_payroll_managers');
    }
}
