{* Section: Rechnungen / Bestellungen *}

<div class="admin2000-form-section">
<div class="admin2000-form-section-title">Bestellungen / Rechnungen</div>

{if $orders}
<div class="admin2000-orders-table-wrapper">
	<table class="admin2000-table admin2000-orders-table">
		<thead>
			<tr>
				<th>Bestellnummer</th>
				<th>Bestelldatum</th>
				<th>Bezahlstatus</th>
				<th>Bestellwert</th>
				<th>Aktionen</th>
			</tr>
		</thead>
		<tbody>
			{foreach from=$orders item=order}
			<tr>
				<td>
					<strong>
						{$order.order_number|escape:'html'}
						{if $order.order_revision}-{$order.order_revision|escape:'html'}{/if}
					</strong>
				</td>
				<td>{$order.order_date|escape:'html'}</td>
				<td>
					<span class="admin2000-badge-status admin2000-badge-{$order.invoice_status_text|lower|replace:' ':'-'}">
						{$order.invoice_status_text|escape:'html'}
					</span>
				</td>
				<td>
					<strong>{$order.order_total|escape:'html'}</strong>
				</td>
				<td>
					<a href="./index.php?admin_modul=admin_order_editor&action=edit&id={$order.id}" class="admin2000-btn-small admin2000-btn-primary">
						Bearbeiten
					</a>
				</td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>

<div class="admin2000-orders-summary">
	<strong>Gesamt:</strong> {$orders|@count} Bestellung{if $orders|@count != 1}en{/if}
</div>

{else}
<div class="admin2000-empty-state">
	<p>Keine Bestellungen vorhanden</p>
	<small style="color: #6c757d;">Dieser Kunde hat noch keine Bestellungen aufgegeben.</small>
</div>
{/if}

</div>
