<?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('payroll_old_records', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('company_id', 50)->index();
            $table->string('dealer_id', 50)->index();
            $table->date('start_date');
            $table->date('end_date', 50);
            $table->string('emp_no', 50)->index();
            $table->string('name');
            $table->decimal('basic_pay', 12, 2)->default(0);
            $table->decimal('cola', 12, 2)->default(0);
            $table->decimal('ot', 12, 2)->default(0);
            $table->decimal('cdo', 12, 2)->default(0);
            $table->decimal('hol', 12, 2)->default(0);
            $table->decimal('n_diff', 12, 2)->default(0);
            $table->decimal('tardines', 12, 2)->default(0);
            $table->decimal('absent', 12, 2)->default(0);
            $table->decimal('pay_adj', 12, 2)->default(0);
            $table->decimal('benefit', 12, 2)->default(0);
            $table->decimal('deduc', 12, 2)->default(0);
            $table->decimal('loan', 12, 2)->default(0);
            $table->decimal('sss', 12, 2)->default(0);
            $table->decimal('p_ibig', 12, 2)->default(0);
            $table->decimal('p_health', 12, 2)->default(0);
            $table->decimal('w_tax', 12, 2)->default(0);
            $table->decimal('net_pay', 12, 2)->default(0);
            $table->decimal('tax', 12, 2)->default(0);
            $table->decimal('sss_p', 12, 2)->default(0);
            $table->decimal('p_ibig_p', 12, 2)->default(0);
            $table->decimal('p_health_p', 12, 2)->default(0);
            $table->decimal('final_net', 12, 2)->default(0);
            $table->timestamps();
        });
    }

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