* This PR adds visual indicators on the Sales Order card (commande/card.php) to quickly identify if an order or its lines are shippable based on current stock levels. This feature mirrors the existing functionality found in the Orders List, bringing valuable logistics information directly into the Order Card context.
Key Features:
Global Shippable Status: Adds a "shippable" icon (Truck) next to the "Planned delivery date" field.
Logic: Checks if all products in the order are in stock.
Condition: Visible only if Stock and Shipment modules are enabled, a delivery date is set, and the order is validated.
Visual: Green icon if fully shippable, Red/Warning if stock is insufficient. Includes a detailed tooltip.
Per-Line Shippable Status: Adds a new "Shippable" column in the product lines table.
Logic: Compares real stock vs. remaining quantity to ship for each line.
Visual: Displays a green/red status bullet (standard Dolibarr status icons) directly in the line.
Implementation: Done by updating objectline_title.tpl.php and objectline_view.tpl.php with specific checks for the commande element.
New Configuration Option: Added a hidden option ORDER_DISABLE_SHIPPABLE_ICON_ON_CARD to disable this feature if needed (configurable in Home > Setup > Other Setup or via module settings).
Backend Optimization: Added a new method getShippableInfos() in commande.class.php to centralize the stock check logic (optimized with stock caching to avoid N+1 query issues).
Technical Details:
Modified Files:
commande/card.php: Integration of the global icon next to the date.
commande/class/commande.class.php: Added getShippableInfos() method.
core/tpl/objectline_title.tpl.php: Added "Shippable" column header (conditional for Orders).
core/tpl/objectline_view.tpl.php: Added "Shippable" column cell content (conditional for Orders).
Performance: Logic uses static caching for product stock to minimize database impact when rendering large orders.
* missed element
* img_picto
* phan add
* load_stock and global $i
* phan
* ci retour
* change icon
change phan directive
* phan
* Fight against optionflation
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
* Change condition for displaying shippable icon
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
* Change condition for displaying shippable status icon
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
* Update card.php
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
* Update shippable status condition in template
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
* Update shippable status condition logic
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
---------
Signed-off-by: Laurent Destailleur <eldy@destailleur.fr>
Co-authored-by: jpb <jean-pascal.boudet@atm-consulting>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
When adding a product line to a sales order in multicurrency mode, if the user
fills only the 'UP currency' (multicurrency_price_ht) and not the local unit
price, the line was saved with price 0. The form values for multicurrency
price were never applied to pu_ht_devise, and pu_ht was not derived from
pu_ht_devise using the order rate.
- Set pu_ht_devise from multicurrency_price_ht when user entered it
- When local price is empty/zero, derive pu_ht from pu_ht_devise / multicurrency_tx
(same convention as core/lib/price.lib.php calcul_price_total)
- Same for multicurrency_price_ttc -> pu_ttc_devise and pu_ttc
Made-with: Cursor
* FIX - Show POS in Order and Invoice list
* Update list.php
* Change $showpos value type from int to string
* Refactor POS fields visibility logic
---------
Co-authored-by: Anthony Berton <anthony.berton@bb2a.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
due to an mismatch of the used variable in hasDelay (status) and the setted variable (statut) the late orders where never shown in the start page as the count was always wrongly zero.
* FIX: Unecessary load of all order lines
* FIX: Unecessary load of all order lines
* FIX: Tabs indent instead of space
---------
Co-authored-by: Noé <noe@scopen.fr>
* fix: divided by zero with customer packaging
* fix: divided by zero with customer packaging
* fix: divided by zero with customer packaging
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>