Skip to content

Commit

Permalink
fix(minor): don't print tax rate if its '0' (#31838)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3b4c0a3)
  • Loading branch information
ruthra-kumar authored and mergify[bot] committed Aug 30, 2022
1 parent 821c1cd commit a46dca5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion erpnext/selling/page/point_of_sale/pos_item_cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<div class="tax-row">
<div class="tax-label">${description}</div>
<div class="tax-value">${format_currency(t.tax_amount_after_discount_amount, currency)}</div>
Expand Down
3 changes: 2 additions & 1 deletion erpnext/selling/page/point_of_sale/pos_past_order_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `
<div class="tax-row">
<div class="tax-label">${description}</div>
Expand Down

0 comments on commit a46dca5

Please sign in to comment.