You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
En France, l'amortissement annuel porte sur 360 jours. Aussi dans le core/lib/date.lib.php, il serait utile de rajouter la fonction suivante: num_between_day360()
qui serait appelée dans le fichier asset.class.php à la ligne 1044 au lieu de num_between() pour l'amortissement annuel
Cela permet d'obtenir des tableaux d'amortissement conformes à la compta France.
/**
Function to return number of dys between two dates with 360 days in Year
Comptabilité France: Amortissement annuel sur 360 jours
*/
Feature Request
En France, l'amortissement annuel porte sur 360 jours. Aussi dans le core/lib/date.lib.php, il serait utile de rajouter la fonction suivante: num_between_day360()
qui serait appelée dans le fichier asset.class.php à la ligne 1044 au lieu de num_between() pour l'amortissement annuel
Cela permet d'obtenir des tableaux d'amortissement conformes à la compta France.
/**
*/
function num_between_day360($timestampStart, $timestampEnd, $lastday = 0)
{
if ($timestampStart < $timestampEnd) {
if ($lastday == 1) {
$bit = 0;
} else {
$bit = 1;
}
//$nbjours = (int) floor(($timestampEnd - $timestampStart) / (60 * 60 * 24)) + 1 - $bit;
$dateStart = new DateTime();
$dateStart->setTimestamp($timestampStart);
$dateEnd = new DateTime();
$dateEnd->setTimestamp($timestampEnd);
$diff = $dateStart->diff($dateEnd);
$days = $diff->d >= 30 ? 30 : $diff->d;
$nbjours = $diff->y * 360 + $diff->m * 30 + $days + 1 - $bit;
}
Use case
No response
Suggested implementation
No response
Suggested steps
No response
The text was updated successfully, but these errors were encountered: