<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('invoice_reports', function (Blueprint $table) {
            $table->id();
            $table->string('internal_id')->nullable();
            $table->foreignId('customer_id')->constrained();
            $table->date('date_start');
            $table->date('date_end');
            $table->boolean('with_unpaid')->default(false);
            $table->boolean('with_partially_paid')->default(false);
            $table->boolean('with_paid')->default(false);
            $table->boolean('with_void')->default(false);
            $table->float('subtotal', 2)->default(0);
            $table->float('pst', 2)->default(0);
            $table->float('gst', 2)->default(0);

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

    public function down(): void
    {
        Schema::dropIfExists('invoice_reports');
    }
};