[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) {
|
||||
frappe.msgprint(__("Please set 'Apply Additional Discount On'"));
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
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,
|
||||
precision("discount_amount"));
|
||||
|
||||
frm.set_value("discount_amount", discount_amount);
|
||||
delete frm.via_discount_percentage;
|
||||
frm.set_value("discount_amount", discount_amount)
|
||||
.then(() => delete frm.via_discount_percentage);
|
||||
});
|
||||
|
||||
frappe.ui.form.on(this.frm.doctype, "discount_amount", function(frm) {
|
||||
frm.cscript.set_dynamic_labels();
|
||||
|
||||
if (!frm.via_discount_percentage) {
|
||||
frm.via_discount_amount = true;
|
||||
frm.set_value("additional_discount_percentage", 0);
|
||||
delete frm.via_discount_amount;
|
||||
frm.doc.additional_discount_percentage = 0;
|
||||
}
|
||||
|
||||
frm.cscript.calculate_taxes_and_totals();
|
||||
|
Loading…
x
Reference in New Issue
Block a user