Hello,
It is possible to substract the value of 2 fields?
Thanks!
cur_frm.set_value(“rest_piata”, cur_frm.doc.valoare - cur_frm.doc.discount);
frappe.ui.form.on('Contracte', {
refresh: function(frm) {
//This will make sure they are are updated whenever the form reloads
frm.set_value("rest_piata", cur_frm.doc.valoare - cur_frm.doc.discount);
},
valoare: function(frm) {
//This will make sure the calculation happens whenever valoare is updated
frm.set_value("rest_piata", cur_frm.doc.valoare - cur_frm.doc.discount);
},
discount: function(frm) {
//This will make sure the calculation happens whenever discount is updated
frm.set_value("rest_piata", cur_frm.doc.valoare - cur_frm.doc.discount);
},
});
Many Thanks!