# VAT Settings + RFQ Per-Item Vatable Checkbox — Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Add a global VAT rate setting and per-item vatable checkboxes on the supplier RFQ portal, with live VAT breakdown in totals. **Architecture:** Global VAT rate stored in existing `settings` key/value table. Per-item `is_vatable` flag added to `supplier_quote_items`. RFQ portal view updated with checkbox column and three-row footer (subtotal / VAT / grand total). New `VatSettingController` + `settings/vat` page added under the Admin-only System sidebar section. **Tech Stack:** Laravel 12, PHP 8.2, SQLite, Blade, Alpine-free vanilla JS, Tailwind (inline styles per project convention) --- ### Task 1: Migration — add `is_vatable` to `supplier_quote_items` **Files:** - Modify: `database/migrations/2026_06_01_090734_add_is_vatable_to_supplier_quote_items.php` - Modify: `app/Models/SupplierQuoteItem.php` - [ ] **Step 1: Write the migration** Replace the generated migration body with: ```php boolean('is_vatable')->default(false)->after('total_price'); }); } public function down(): void { Schema::table('supplier_quote_items', function (Blueprint $table) { $table->dropColumn('is_vatable'); }); } }; ``` - [ ] **Step 2: Run migration** ```bash php artisan migrate ``` Expected: `Migrating: 2026_06_01_090734_add_is_vatable_to_supplier_quote_items` then `Migrated`. - [ ] **Step 3: Update SupplierQuoteItem model** In `app/Models/SupplierQuoteItem.php`, update `$fillable`: ```php protected $fillable = [ 'supplier_quote_id', 'description', 'unit', 'quantity', 'unit_price', 'total_price', 'is_vatable', ]; protected $casts = [ 'is_vatable' => 'boolean', ]; ``` - [ ] **Step 4: Commit** ```bash git add database/migrations/2026_06_01_090734_add_is_vatable_to_supplier_quote_items.php app/Models/SupplierQuoteItem.php git commit -m "feat: add is_vatable column to supplier_quote_items" ``` --- ### Task 2: VatSettingController + route + view **Files:** - Create: `app/Http/Controllers/Settings/VatSettingController.php` - Create: `resources/views/settings/vat.blade.php` - Modify: `routes/web.php` - [ ] **Step 1: Create VatSettingController** Create `app/Http/Controllers/Settings/VatSettingController.php`: ```php validate([ 'vat_rate' => ['required', 'numeric', 'min:0', 'max:100'], ]); Setting::set('vat_rate', (string) $validated['vat_rate']); return response()->json(['message' => 'VAT rate saved.', 'vat_rate' => $validated['vat_rate']]); } } ``` - [ ] **Step 2: Add routes** In `routes/web.php`, after the integrations routes (around line 148), add: ```php // VAT settings Route::get('settings/vat', [VatSettingController::class, 'index'])->name('settings.vat'); Route::post('settings/vat', [VatSettingController::class, 'update'])->name('settings.vat.update'); ``` Also add the import at the top of the file with the other Settings controllers: ```php use App\Http\Controllers\Settings\VatSettingController; ``` - [ ] **Step 3: Create the VAT settings view** Create `resources/views/settings/vat.blade.php`: ```blade @extends('layouts.app') @section('title', 'Settings — VAT') @section('content')
Set the global VAT rate applied to vatable items on supplier quotes.