-
${invoice.name}
+
${frappe.utils.escape_html(invoice.name)}
${posting_datetime}
@@ -1051,7 +1064,7 @@ erpnext.PointOfSale.ItemCart = class {
${format_currency(invoice.grand_total, invoice.currency, frappe.sys_defaults.currency_precision) || 0}
-
+
${__(invoice.status)}
diff --git a/erpnext/selling/page/point_of_sale/pos_item_details.js b/erpnext/selling/page/point_of_sale/pos_item_details.js
index 75f6015980d..988ab60d548 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_details.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_details.js
@@ -129,24 +129,26 @@ erpnext.PointOfSale.ItemDetails = class {
return ``;
}
- this.$item_name.html(item_name);
+ this.$item_name.html(frappe.utils.escape_html(item_name));
this.$item_description.html(get_description_html());
this.$item_price.html(format_currency(price_list_rate, this.currency));
if (!this.hide_images && image) {
this.$item_image.html(
`

`
);
} else {
- this.$item_image.html(`
${frappe.get_abbr(item_name)}
`);
+ this.$item_image.html(
+ `
${frappe.utils.escape_html(frappe.get_abbr(item_name))}
`
+ );
}
}
handle_broken_image($img) {
- const item_abbr = $($img).attr("alt");
+ const item_abbr = frappe.utils.escape_html($($img).attr("alt"));
$($img).replaceWith(`
${item_abbr}
`);
}
diff --git a/erpnext/selling/page/point_of_sale/pos_item_selector.js b/erpnext/selling/page/point_of_sale/pos_item_selector.js
index 1da8e1e5d65..f05040c6a08 100644
--- a/erpnext/selling/page/point_of_sale/pos_item_selector.js
+++ b/erpnext/selling/page/point_of_sale/pos_item_selector.js
@@ -196,10 +196,14 @@ erpnext.PointOfSale.ItemSelector = class {
${
!me.hide_images
? `
- ${format_currency(price_list_rate, item.currency, precision) || 0} / ${uom}
+ ${frappe.utils.escape_html(format_currency(price_list_rate, item.currency, precision)) || 0} / ${uom}
`
: `
-
${format_currency(price_list_rate, item.currency, precision) || 0}
+
${
+ frappe.utils.escape_html(
+ format_currency(price_list_rate, item.currency, precision)
+ ) || 0
+ }
${uom}
${qty_to_display || "Non stock item"}
`
diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_list.js b/erpnext/selling/page/point_of_sale/pos_past_order_list.js
index 89bda039536..7eb5e16b2d6 100644
--- a/erpnext/selling/page/point_of_sale/pos_past_order_list.js
+++ b/erpnext/selling/page/point_of_sale/pos_past_order_list.js
@@ -42,7 +42,7 @@ erpnext.PointOfSale.PastOrderList = class {
this.$invoices_container.on("click", ".invoice-wrapper", function () {
const invoice_clicked = $(this);
const invoice_doctype = invoice_clicked.attr("data-invoice-doctype");
- const invoice_name = unescape(invoice_clicked.attr("data-invoice-name"));
+ const invoice_name = invoice_clicked.attr("data-invoice-name");
$(".invoice-wrapper").removeClass("invoice-selected");
invoice_clicked.addClass("invoice-selected");
@@ -108,15 +108,15 @@ erpnext.PointOfSale.PastOrderList = class {
);
return `
+ }" data-invoice-name="${frappe.utils.escape_html(invoice.name)}">
- ${frappe.ellipsis(invoice.customer_name, 20)}
+ ${frappe.utils.escape_html(frappe.ellipsis(invoice.customer_name, 20))}
-
${invoice.name}
+
${frappe.utils.escape_html(invoice.name)}
${format_currency(invoice.grand_total, invoice.currency) || 0}
diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
index 4585b3307b2..d59b50c60ad 100644
--- a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
+++ b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js
@@ -82,15 +82,19 @@ erpnext.PointOfSale.PastOrderSummary = class {
return `
-
${doc.customer_name}
- ${is_customer_naming_by_customer_name ? `
${doc.customer}
` : ""}
-
${this.customer_email}
+
${frappe.utils.escape_html(doc.customer_name)}
+ ${
+ is_customer_naming_by_customer_name
+ ? `
${frappe.utils.escape_html(doc.customer)}
`
+ : ""
+ }
+
${frappe.utils.escape_html(this.customer_email)}
-
${__("Sold by")}: ${doc.owner}
+
${__("Sold by")}: ${frappe.utils.escape_html(doc.owner)}
${format_currency(doc.paid_amount, doc.currency)}
-
${doc.name}
+
${frappe.utils.escape_html(doc.name)}
${__(doc.status)}
`;
}
@@ -100,8 +104,8 @@ erpnext.PointOfSale.PastOrderSummary = class {
return `
-
${item_data.item_name}
-
${item_data.qty || 0} ${item_data.uom}
+
${frappe.utils.escape_html(item_data.item_name)}
+
${item_data.qty || 0} ${frappe.utils.escape_html(item_data.uom)}
${get_rate_discount_html()}
@@ -166,7 +170,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
.map((t) => {
return `
-
${t.description}
+
${frappe.utils.escape_html(t.description)}
${format_currency(t.tax_amount_after_discount_amount, doc.currency)}
`;
@@ -185,7 +189,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
get_payment_html(doc, payment) {
return `
-
${__(payment.mode_of_payment)}
+
${frappe.utils.escape_html(__(payment.mode_of_payment))}
${format_currency(payment.amount, doc.currency)}
`;
}
diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js
index a92c8958917..bf8c9f44049 100644
--- a/erpnext/selling/page/point_of_sale/pos_payment.js
+++ b/erpnext/selling/page/point_of_sale/pos_payment.js
@@ -519,7 +519,7 @@ erpnext.PointOfSale.Payment = class {
return `
- ${p.mode_of_payment}
+ ${frappe.utils.escape_html(p.mode_of_payment)}
${amount}
@@ -603,7 +603,7 @@ erpnext.PointOfSale.Payment = class {
Redeem Loyalty Points
${amount}
-
${loyalty_program}
+
${frappe.utils.escape_html(loyalty_program)}
`