Merge pull request #26946 from frederic34/patch-7

fix phpstan
This commit is contained in:
Laurent Destailleur 2023-12-06 16:20:21 +01:00 committed by GitHub
commit 3fdef3fc73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1014,6 +1014,8 @@ class Asset extends CommonObject
$nb_days_in_month = getDolGlobalString('ASSET_DEPRECIATION_DURATION_PER_MONTH') ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_MONTH : 30;
$period_amount = (float) price2num($depreciation_period_amount / $fields['duration'], 'MT');
$first_period_found = false;
// TODO fix declaration of $begin_period
// @phpstan-ignore-next-line
$first_period_date = isset($begin_period) && $begin_period > $fiscal_period_start ? $begin_period : $fiscal_period_start;
$ref_date_format = "%Y" . ($fields['duration_type'] == 1 || $fields['duration_type'] == 2 ? '-%m' : '') . ($fields['duration_type'] == 2 ? '-%d' : '');