Commit graph

138827 commits

Author SHA1 Message Date
Laurent Destailleur
dc382c14aa Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-07-13 16:28:07 +02:00
Laurent Destailleur
febbfc8207 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-07-13 16:16:47 +02:00
ThomasNgr-OpenDSI
d41fd4193b
FIX Odt generation : create missing temp directory (#39105) 2026-07-10 17:18:43 +02:00
lvessiller-opendsi
c49e834885
Merge pull request #38901 from Dolicraft/fix/37661-product-import-price-base-type-mandatory
Fix #37661 require price_base_type on product CSV import
2026-07-09 10:12:46 +02:00
lvessiller-opendsi
7cb02d0214
FIX #38958 - Supplier payment : multi-currency code/rate not saved on payment-invoice link when caller does not fill multicurrency arrays (#38972) 2026-07-09 09:25:30 +02:00
lvessiller-opendsi
2ab9bbf877
FIX #38959 - Supplier payment : multi-currency code/rate not saved on auto-created discount when a DEPOSIT supplier invoice is fully paid (#38973)
* FIX #38959 - Supplier payment : multi-currency code/rate not saved on auto-created discount when a DEPOSIT supplier invoice is fully paid

* Move set of multicurrency_code like in PR #38966 merged
2026-07-09 09:24:34 +02:00
w3houde
8992ce8704
Fix #38949 enforce takepos editlines permission on all line actions (#38999)
* Fix #38949 enforce takepos editlines permission on all line actions

addline, freezone, addnote, deleteline, updateqty, updateprice, updatereduction
and update_reduction_global all mutated the invoice content but only updateqty,
updateprice and updatereduction had a server-side editlines check. A user with
only takepos.run could therefore add free-text lines, change prices, delete
lines and apply discounts before payment, bypassing the editlines permission
that was supposed to gate exactly those operations. Refuse the request at the
top of the action dispatcher when editlines is missing. The editlines right
is enabled by default at module activation so existing setups are unaffected.

The editorderedlines per-line check kept by updateqty/updateprice/updatereduction
still applies after this gate, so the special_code = 4 override path is not
broken.

Signed-off-by: Dolicraft <contact@dolicraft.com>

* Fix #38949 move editlines guard after hook and use hasRight

Signed-off-by: Dolicraft <contact@dolicraft.com>

* Fix #38949 limit editlines guard to line-edit actions only

Adding a line, free zone or note stays under the run permission as in the
current stable branch, so a cashier without editlines can still ring up
sales. The guard now enforces editlines only on delete/qty/price/discount
actions, which is exactly what the report targets.

Signed-off-by: Dolicraft <contact@dolicraft.com>

---------

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-07-09 09:23:22 +02:00
ThomasNgr-OpenDSI
64ab2f006b
Fix sql injection in sqlfilters API param - reported by sangkilp (#38794) (#39070)
Switch four list endpoints that still used the legacy DolibarrApi::_checkFilters
+ bare preg_replace_callback path to the hardened forgeSQLFromUniversalSearchCriteria()
already used by the rest of the same files. The legacy path only validated
parenthesis balance and concatenated non-matching text verbatim into the WHERE
clause, while the hardened path applies the dummy-criteria syntax check first.

Endpoints touched:
- htdocs/api/class/api_setup.class.php getListOfRegions
- htdocs/api/class/api_setup.class.php getListOfIncoterms
- htdocs/api/class/api_setup.class.php getListOfVAT
- htdocs/multicurrency/class/api_multicurrencies.class.php index

See #38768 for the report.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: w3houde <clement@pixodeo.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-07-09 09:20:16 +02:00
lvessiller-opendsi
96f5970729
Merge pull request #39077 from Dolicraft/fix/39063-user-note-idor-self-write
Fix #39063 enforce user write right on other users notes
2026-07-09 09:17:32 +02:00
Dolicraft
32d74594be Fix #39063 enforce user write right on other users notes
The note editor set $permissionnote from user->self->write only, so a user
holding user->user->read plus user->self->write (but not user->user->write)
could edit the public/private notes of any user, admins included: the
setnote actions are not in restrictedArea's write-check list, so
$permissionnote was the only remaining guard. It now requires user->user->write
to edit another user's notes, matching caneditfield in user/card.php.

Reported by Abderrahmane Aksoum.

Signed-off-by: Dolicraft <contact@dolicraft.com>
2026-07-07 23:19:58 +07:00
w3houde
20b4edcf33
Fix #32407 translate prospection status libelle in dictionaries (#38923)
The dict.php renderer translated 'label' for some tables (c_units, c_product_nature,
c_productbatch_qcstatus) but left the 'libelle' column of c_stcomm and
c_stcommcontact as the raw English seed text. Map the row to its StatusProspect{id}
translation key when present so the French (or any other locale) shows the
expected label instead of 'Do not contact' / 'Never contacted' etc.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-07-02 09:56:59 +02:00
lvessiller-opendsi
155a84d980
FIX #38957 - Supplier invoice : Multi-currency code/rate and amount not saved when converting EXCESS PAID, CREDIT_NOTE or DEPOSIT to discount (#38971)
* FIX #38957 - Supplier invoice :  Multi-currency code/rate and amount not saved when converting EXCESS PAID, CREDIT_NOTE or DEPOSIT to discount

* Add author
2026-07-02 09:53:10 +02:00
w3houde
9425b899f2
Fix #36238 keep supplier filter when sorting product list (#38915)
print_liste_field_titre signature is (name, file, field, begin, moreparam, ...)
but the seven calls in fourn/product/list.php passed $param at position 4
(begin) instead of 5 (moreparam), so the URL was rebuilt without the
fourn_id filter and the list reset when the user clicked a column header.
Swap to the correct slot, matching the fix already in the 22.0 line.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-27 18:57:06 +02:00
w3houde
60db2cbfe4
Fix #34720 do not crash on duplicate bank_url link for same target (#38916)
* Fix #36238 keep supplier filter when sorting product list

print_liste_field_titre signature is (name, file, field, begin, moreparam, ...)
but the seven calls in fourn/product/list.php passed $param at position 4
(begin) instead of 5 (moreparam), so the URL was rebuilt without the
fourn_id filter and the list reset when the user clicked a column header.
Swap to the correct slot, matching the fix already in the 22.0 line.

Signed-off-by: Dolicraft <contact@dolicraft.com>

* Fix #34720 do not crash on duplicate bank_url link for same target

llx_bank_url has a UNIQUE key on (fk_bank, url_id, type) so dispatching two
distinct credit transfers for the same employee on the same bank line raised a
Duplicate entry crash that left the operation in an unfinished state. Pre-check
the row and reuse the existing rowid silently, keeping the historical link
without breaking the calling transaction.

Signed-off-by: Dolicraft <contact@dolicraft.com>

---------

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-27 18:28:39 +02:00
w3houde
429d3354e2
Fix #31471 translate CostPrice and PriceBaseType on import field list (#38922)
import.php loadLangs only loaded exports/compta/errors, so labels coming from
modProduct / modService import_fields_array that resolve to keys in
products.lang (PriceBaseType) and margins.lang (CostPrice) stayed in English
on a French install. Add 'products' and 'margins' to the loaded set so the
import field picker shows the translated label everywhere else the user sees
the product card.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-27 18:24:32 +02:00
ThomasNgr-OpenDSI
b726e3b853
SEC: Sanitize SQL query parameters (#38942) (#38955)
Sanitize SQL query parameters.
Replace urlencode with explicit type casting to int for fk_statut and signed_status parameters.

Co-authored-by: MDW <mdeweerd@users.noreply.github.com>
2026-06-23 20:45:50 +02:00
Laurent Destailleur
998967c93a Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-06-22 13:22:21 +02:00
Laurent Destailleur
50151e3ad3 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2026-06-22 13:04:36 +02:00
Laurent Destailleur
d713e62c26 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2026-06-22 13:04:11 +02:00
Laurent Destailleur
9f6306bfeb Fix whitespace 2026-06-22 12:18:56 +02:00
atm-jonathan
058c2341ce
FIX : fix duplicate contact names in messaging timeline (#38855)
Cache key was using legacy fk_contact field instead of the current
contact id ($cid), causing all contacts after the first to resolve
to the same cached entry in show_actions_messaging().
2026-06-22 03:46:41 +02:00
Dolicraft
b2927a68e0 Fix #37661 require price_base_type on product CSV import
The import_fields_array entry for p.price_base_type accepted a missing/empty
value because the CSV importer skips the regex check when newval is empty
(import_csv.modules.php:682). Marking the field as mandatory with the trailing
star forces the user to map a column and provide HT or TTC, so the row no
longer ends up with an empty/NULL value that breaks price displays.

Signed-off-by: Dolicraft <contact@dolicraft.com>
2026-06-19 09:42:53 +02:00
Eric - CAP-REL
d500b8ca62
fix adherent table name (#38872)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-19 04:00:36 +02:00
Laurent Destailleur
f553ff53af Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-06-19 03:34:30 +02:00
Laurent Destailleur
d7e92bcd50 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-06-19 03:34:19 +02:00
Laurent Destailleur
594129161d Automated merge from 17.0 to 18.0 by tool pullmerge.sh 2026-06-19 03:34:05 +02:00
Laurent Destailleur
50ceefb2a4 Automated merge from 16.0 to 17.0 by tool pullmerge.sh 2026-06-19 03:28:40 +02:00
Laurent Destailleur
6993c665bf Automated merge from 15.0 to 16.0 by tool pullmerge.sh 2026-06-19 03:28:31 +02:00
Laurent Destailleur
4b22126e44 Automated merge from 14.0 to 15.0 by tool pullmerge.sh 2026-06-19 03:28:24 +02:00
Laurent Destailleur
c72af785c9 Fix ci 2026-06-19 03:22:18 +02:00
Eric - CAP-REL
1b4ece48e2
fix adherent table name (#38871) 2026-06-19 03:19:40 +02:00
Pichinov-Jose
2653b1707a
FIX Multicurrency amount columns were hidden on discount screens (wrong module test) (#38825)
On the third party discount tabs (htdocs/comm/remx.php), the multicurrency amount columns
(MulticurrencyAmountHT / MulticurrencyAmountTTC) and their colspan adjustments were guarded by
isModEnabled('multicompany') instead of isModEnabled('multicurrency'). As a result the foreign
currency amounts of available and consumed discounts/down payments were never shown when the
Multicurrency module is enabled (and the Multi-company module disabled).

The wrong test was introduced in commit 3bb1a2387b (2022, 'FIX php8 compatibility') which converted
!empty($conf->multicurrency->enabled) into isModEnabled('multicompany'). Restore the correct module
test. Present from v17 to develop; fixed here on the oldest maintained LTS branch (18.0).
2026-06-18 09:55:17 +02:00
lvessiller-opendsi
89d1696d61
Merge pull request #38830 from rycks/18.0_fix_adherent_migration
FIX: very old llx_adherent migration bug from 3.6-3.7
2026-06-18 09:45:23 +02:00
lvessiller-opendsi
50d61ed31c
Merge pull request #38833 from rycks/18.0_fix_stock_entrepot_table_name
name llx_product_stock_entrepot is now llx_product_warehouse_properties
2026-06-18 09:42:50 +02:00
Eric Seigne
1145c38080 fix table name thanks to lionel review 2026-06-18 09:29:12 +02:00
Eric Seigne
7338f2916b missing llx prefix 2026-06-18 09:22:21 +02:00
ThomasNgr-OpenDSI
4978cccc3b
Fix #38781 allow editing dictionary entries with rowid = 0 (ST_NEVER) (#38841) 2026-06-18 09:19:59 +02:00
ThomasNgr-OpenDSI
5556626a92
Fix #38781 allow editing dictionary entries with rowid = 0 (ST_NEVER) (#38842) 2026-06-16 02:08:22 +02:00
Eric Seigne
a2623d8fc5 name llx_product_stock_entrepot is now llx_product_warehouse_properties 2026-06-15 11:38:22 +02:00
Eric Seigne
b302dfea2e fix very old llx_adherent migration bug from 3.6-3.7 2026-06-15 11:25:24 +02:00
Eric - CAP-REL
db6314ce9b
remove suppliers from list as fichinter is displayed only on customer… (#38657)
* remove suppliers from list as fichinter is displayed only on customer/prospect card

* add client = 2 as accepted values

* QUAL: switch to constants
2026-06-12 23:57:34 +02:00
lvessiller-opendsi
c278f65591
FIX set SOCIETE_FISCAL_MONTH_START default to 1 (#37662) (#38162) 2026-06-12 23:48:03 +02:00
Laurent Destailleur
836119732d Fix bug of sort -u on ubuntu 26.04. Use uniq instead. 2026-06-10 12:42:04 +02:00
Laurent Destailleur
cd2b52b982 Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-06-10 12:13:30 +02:00
Laurent Destailleur
6515c4feb1 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-06-10 12:13:28 +02:00
Laurent Destailleur
874422802e Automated merge from 17.0 to 18.0 by tool pullmerge.sh 2026-06-10 12:13:24 +02:00
atm-corentin
62b1c0b2ab
FIX : use multidir_output fallback for multi-entity HRM PDF generation (#38640)
When generating a PDF for an Evaluation on an entity other than entity 1,
$conf->hrm->multidir_output[$entity] was used without a fallback to
$conf->hrm->dir_output. If multidir_output for the target entity is empty,
the resulting path was '/evaluation/<ref>' (missing base), causing a
directory creation failure.

Apply the same pattern used in other PDF modules (e.g. pdf_crabe for invoices):
fall back to dir_output when multidir_output[$entity] is not set.
2026-06-09 01:11:03 +02:00
atm-corentin
61afdd2e8c
FIX : use get_exdir to compute holiday upload path in prepare_head (#38644)
holiday module stores files using an ID-based 2-level hierarchy
(get_exdir with level=2), not a ref-based flat path.
Using dol_sanitizeFileName($object->ref) returns the wrong directory,
causing the attachment badge count to always read 0.
2026-06-09 01:07:51 +02:00
atm-adrien
34b508d266
FIX : Clean datas on infoGroups api call (#38643) 2026-06-09 01:06:30 +02:00
Laurent Destailleur
b784031f7c Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-06-08 23:43:03 +02:00