mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
Updated suggested changes
This commit is contained in:
parent
102ef29d6b
commit
6178cf55c0
@ -105,11 +105,13 @@ module.exports = {
|
|||||||
required: 1,
|
required: 1,
|
||||||
formula: doc => doc.getSum('for', 'amount'),
|
formula: doc => doc.getSum('for', 'amount'),
|
||||||
validate(value, doc) {
|
validate(value, doc) {
|
||||||
let amount = doc.getSum('for', 'amount');
|
const amount = doc.getSum('for', 'amount');
|
||||||
let isValid = amount >= value && value > 0 ? true : false;
|
const isValid = amount >= value && value > 0;
|
||||||
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
throw new frappe.errors.ValidationError(`Invalid amount ${value}`);
|
throw new frappe.errors.ValidationError(
|
||||||
|
`Payment amount ${value} cannot be accepted. Please enter a value between 0 and ${amount}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user