refactor: allow '0' rounding allowance
This commit is contained in:
parent
9d04af9ecc
commit
4567474418
@ -37,7 +37,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
|
|||||||
|
|
||||||
validate_rounding_loss: function(frm) {
|
validate_rounding_loss: function(frm) {
|
||||||
let allowance = frm.doc.rounding_loss_allowance;
|
let allowance = frm.doc.rounding_loss_allowance;
|
||||||
if (!(allowance > 0 && allowance < 1)) {
|
if (!(allowance >= 0 && allowance < 1)) {
|
||||||
frappe.throw(__("Rounding Loss Allowance should be between 0 and 1"));
|
frappe.throw(__("Rounding Loss Allowance should be between 0 and 1"));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@ class ExchangeRateRevaluation(Document):
|
|||||||
self.set_total_gain_loss()
|
self.set_total_gain_loss()
|
||||||
|
|
||||||
def validate_rounding_loss_allowance(self):
|
def validate_rounding_loss_allowance(self):
|
||||||
if not (self.rounding_loss_allowance > 0 and self.rounding_loss_allowance < 1):
|
if not (self.rounding_loss_allowance >= 0 and self.rounding_loss_allowance < 1):
|
||||||
frappe.throw(_("Rounding Loss Allowance should be between 0 and 1"))
|
frappe.throw(_("Rounding Loss Allowance should be between 0 and 1"))
|
||||||
|
|
||||||
def set_total_gain_loss(self):
|
def set_total_gain_loss(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user