[fix] reset flag after promise
This commit is contained in:
parent
7773ee8960
commit
233a19a373
@ -69,7 +69,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
if(!frm.doc.apply_discount_on) {
|
if(!frm.doc.apply_discount_on) {
|
||||||
frappe.msgprint(__("Please set 'Apply Additional Discount On'"));
|
frappe.msgprint(__("Please set 'Apply Additional Discount On'"));
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
frm.via_discount_percentage = true;
|
frm.via_discount_percentage = true;
|
||||||
@ -83,17 +83,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
var discount_amount = flt(total*flt(frm.doc.additional_discount_percentage) / 100,
|
var discount_amount = flt(total*flt(frm.doc.additional_discount_percentage) / 100,
|
||||||
precision("discount_amount"));
|
precision("discount_amount"));
|
||||||
|
|
||||||
frm.set_value("discount_amount", discount_amount);
|
frm.set_value("discount_amount", discount_amount)
|
||||||
delete frm.via_discount_percentage;
|
.then(() => delete frm.via_discount_percentage);
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on(this.frm.doctype, "discount_amount", function(frm) {
|
frappe.ui.form.on(this.frm.doctype, "discount_amount", function(frm) {
|
||||||
frm.cscript.set_dynamic_labels();
|
frm.cscript.set_dynamic_labels();
|
||||||
|
|
||||||
if (!frm.via_discount_percentage) {
|
if (!frm.via_discount_percentage) {
|
||||||
frm.via_discount_amount = true;
|
frm.doc.additional_discount_percentage = 0;
|
||||||
frm.set_value("additional_discount_percentage", 0);
|
|
||||||
delete frm.via_discount_amount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
frm.cscript.calculate_taxes_and_totals();
|
frm.cscript.calculate_taxes_and_totals();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user