Minor fixes
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index d1ce3c6..61b3c52 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -26,7 +26,7 @@
 			self.validate_return_doc()
 			self.set_total_in_words()
 
-		if not self.is_return:
+		if self.doctype in ("Sales Invoice", "Purchase Invoice") and not self.is_return:
 			self.validate_due_date()
 
 		if self.meta.get_field("is_recurring"):
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index 31a2f50..a94856d 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -71,7 +71,6 @@
 			
 	def validate_purchase_return(self):
 		for d in self.get("items"):
-			print flt(d.rejected_qty)
 			if self.is_return and flt(d.rejected_qty) != 0:
 				frappe.throw(_("Row #{0}: Rejected Qty can not be entered in Purchase Return").format(d.idx))
 				
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 78e1038..58a1331 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -51,7 +51,6 @@
 		self.get_stock_and_rate()
 		self.validate_bom()
 		self.validate_finished_goods()
-		self.validate_return_reference_doc()
 		self.validate_with_material_request()
 		self.validate_valuation_rate()
 		self.set_total_incoming_outgoing_value()
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index 5406bdc..95196cc 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -12,7 +12,7 @@
 from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice
 from erpnext.stock.stock_ledger import get_previous_sle
 from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order, create_dn_against_so
-from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv, NotUpdateStockError
+from erpnext.stock.doctype.stock_entry.stock_entry import NotUpdateStockError
 from erpnext.stock.doctype.stock_reconciliation.test_stock_reconciliation import create_stock_reconciliation
 
 def get_sle(**args):
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
index eaa82dd..dde3386 100644
--- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
@@ -107,8 +107,6 @@
 		"valuation_rate": args.rate
 	})
 
-	sr.insert()
-
 	sr.submit()
 	return sr