Choisir exercice avant date amortissement
This commit is contained in:
parent
5b8c869ba4
commit
839739b992
4 changed files with 203 additions and 158 deletions
16
scripts.js
16
scripts.js
|
|
@ -81,3 +81,19 @@ function chooseYears(id_date, id_exercices, id_years)
|
|||
setAccountYear(['credit_account', 'debit_account'], 0);
|
||||
}
|
||||
}
|
||||
|
||||
// afficher la date de fin de l'exercice choisi
|
||||
function setDateEnd(id_exercices, id_date, id_years) {
|
||||
const selected_year = document.getElementById(id_exercices).value;
|
||||
const years_data = document.getElementById(id_years);
|
||||
for (const choix of years_data.options) {
|
||||
if (choix.value == '') {
|
||||
document.getElementById(id_date).value = '';
|
||||
} else if (choix.value == selected_year) {
|
||||
const epox = choix.text.split(' ');
|
||||
const date_fin = new Date(epox[1] * 1000);
|
||||
document.getElementById(id_date).value = date_fin.toLocaleDateString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue