<?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::table('companies', function (Blueprint $table) {
            $table->text('description')->nullable();
            $table->string('vat_no')->nullable();
            $table->string('tax_no')->nullable();
            $table->string('tin_no')->nullable();
            $table->string('registration_no')->nullable();
            $table->string('esi_no')->nullable();
            $table->string('pancard_no')->nullable();
            $table->string('pf_no')->nullable();
            $table->decimal('pf_percent', 5, 2)->default(0.00);
            $table->decimal('epf_percent', 5, 2)->default(0.00);
            $table->decimal('ppf_percent', 5, 2)->default(0.00);
            $table->decimal('esi_percent', 5, 2)->default(0.00);
            for ($i = 1; $i <= 10; $i++) {
                $table->string("head{$i}")->nullable();
            }
            $table->string('deduction_head1')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('companies', function (Blueprint $table) {
            $table->dropColumn([
                'description', 'vat_no', 'tax_no', 'tin_no', 'registration_no',
                'esi_no', 'pancard_no', 'pf_no', 'pf_percent', 'epf_percent',
                'ppf_percent', 'esi_percent',
                'head1', 'head2', 'head3', 'head4', 'head5',
                'head6', 'head7', 'head8', 'head9', 'head10',
                'deduction_head1'
            ]);
        });
    }
};
