<?php
// Nowills SQC ERP — C4: currency on sales credit notes
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::table('sales_credit_notes', function (Blueprint $table) {
            $table->char('currency_code', 3)->default('GHS')->index();
            $table->decimal('exchange_rate', 14, 6)->default(1);
        });
    }
    public function down(): void {
        Schema::table('sales_credit_notes', function (Blueprint $table) { $table->dropColumn(['currency_code', 'exchange_rate']); });
    }
};
