Skip to content

Commit

Permalink
Clean asset.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
josett225 authored Oct 29, 2024
1 parent 1ee1ba7 commit f4d5503
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/asset/class/asset.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,13 +1109,13 @@ public function calculationDepreciation()
}
}
$depreciation_ht = (float) price2num($period_amount * $nb_days / $nb_days_in_month, 'MT');
} else { // Annually, taking care for adjustments to shortened or extended periods (e.g., fiscal years of 9 or 15 months)
} else { // Annually, taking care for adjustments to shortened or extended periods (e.g., fiscal years of 9 or 15 months)
$nb_days_real = num_between_day($begin_date, $end_date, 1);
if (($nb_days_real > 366) || (num_between_day($fiscal_period_start,$fiscal_period_end,1) < $nb_days_in_year)) { // FY Period changed
if (($nb_days_real > 366) || (num_between_day($fiscal_period_start, $fiscal_period_end, 1) < $nb_days_in_year)) { // FY Period changed
$nb_days = $nb_days_real;
} else {
$nb_days = min($nb_days_in_year, $nb_days_real);
}
}
$depreciation_ht = (double) price2num($period_amount * $nb_days / $nb_days_in_year, 'MT');
}

Expand All @@ -1135,7 +1135,7 @@ public function calculationDepreciation()

// Next fiscal period (+1 day/month/year)
$fiscal_period_start = dol_time_plus_duree($fiscal_period_end, 1, 'd');
$dates_fiscal_period = getCurrentPeriodOfFiscalYear($this->db, $conf, $fiscal_period_start,'gmt');
$dates_fiscal_period = getCurrentPeriodOfFiscalYear($this->db, $conf, $fiscal_period_start, 'gmt');
if ($fields['duration_type'] == 2) { // Daily
$fiscal_period_end = $fiscal_period_start;
} elseif ($fields['duration_type'] == 1) { // Monthly
Expand Down

0 comments on commit f4d5503

Please sign in to comment.