From aa71b5b6ea634ac5140917d463269f68b7899767 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 5 Aug 2013 13:00:53 +0530 Subject: [PATCH] [fix] [minor] show item-wise taxes --- public/js/transaction.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/transaction.js b/public/js/transaction.js index 6348e5a30e6..34d3cb04298 100644 --- a/public/js/transaction.js +++ b/public/js/transaction.js @@ -315,15 +315,15 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ var tax_rate = tax_data[0] == null ? "" : (flt(tax_data[0], tax_rate_precision) + "%"), tax_amount = format_currency(flt(tax_data[1], tax_amount_precision), company_currency); - item_tax[item_code][tax.account_head] = [tax_rate, tax_amount]; + item_tax[item_code][tax.name] = [tax_rate, tax_amount]; } else { - item_tax[item_code][tax.account_head] = [flt(tax_data, tax_rate_precision) + "%", ""]; + item_tax[item_code][tax.name] = [flt(tax_data, tax_rate_precision) + "%", ""]; } }); - tax_accounts.push(tax.account_head); + tax_accounts.push([tax.name, tax.account_head]); }); - var headings = $.map([wn._("Item Name")].concat(tax_accounts), + var headings = $.map([wn._("Item Name")].concat($.map(tax_accounts, function(head) { return head[1]; })), function(head) { return '' + (head || "") + "" }).join("\n"); var rows = $.map(this.get_item_doclist(), function(item) { @@ -332,8 +332,8 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ return repl("%(item_name)s%(taxes)s", { item_name: item.item_name, taxes: $.map(tax_accounts, function(head) { - return item_tax_record[head] ? - "(" + item_tax_record[head][0] + ") " + item_tax_record[head][1] + "" : + return item_tax_record[head[0]] ? + "(" + item_tax_record[head[0]][0] + ") " + item_tax_record[head[0]][1] + "" : ""; }).join("\n") });