<?php

use App\Http\Controllers\ProfileController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AccountingController;
use App\Http\Controllers\SupplierController;
use App\Http\Controllers\ExpenseController;
use App\Http\Controllers\BillController;
use App\Http\Controllers\CustomerController;
use App\Http\Controllers\InvoiceController;
use App\Http\Controllers\InvoicePaymentController;
use App\Http\Controllers\SalesReceiptController;
use App\Http\Controllers\CreditMemoController;
use App\Http\Controllers\ProductController;
use App\Http\Controllers\ReportController;
use App\Http\Controllers\TrialBalanceController;
use App\Http\Controllers\ProfitLossController;
use App\Http\Controllers\BalanceSheetController;
// PayrollController Controllers
use App\Http\Controllers\PayrollController;
// Leave Management Controller
use App\Http\Controllers\LeaveController;
use App\Http\Controllers\FinancialYearController;
use App\Http\Controllers\CurrencyController;
use App\Http\Controllers\CurrencyRateController;
use App\Http\Controllers\CompanyController;

Route::get('/', function () {
    return view('welcome');
});

Route::get('/dashboard', function () {
    return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');

Route::middleware('auth')->group(function () {
    
    Route::get('/company/profile', [CompanyController::class, 'show'])->name('company.profile');
    Route::put('/company/profile', [CompanyController::class, 'update'])->name('company.update');
    
    // Financial Year Management Routes
    Route::resource('financial-years', FinancialYearController::class);
    
    // Custom routes for the Close and Reopen logic
    Route::post('financial-years/{id}/close', [FinancialYearController::class, 'close'])->name('financial-years.close');
    Route::post('financial-years/{id}/reopen', [FinancialYearController::class, 'reopen'])->name('financial-years.reopen');
    
    // Add the specific "Show Close" GET route so the link in your table works
    Route::get('financial-years/{id}/close', [FinancialYearController::class, 'showClose'])->name('financial-years.show-close');
    
    Route::resource('currencies', CurrencyController::class);
    
    Route::get('currency-rates', [CurrencyRateController::class, 'index'])->name('currency-rates.index');
    Route::post('currency-rates/sync', [CurrencyRateController::class, 'sync'])->name('currency-rates.sync');
    
    
    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
    
    Route::prefix('accounting')->name('accounting.')->group(function () {

    // --- 1. Primary Categories ---
    Route::get('/categories', [AccountingController::class, 'categories'])->name('categories');
    Route::post('/categories', [AccountingController::class, 'storeCategory'])->name('categories.store');
    Route::put('/categories/{id}', [AccountingController::class, 'updateCategory'])->name('categories.update');
    Route::delete('/categories/{id}', [AccountingController::class, 'destroyCategory'])->name('categories.delete');

    // --- 2. Account Groups ---
    Route::get('/groups', [AccountingController::class, 'groups'])->name('groups');
    Route::post('/groups', [AccountingController::class, 'storeGroup'])->name('groups.store');
    Route::put('/groups/{id}', [AccountingController::class, 'updateGroup'])->name('groups.update');
    Route::delete('/groups/{id}', [AccountingController::class, 'destroyGroup'])->name('groups.delete');

    // --- 3. Account Types ---
    Route::get('/types', [AccountingController::class, 'types'])->name('types');
    Route::post('/types', [AccountingController::class, 'storeType'])->name('types.store');
    Route::put('/types/{id}', [AccountingController::class, 'updateType'])->name('types.update');
    Route::delete('/types/{id}', [AccountingController::class, 'destroyType'])->name('types.delete');

    // --- 4. Chart of Accounts (COA) ---
    Route::get('/chart-of-accounts', [AccountingController::class, 'coa'])->name('coa');
    Route::post('/accounts', [AccountingController::class, 'storeAccount'])->name('accounts.store');
    Route::put('/accounts/{id}', [AccountingController::class, 'updateAccount'])->name('accounts.update');
    Route::delete('/accounts/{id}', [AccountingController::class, 'destroyAccount'])->name('accounts.delete');
    
    // --- 7. Accounting Mappings ---
        // This provides the view for mapping system events to accounts
        Route::get('/mappings', [AccountingController::class, 'mappings'])->name('mappings');
        
        // This handles the saving of the mappings to the database
        Route::post('/mappings', [AccountingController::class, 'storeMappings'])->name('mappings.store');

    // --- 5. Transactions ---
    Route::get('/transactions', [AccountingController::class, 'transactions'])->name('transactions');
    Route::post('/transactions', [AccountingController::class, 'storeTransaction'])->name('transactions.store');
    Route::delete('/transactions/{id}', [AccountingController::class, 'destroyTransaction'])->name('transactions.delete');
    
    // make sure this is inside your accounting prefix/name group
    Route::get('/journals/template', [AccountingController::class, 'downloadJournalTemplate'])->name('transactions.template');

    // --- 6. Journal Entries ---
    // Note: The GET route takes the transaction ID to show specific lines
    Route::get('/transactions/{transaction_id}/journals', [AccountingController::class, 'journals'])->name('journals');
    Route::post('/journals', [AccountingController::class, 'storeJournalEntry'])->name('journals.store');
    Route::delete('/journals/{id}', [AccountingController::class, 'destroyJournalEntry'])->name('journals.delete');
    
    Route::post('/accounts/import', [AccountingController::class, 'importAccounts'])->name('accounts.import');
    Route::get('/accounts/template', [AccountingController::class, 'downloadTemplate'])->name('accounts.template');
    
    Route::post('/types/import', [AccountingController::class, 'importTypes'])->name('types.import');
    Route::get('/types/template', [AccountingController::class, 'downloadTypesTemplate'])->name('types.template');
    
    Route::post('/groups/import', [AccountingController::class, 'importGroups'])->name('groups.import');
    Route::get('/groups/template', [AccountingController::class, 'downloadGroupsTemplate'])->name('groups.template');
    
    Route::post('/categories/import', [AccountingController::class, 'importCategories'])->name('categories.import');
    Route::get('/categories/template', [AccountingController::class, 'downloadCategoriesTemplate'])->name('categories.template');
    
    // 5. Journal Entries (Transactions)
    Route::get('/journals', [AccountingController::class, 'transactions'])->name('transactions');
    Route::get('/journals/new', [AccountingController::class, 'createTransaction'])->name('transactions.create');
    Route::post('/journals', [AccountingController::class, 'storeTransaction'])->name('transactions.store');
    Route::get('/journals/{id}', [AccountingController::class, 'showTransaction'])->name('transactions.show');
    
    Route::post('/journals/{id}/reverse', [AccountingController::class, 'reverseTransaction'])->name('transactions.reverse');
    Route::get('/journals/{id}/reverse', [AccountingController::class, 'previewReversal'])->name('transactions.reverse.preview');
    
    Route::get('/journals/{id}/edit', [AccountingController::class, 'editTransaction'])->name('transactions.edit');
    Route::put('/journals/{id}', [AccountingController::class, 'updateTransaction'])->name('transactions.update');
    
    Route::delete('/journals/{id}', [AccountingController::class, 'destroyTransaction'])->name('transactions.destroy');
    
    Route::post('/journals/bulk-action', [AccountingController::class, 'bulkAction'])->name('transactions.bulk');
    
  

});

  // Supplier Management Routes
    Route::prefix('suppliers')->name('suppliers.')->group(function () {
        
        // 1. List View
        Route::get('/', [SupplierController::class, 'index'])->name('index');
        // 2. Create Views
        Route::get('/create', [SupplierController::class, 'create'])->name('create');
        Route::post('/', [SupplierController::class, 'store'])->name('store');
        // 3. Bulk Actions (Must be POST)
        Route::post('/bulk-action', [SupplierController::class, 'bulkAction'])->name('bulk');
        // 4. Supplier Statement (Ledger)
        Route::get('/{id}/statement', [SupplierController::class, 'showStatement'])->name('statement');
        // 5. Edit/Update Views
        Route::get('/{id}/edit', [SupplierController::class, 'edit'])->name('edit');
        Route::put('/{id}', [SupplierController::class, 'update'])->name('update');
        // 6. Delete (Soft Delete)
        Route::delete('/{id}', [SupplierController::class, 'destroy'])->name('destroy');
        // Expense Management Routes
       // Expense Management Routes
        // We add ->name('') to the prefix to prevent it from inheriting the 'suppliers.' prefix
        Route::prefix('expenses')->group(function () {
            
            Route::get('/', [ExpenseController::class, 'index'])->name('expenses.index');
            Route::get('/create', [ExpenseController::class, 'create'])->name('expenses.create');
            Route::post('/store', [ExpenseController::class, 'store'])->name('expenses.store');
            
            Route::get('/download-template', [ExpenseController::class, 'downloadTemplate'])->name('expenses.template');
            Route::post('/import', [ExpenseController::class, 'import'])->name('expenses.import');
            
            Route::get('/export', [ExpenseController::class, 'export'])->name('expenses.export');
            
            Route::get('/{id}', [ExpenseController::class, 'show'])->name('expenses.show');
            Route::get('/{id}/edit', [ExpenseController::class, 'edit'])->name('expenses.edit');
            Route::put('/{id}/update', [ExpenseController::class, 'update'])->name('expenses.update');
            Route::post('/{id}/reverse', [ExpenseController::class, 'reverse'])->name('expenses.reverse');
            // 1. Add this line for the Delete functionality
            Route::delete('/{id}', [ExpenseController::class, 'destroy'])->name('expenses.destroy');
            // Show the form
            Route::get('/{id}/reverse', [ExpenseController::class, 'reversalForm'])->name('expenses.reverse');
            // Process the form
            Route::post('/{id}/reverse', [ExpenseController::class, 'processReversal'])->name('expenses.reverse.store');
            
        });
        
        
        // Standard Resource Routes (Index, Create, Store, Show, Edit, Update, Destroy)
        Route::resource('bills', BillController::class);
        // Excel Utility Routes
        Route::get('suppliers/bills/export', [BillController::class, 'export'])->name('bills.export');
        Route::get('suppliers/bills/template', [BillController::class, 'downloadTemplate'])->name('bills.downloadTemplate');
        Route::post('suppliers/bills/import', [BillController::class, 'import'])->name('bills.import');
        
        
        
        // Payment History & Aging Analysis
        Route::get('suppliers/payment-history', [BillController::class, 'paymentHistory'])->name('billpayments.history');
        Route::get('suppliers/bills-aging', [BillController::class, 'agingAnalysis'])->name('bills.aging');
        Route::get('suppliers/bills/aging/download', [BillController::class, 'downloadAgingPdf'])->name('bills.aging.download');
        
        // Using the same BillController for Payments
        Route::get('suppliers/bill-payments', [BillController::class, 'paymentsIndex'])->name('billpayments.index');
        // Route for the specialized payment form
        Route::get('suppliers/bill-payments/{id}/pay', [BillController::class, 'pay'])->name('billpayments.pay');
        Route::post('suppliers/bill-payments/store', [BillController::class, 'storePayment'])->name('billpayments.store');
        // Posting Route (Convert Draft to Ledger Entry)
        Route::get('bills/{id}/post', [BillController::class, 'post'])->name('bills.post');
        // Reversal Routes (Separate View and Logic)
        // Route to show the reversal form
        Route::get('suppliers/bills/{id}/reverse', [BillController::class, 'reverse'])->name('bills.reverse');
        // Route to process the reversal data
        Route::post('suppliers/bills/{id}/reverse', [BillController::class, 'doReverse'])->name('bills.doReverse');
        
        Route::get('suppliers/bills/{id}/download', [BillController::class, 'downloadPdf'])->name('bills.download');
        
        Route::get('suppliers/bill-payments/{id}/reverse', [BillController::class, 'confirmReversal'])->name('billpayments.reverse_confirm');
        Route::post('suppliers/bill-payments/{id}/reverse', [BillController::class, 'storeReversal'])->name('billpayments.reverse_store');
       
        
        Route::get('suppliers/{id}/statement/download', [SupplierController::class, 'downloadStatement'])->name('statement.download');
        
        // This is the customers  routes 
        
        // --- 1. Customer Management ---
       
        
        
        
    });
    
    // Fixed Assets Module
   
    Route::prefix('assets')->name('assets.')->group(function () {
        
        // 1. Asset Register & Management
        Route::get('/', [App\Http\Controllers\FixedAssetController::class, 'index'])->name('index');
        Route::get('/create', [App\Http\Controllers\FixedAssetController::class, 'create'])->name('create');
        Route::post('/', [App\Http\Controllers\FixedAssetController::class, 'store'])->name('store');
        Route::get('/{id}', [App\Http\Controllers\FixedAssetController::class, 'show'])->name('show');
        
        // 2. Depreciation Engine
        // This is the POST route for the 'Run Monthly Depreciation' button
        Route::post('/depreciate', [App\Http\Controllers\FixedAssetController::class, 'runDepreciation'])->name('depreciate');

        // 3. Reporting
        // Asset Schedule shows Cost, Accumulated Dep, and Net Book Value (NBV)
        Route::get('/reports/schedule', [App\Http\Controllers\ReportController::class, 'assetSchedule'])->name('reports.schedule');
    });
    
    /*
|--------------------------------------------------------------------------
| Inventory & Warehouse Module (Zoho Style)
|--------------------------------------------------------------------------
*/
Route::prefix('inventory')->name('inventory.')->group(function () {
    
    // --- 1. Warehouses & Locations ---
    Route::prefix('warehouses')->name('warehouses.')->group(function () {
        Route::get('/', [App\Http\Controllers\WarehouseController::class, 'index'])->name('index');
        Route::get('/create', [App\Http\Controllers\WarehouseController::class, 'create'])->name('create');
        Route::post('/', [App\Http\Controllers\WarehouseController::class, 'store'])->name('store');
        Route::get('/{id}/edit', [App\Http\Controllers\WarehouseController::class, 'edit'])->name('edit');
        Route::put('/{id}', [App\Http\Controllers\WarehouseController::class, 'update'])->name('update');
        
        // ADD THIS LINE FOR THE DELETE BUTTON:
        Route::delete('/{id}', [App\Http\Controllers\WarehouseController::class, 'destroy'])->name('destroy');
    });

    // --- 2. Item Detail & Movement History (The Drill-down) ---
    // Note: This complements your existing products.index
    Route::get('/items/{id}', [App\Http\Controllers\InventoryController::class, 'show'])->name('show');

    // --- 3. Manual Adjustments (Damages/Loss) ---
    Route::get('/adjustments', [App\Http\Controllers\InventoryAdjustmentController::class, 'index'])->name('adjustments.index');
    Route::get('/adjustments/create', [App\Http\Controllers\InventoryAdjustmentController::class, 'create'])->name('adjustments.create');
    Route::post('/adjustments', [App\Http\Controllers\InventoryAdjustmentController::class, 'store'])->name('adjustments.store');

    // --- 4. Stock Transfers (Inter-Warehouse) ---
    Route::get('/transfers', [App\Http\Controllers\InventoryTransferController::class, 'index'])->name('transfers.index');
    Route::get('/transfers/create', [App\Http\Controllers\InventoryTransferController::class, 'create'])->name('transfers.create');
    Route::post('/transfers', [App\Http\Controllers\InventoryTransferController::class, 'store'])->name('transfers.store');

    // --- 5. Physical Stocktake (Counts) ---
    // --- 5. Physical Stocktake (Counts) ---
    Route::get('/stocktakes', [App\Http\Controllers\InventoryCountController::class, 'index'])->name('counts.index');
    Route::get('/stocktakes/create', [App\Http\Controllers\InventoryCountController::class, 'create'])->name('counts.create');

    // ADD THIS LINE: This is the route the form is looking for
    Route::post('/stocktakes', [App\Http\Controllers\InventoryCountController::class, 'store'])->name('counts.store');

    Route::get('/stocktakes/{id}', [App\Http\Controllers\InventoryCountController::class, 'show'])->name('counts.show');
    Route::post('/stocktakes/{id}/adjust', [App\Http\Controllers\InventoryCountController::class, 'adjust'])->name('counts.adjust');

    // --- 6. Inventory Reports ---
    Route::prefix('reports')->name('reports.')->group(function () {
        Route::get('/valuation', [App\Http\Controllers\ReportController::class, 'inventoryValuation'])->name('valuation');
        Route::get('/aging', [App\Http\Controllers\ReportController::class, 'inventoryAging'])->name('aging');
        Route::get('/low-stock', [App\Http\Controllers\ReportController::class, 'lowStockAlerts'])->name('low-stock');
    });
});
   
   // Customer management 
   /*
    |--------------------------------------------------------------------------
    | Sales & Accounts Receivable Module
    |--------------------------------------------------------------------------
    */
   /*
|--------------------------------------------------------------------------
| Sales & Accounts Receivable Module
|--------------------------------------------------------------------------
*/
Route::prefix('sales')->group(function () {

    // --- 1. Customer Management ---
    // Note: Manual routes must come BEFORE the resource to avoid ID conflicts
    Route::get('customers/export', [CustomerController::class, 'export'])->name('customers.export');
    Route::post('customers/import', [CustomerController::class, 'import'])->name('customers.import');
    // Products and Services
    Route::resource('products', ProductController::class);
    Route::get('customers/{id}/statement', [CustomerController::class, 'statement'])->name('customers.statement');
    Route::get('customers/{id}/delete', [CustomerController::class, 'delete'])->name('customers.delete');
    Route::resource('customers', CustomerController::class);

    // --- 2. Invoices (Accounts Receivable) ---
    Route::get('sales/invoices/aging-analysis', [InvoiceController::class, 'agingAnalysis'])->name('invoices.aging');
    Route::get('invoices/export', [InvoiceController::class, 'export'])->name('invoices.export');
    Route::post('invoices/{id}/post', [InvoiceController::class, 'post'])->name('invoices.post');
    Route::resource('invoices', InvoiceController::class);

    // --- 3. Invoice Payments (Clearing Debt) ---
    // This matches the {{ route('invoice.payments.history') }} in your sidebar
    Route::get('payments', [InvoicePaymentController::class, 'index'])->name('invoice.payments.history');
    Route::get('invoices/{invoice}/payments/create', [InvoicePaymentController::class, 'createPayment'])->name('invoice.payments.create');
    Route::post('invoices/{invoice}/payments', [InvoicePaymentController::class, 'storePayment'])->name('invoice.payments.store');

    // --- 4. Sales Receipts (Direct Cash Sales) ---
    Route::get('receipts/export', [SalesReceiptController::class, 'export'])->name('sales-receipts.export');
    Route::post('receipts/import', [SalesReceiptController::class, 'import'])->name('sales-receipts.import');
    
    // Add reverse routes BEFORE the resource to avoid conflicts
    Route::get('receipts/{id}/reverse', [SalesReceiptController::class, 'reverseForm'])->name('sales-receipts.reverse');
    Route::post('receipts/{id}/reverse', [SalesReceiptController::class, 'reverse'])->name('sales-receipts.reverse.store');
    Route::get('sales-receipts/{id}/history', [SalesReceiptController::class, 'history'])->name('sales-receipts.history');
    
    Route::resource('receipts', SalesReceiptController::class)->names([
        'index'   => 'sales-receipts.index',
        'create'  => 'sales-receipts.create',
        'store'   => 'sales-receipts.store',
        'show'    => 'sales-receipts.show',
        'edit'    => 'sales-receipts.edit',
        'update'  => 'sales-receipts.update',
        'destroy' => 'sales-receipts.destroy',
    ]);

    // --- 5. Credit Memos (Returns & Adjustments) ---
    // This matches the {{ route('credit-memos.index') }} in your sidebar
   
   // Credit Memo Routes (pointing to InvoiceController)
    // web.php
    Route::get('sales/credit-memos/create/{id}', [InvoiceController::class, 'createCreditMemo'])->name('credit-memos.create');
    Route::post('sales/credit-memos/store', [InvoiceController::class, 'storeCreditMemo'])->name('credit-memos.store');
    
    Route::get('sales/credit-memos', [CreditMemoController::class, 'index'])->name('credit-memos.index');
    Route::get('sales/credit-memos/{id}', [CreditMemoController::class, 'show'])->name('credit-memos.show');
    //Route::resource('credit-memos', CreditMemoController::class);
    Route::get('sales/invoices/{id}/history', [InvoiceController::class, 'history'])->name('invoices.history');
   
});

// Payroll Module Routes
// Payroll Module
// --- Payroll Module ---
Route::prefix('payroll')->name('payroll.')->group(function () {
    // Basic Navigation
    
    
    // Global Payroll Settings Console
  
    
    Route::get('/', [PayrollController::class, 'index'])->name('index');

    // Statutory Settings (The ones causing your current crash)
    Route::get('/paye', [PayrollController::class, 'payeIndex'])->name('paye.index');
    Route::post('/paye', [PayrollController::class, 'payeStore'])->name('paye.store');
    
    Route::get('/settings/console', [PayrollController::class, 'settingsIndex'])->name('settings.index');
    Route::post('/settings/toggle', [PayrollController::class, 'settingsToggle'])->name('settings.toggle');
    
    Route::get('/napsa', [PayrollController::class, 'nAPSAIndex'])->name('napsa.index');
    Route::post('/napsa', [PayrollController::class, 'nAPSAStore'])->name('napsa.store');
    
    Route::get('/nhima', [PayrollController::class, 'nHIMAIndex'])->name('nhima.index');
    Route::post('/nhima', [PayrollController::class, 'nHIMAStore'])->name('nhima.store');
    
    Route::get('/sdl', [PayrollController::class, 'sdlIndex'])->name('sdl.index');
    Route::post('/sdl', [PayrollController::class, 'sdlStore'])->name('sdl.store');

    // Employee Management
    Route::get('/employees', [PayrollController::class, 'employeesIndex'])->name('employees.index');
    Route::get('/employees/create', [PayrollController::class, 'employeesCreate'])->name('employees.create');
    Route::post('/employees', [PayrollController::class, 'employeesStore'])->name('employees.store');
    Route::get('/employees/template', [PayrollController::class, 'employeesTemplateDownload'])->name('employees.template.download');
    
    // --- Payroll Periods Management ---
    Route::prefix('periods')->name('periods.')->group(function () {
        Route::get('/', [PayrollController::class, 'periodsIndex'])->name('index');
        Route::post('/', [PayrollController::class, 'periodsStore'])->name('store');
        Route::get('/{id}/edit', [PayrollController::class, 'periodsEdit'])->name('edit');
        Route::put('/{id}', [PayrollController::class, 'periodsUpdate'])->name('update');
        Route::delete('/{id}', [PayrollController::class, 'periodsDestroy'])->name('destroy');
        
        // Special Actions from your view
        Route::post('/generate', [PayrollController::class, 'periodsGenerate'])->name('generate');
        Route::post('/{id}/close', [PayrollController::class, 'periodsClose'])->name('close');
        Route::post('/{id}/reopen', [PayrollController::class, 'periodsReopen'])->name('reopen');
    });

    // Preparation & Processing
    Route::get('/preparation/{periodId?}', [PayrollController::class, 'preliminarySummary'])->name('preparation.index');
    Route::get('/processing', [PayrollController::class, 'processingIndex'])->name('processing.index');
    
    // Payroll Runs
    Route::get('/runs', [PayrollController::class, 'runsIndex'])->name('runs.index');
    Route::get('/runs/{id}', [PayrollController::class, 'runsShow'])->name('runs.show');
});

// Financial Statements Group
// Financial Statements Group
Route::prefix('reports')->name('reports.')->group(function () {
    
    Route::get('/trial-balance', [TrialBalanceController::class, 'index'])
            ->name('trial-balance');
            
    // 2. Profit & Loss (The new route)
   Route::get('/profit-loss', [ProfitLossController::class, 'index'])
            ->name('profit-loss');  
            
     Route::get('/balance-sheet', [App\Http\Controllers\BalanceSheetController::class, 'index'])
    ->name('balance-sheet');       
    
    // 1. The Selector View
    Route::get('/financial-statements/create', [ReportController::class, 'createStatementSelector'])
        ->name('statements.create');

    // 2. THE REDIRECT ROUTE (Required by your Selector Form)
    Route::get('/financial-statements/edit-redirect', function(\Illuminate\Http\Request $request) {
        return redirect()->route('reports.statements.edit', [
            'year' => $request->year,
            'start' => $request->start_date,
            'end' => $request->end_date
        ]);
    })->name('statements.edit.redirect');
        
    // 3. The Editor View
    Route::get('/financial-statements/{year}/edit', [ReportController::class, 'editFinancialStatement'])
        ->name('statements.edit');

    // 4. The Store Route
    Route::post('/financial-statements/store', [ReportController::class, 'storeStatement'])
        ->name('statements.store');

    // 5. The Final Show View
    Route::get('/financial-statements/{year}/show', [ReportController::class, 'showFinancialStatement'])
        ->name('statements.show');
}); 
    

    
    
    
    
});




require __DIR__.'/auth.php';
