Fixed merge conflict
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index 0ecf6e1..55fcaab 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -119,7 +119,8 @@
 		if (doc.doctype == "Purchase Order" && item.blanket_order_rate) {
 			item_rate = item.blanket_order_rate;
 		}
-		item.rate = flt(item_rate * (1 - item.discount_percentage / 100.0), precision("rate", item));
+		item.discount_amount = flt(item_rate) * flt(item.discount_percentage) / 100;		
+		item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
 
 		this.calculate_taxes_and_totals();
 	},