[fix] patches
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 28499c1..2d5df15 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -217,7 +217,7 @@
tax.grand_total_for_current_item = flt(item.net_amount + current_tax_amount, tax.precision("total"))
else:
tax.grand_total_for_current_item = \
- flt(self.doc.get("taxes")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision("total_taxes_and_charges"))
+ flt(self.doc.get("taxes")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision("total"))
# in tax.total, accumulate grand total of each item
tax.total += tax.grand_total_for_current_item
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index b3745e7..e4e35ad 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -126,4 +126,4 @@
erpnext.patches.v5_0.update_journal_entry_title
erpnext.patches.v5_0.taxes_and_totals_in_party_currency
erpnext.patches.v5_0.replace_renamed_fields_in_custom_scripts_and_print_formats
-execute:frappe.db.sql("update `tabStock Entry` set from_bom = if(ifnull(bom_no, '')='', 0, 1)")
+erpnext.patches.v5_0.update_from_bom
diff --git a/erpnext/patches/v5_0/update_from_bom.py b/erpnext/patches/v5_0/update_from_bom.py
new file mode 100644
index 0000000..fb4ffcc
--- /dev/null
+++ b/erpnext/patches/v5_0/update_from_bom.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ frappe.reload_doctype("BOM")
+ frappe.db.sql("update `tabStock Entry` set from_bom = if(ifnull(bom_no, '')='', 0, 1)")