From dd942bb3d2e0597d3e5bb642e8eaa8a52a200d37 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 4 Feb 2015 18:52:35 +0530 Subject: [PATCH] [minor] fixed update item name in bom patch, removed filter from sales invoice list, show tax calculation only if tax exists --- .../accounts/doctype/sales_invoice/sales_invoice_list.js | 7 +++---- erpnext/patches/v5_0/update_item_name_in_bom.py | 1 + erpnext/public/js/transaction.js | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index efc3eb4597..46b720111b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -5,14 +5,13 @@ frappe.listview_settings['Sales Invoice'] = { add_fields: ["customer", "customer_name", "grand_total", "outstanding_amount", "due_date", "company", "currency"], - filters: [["outstanding_amount", ">", "0"]], get_indicator: function(doc) { if(doc.outstanding_amount==0) { - return [__("Paid"), "green", "oustanding_amount,=,0"] + return [__("Paid"), "green", "outstanding_amount,=,0"] } else if (doc.outstanding_amount > 0 && doc.due_date > frappe.datetime.get_today()) { - return [__("Unpaid"), "orange", "oustanding_amount,>,0|due_date,>,Today"] + return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>,Today"] } else if (doc.outstanding_amount > 0 && doc.due_date <= frappe.datetime.get_today()) { - return [__("Overdue"), "red", "oustanding_amount,>,0|due_date,<=,Today"] + return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<=,Today"] } }, right_column: "grand_total_export" diff --git a/erpnext/patches/v5_0/update_item_name_in_bom.py b/erpnext/patches/v5_0/update_item_name_in_bom.py index 56472f8aac..6b5623216d 100644 --- a/erpnext/patches/v5_0/update_item_name_in_bom.py +++ b/erpnext/patches/v5_0/update_item_name_in_bom.py @@ -7,6 +7,7 @@ def execute(): frappe.reload_doc("manufacturing", "doctype", "bom") frappe.reload_doc("manufacturing", "doctype", "bom_item") frappe.reload_doc("manufacturing", "doctype", "bom_explosion_item") + frappe.reload_doc("manufacturing", "doctype", "bom_operation") frappe.db.sql("""update `tabBOM` as bom set bom.item_name = \ ( select item.item_name from `tabItem` as item where item.name = bom.item)""") diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index bf10c15da3..001da28c9b 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -793,8 +793,13 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ show_item_wise_taxes: function() { if(this.frm.fields_dict.other_charges_calculation) { - $(this.get_item_wise_taxes_html()) - .appendTo($(this.frm.fields_dict.other_charges_calculation.wrapper).empty()); + var html = this.get_item_wise_taxes_html(); + if (html) { + this.frm.toggle_display("other_charges_calculation", true); + $(this.frm.fields_dict.other_charges_calculation.wrapper).html(html); + } else { + this.frm.toggle_display("other_charges_calculation", false); + } } },