Index: app/Http/Controllers/DashboardController.php
===================================================================
--- app/Http/Controllers/DashboardController.php	(revision dc20c18d697fcd2cdddc4a6d9e61668a75c42cb0)
+++ app/Http/Controllers/DashboardController.php	(revision 99b0ca3cb6693d65d404ff94fba81fdfca07f8ee)
@@ -8,5 +8,4 @@
 use App\Models\Product;
 use App\Models\Producer;
-use App\Models\Invoice;
 use App\Models\Batch;
 use Illuminate\Support\Facades\DB;
@@ -41,15 +40,15 @@
             ]);
 
-        // New Reports from AdvancedReports
+        // Updated Reports - No Invoice model references
 
-        // 1. Top Buyers
+        // 1. Top Buyers - Calculate from orders and order_batches
         $topBuyers = Client::select(
             'clients.id',
             'clients.name as company_name',
             DB::raw('COUNT(orders.id) as total_orders'),
-            DB::raw('COALESCE(SUM(invoices.total_amount), 0) as total_spent')
+            DB::raw('COALESCE(SUM(order_batches.total_price), 0) as total_spent')
         )
             ->leftJoin('orders', 'clients.id', '=', 'orders.buyer_id')
-            ->leftJoin('invoices', 'orders.id', '=', 'invoices.order_id')
+            ->leftJoin('order_batches', 'orders.id', '=', 'order_batches.order_id')
             ->groupBy('clients.id', 'clients.name')
             ->orderBy('total_spent', 'DESC')
@@ -58,13 +57,13 @@
             ->get();
 
-        // 2. Pending Orders
+        // 2. Pending Orders - Calculate from orders and order_batches
         $pendingOrders = Client::select(
             'clients.id',
             'clients.name as company_name',
             DB::raw('COUNT(orders.id) as pending_orders'),
-            DB::raw('COALESCE(SUM(invoices.total_amount), 0) as total_pending_value')
+            DB::raw('COALESCE(SUM(order_batches.total_price), 0) as total_pending_value')
         )
             ->leftJoin('orders', 'clients.id', '=', 'orders.buyer_id')
-            ->leftJoin('invoices', 'orders.id', '=', 'invoices.order_id')
+            ->leftJoin('order_batches', 'orders.id', '=', 'order_batches.order_id')
             ->where('orders.status', 'pending')
             ->groupBy('clients.id', 'clients.name')
@@ -73,17 +72,17 @@
             ->get();
 
-        // 3. Orders by Country
+        // 3. Orders by Country - Calculate from orders and order_batches
         $ordersByCountry = Client::select(
             'clients.country',
             DB::raw('COUNT(orders.id) as total_orders'),
-            DB::raw('COALESCE(SUM(invoices.total_amount), 0) as total_revenue')
+            DB::raw('COALESCE(SUM(order_batches.total_price), 0) as total_revenue')
         )
             ->leftJoin('orders', 'clients.id', '=', 'orders.buyer_id')
-            ->leftJoin('invoices', 'orders.id', '=', 'invoices.order_id')
+            ->leftJoin('order_batches', 'orders.id', '=', 'order_batches.order_id')
             ->groupBy('clients.country')
             ->orderBy('total_revenue', 'DESC')
             ->get();
 
-        // 4. Best Selling Products (UPDATED - using order_batches)
+        // 4. Best Selling Products - using order_batches
         $bestSellingProducts = Product::select(
             'products.id',
@@ -103,15 +102,13 @@
             ->get();
 
-        // 5. Revenue by Producer (UPDATED - using order_batches)
+        // 5. Revenue by Producer - using order_batches
         $revenueByProducer = Producer::select(
             'producers.id',
             'producers.name as company_name',
-            DB::raw('COALESCE(SUM(DISTINCT invoices.total_amount), 0) as total_revenue')
+            DB::raw('COALESCE(SUM(order_batches.total_price), 0) as total_revenue')
         )
             ->join('products', 'producers.id', '=', 'products.producer_id')
             ->join('batches', 'products.id', '=', 'batches.product_id')
             ->join('order_batches', 'batches.id', '=', 'order_batches.batch_id')
-            ->join('orders', 'order_batches.order_id', '=', 'orders.id')
-            ->join('invoices', 'orders.id', '=', 'invoices.order_id')
             ->groupBy('producers.id', 'producers.name')
             ->orderBy('total_revenue', 'DESC')
@@ -119,9 +116,9 @@
             ->get();
 
-        // 6. Unpaid Invoices
-        $unpaidInvoices = Invoice::select(
-            'invoices.id as invoice_key',
-            'invoices.invoice_date',
-            'invoices.status as invoice_status',
+        // 6. Unpaid Orders (replaced Unpaid Invoices)
+        $unpaidOrders = Order::select(
+            'orders.id as order_key',
+            'orders.date as order_date',
+            'orders.status as order_status',
             'payments.due_date as payment_due_date',
             'payments.payment_status',
@@ -130,9 +127,10 @@
             'clients.billing_address'
         )
-            ->join('orders', 'invoices.order_id', '=', 'orders.id')
             ->join('clients', 'orders.buyer_id', '=', 'clients.id')
             ->leftJoin('payments', 'orders.id', '=', 'payments.order_id')
-            ->where('payments.payment_status', '!=', 'paid')
-            ->orWhereNull('payments.payment_status')
+            ->where(function($query) {
+                $query->where('payments.payment_status', '!=', 'paid')
+                    ->orWhereNull('payments.payment_status');
+            })
             ->orderBy('payments.due_date', 'DESC')
             ->limit(5)
@@ -150,5 +148,5 @@
             ->get();
 
-        // 8. Products with Poor Performance (FIXED - using orders.date instead of order_date)
+        // 8. Products with Poor Performance
         $poorPerformingProducts = Product::select(
             'products.id',
@@ -180,5 +178,5 @@
             'bestSellingProducts' => $bestSellingProducts,
             'revenueByProducer' => $revenueByProducer,
-            'unpaidInvoices' => $unpaidInvoices,
+            'unpaidOrders' => $unpaidOrders, // Changed from unpaidInvoices
             'paymentStatusOverview' => $paymentStatusOverview,
             'poorPerformingProducts' => $poorPerformingProducts,
Index: app/Http/Controllers/OrderController.php
===================================================================
--- app/Http/Controllers/OrderController.php	(revision dc20c18d697fcd2cdddc4a6d9e61668a75c42cb0)
+++ app/Http/Controllers/OrderController.php	(revision 99b0ca3cb6693d65d404ff94fba81fdfca07f8ee)
@@ -4,6 +4,4 @@
 
 use App\Models\Order;
-use App\Models\Invoice;
-use App\Models\PackingList;
 use App\Models\Payment;
 use App\Models\Client;
@@ -29,6 +27,4 @@
             'transport',
             'payment',
-            'invoice',
-            'packingList',
             'batches' => function($query) {
                 $query->with('product');
@@ -258,12 +254,4 @@
             });
 
-            // Create invoice
-            $invoice = Invoice::create([
-                'order_id' => $order->id,
-                'invoice_date' => now(),
-                'status' => 'draft',
-                'total_amount' => $totalAmount,
-            ]);
-
             // Create payment record if it doesn't exist
             if (!$order->payment) {
@@ -306,11 +294,4 @@
             }
 
-            // Create packing list
-            $packingList = PackingList::create([
-                'order_id' => $order->id,
-                'packing_list_date' => now(),
-                'status' => 'draft',
-            ]);
-
             DB::commit();
 
Index: resources/js/Pages/Dashboard.vue
===================================================================
--- resources/js/Pages/Dashboard.vue	(revision dc20c18d697fcd2cdddc4a6d9e61668a75c42cb0)
+++ resources/js/Pages/Dashboard.vue	(revision 99b0ca3cb6693d65d404ff94fba81fdfca07f8ee)
@@ -46,8 +46,8 @@
 }
 
-interface UnpaidInvoice {
-    invoice_key: string;
-    invoice_date: string;
-    invoice_status: string;
+interface UnpaidOrder {
+    order_key: string;
+    order_date: string;
+    order_status: string;
     payment_due_date: string;
     payment_status: string;
@@ -80,5 +80,5 @@
     bestSellingProducts: BestSellingProduct[];
     revenueByProducer: RevenueByProducer[];
-    unpaidInvoices: UnpaidInvoice[];
+    unpaidOrders: UnpaidOrder[]; // Changed from unpaidInvoices
     paymentStatusOverview: PaymentStatusOverview[];
     poorPerformingProducts: PoorPerformingProduct[];
@@ -107,6 +107,6 @@
 });
 
-const totalUnpaidInvoices = computed(() => {
-    return props.unpaidInvoices.length;
+const totalUnpaidOrders = computed(() => { // Changed from totalUnpaidInvoices
+    return props.unpaidOrders.length;
 });
 
@@ -199,6 +199,6 @@
                 >
                     <CardTitle class="text-sm font-medium">
-                        Unpaid Invoices
-                    </CardTitle>
+                        Unpaid Orders
+                    </CardTitle> <!-- Changed from Unpaid Invoices -->
                     <svg
                         xmlns="http://www.w3.org/2000/svg"
@@ -218,5 +218,5 @@
                 <CardContent>
                     <div class="text-2xl font-bold">
-                        {{ totalUnpaidInvoices }}
+                        {{ totalUnpaidOrders }} <!-- Changed from totalUnpaidInvoices -->
                     </div>
                     <p class="text-muted-foreground text-xs">
@@ -242,6 +242,6 @@
                         >
                             <span class="capitalize">{{
-                                status.payment_status
-                            }}</span>
+                                    status.payment_status
+                                }}</span>
                             <div class="text-right">
                                 <div class="font-medium">
@@ -272,6 +272,6 @@
                         >
                             <span class="font-medium">{{
-                                country.country || 'Unknown'
-                            }}</span>
+                                    country.country || 'Unknown'
+                                }}</span>
                             <div class="text-right">
                                 <div class="font-medium">
@@ -410,6 +410,6 @@
                     <CardTitle>Products Needing Attention</CardTitle>
                 </CardHeader>
-                <CardContent
-                    >n
+                <CardContent>
+                    <!-- Fixed: removed stray 'n' character -->
                     <div class="space-y-3">
                         <div
Index: routes/web.php
===================================================================
--- routes/web.php	(revision dc20c18d697fcd2cdddc4a6d9e61668a75c42cb0)
+++ routes/web.php	(revision 99b0ca3cb6693d65d404ff94fba81fdfca07f8ee)
@@ -36,8 +36,6 @@
     });
 
-    // Generic model routes (including orders)
-    Route::prefix('{model}')->where([
-        'model' => '^(?!users$).*$'
-    ])->group(function () {
+    Route::prefix('{model}')
+        ->group(function () {
         Route::get('/', [GenericModelController::class, 'index'])->name('generic.index');
         Route::post('/', [GenericModelController::class, 'store'])->name('generic.store');
