comm/action/index.php (agenda month/week/day view) fires the
printFieldListFrom hook right before the WHERE clause of the event query,
letting external modules add extra JOIN conditions to the agenda SQL
query. comm/action/peruser.php (agenda "per user" view) builds a
structurally identical query but never calls this hook - it only fires
printFieldListSelect, whose output lands before FROM and can't be used to
add a WHERE-equivalent join condition. printFieldListWhere isn't fired in
either file, so printFieldListFrom is the only hook point available
before WHERE.
This adds the same hook call already present in index.php, at the same
relative position (after the FROM/JOIN clauses, right before WHERE), so
modules can extend the agenda query the same way in both views.
Fixes#39506
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Qual(ci): Fix phan notices (typing)
* Qual: Fix deposit_percent type (escaping)
# Qual: Fix deposit_percent type (escaping)
deposit_percent is a float but was escaped to string resulting in argument mismatch.
Fixed by casting to float.
Follow-up to the 18.0 fix. On 21.0 and later, MoLine::fetchAll no longer
handles fk_mo/origin_id/origin_type as exact matches in the array-filter
path; every non-rowid key falls back to LIKE '%value%'. So the array
filter added for 18.0 turned into origin_id LIKE '%..%' here, which can
match an unrelated MO line and reintroduce the duplicate MO the fix was
meant to prevent.
Build the lookup with the universal-search string filter
(fk_mo:=:.. AND origin_id:=:.. AND origin_type:=:'bomline') so the class
turns it into exact equality, as requested during review of #39163.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
The asset disposal amount was read with GETPOSTINT, casting it to int
and dropping the decimals, so a disposal at 1500.50 was stored as 1500.
disposal_amount_ht is a 'price' field, so use GETPOSTFLOAT to keep the
decimal amount, both when storing it and when re-displaying it in the
disposal confirmation form.
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
On 23.0 the generic CommonObject methods (setPaymentMethods,
setBankAccount, ...) build the trigger name from
$this->TRIGGER_PREFIX, falling back to get_class() when it is empty.
Facture does not declare it, so it fires FACTURE_MODIFY instead of the
BILL_* events the class uses everywhere else (BILL_CREATE, BILL_MODIFY,
...). Modules listening on BILL_MODIFY miss those changes.
Declare public $TRIGGER_PREFIX = 'BILL', like the other objects do
(Holiday='HOLIDAY', Workstation='WORKSTATION', BOM='BOM').
Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
The origin multicurrency exchange rate was read with GETPOSTINT('originmulticurrency_tx'), which truncates any fractional rate (e.g. 0.83, 1.27) down to an integer. As a result, creating a Supplier Invoice from a Supplier Order (or other origin) always produced an exchange rate of 0 or 1 instead of the real rate, even when the multi-currency setting to keep the source object's original rate was enabled.
This was already fixed for one of the four occurrences in this file (the credit-note/replacement-invoice path) but the other three were never backported to this branch. This commit switches all three remaining occurrences from GETPOSTINT() to GETPOSTFLOAT(), matching develop/23.0.
Fixes#39423