diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index 05d7c991..97e2db17 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -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')}.` ) ); diff --git a/models/doctype/Payment/PaymentServer.js b/models/doctype/Payment/PaymentServer.js index f4b07d77..97554795 100644 --- a/models/doctype/Payment/PaymentServer.js +++ b/models/doctype/Payment/PaymentServer.js @@ -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.` ); } diff --git a/models/doctype/SalesInvoiceItem/SalesInvoiceItem.js b/models/doctype/SalesInvoiceItem/SalesInvoiceItem.js index 6c32030f..40ac5e7c 100644 --- a/models/doctype/SalesInvoiceItem/SalesInvoiceItem.js +++ b/models/doctype/SalesInvoiceItem/SalesInvoiceItem.js @@ -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.` ) );