fix: duplikaty zamowien + status COD (is_cod flag)

- summaryView(): guard — redirect do istniejacego zamowienia gdy ORDER_SUBMIT_LAST_ORDER_ID w sesji
- basketSave(): try-catch wokol createFromBasket(), wyjatki logowane, koszyk zachowany
- OrderRepository: usunieto hardkodowane payment_id == 3, uzywana flaga is_cod
- PaymentMethodRepository: nowe pole is_cod w normalizacji, save() i forTransport() SQL
- ShopPaymentMethodController: switch "Platnosc przy odbiorze" w formularzu edycji
- migrations/0.338.sql: ALTER TABLE pp_shop_payment_methods ADD COLUMN is_cod

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jacek
2026-03-12 11:00:23 +01:00
parent 443940207f
commit a1b60c1f25
7 changed files with 55 additions and 4 deletions

View File

@@ -814,7 +814,7 @@ class OrderRepository
\Shared\Helpers\Helpers::send_email($settings['contact_email'], 'Nowe zamówienie / ' . $settings['firm_name'] . ' / ' . $order['number'] . ' - ' . $order['client_surname'] . ' ' . $order['client_name'], $mail_order);
// zmiana statusu w realizacji jeżeli płatność przy odbiorze
if ($payment_id == 3) {
if (!empty($payment_method['is_cod'])) {
$this->updateOrderStatus($order_id, 4);
$this->insertStatusHistory($order_id, 4, 1);
}