Debug livraison Total Legumes & form compo paniers
This commit is contained in:
parent
6a991ab287
commit
2e0ab9710b
|
|
@ -661,9 +661,16 @@ function calcLivraisonTotalLegumes($legumes) {
|
||||||
$tot["legumes"][$l['ref']]["quantite"] = 0.0;
|
$tot["legumes"][$l['ref']]["quantite"] = 0.0;
|
||||||
$tot["legumes"][$l['ref']]["montant"] = 0.0;
|
$tot["legumes"][$l['ref']]["montant"] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QUANTITE
|
||||||
$tot["legumes"][$l['ref']]["quantite"] += floatval($l["quantite"]) * floatval($p['nb']);
|
$tot["legumes"][$l['ref']]["quantite"] += floatval($l["quantite"]) * floatval($p['nb']);
|
||||||
|
$tot["legumes"][$l['ref']]['quantite_print'] = floatval($tot["legumes"][$l['ref']]['quantite'])." ".$tot["legumes"][$l['ref']]['tarif_unite_acro'];
|
||||||
|
if($tot["legumes"][$l['ref']]["tarif_unite"]=="kg" && floatval($tot["legumes"][$l['ref']]["quantite"])*1000<1000) $tot["legumes"][$l['ref']]['quantite_print'] = (floatval($tot["legumes"][$l['ref']]["quantite"])*1000)." g";
|
||||||
|
|
||||||
|
// MONTANT
|
||||||
$tot["legumes"][$l['ref']]["montant"] += floatval($l["tarif_prix"]) * floatval($l["quantite"]) * floatval($p['nb']);
|
$tot["legumes"][$l['ref']]["montant"] += floatval($l["tarif_prix"]) * floatval($l["quantite"]) * floatval($p['nb']);
|
||||||
|
|
||||||
|
// TOTAL
|
||||||
$tot["montant"] += floatval($l["tarif_prix"]) * floatval($l["quantite"]) * floatval($p['nb']);
|
$tot["montant"] += floatval($l["tarif_prix"]) * floatval($l["quantite"]) * floatval($p['nb']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,8 @@
|
||||||
|
|
||||||
.formLivraison table.panier tr.legume > td.quantite { text-align: right; width: 80px; }
|
.formLivraison table.panier tr.legume > td.quantite { text-align: right; width: 80px; }
|
||||||
.formLivraison .tabLegumes table.panier tr.legume > td.quantite,
|
.formLivraison .tabLegumes table.panier tr.legume > td.quantite,
|
||||||
#modalViewLivraison .formLivraison table.panier tr.legume td.quantite { text-align: center; }
|
#modalViewLivraison .formLivraison table.panier tr.legume td.quantite,
|
||||||
|
body.print .formLivraison table.panier tr.legume td.quantite { text-align: center; }
|
||||||
|
|
||||||
.formLivraison table.panier tr.legume td.unite { width: 40px; }
|
.formLivraison table.panier tr.legume td.unite { width: 40px; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -498,8 +498,6 @@ function modalFormLivraison_addPanierTypeCompo(modal, datas) {
|
||||||
thead.append(trH);
|
thead.append(trH);
|
||||||
table.append(thead);
|
table.append(thead);
|
||||||
|
|
||||||
btnAddLegume.click(function(e) { e.preventDefault(); $(this).blur(); modalFormLivraison_addPanierTypeCompoLegume(modal, table, "new"); });
|
|
||||||
|
|
||||||
// LEGUMES
|
// LEGUMES
|
||||||
var tbody = $("<tbody></tbody>");
|
var tbody = $("<tbody></tbody>");
|
||||||
var trNull = $("<tr class='nullChild hide'><td colspan='8'>aucun légume</td></tr>");
|
var trNull = $("<tr class='nullChild hide'><td colspan='8'>aucun légume</td></tr>");
|
||||||
|
|
@ -511,6 +509,13 @@ function modalFormLivraison_addPanierTypeCompo(modal, datas) {
|
||||||
}
|
}
|
||||||
else trNull.removeClass("hide");
|
else trNull.removeClass("hide");
|
||||||
|
|
||||||
|
// INIT BTN ADD
|
||||||
|
btnAddLegume.click(function(e) {
|
||||||
|
e.preventDefault(); $(this).blur();
|
||||||
|
if(tbody.find("tr.editing").length>0) return;
|
||||||
|
modalFormLivraison_addPanierTypeCompoLegume(modal, table, "new");
|
||||||
|
});
|
||||||
|
|
||||||
modal.find("div.tabCompo").append(table);
|
modal.find("div.tabCompo").append(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -603,23 +608,21 @@ function modalFormLivraison_addPanierTypeCompoLegume(modal, panier, datas) {
|
||||||
|
|
||||||
if(ref>0 && tarif_ref>0) {
|
if(ref>0 && tarif_ref>0) {
|
||||||
var td = ipt.parent(); var tr = td.parent();
|
var td = ipt.parent(); var tr = td.parent();
|
||||||
tr.attr("ref", ref);
|
tr.attr("ref", ref).removeClass("editing");
|
||||||
td.html( val ).attr('ref', ref);
|
td.html( val ).attr('ref', ref);
|
||||||
modalFormLivraison_loadPanierTypeCompoLegumeTarif(tr, tarif_ref, tarif_prix, tarif_unite);
|
modalFormLivraison_loadPanierTypeCompoLegumeTarif(tr, tarif_ref, tarif_prix, tarif_unite);
|
||||||
tr.find("td.quantite").dblclick();
|
tr.find("td.quantite").dblclick();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
beep(50, 800, null, "square");
|
|
||||||
ipt.focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
ipt.select();
|
ipt.select();
|
||||||
});
|
});
|
||||||
tdQ.dblclick(function(e) {
|
tdQ.dblclick(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
val = $(this).html();
|
val = $(this).html();
|
||||||
unite = $(this).attr("unite");
|
unite = $(this).attr("unite");
|
||||||
if(unite in legumeTarifUnitesAccronymes) {
|
if(unite in legumeTarifUnitesAccronymes) {
|
||||||
|
if($(this).parent().hasClass("editing")) return;
|
||||||
$(this).parent().addClass("editing");
|
$(this).parent().addClass("editing");
|
||||||
var ipt = $("<input class='editable quantite' type='number' step='0.1'>");
|
var ipt = $("<input class='editable quantite' type='number' step='0.1'>");
|
||||||
$(this).html("").append(ipt);
|
$(this).html("").append(ipt);
|
||||||
|
|
@ -765,7 +768,7 @@ function modalFormLivraison_updateTotalLegumes(modal) {
|
||||||
trL = $("<tr class='legume'></tr>");
|
trL = $("<tr class='legume'></tr>");
|
||||||
tdNom = $("<td class='nom noselect'></td>").html(l.nom);
|
tdNom = $("<td class='nom noselect'></td>").html(l.nom);
|
||||||
tdTarif = $("<td class='tarif noselect'></td>").html(number_format(l.tarif_prix,2)+" €/"+unite);
|
tdTarif = $("<td class='tarif noselect'></td>").html(number_format(l.tarif_prix,2)+" €/"+unite);
|
||||||
tdQ = $("<td class='quantite noselect'></td>").html( round_number(l.quantite,3)+" "+unite );
|
tdQ = $("<td class='quantite noselect'></td>").html( number_format(l.quantite, 2)+" "+unite );
|
||||||
tdMontant = $("<td class='montant noselect'></td>").html(number_format((l.quantite * l.tarif_prix),2)+" €");
|
tdMontant = $("<td class='montant noselect'></td>").html(number_format((l.quantite * l.tarif_prix),2)+" €");
|
||||||
trL.append(tdNom).append(tdTarif).append(tdQ).append(tdMontant);
|
trL.append(tdNom).append(tdTarif).append(tdQ).append(tdMontant);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue