2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 14:50:56 +00:00

refactor: replace all frappe._(` instances

This commit is contained in:
18alantom 2022-01-24 11:45:26 +05:30
parent d4675c0e5a
commit 0320743161
3 changed files with 8 additions and 8 deletions

View File

@ -113,7 +113,7 @@ export default {
validate(value, doc) {
if (value.isNegative()) {
throw new frappe.errors.ValidationError(
frappe._(`Payment amount cannot be less than zero.`)
frappe.t(`Payment amount cannot be less than zero.`)
);
}
@ -122,7 +122,7 @@ export default {
if (value.gt(amount)) {
throw new frappe.errors.ValidationError(
frappe._(
frappe.t(
`Payment amount cannot exceed ${frappe.format(
amount,
'Currency'
@ -131,7 +131,7 @@ export default {
);
} else if (value.isZero()) {
throw new frappe.errors.ValidationError(
frappe._(
frappe.t(
`Payment amount cannot be ${frappe.format(value, 'Currency')}.`
)
);

View File

@ -84,7 +84,7 @@ export default class PaymentServer extends BaseDocument {
: '';
throw new Error(
frappe._(
frappe.t(
`Amount: ${payment} ${writeoffString}is less than the total amount allocated to references: ${refAmount}.`
)
);
@ -115,7 +115,7 @@ export default class PaymentServer extends BaseDocument {
outstandingAmount = baseGrandTotal;
}
if (this.amount.lte(0) || this.amount.gt(outstandingAmount)) {
let message = frappe._(
let message = frappe.t(
`Payment amount: ${frappe.format(
this.amount,
'Currency'
@ -127,7 +127,7 @@ export default class PaymentServer extends BaseDocument {
if (this.amount.lte(0)) {
const amt = frappe.format(this.amount, 'Currency');
message = frappe._(
message = frappe.t(
`Payment amount: ${amt} should be greater than 0.`
);
}

View File

@ -41,7 +41,7 @@ export default {
}
throw new frappe.errors.ValidationError(
frappe._(`Quantity (${value}) cannot be less than zero.`)
frappe.t(`Quantity (${value}) cannot be less than zero.`)
);
},
},
@ -63,7 +63,7 @@ export default {
}
throw new frappe.errors.ValidationError(
frappe._(
frappe.t(
`Rate (${frappe.format(value, 'Currency')}) cannot be less zero.`
)
);