mise à jour de la bdd pour les fiches de frais et suppression des hors forfait
This commit is contained in:
@@ -62,7 +62,7 @@ $(document).ready(function () {
|
||||
|
||||
line.find('.btn').attr('id', 'frsSup-' + lastId)
|
||||
|
||||
var line = $('<tr id="fraisHf-' + lastId + '" class="fraisHF"></tr>');
|
||||
var line = $('<tr id="fraisHf-' + lastId + '" data-id="" class="fraisHF"></tr>');
|
||||
var tdDate = $('<th scope="row" id="dateFrsHF"></th>');
|
||||
tdDate.html(date.val());
|
||||
var tdLibelle = $('<td id="LibelleFrsHF"></td>');
|
||||
@@ -89,7 +89,6 @@ $(document).ready(function () {
|
||||
updatePrixTotal();
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -97,13 +96,70 @@ $(document).ready(function () {
|
||||
*/
|
||||
$(document).on('click', '.btnSuprFraisHf', function () {
|
||||
id = $(this).attr('id').split('-')[1]
|
||||
console.log(id)
|
||||
fiche = $('#idFiche').attr('data-id')
|
||||
idFrais = $(this).parent().parent().attr('data-id')
|
||||
//SUPPRIME DE LA BD
|
||||
$.ajax({
|
||||
url: "../controleurs/c_actionFiche.php?action=suprFraisHF&fiche=" + fiche + "&idFrais=" + idFrais,
|
||||
method: "POST",
|
||||
})
|
||||
|
||||
$('#fraisHf-' + id).remove()
|
||||
calcPrixTotalFrsHorsF();
|
||||
updatePrixTotal();
|
||||
})
|
||||
|
||||
/**
|
||||
* PARTIE ENVOIE DE LA FICHE
|
||||
*/
|
||||
$(document).on('click', '#sendFileBtn', function () {
|
||||
|
||||
//FRAIS FORFAITAIRES
|
||||
var listeFraisF = []
|
||||
$('tr.fraisForfaitaire').each(function () {
|
||||
quantite = parseInt($(this).find('.frsFrt').val())
|
||||
montant = parseFloat($(this).find('.mttFrsTotal').html())
|
||||
id = $(this).attr('data-id')
|
||||
|
||||
tabData = {
|
||||
'quantité': quantite,
|
||||
'montant': montant,
|
||||
'id': id
|
||||
}
|
||||
listeFraisF.push(tabData);
|
||||
})
|
||||
|
||||
//FRAIS HF
|
||||
var listeFraisHf = []
|
||||
$('tr.fraisHF').each(function () {
|
||||
date = $(this).find('#dateFrsHF').html()
|
||||
libelle = $(this).find('#LibelleFrsHF').html()
|
||||
montant = parseFloat($(this).find('#MttFrsHF').html())
|
||||
id = $(this).attr('data-id')
|
||||
|
||||
tabData = {
|
||||
'date': date,
|
||||
'libelle': libelle,
|
||||
'montant': montant,
|
||||
'id': id
|
||||
}
|
||||
listeFraisHf.push(tabData);
|
||||
})
|
||||
data = {
|
||||
fraisF: listeFraisF,
|
||||
fraisHF: listeFraisHf
|
||||
}
|
||||
fiche = $('#idFiche').attr('data-id')
|
||||
|
||||
$.ajax({
|
||||
url: "../controleurs/c_actionFiche.php?action=update&fiche=" + fiche,
|
||||
method: "POST",
|
||||
data: data,
|
||||
}).done(function () {
|
||||
location.reload();
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* Calcul prix total frais forfaitaires
|
||||
*/
|
||||
|
Reference in New Issue
Block a user