$(document).ready(function () { calcPrixTotalFrsF(); /** * Partie enregistrement frais F */ $('.frsFrt').on('change', function (e) { console.log($(this).val()) val = $(this).val(); val = val.replace(',', '.') if ($.isNumeric(val)) { /** * Calcul le prix de la ligne */ id = $(this).attr('id') formTotal = $('#totalFrs-' + id) mttFrs = $('#mttFrs-' + id).attr('data-price') formTotal.html((val * mttFrs).toFixed(2) + ' €'); calcPrixTotalFrsF(); } }) /** * Enregistrement frais HF */ $('.validFraisHF').on('click', function () { let date = $('#dateHf') let libelle = $('#libelleHf') let montant = $('#mttHf') let canAdd = true; if (date.val() == "") { canAdd = false; date.css("border-color", "red") } else { date.css("border-color", "var(--bs-border-color)") } if (libelle.val() == "") { canAdd = false; libelle.css("border-color", "red") } else { libelle.css("border-color", "var(--bs-border-color)") } if (montant.val() == "") { canAdd = false; montant.css("border-color", "red") } else { montant.css("border-color", "var(--bs-border-color)") } if (canAdd == true) { var line = $('tr.fraisHF:first').clone(); lastId = $('tr.fraisHF').length /* line.find("#dateFrsHF").html(date.val()); line.find("#LibelleFrsHF").html(libelle.val()); line.find("#MttFrsHF").html(parseFloat(montant.val()).toFixed(2) + ' €'); */ line.find('.btn').attr('id', 'frsSup-' + lastId) var line = $('