275 Commits

Author SHA1 Message Date
Valentin Lab
5947ee256a fix: allow merchandise articles to appear in category pages 2026-03-27 13:11:41 +01:00
Valentin Lab
493743307a new: add visibility badge for articles in offer form select 2026-03-16 16:44:48 +01:00
Valentin Lab
d8f95c667c new: add warning icon for tariffs without price list in offer form select 2026-03-16 16:41:17 +01:00
Valentin Lab
2563398df2 new: add colored status badges for tariffs in list and offer form select 2026-03-16 16:35:24 +01:00
Valentin Lab
63673117b3 fix: enforce stock limits on basket quantities
No stock validation existed in the ordering flow, allowing customers
to order more items than available.

Cap quantity to ``stock_current`` in ``Baskets::getBasketData()`` when
adding to cart. Add ``min=1`` and ``max=stock`` attributes on the
basket quantity input, with JS clamping in the change handler.
Verify stock again in ``Shop\OrderController::store()`` before saving
the order as a race-condition safeguard.
2026-02-20 13:05:31 +01:00
Valentin Lab
fa4aea7358 new: add colored status badges in order lists
Add ``getStatusBadge()`` to ``Orders`` returning Bootstrap badge HTML
per status: warning (En attente), info (Préparation), primary
(Expédié), success (Livré), danger (Annulé). Applied to all four
order DataTables (admin, admin customer, shop, shop customer).
2026-02-20 11:55:33 +01:00
Valentin Lab
5325fa1f06 new: send alert email when Paybox payment arrives on cancelled order
When a Paybox callback confirms payment on an order with status 4
(Annulé), the payment is still recorded but the order status is no
longer forced to « Préparation ». Instead, an alert email is sent to
``commande@jardinenvie.com`` warning that a refund is likely needed.

New ``AlertePaiementAnnule`` mailable with DB template providing order
ref, amount, customer info and payment reference. New method
``OrderMails::sendCancelledOrderPaymentAlert()`` handles the dispatch.
2026-02-20 11:52:03 +01:00
Valentin Lab
5c10645af7 new: restore and manage stock on order cancellation
Add ``restoreStock()``, ``decreaseStockForOrder()``, and
``checkStockForOrder()`` to ``OfferStocks``. When an order is cancelled
(status 4), stock is restored. When un-cancelling, stock availability is
checked first—insufficient stock blocks the transition with an error
message—then decremented.
2026-02-20 11:38:21 +01:00
Valentin Lab
e4540f9d88 fix: exclude cancelled orders from dashboard statistics
The ``scopeNotCancelled`` scope on ``Order`` filters out orders with
status 4 (Annulé). All ``OrderMetrics`` methods now chain
``notCancelled()`` so that dashboard counts and totals ignore cancelled
orders.
2026-02-20 11:38:06 +01:00
Valentin Lab
936c9473a7 new: send stock alert email when offer stock crosses threshold
When a purchase causes an offer's ``stock_current`` to drop to or below
its ``minimum_ondemand`` threshold, an email is sent to
``commande@jardinenvie.com`` using an editable mail template (Spatie
``MailTemplate``).

The check runs in ``OfferStocks::decreaseStock()`` after updating stock.
Only threshold-crossing events trigger the alert (not every low-stock
sale).  Failures are caught and logged to avoid disrupting the order
flow.
2026-02-13 07:13:56 +01:00
Valentin Lab
cbd8e33f3b new: add "Annulé" status for orders
Add ``'Annulé'`` at index 4 in ``Orders::statuses()``, allowing
administrators to mark orders as cancelled from the admin edit page.

This is a label-only change; side-effects (dashboard stats, stock
restoration, Paybox guard) are documented in ``admin.org`` for
client review.
2026-02-13 06:48:08 +01:00
Valentin Lab
cd5d72e272 fix: make drag-and-drop on category tree persist correctly
Two issues prevented the shelf tree reordering from working:

- The JS used ``onDragStop`` (only fires for drags outside the
  tree) instead of the ``tree.move`` event to send the AJAX
  request. Moved the POST into the ``tree.move`` handler.
- The ``inside`` case used ``appendNode`` (last child), but
  jqTree sends ``inside`` when dropping before the first child.
  Switched to ``prependNode`` so the node lands first.
- Added missing ``before`` case with ``insertBeforeNode``.
2026-02-13 06:46:12 +01:00
Valentin Lab
1bf920c123 fix: correct PDF invoice address separator and translate label
- Replace ``<br>`` with ``\n`` in ``InvoicePDF::makeAddress()`` so
  dompdf renders line breaks instead of showing raw HTML tags.
- Translate ``order number`` to ``Numéro de commande`` in the custom
  fields passed to the invoice builder.

The amount-in-words was already in English because the container
lacked French ICU data (``icu-data-full``); that was fixed at
runtime, not in code.
2026-02-09 08:53:38 +01:00
Valentin Lab
9c1f3dfed2 new: show payment-specific confirmation for check/wire orders
Display a tailored confirmation message when the customer pays by
check or wire transfer, including a warning about the 30-day
cancellation policy. The payment type is passed as a query parameter
so the message survives page reloads.

- Add ``getOrderConfirmedByCheckContent()`` and
  ``getOrderConfirmedByWireContent()`` to ``Contents`` repository
- Flash ``payment_type`` through redirect query parameter
- Add migration inserting content rows (id 10, 11)
- Update confirmed view with green checkmark and warning icon
2026-02-09 06:47:18 +01:00
Valentin Lab
e774113110 fix: prevent error 500 on search with no results
``getArticlesToSell()`` returned ``false`` when no articles matched,
causing ``collect(false)`` to produce ``[false]``. The view then
iterated over that single-element array and tried to access array
offsets on a boolean value.
2026-02-09 05:00:27 +01:00
Valentin Lab
66c035ef9a new: add `duplicate` button for articles 2025-12-14 21:25:42 +01:00
Valentin Lab
f92e175731 fix: prevent error 500 upon displaying empty 'Rayons' 2025-12-13 21:43:40 +01:00
Valentin Lab
ef1964d472 fix: prevent error 500 on article pages 2025-11-03 11:35:16 +01:00
Valentin Lab
8c29459489 new: make the debug info available to all backoffice users with helpful links 2025-11-03 11:23:58 +01:00
Valentin Lab
accb052f5c fix: repair price appearance on all articles 2025-11-03 11:23:24 +01:00
Valentin Lab
d5f095b5e5 fix: remove non-visible article from research results 2025-11-03 09:20:53 +01:00
Valentin Lab
858421a9eb fix: prevent broken link upon thumbnail in variety list when having uploaded a PNG file 2025-10-15 14:48:51 +02:00
Valentin Lab
b7e3eefed6 new: allow to delete seuil lines in price-list's pice modal 2025-10-15 13:17:54 +02:00
Valentin Lab
9ce62e82e5 fix: allow saving list-price's price seuil if seuil is unset or 0 2025-10-15 12:22:36 +02:00
Valentin Lab
1f02c932a0 fix: make varieties creation form avoid error 500 on save 2025-10-15 11:57:38 +02:00
Valentin Lab
a5b2196b32 fix: make the selected channel apply changes to product each time 2025-10-05 12:33:08 +02:00
Valentin Lab
cc8dfa29b4 fix: display only delivery types that have a price and auto-select first 2025-10-05 10:09:03 +02:00
Valentin Lab
8d130b9741 new: add channel management 2025-10-05 09:39:27 +02:00
Valentin Lab
e37cad6699 new: make the eye icon work to see an invoice in admin customer view 2025-10-04 15:37:28 +02:00
Valentin Lab
a3a86f4b2f new: keep cart when login in 2025-10-04 14:13:48 +02:00
Valentin Lab
11edccad02 fix: make invoices creation resistant to missing address if this still happens 2025-10-04 12:55:11 +02:00
Valentin Lab
f094411f10 new: add persistence of default address selection 2025-10-04 11:59:57 +02:00
Valentin Lab
ccc477f291 new: display the default address checkbox on profile load 2025-10-04 11:59:57 +02:00
Valentin Lab
a7ae946797 fix: prevent error 500 on profile edition 2025-10-04 10:51:41 +02:00
Valentin Lab
61e34b4f4e fix: finalize payments and clear cart after Paybox success
This captures the Paybox verification flow, duplicate-payment guard, and cart cleanup.
2025-10-04 09:17:53 +02:00
ludo
1cc6cc879e fix: fix 2025-04-21 10:57:31 +02:00
ludo
adbba79bd2 fixes 2025-03-18 13:06:02 +01:00
ludo
592402a6c1 fixes 2025-02-15 12:12:42 +01:00
ludo
2e71f17856 fix calculation on indirect articles by tags 2025-01-03 14:45:23 +01:00
ludo
df78126b12 refactor scopes 2025-01-03 14:09:22 +01:00
ludo
befaa40b48 fixes 2025-01-03 03:46:45 +01:00
ludo
b3fbfc38e7 fixes 2024-06-17 21:56:42 +02:00
ludo
ee60bac538 fixes on addresses 2024-04-29 22:01:45 +02:00
ludo
44bfe7d09c fix on tags 2024-03-11 19:02:57 +01:00
ludo
7b7295aed1 fixes 2024-03-03 22:52:00 +01:00
ludo
26ca3eb3ca Core classes removed by error 2024-03-03 14:53:54 +01:00
ludo
139aeb8074 fixes 2024-03-03 14:44:35 +01:00
ludo
cc411cba68 minor fixes 2024-02-23 08:35:41 +01:00
ludo
fb6da523fa cleaning day 2024-02-22 21:28:33 +01:00
ludo
64a218afc2 coding style 2024-02-22 19:35:51 +01:00