Commit Graph

2062 Commits

Author SHA1 Message Date
ldestailleur
b03f30c7e2 Sec: Remove functions accepting callable params - Reported by phdwg1410 2025-07-27 13:54:02 +02:00
ldestailleur
85f49c2272 Fix syntax 2025-07-19 18:01:10 +02:00
ldestailleur
c0a0acf129 FIX #34746 2025-07-17 19:30:58 +02:00
ldestailleur
61dcd176e0 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 22.0 2025-07-17 19:30:58 +02:00
ldestailleur
a4aa00c498 Sec: Remove all functions that accept callable params - CVE-2024-40137 2025-07-17 19:30:58 +02:00
Marc de Lima Lucio
d5250eadeb FIX: pgsql: cast string_agg arguments (#34210)
* FIX local taxes text in object line view mode (#34103)

* FIX: product suplier tab: last modif date column was wrongly dependant of module barcode (#34170)

* FIX: product suplier tab: last modif date column was wrongly dependant of module barcode

* FIX: product suplier tab: last modif date column was wrongly dependant of module barcode, part 2

* FIX: pgsql: cast string_agg arguments

* FIX: pgsql group concat conversion: modify tests as a consequence

---------

Co-authored-by: lvessiller-opendsi <lvessiller@open-dsi.fr>
2025-06-04 18:24:19 +02:00
Laurent Destailleur
b2f148da50 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-05-22 17:06:21 +02:00
Laurent Destailleur
30b8237a52 Fix phpunit 2025-05-22 17:01:13 +02:00
ldestailleur
a674676ded Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-05-10 13:33:53 +02:00
ldestailleur
d76848351c Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-05-10 13:30:36 +02:00
ldestailleur
ae94c71a10 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2025-05-10 13:25:31 +02:00
ldestailleur
445f089556 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2025-05-10 12:53:37 +02:00
Yannis Hoareau
1301cd36a1 NEW Subtotal module (#33502)
* Changes to follow mvc logic

* Reworked admin page and form to add lines

* Reworked adding line logic

* Adding options when editing subtotal lines

* Fix translations

* Fixed errors/displays and started pdf

* Color for subtotals pdf lines

* FIX display of subtotal totht

* Added pdf azur for propal

* Fix duplicate translation

* Added subtotal support for facture pdf

* Added subtotal support for commande pdf

* Improve UI/translations

* Restored old pdf

* Info to warn user for unsupported pdf

* Added title lines VAT rate and discount support

This is meant for future feature wich is block mass changing vat rate
and discount percentage

* Working on block apply vat and discount

* Added buttons for block actions

* Handle editing vat and discount for subtotal lines

* Editing vat and discount for subtotal lines bloc working

* Added possibility to move by block

* Updated adding and updating a subtotal line

* Improved vat and discount block update

* Improvement for block vat/discount and line edition

Editing a title line edits the corresponding subtotal line

* Improvement for moving by block

* Bad tile or st line placement managing

* Improved bad title or st line placement managing

* Adding subtotal line improved

Adding a subtotal line adds it right under its corresponding title

* Improved deleting subtotal line

Added possibility to choose if you want to delete the corresponding
subtotal line when deleting a title line

* Preventing too high level titles to be created

* Create and update line errors managing

* Improved bad title or st line placement managing

* Improved st line creation

* improve headers

* fix bad block placement managing

* fix adding st line not working if duplicates titles

* fix translations

* Fix block update

* FIX special chars bug

If special char like " ' " was used in title it could be converted to
special char entity.

* Prepare for pdf options

Pdf options like page break befor title should be shown as a picto if activated on a subtotal line on a document

* Added option managing

* Improved subtotal options and PDF integration

* Code refactor

* Action name/Error managment/PDF refreshing

When adding or updating a subtotal line

* Reformat

* Reworked subtotal options database managment

* Changed access to special code

* Remove unecessary call to php trait

* Changed definition of subtotals special code constant

* Reworked align on PDF

* Removed unecessary function and improved error managment

* Typo fix and removed treated todos

* Post typo changed for to better match subtotals names

* Disabled edit if status is not draft

* Changed way subtotals options are stored

* Added view managing when creating a document form an other

* Improved creating document from an other

Can check subtotals lines with table head checkbox and removed highlight
class for better UI.

* Make include of subtotals tpl more clear

* Manage centered or justified case

If user chose to center or justify, we don't change nothing

* Improved pdf

* Removed unecessary code block

* optimisation

* Code sniffer fix

* Code sniffer fix

* Code sniffer fix

* Code sniffer fix

* Code sniffer fix and added missing translation

* Fix php code sniffer

* Reload page when setup saved on subtotals admin page

* Fix php code sniffer

* pjan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* phan fix

* php warning fix

* php warning fix

* php phan fix

* php phan fix

* php phan fix

* Fix bug admin page not loading because of const not defined

* php phan fix

* php phan fix

* FIX subtotals admin page display

* php phan fix

* FIX php phan

* Fix bugs and langs

* Fix bug pdf align

* Replace include by require

* Add headers to avoid refreshing and adding unwanted lines

* Fix phan

* Add GETPOST check for security

* Fix phan

* Fix phan

* Fix phan

* Subtotal option when creating a document from another

* Fix phan

* Add field subtotal options for subtotal lines

* Fix phan

* Fix phan

* Fix phan

* Update to follow mvc

* Fix php phan

* Fix php phan

* Fix phpstan/phan

* Fix phpstan

* Fix phpstan

* Fix phpstan

* Fix phpstan

* Fix phpstan

* Update to switch to extraparams

* Update to switch to extraparams

* Retrieve extraparams from db to objectline

* Modified last things to switch to extraparams

* Cleaning unnecessary code lines

* Fix php-stan

* Section subtotal in extraparams to differentiate if needed for further devs

* Fix phan

* Keep extraparams when creating from another object

* Change default value to false when creating a subtotal line

* Fix clone would not keep extraparams in new object

* Fix dark subtotal line background color

Fix when a subtotal background color is too dark and edit pencil or
delete trash could not be seen

* Fix typo

* Fix typo

* Added subtotals for facturerec

* Fix precommit

* Added extraparams when creating rec from fac and other way

* Fix phan

* Fix objectline null

* Desactivating block vat / discount update for facturerec

* reformating code

* Added expeditions for subtotal

* Save extraparams for shipping lines

* Display of subtotals lines in shipments

* Display when creating facture from shipments

* Improve display of lines and invoice creation from shipments

* Fix error if missing line rang

* Deleted duplicate

* Added deletion of subtotal line in shipping documents

* Not including subtotal lines if there is no product line in between

* Update get subtotal lines in shipment docs to disable

* Delete possibility to edit subtotal lines in shipments

* Handle pdf for shipment

* Handle conf stock or shipment supporting services

* Fix precommit

* Fix duplicate name creating bug

* Fix bug where id could be changed by the line id and would create bug

* Deleted subtotal lines when STOCK_SUPPORTS_SERVICES is enabled and block would only have service lines

* Disable shipments in admin modules

Shimpements subtotals lines are only created from commands

* Fixing phan and stan

* Deleted unused template and phan fix

* Fix phan

* Fix phan

* Fix phan

* FIX: phan

* Fix template bug

If document was not in subtotal scope and would use a template used by
subtotal it would create an error.

* Fix php-stan

* Fix bad display when modules and confs were activated

* Fix php codesniffer

* Excluding subtotal lines when mass updating

* Fix shipments service lines exluded + showing subtotal line with specific configs

* Fix line display with situation invoices + bug block line update

* Added ODT managment

This works with invoices but has not been tested with other documents

* Fix bug when editing VAT/discount by block

* Fix error raised when subtotal line added

Subtotal line had no fk_product and raised the error but we want this
line to have no fk product

* Fix precommit

* Added ODT template for documents that uses subtotals

This template can be usefull to understand how to create an odt template
using subtotals module

* Fix phan

* Fix phan

* fix: buttons showing in bad document status

* clean: unwanted commited files

* add: table examples to use with subtotals on ODT templates

* fix: Unwanted print of value when creating a document from another

* feat: renaming for better understanding

* feat: Improved templates for documents related to subtotals

---------

Co-authored-by: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-05-10 02:44:31 +02:00
Laurent Destailleur (aka Eldy)
b85bfc40f4 Fix phpunit 2025-05-06 11:59:08 +02:00
ldestailleur
eadc676edf NEW Add option MAIN_ALLOW_DOUBLE_COLON_IN_DOL_EVAL 2025-05-06 11:10:57 +02:00
Alexandre Janniaux
2c03be5014 tests: add BookKeeping test (#34062)
This smoke-test the bookkeeping class to check the queries are working
correctly. This is a good way to smoke-test the postgresql compatibility
and enables more complex tests like the yearly closure later.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-05-05 21:31:48 +02:00
MDW
69e3d4b5df UIUX: Interpret first token as thousands separator 21.500,00 (when French, ...). (#33832)
* Qual: Add testcase for price2num to convert '21.500,00' in FR

* NEW: Accept numbers like 1.213,00 in locales with whitespace/empty thousands separator

# NEW: Accept numbers like 1.213,00 in locales with whitespace/empty thousands separator

- Graceful handling of comma and dot as decimal points and thousands separators in the `price2num` function.
- Improved the `getNonEmptyString` function to include proper indentation and spacing (automatic).

* Add testcases for price2num

* en_US tests for invalid prices, add doc for price2num regex

* Restore lost test to validate compatibility

* Update FunctionsLibTest.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-04-21 11:57:13 +02:00
Francis Appels
55530fa588 Fix intervention update sql error (#33916) 2025-04-18 20:01:58 +02:00
ldestailleur
f4d7ddaaf4 Add more phpunit tests 2025-04-16 18:54:43 +02:00
ldestailleur
57268af48e Add more phpunit tests 2025-04-16 18:42:20 +02:00
ldestailleur
c1649c04b4 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-04-16 18:28:45 +02:00
ldestailleur
9582894136 Add constant SECURITY_WAF_ALLOW_QUOTES_IN_GET in WAF 2025-04-06 18:56:59 +02:00
ldestailleur
3edadbd8b8 Add option MAIN_DISALLOW_STRING_OBFUSCATION_IN_DOL_EVAL. Close #33612 2025-04-01 16:23:50 +02:00
ldestailleur
15f2f4f223 Clean code 2025-04-01 15:21:43 +02:00
ldestailleur
cc8c7b8329 Fix possible remote code execution using dol_concatdesc in dol_eval. To
allow concat char, you can use
MAIN_ALLOW_UNSECURED_SPECIAL_CHARS_IN_DOL_EVAL='.'
2025-04-01 13:25:10 +02:00
ldestailleur
bcf0ef0bc0 Test switch in dol_eval function() 2025-04-01 12:31:27 +02:00
ldestailleur
bb826b9f93 Add more phpunit to aclude lang file with a simple % character. 2025-04-01 10:24:19 +02:00
Lucas Marcouiller
0aa0588f52 New Implements findNearest for societe module (#33643)
* New Implements Find Nearest for societe module

* fix CI

* fix CI
2025-03-28 23:11:01 +01:00
ldestailleur
94ce8346c0 Fix phpunit 2025-03-27 18:56:13 +01:00
ldestailleur
df9fea28f1 Complete #33605 by adding phpunit tests 2025-03-27 10:39:08 +01:00
ldestailleur
33c7378d2d Add phpunit test 2025-03-26 21:01:46 +01:00
ldestailleur
fd0889cebb Test 2025-03-25 22:48:19 +01:00
ldestailleur
507262a1a8 Test fix CI 2025-03-25 22:27:52 +01:00
ldestailleur
b321336562 Test 2025-03-25 21:45:05 +01:00
ldestailleur
7b9b32cb9e Debug pgsql DDLInfoTable 2025-03-25 21:32:28 +01:00
ldestailleur
e028b2325e Test travis 2025-03-25 21:18:50 +01:00
ldestailleur
507e81d819 More logs 2025-03-25 21:11:02 +01:00
ldestailleur
1a4b888f2e Add a test to debug travis error 2025-03-25 20:59:05 +01:00
ldestailleur
9f70a961b0 Comment 2025-03-25 18:36:51 +01:00
ldestailleur
03c4ce1cc3 Fix travis 2025-03-24 21:44:57 +01:00
ldestailleur
bb7ef236c5 Fix travis 2025-03-24 21:43:38 +01:00
ldestailleur
2cb5ec448b Fix travis 2025-03-24 21:42:16 +01:00
ldestailleur
8a89cc3f04 FIX phpunit 2025-03-24 20:52:13 +01:00
ldestailleur
c15f729cc4 Use environment variable instead of hard coded values 2025-03-24 19:24:04 +01:00
ldestailleur
1726312fc3 Fix travis 2025-03-24 18:23:31 +01:00
ldestailleur
d670d67668 Disable test when libxml not good. 2025-03-09 23:37:36 +01:00
ldestailleur
5db341a3e8 Fix phpunit 2025-03-09 22:27:46 +01:00
ldestailleur
202ffe732e Enhance phpunit tests 2025-03-09 21:26:51 +01:00
ldestailleur
8b94a99dd1 Fix contract update method. Add phpunit for TDD. 2025-03-07 16:02:18 +01:00
ldestailleur
7a0e9d4dc1 Accept utf8 chars in the natural_search in mode 3. Close #32930 2025-03-06 04:00:42 +01:00