Merge branch 'develop'
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 54d8de2..7d2298f 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
 from __future__ import unicode_literals
-__version__ = '5.0.4'
+__version__ = '5.0.5'
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 3ae36c1..b5056d7 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -20,9 +20,9 @@
 	# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
 	cond = " ifnull(disabled, 0) = 0"
 	if fiscal_year:
-		cond = " and fy.name = %(fiscal_year)s"
+		cond += " and fy.name = %(fiscal_year)s"
 	else:
-		cond = " and %(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
+		cond += " and %(transaction_date)s >= fy.year_start_date and %(transaction_date)s <= fy.year_end_date"
 
 	if company:
 		cond += """ and (not exists(select name from `tabFiscal Year Company` fyc where fyc.parent = fy.name)
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 483172a..aa8638e 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -5,7 +5,7 @@
 app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
 app_icon = "icon-th"
 app_color = "#e74c3c"
-app_version = "5.0.4"
+app_version = "5.0.5"
 
 error_report_email = "support@erpnext.com"
 
diff --git a/setup.py b/setup.py
index ad111d6..669c901 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = "5.0.4"
+version = "5.0.5"
 
 with open("requirements.txt", "r") as f:
 	install_requires = f.readlines()