accepted qty = received qty, if not accepted qty
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.js b/stock/doctype/purchase_receipt/purchase_receipt.js
index 9ed587b..a15573f 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -150,9 +150,10 @@
 cur_frm.cscript.received_qty = function(doc, cdt, cdn) {
 	var d = locals[cdt][cdn];
 	ret = {
-			'qty' : d.qty ? d.qty : d.received_qty,
+			'qty' : (flt(d.qty) && flt(d.qty) < flt(d.received_qty)) 
+			 	? flt(d.qty) : flt(d.received_qty),
 			'stock_qty': 0,
-			'rejected_qty' : 0
+			'rejected_qty' : 0,
 		}
 	set_multiple('Purchase Receipt Item', cdn, ret, 'purchase_receipt_details');
 	cur_frm.cscript.calc_amount(doc, 2);