* Fix: mass createbills success message showed draft PROV ref instead of final ref
Extended description (corps de la PR)
When creating an invoice from several orders at once via the order list
mass action ("Create invoice for this customer"), with the "Validate
generated invoices" option set to "yes", the success message and its link
displayed the temporary draft reference (PROVxxxx) instead of the final
validated invoice reference.
Root cause:
In htdocs/commande/list.php, during the confirm_createbills action, $lastref
is captured right after $objecttmp->create($user), at which point the invoice
is still a draft (PROVxxxx). When the "validate invoices" option is enabled,
each invoice is then validated through $objecttmp->validate($user), which
assigns the definitive reference to the object. However $lastref was never
refreshed afterwards, so the "BillXCreated" message (single-invoice case) kept
showing the draft ref.
Fix:
Refresh $lastref from the object inside the validation loop, after a successful
validate(), so the success message links to and displays the final reference.
Only the single-invoice success message exposes a reference, so this is the only
case affected; the multi-invoice message only shows a counter.
Steps to reproduce:
1. Go to the orders list.
2. Select several orders (or one), and choose the "Create invoice for this
customer" mass action.
3. Set "Validate generated invoices" to "Yes".
4. Confirm.
=> Before: the success message links to the draft ref PROVxxxx.
=> After: the success message links to the final validated invoice ref.
* Fix indent
* NEW : Add stats button on Propal list
* NEW : Add stats button on Task list
* NEW : Add stats button on Order list
* NEW : Add stats button on Contract list
* NEW : Add stats button on Supplier Order list
* NEW : Add stats button on Invoice list
* NEW : Add stats button on Supplier Invoice list
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
In the current implementation it checks only line by line against the stock. This can lead to not correct show of shippable orders icon as this can be incorrect due to multiple lines with the same product.
Example: Stock of product A is 2. There are two lines with this product A. In the previous implementation it will check the first line against the stock 2-2=0 -> ok and then the same result for the next line but this is not correct as it doesn't reflect previous lines.
* 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>
* 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>
The filter on the p.title of the command list doesn't work if you switch result pages. It's simply not kept in the next page url.
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Invoice List : add tag filter
* Invoice List : Add operator to invoice filter
* Add tag filter in order list
* Clean code
---------
Co-authored-by: atm-lena <lena.papazian@atm-consulting.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* NEW input reason for customer invoice
* Fix CI error
* Fix format fk_input_reason in array of fileds
* Add invoices in translate key of source dictionary