HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/owlcrm/database/migrations/2024_06_06_042931_create_invoices_table.php
<?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('invoices', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('customer_id')->nullable();
            $table->unsignedInteger('lead_id');
            $table->unsignedInteger('proposal_id');
            $table->string('invoice_number');
            $table->timestamp('invoice_date');
            $table->timestamp('due_date');
            $table->string('tags')->nullable();
            $table->string('payment_modes')->nullable();
            $table->unsignedInteger('currency');
            $table->unsignedInteger('generated_by');
            $table->unsignedInteger('agent_id')->nullable();
            $table->unsignedTinyInteger('discount_type')->default(0);
            $table->float('discount')->default(0);
            $table->float('subtotal')->default(0);
            $table->float('total')->default(0);
            $table->float('adjustment_amount')->default(0);
            $table->text('client_note')->nullable();
            $table->text('terms_conditions')->nullable();
            $table->tinyInteger('is_draft')->default(0);
            $table->tinyInteger('status')->comment('paid/unpaid');
            $table->timestamps();
        });
    }

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