# Qual: Update fields phpdoc to include fields that are defined/used in some cases
comment, copytoclipboard, autofocusoncreated are documented and used in some cases for the
$fields definition
* FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it
* FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it, part 2
* NEW FY Changed Period handle in Module Asset
NEW This is the code modification to take in consideration any changed in fiscal year period adjustments to shortened or extended periods (e.g., fiscal years of 9 or 15 months)
* Clean asset.class.php
* NEW CONST ASSET_ROUND_INTEGER_NUMBER_UPWARDS
New CONST ASSET_ROUND_INTEGER_NUMBER_UPWARDS
During several months, we worked with 3 accounting experts in migrating from Quadratus to Dolibarr several assets.(more than 200). We compared all of them ot get same result in Dolibarr. During this test we discoverd that Quadratus has an option to round upwards all the calculated asset values (less the last one). With this const and the code attach we get same result. This is really helpful to migration and also clarity in the lines.
Update asset.class.php Round upwards AssetCalculationThis new CONSTUpdate asset.class.php Round upwards AssetCalculation
* Update asset.class.php
This fix corrects 2 issues:
- PHP Error required (float)
- $depreciation_date_end was incorrect with an extra day. This was impacting last calculation period.
e.g; 5 years period starting the 30/09/2019 means $depreciation_date_end = 29/09/2024. It was returning 30/09/2024
* Qual: Enable & fix or ignore Invalid DimOffset
# Qual: Enable & fix or ignore Invalid DimOffset
The Invalid DimOffset notices occur when array keys are defined and
the index used is not amongst the known array keys.
This PR enables these notices and fixes array definitions when needed,
or ignores the notices locally if it's a false positive, or in the
baseline.txt when it does not seem to be a false positive so that
it can be fixed later
* Nullable object typing in function signature not ok for 7.0/8.4
Can't user '?User' as argument type for PHP7.0 which is required by PHP8.4.
Therefore, removing the typing specification in the function definition
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Qual: Fix PhanTypeMismatchProperty and some other phan notices
* Qual: Phan fixes for BOM
* Phan - fix fields
* fixup! Qual: Phan fixes for BOM
* Fix phpstan double array keys for syslog
* Fix $fields phpdoc
* Fix phan typing issues with intermediate var and ??
* Fix phan typing issue with ?? operator
* Ignore htdocs/install/install.forced.php for git
* Qual: Revert to original code, ignore notice
When changing the method to avoid one notice type, another one
appears. So simply ignoring this error.
* Qual: Revert to original code, ignore notice
When changing the method to avoid one notice type, another one
appears. So simply ignoring this error.
* Update baseline
* Qual: Phan fixes for BOM
* fixup! Qual: Phan fixes for BOM
* Fix phpstan double array keys for syslog
* Qual: Revert to original code, ignore notice
When changing the method to avoid one notice type, another one
appears. So simply ignoring this error.
* Ignore PhanTypeSuspiciousNonTraversableForeach to allow integration
* Fix typing hints (phpstan)
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Update baseline
* Add/update phpdoc typings
* Fix type for AssetDepreciationOptions as is
* Fix typing for Asset->depreciation_lines
* $card is used in derived classes, add it back to ActionsAdherentCardCommon
* Adjust code with typing/corrections for defined types
* Fix typos, code update to match typing, extra typing
* Add type cast for numeric operation
* Phpdoc/cast adjustments detected because of new phpdoc hints
* FIX ASSET: annual depreciation starting year (Again ;-)) #26084
FIX Update asset.class.php
This is an old issue that has been already fixed by
https://github.com/Dolibarr/dolibarr/pull/26084
I tested it several times and it works.
* Update asset.class.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
# Fix $mybool |=... which is binary op, not boolean op
This fixes PhanTypeInvalidLeftOperandOfBitwiseOp.
Replace $var |= ... with $var = ... || $var .
Add cast before ... when needed (@include does not always return bool).
|= always evaluates expression, there for || $var, not $var ||
# Fix $mybool |=... which is binary op, not boolean op
This fixes PhanTypeInvalidLeftOperandOfBitwiseOp.
Replace $var |= ... with $var = $var || ... .
Add cast before ... when needed (@include does not always return bool).
# Fix: Repeat fields typing in CommonClass children
phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
# Fix: Repeat fields typing in CommonClass children
phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
# Fix: Repeat fields typing in CommonClass children
phpstan needs typing to be 'co-variant' and therefore typing must be repeated as
the method is not to initialise the property in the constructor, but to override
the proparty by a 'local' definition in the child class
* Qual: Ignore some false positives for deprecated functions
# Qual: Ignore some false positives for deprecated functions
The Phan Deprecation Plugin for internal functions has mixed up some
mail functions and lists them as deprecated, this ignores that
* Qual: Enable detection and fixing of internal deprecations
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Replace 'join' with 'implode'
* Qual: Update codespell lines ignore list after format
# Qual: Update codespell lines ignore list after forma
Done using latest library, so also adds some exceptions that are needed
in the future;
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>