From 80f8e119d441309d0d2c9b2bb4d6c88db493118e Mon Sep 17 00:00:00 2001 From: Pichi1966 <57623859+josett225@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:25:14 +0200 Subject: [PATCH] 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. --- htdocs/asset/class/asset.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index e2d93806ca352..aff37b6df3170 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -863,7 +863,7 @@ public function calculationDepreciation() // Get fiscal period require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; - $dates = getDefaultDatesForTransfer(); + $dates = getCurrentPeriodofFiscalYear($this->db, $conf, $this->date_start > $this->date_acquisition ? $this->date_start : $this->date_acquisition); $init_fiscal_period_start = $dates['date_start']; $init_fiscal_period_end = $dates['date_end']; if (empty($init_fiscal_period_start) || empty($init_fiscal_period_end)) {