update tax amount after discount amount in purchase cycle
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 5dff001..d21b955 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -153,4 +153,5 @@
 execute:frappe.delete_doc("Page","stock-level")
 erpnext.patches.v5_0.reclculate_planned_operating_cost_in_production_order
 erpnext.patches.v5_0.repost_requested_qty
-erpnext.patches.v5_0.fix_taxes_and_totals_in_party_currency
\ No newline at end of file
+erpnext.patches.v5_0.fix_taxes_and_totals_in_party_currency
+erpnext.patches.v5_0.update_tax_amount_after_discount_in_purchase_cycle
\ No newline at end of file
diff --git a/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py b/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py
new file mode 100644
index 0000000..987247c
--- /dev/null
+++ b/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+import frappe
+
+def execute():
+	frappe.db.sql("""
+		update 
+			`tabPurchase Taxes and Charges`
+		set
+			tax_amount_after_discount_amount = tax_amount,
+			base_tax_amount_after_discount_amount = base_tax_amount
+		where
+			ifnull(tax_amount_after_discount_amount, 0) = 0 
+			and ifnull(base_tax_amount_after_discount_amount, 0) = 0 
+	""")
\ No newline at end of file