Commit graph

155976 commits

Author SHA1 Message Date
Laurent Destailleur
863138ef9f Merge branch '24.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-08-13 17:25:52 +02:00
Laurent Destailleur
d119dd688e Automated merge from 21.0 to 22.0 by tool pullmerge.sh 2026-08-13 17:18:40 +02:00
Laurent Destailleur
72a97f32ff Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 24.0 2026-08-13 17:16:49 +02:00
Laurent Destailleur
5316cb7632 Fix subtotal when detail of line disabled
(SUBTOTAL_HIDE_LINES_UNDER_TITLE)
2026-08-13 17:04:11 +02:00
Laurent Destailleur
8133095ae1 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2026-08-13 15:53:04 +02:00
Laurent Destailleur
61ef9d017a Automated merge from 20.0 to 21.0 by tool pullmerge.sh 2026-08-13 15:52:37 +02:00
w3houde
050a776b0e
Fix #39020 use universal-search filter for MoLine lookup on V21+ (#39489)
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>
2026-08-13 14:25:01 +02:00
Laurent Destailleur
4cea4f8c71 Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-08-13 14:23:57 +02:00
Laurent Destailleur
7ea87bb303 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-08-13 14:23:54 +02:00
w3houde
53085395c2
Fix #39494 keep decimals on asset disposal amount (#39495)
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>
2026-08-13 14:22:04 +02:00
w3houde
7a82187acd
Fix #39245 set TRIGGER_PREFIX to BILL on Facture (#39497)
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>
2026-08-13 14:21:43 +02:00
Laurent Destailleur
f437cd62b1 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-08-13 12:55:11 +02:00
Laurent Destailleur
3c48160915 Add migration to v25 2026-08-13 12:53:10 +02:00
Frédéric FRANCE
ba4d245f87
fix sanitize 2026-08-13 09:05:17 +02:00
dunds.com GmbH
47320fde96
FIX #39403: Fill extrafields of type boolean, select, radio, date, and html when selecting a product with the same extrafield (#39404)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 05:41:17 +02:00
Lenin Rivas
4143139956
UIUX: Currency is the same of origin (credit note) (#39420)
* Currency is the same of origin (credit note)

* Currency is the same of origin (credit note)

* Update card.php

* Update facture.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 04:23:13 +02:00
Jam Balaya
82bdf7a8ec
Qual: Fix phpstan notices on 24.0 (wrong case and always-false comparison) (#39487) 2026-08-13 04:17:26 +02:00
HENRY Florian
af6c24c0ce
fix: remove bug in last PR 39407 merged (JS allowoverconsumption not delcared) (#39414) 2026-08-13 04:00:48 +02:00
support-accellier
7e72304271
FIX #39425 Missing rollback when stock movement fails in Expedition::valid() (#39426)
* Fix missing rollback when stock movement fails in Expedition::valid()

When STOCK_CALCULATE_ON_SHIPMENT is enabled and manageStockMvtOnEvt() fails while validating a shipment, the method returned -2 directly without calling $this->db->rollback(), unlike every other error branch in this method. Changed to increment $error instead, so execution falls through to the existing commit/rollback block at the end of valid().

Fixes #39425

* Update expedition.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 03:59:28 +02:00
Laurent Destailleur
b9a31b4563 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-08-13 03:45:20 +02:00
Laurent Destailleur
7cdc14b185 Complete commit 85384fb523 2026-08-13 03:44:04 +02:00
Laurent Destailleur
30bb613228 Clean code 2026-08-13 03:31:51 +02:00
support-accellier
bfbc4db36d
Fix currency rate lost (comes as 1) when creating Supplier Invoice from Supplier Order (#39424)
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
2026-08-13 03:23:59 +02:00
Laurent Destailleur
be3fb14684 Prepare more generic definition of MCP server 2026-08-13 03:20:02 +02:00
Pichinov-Jose
00a93424c3
New: AI MCP create_product tool to create products/services (#39434)
Adds a create_product tool to ToolProducts so the assistant / MCP
clients can reference a brand-new article or service in the catalog
(e.g. before adding it to a supplier order or a reception). Creation
goes through the Product business class (triggers, numbering, rights).
Guarded by produit|service / creer. Fields: label (required), ref,
type, price, price_base_type, vat_rate, cost_price, barcode, description.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 03:08:28 +02:00
Maxime Kohlhaas
cc31d40638
Fix : thirdparty birth was emptied on country change (#39440) 2026-08-13 03:05:13 +02:00
Laurent Destailleur
5e0c01fb1f Update file 2026-08-13 02:59:53 +02:00
Jam Balaya
99f0e545fa
FIX: Remove always-true error checks in mysql dump export (backport of #39339 to 24.0) (#39444) 2026-08-13 02:51:25 +02:00
Jam Balaya
21104e9204
FIX: REST API POST /tasks/{id}/addtimespent always returns 500 (#39442)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 02:48:35 +02:00
Pierre Grasswill
9decbcf53e
Allow positive lines on a supplier credit note, like on the customer side (#39456)
FactureFournisseur::addline() and updateline() force -abs() on every line of a
credit note, unconditionally. Facture (customer side) has the same forcing but
it can be relaxed since #33434 / #38730 when both FACTURE_ENABLE_NEGATIVE_LINES
and INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN are enabled. The supplier side has
no equivalent, so a supplier credit note can never hold a positive line.

Real case: a supplier withholds a fixed handling fee on every credit note it
issues. The fee reduces the credit, so on the document it is a positive amount
among negative ones. Dolibarr flips it to negative, the credit note comes out
3 EUR too large, and the only way to match the supplier document is to edit the
database by hand.

Use the same gate as Facture::updateline() in both methods, so the two classes
behave the same and default installs are untouched: with either constant unset,
-abs() still applies exactly as today.

The "credit note for the remaining amount to pay" option relied on the forcing
to sign its line: it now passes the amount already negative, which is a no-op
while the forcing applies and keeps the line correct once it is relaxed.

Tested on 23.0.3 and 24.0.0-beta: with a constant missing the fee line is still
stored at -3, with both set it stays at +3 and update_price() recomputes the
invoice totals correctly.

Co-authored-by: daGrumpf <pierre.grasswill@mediactivegroup.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-13 02:47:43 +02:00
VIAL-GOUTEYRON Quentin
3ad376dc01
FIX Holiday shown one day off in agenda for users in another timezone (#39465)
Columns llx_holiday.date_debut and date_fin are pure DATE columns: they hold a
calendar fact, not an absolute instant, so they carry no time and no timezone.

The agenda read them with jdate() defaulting to 'tzserver', then projected them
back with dol_print_date(..., 'tzuserrel') to pick the calendar day box. The
resulting shift equals TZ_user - TZ_server, so any user whose timezone differs
from the server got leaves rendered on the wrong day. Users aligned with the
server saw nothing wrong, which is why this went unnoticed. It also triggers with
no user timezone set at all, since 'tzuserrel' falls back to UTC when
$_SESSION['dol_tz_string'] is empty, shifting leaves on any server east of UTC.

Read and project those dates in GMT instead. This follows the documented core
convention for dates without time ("We suppose dates without time are always gmt
(storage of course + output)", commonobject.class.php; "For date without hour,
date is always GMT for storage and output", extrafields.class.php) and honors the
$daykey contract of $eventarray, which must be midnight GMT of the displayed
calendar day. It also makes the half-day comparison consistent, since
dol_get_first_hour() is already called with 'gmt' a few lines below and only
supports gmt/tzserver anyway.

Two further defects disappear as a side effect: the loop condition
"while ($daykey <= $event->date_end_in_calendar)" compared a user-shifted $daykey
against a server-anchored $datef and rendered one extra day box, and halfday=-1
happened to be correct while halfday=0/1 were not, because the +12h offset
accidentally compensated the timezone shift.

Regular events are untouched: llx_actioncomm.datep is a DATETIME holding a real
instant, and its block still uses 'tzuserrel', so a 9am meeting stays correctly
shifted for a viewer in another timezone. Every other render path already
excludes type_code 'HOLIDAY', so there is no display change elsewhere.

peruser.php carries a copy of the same block and is fixed identically, otherwise
the two views of the same page would contradict each other.

Tested with a real browser (Playwright) against a server running in UTC, driving
the month view as Europe/Paris, America/Cayenne and Pacific/Auckland users on
three existing leaves: 3 failures before, none after, with identical day boxes in
every timezone. A single-day leave of 2026-07-28 was rendered on both 2026-07-27
and 2026-07-28 for the America/Cayenne user before the fix.
2026-08-13 02:45:02 +02:00
VIAL-GOUTEYRON Quentin
b35b9cdc3c
QUAL Add the CSP nonce on the drag and drop script tag (#39466)
The script tag emitted by dragAndDropFileUpload() was the only inline script of
the page without the nonce, so it was blocked by a Content Security Policy that
allows the inline scripts through it, and the drag and drop was then silently
inert on every card that enables it.

Same form as the ~25 other inline script tags of main.inc.php. getNonce() is
stable within a request, and the attribute is ignored by the browser when no
policy is defined.
2026-08-13 02:29:49 +02:00
Laurent Destailleur
4d5530d3d8 Debug v24 2026-08-13 02:16:24 +02:00
Laurent Destailleur
76f43ae9b1 Debug v24 2026-08-13 02:09:15 +02:00
Laurent Destailleur
c26483b012 Fix ci 2026-08-13 01:31:31 +02:00
Laurent Destailleur
26f33ecfaa Fix ci 2026-08-13 01:29:41 +02:00
Laurent Destailleur
defa8b2f2d Debug v24 2026-08-13 01:06:24 +02:00
Laurent Destailleur
491601af9b Typo 2026-08-13 00:32:09 +02:00
Laurent Destailleur
05b6b59853 css 2026-08-12 23:49:17 +02:00
w3houde
e7ab87886e
Fix #39395 remove duplicate fk_user_modif in chargesociales update (#39474)
ChargeSociales::update() set fk_user_modif twice in the same UPDATE
statement. PostgreSQL rejects this with "multiple assignments to the
same column", so editing a social contribution failed. Remove the
duplicate assignment. Backport of the develop fix #39389 to the 22.0
and 23.0 maintenance branches, where the duplicate is still present.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-08-12 23:37:36 +02:00
w3houde
79128945ff
Fix #39400 unaccent Hungarian double acute letters (#39476)
dol_string_unaccent() did not map the Hungarian letters o-double-acute
and u-double-acute (U+0150/U+0151/U+0170/U+0171), so they were left
untouched in sanitized filenames. Add the four missing entries so they
transliterate to O/o/U/u like the other accented variants.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-08-12 23:37:10 +02:00
HENRY Florian
a1bfd5d9fb
fix: module builder rebuild class mistype foreignkey so delete them (#39480)
* fix: module builder rebuild class mistype foreignkey so delete them

* fix: module builder rebuild class mistype foreignkey so delete them
2026-08-12 23:07:45 +02:00
lvessiller-opendsi
f8557c0ccd
FIX webportal shared documents controller page (#39485) 2026-08-12 23:04:50 +02:00
Laurent Destailleur
0620be0601 Fix can use a non template ODT file as template to read it - reported by
tremor hunter
2026-08-12 22:55:31 +02:00
Laurent Destailleur
15c9ca58dc Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-08-12 22:43:32 +02:00
Laurent Destailleur
736b11913d Debug v24 2026-08-12 22:40:57 +02:00
Laurent Destailleur
5028dae981 Fix file access with hasp parameter - reported by tremor hunter 2026-08-12 22:16:43 +02:00
Laurent Destailleur
6dbaef2fd4 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-08-12 22:13:16 +02:00
Laurent Destailleur
6c4cc72d72 Fix file access with hasp parameter - reported by tremor hunter 2026-08-12 22:10:23 +02:00
Laurent Destailleur
e9f6710db6 Prepare 24.0 release 2026-08-12 22:04:04 +02:00