This commit is contained in:
2026-04-07 20:32:43 +02:00
parent 1933c74395
commit 8fa9ca6439
45 changed files with 2974 additions and 3382 deletions

View File

@@ -340,7 +340,7 @@ final class OrdersController
$totalWithTax = $row['total_with_tax'] !== null ? number_format((float) $row['total_with_tax'], 2, '.', ' ') : '-';
$totalPaid = $row['total_paid'] !== null ? number_format((float) $row['total_paid'], 2, '.', ' ') : '-';
$paymentType = strtoupper(trim((string) ($row['external_payment_type_id'] ?? '')));
$isCod = $paymentType === 'CASH_ON_DELIVERY';
$isCod = StringHelper::isCodPayment($paymentType);
$paymentStatus = isset($row['payment_status']) ? (int) $row['payment_status'] : null;
$isUnpaid = !$isCod && $paymentStatus === 0;
$itemsCount = max(0, (int) ($row['items_count'] ?? 0));
@@ -661,7 +661,7 @@ final class OrdersController
$html .= '<div class="orders-product">'
. $thumb
. '<div class="orders-product__txt">'
. '<div class="orders-product__name">' . htmlspecialchars($name !== '' ? $name : '-', ENT_QUOTES, 'UTF-8') . '</div>'
. '<div class="orders-product__name"' . ($name !== '' ? ' title="' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '"' : '') . '>' . htmlspecialchars($name !== '' ? $name : '-', ENT_QUOTES, 'UTF-8') . '</div>'
. '<div class="orders-product__qty">' . htmlspecialchars($qty, ENT_QUOTES, 'UTF-8') . ' szt.</div>'
. '</div>'
. '</div>';
@@ -914,4 +914,17 @@ final class OrdersController
}
}
public function quickSearch(Request $request): Response
{
$query = trim((string) $request->input('q', ''));
if ($query === '' || mb_strlen($query) < 2) {
return Response::json(['results' => []]);
}
$limit = min((int) $request->input('limit', 10), 20);
$results = $this->orders->quickSearch($query, $limit);
return Response::json(['results' => $results]);
}
}