From 3b4c0a3fc0c4fa2ab8b07ac9918352486d75a1da Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 16 Aug 2022 16:35:46 +0530 Subject: [PATCH] fix(minor): don't print tax rate if its '0' (#31838) --- erpnext/selling/page/point_of_sale/pos_item_cart.js | 3 ++- erpnext/selling/page/point_of_sale/pos_past_order_summary.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/pos_item_cart.js b/erpnext/selling/page/point_of_sale/pos_item_cart.js index eacf480ef8f..e7dd211c0f4 100644 --- a/erpnext/selling/page/point_of_sale/pos_item_cart.js +++ b/erpnext/selling/page/point_of_sale/pos_item_cart.js @@ -524,7 +524,8 @@ erpnext.PointOfSale.ItemCart = class { const currency = this.events.get_frm().doc.currency; const taxes_html = taxes.map(t => { if (t.tax_amount_after_discount_amount == 0.0) return; - const description = /[0-9]+/.test(t.description) ? t.description : `${t.description} @ ${t.rate}%`; + // if tax rate is 0, don't print it. + const description = /[0-9]+/.test(t.description) ? t.description : ((t.rate != 0) ? `${t.description} @ ${t.rate}%`: t.description); return `
${description}
${format_currency(t.tax_amount_after_discount_amount, currency)}
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 eeb8523f19c..40165c3484f 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 @@ -130,7 +130,8 @@ erpnext.PointOfSale.PastOrderSummary = class { if (!doc.taxes.length) return ''; let taxes_html = doc.taxes.map(t => { - const description = /[0-9]+/.test(t.description) ? t.description : `${t.description} @ ${t.rate}%`; + // if tax rate is 0, don't print it. + const description = /[0-9]+/.test(t.description) ? t.description : ((t.rate != 0) ? `${t.description} @ ${t.rate}%`: t.description); return `
${description}