From 093a29785687d444ce65fb47f62b7cc5ccc20ca7 Mon Sep 17 00:00:00 2001 From: Ankit Singhaniya Date: Mon, 1 Nov 2021 23:08:08 +0530 Subject: [PATCH] simplify the condition to check if value is larger then max amount --- models/doctype/Payment/Payment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index fd89e2f8..bd934ece 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -107,7 +107,7 @@ module.exports = { validate(value, doc) { const amount = doc.getSum('for', 'amount'); - if (!(amount >= value)) { + if (value > amount)) { throw new frappe.errors.ValidationError( frappe._( `Payment amount cannot exceed ${frappe.format(