This commit is contained in:
Luca 2021-10-26 10:29:46 +02:00
commit 1b73b69761
1 changed files with 4 additions and 1 deletions

View File

@ -71,10 +71,13 @@ if ($options['dir'] == 'entrata') {
var margine = (((prezzo - sconto) * 100) / costo_unitario) - 100; var margine = (((prezzo - sconto) * 100) / costo_unitario) - 100;
var parent = $("#costo_unitario").closest("div").parent(); var parent = $("#costo_unitario").closest("div").parent();
var div = parent.find("div[id*=\"errors\"]"); var div = parent.find("div[id*=\"errors\"]");
var mediaponderata = 0;
margine = isNaN(margine) || !isFinite(margine) ? 0: margine; // Fix per magine NaN margine = isNaN(margine) || !isFinite(margine) ? 0: margine; // Fix per magine NaN
var mediaponderata = parseFloat($("#idarticolo").selectData().media_ponderata); if ($("#idarticolo").val()) {
mediaponderata = parseFloat($("#idarticolo").selectData().media_ponderata);
}
div.html("<table class=\"table table-extra-condensed\" style=\"margin-top:7px;\" >\ div.html("<table class=\"table table-extra-condensed\" style=\"margin-top:7px;\" >\
<tr>\ <tr>\