dolibarr/htdocs/fourn/commande
Vincent Maury 9e6804de64
NEW add method confirmProduced in MOs API (#39324)
* FIX commande/stats: do not default "Created by" filter to current user (#39256)

The order statistics query is not filtered on the current user on first
page load, so the results shown are global. However the "Created by"
selector defaulted to the current user (select_dolusers auto-selects
$user->id when the passed value is empty), wrongly suggesting the
displayed figures were limited to that user.

Pass -1 instead of 0 when no user is selected so the combo keeps its
empty entry, matching the unfiltered query. The empty option posts -1,
which the query turns back into "no user filter", so the round-trip
stays consistent after a refresh.

* FIX Missing translation for "Weight"

* Fix/supplier doc keep project (#39306)

* FIX : situation invoice credit note wrong amount in progressive mode

When creating a credit note "with same lines" from a situation invoice,
the code always subtracts the previous situation invoice's line values
before inverting the sign, assuming lines are stored cumulative
(INVOICE_USE_SITUATION = 1, legacy mode).

In progressive mode (INVOICE_USE_SITUATION = 2), each situation invoice
line already stores its own delta amount and percent, so this extra
subtraction credits the wrong amount and percent (e.g. 60% / 1272
instead of the correct 20% / 424 on a real cycle).

Skip the subtraction in progressive mode so the credit note reuses the
source line's own delta values, as expected.

* FIX supplier order/proposal loses project after supplier selection

On the create form of a supplier order (fourn/commande/card.php) and a supplier
price request (supplier_proposal/card.php), the project select was filtered on
the supplier third party as soon as one was chosen: the `if ($socid > 0)` branch
took precedence over the PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS constant.

As a result, a supplier document created from a customer project lost its
preselected project when the page reloaded after picking the supplier (the
customer project is not linked to the supplier, so it was filtered out).

This aligns the behavior with the supplier invoice (fourn/facture/card.php),
which gives priority to PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS. The external
user restriction now targets $user->socid (the real external-user marker)
instead of $socid > 0, which also matched internal users after selecting a
supplier.

* Fix Standalone reception creation (#39299)

Fatal error: Uncaught Error: Call to a member function fetch_optionals() on null

* Fix missing include

* add method confirmProduced in MOs API

which was missing

---------

Co-authored-by: atm-corentin <165782689+atm-corentin@users.noreply.github.com>
Co-authored-by: Alexandre SPANGARO <alexandre.spangaro@gmail.com>
Co-authored-by: Alexandre SPANGARO <aspangaro.dolibarr@gmail.com>
Co-authored-by: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com>
Co-authored-by: sonikf <93765174+sonikf@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-30 18:22:44 +02:00
..
tpl NEW|New Add delivery date in supplier order linked object block (#38351) 2026-05-22 21:24:05 +02:00
card.php NEW add method confirmProduced in MOs API (#39324) 2026-07-30 18:22:44 +02:00
contact.php clean code (#38720) 2026-06-12 00:17:26 +02:00
dispatch.php clean code (#38720) 2026-06-12 00:17:26 +02:00
document.php clean code (#38720) 2026-06-12 00:17:26 +02:00
index.php Fix option to set max short list 2026-07-04 13:33:17 +02:00
info.php clean code (#38720) 2026-06-12 00:17:26 +02:00
list.php Qual: Fix 'SqlInjection' notices (#39216) 2026-07-23 19:06:39 +02:00
messaging.php clean code (#38720) 2026-06-12 00:17:26 +02:00
note.php clean code (#38720) 2026-06-12 00:17:26 +02:00