(duplicate of $totaldeposits) and $sumcreditnote (duplicate of
$totalcreditnotes) has been removed (there are replaced with the
property that was a duplication of (same for $sumpayed_multicurrency,
$sumdeposit_multicurrency, $sumcreditnote_multicurrency).
* NEW : add extrafield option "empty on clone"
* NEW : empty extrafield value on clone
* Fix : missing parameter in function call
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* fix(commonobject): ensure `tms` field is updated with current timestamp
- Added logic to automatically update the `tms` field with the current timestamp when it exists in `$fieldvalues`.
- Aligns `tms` behavior with other timestamp fields like `date_modification`.
Improves consistency in timestamp handling across the codebase.
* fix(commonobject): set timezone for `dol_now()` call
- Updated `dol_now()` to use the user's timezone (`tz_user`).
- Ensures timestamps are consistent with user-specific settings.
* fix(commonobject): correct parameter for `dol_now()` function
- Updated `dol_now()` to use 'tzuser' instead of 'tz_user'.
- Fixes incorrect parameter causing potential timezone inconsistencies.
* fix(commonobject): respect `MAIN_DISABLE_AUTO_UPDATE_OF_TMS_FIELDS` setting
- Added a check for `MAIN_DISABLE_AUTO_UPDATE_OF_TMS_FIELDS` in the logic updating the `tms` field.
- Ensures the `tms` field is not auto-updated when this global setting is enabled.
- Retains the update behavior for `date_modification` and `fk_user_modif` fields.
Improves flexibility by honoring user-defined global settings for timestamp management.
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* commonobject: line_max: factor conditonals together
The SQL request is shared, except for the additional filter.
* Update commonobject.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Simplify the code by early returning on query failure, which removes
almost every indentation level of the function.
It also highlights some important flaws here, since there is a return
without value (void return type) between the two queries if an error
happened, which would indicate the first query failed and nothing was
registered, but also an error check leading to printing an error message
if the second query fails, without actually reverting the first one, and
since there is no error code, there's no way to trigger a db->rollback()
from the caller code for this reason.