Anteprima Margine nella popup di aggiunta articolo

This commit is contained in:
Matteo 2020-05-13 15:58:11 +02:00 committed by GitHub
parent 0ba28695fe
commit 480b007fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -51,10 +51,11 @@ if ($options['dir'] == 'entrata') {
}
var guadagno = prezzo - sconto - costo_unitario;
var margine = (((prezzo - sconto)*100)/prezzo_acquisto)-100;
var parent = $("#costo_unitario").closest("div").parent();
var div = parent.find("div[id*=\"errors\"]");
div.html("<small>'.tr('Guadagno').': " + guadagno.toLocale() + " " + globals.currency + "</small>");
div.html("<small>'.tr('Guadagno').': " + guadagno.toLocale() + " " + globals.currency + " &nbsp; '.tr('Margine').': " + margine.toLocale() + " %</small>");
if (guadagno < 0) {
parent.addClass("has-error");
div.addClass("text-danger").removeClass("text-success");