argument('order'); $order = ShoppingOrder::with('shopping_order_items.product')->find($orderId); if (! $order) { $this->error("ShoppingOrder {$orderId} nicht gefunden."); return self::FAILURE; } try { $paths = (new InvoiceRepository($order))->makePreview(); } catch (\Throwable $e) { $this->error('Fehler bei der Vorschau-Erzeugung: '.$e->getMessage()); return self::FAILURE; } $this->info("Vorschau für Bestellung {$orderId} erzeugt (keine offizielle Rechnung, keine Nummer verbraucht):"); foreach ($paths as $type => $path) { $label = $type === 'invoice' ? 'Rechnung ' : 'Lieferschein'; $url = preg_replace('#(?url($path)); $this->line(" {$label}: ".$url); $this->line(" {$label} (Datei): ".Storage::disk('public')->path($path)); } $this->newLine(); $this->comment('Hinweis: Der Umsatzpunkte-Block entfällt in der Vorschau (kein Tracking).'); return self::SUCCESS; } }