Merge branch 'navupdate' of github.com:webnotes/erpnext into navupdate

Conflicts:
	version.num
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index 00b6844..bd7e77d 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -152,11 +152,15 @@
 		amt = flt(self.doc.debit) - flt(self.doc.credit)
 		if det[0][2] == 'Credit': amt = -amt
 
-		debit = cancel and -1 * flt(self.doc.credit) or flt(self.doc.debit)
-		credit = cancel and -1 * flt(self.doc.debit) or flt(self.doc.credit)
-		
+		if cancel:
+			debit = -1 * flt(self.doc.credit)
+			credit = -1 * flt(self.doc.debit)
+		else:
+			debit = flt(self.doc.debit)
+			credit = flt(self.doc.credit)
+
 		self.create_new_balances(det)
-		
+
 		# build dict
 		p = {
 			'debit': self.doc.is_opening=='No' and flt(debit) or 0
@@ -197,7 +201,7 @@
 					and ifnull(a.is_pl_account, 'No') = 'No'
 					and ab.period = ab.fiscal_year
 					and fy.name = ab.fiscal_year
-					and fy.year_start_date > %(posting_date)s""" % p)
+					and fy.year_start_date > '%(posting_date)s'""" % p)
 
 		# Update balance for all period for future years
 		sql("""update `tabAccount Balance` ab, `tabAccount` a, `tabFiscal Year` fy 
@@ -209,7 +213,7 @@
 					and ab.account = a.name
 					and ifnull(a.is_pl_account, 'No') = 'No'
 					and fy.name = ab.fiscal_year
-					and fy.year_start_date > %(posting_date)s""" % p)
+					and fy.year_start_date > '%(posting_date)s'""" % p)
 
 
 
diff --git a/erpnext/startup/js/modules.js b/erpnext/startup/js/modules.js
index add068c..d43b021 100644
--- a/erpnext/startup/js/modules.js
+++ b/erpnext/startup/js/modules.js
@@ -32,7 +32,7 @@
 	$(wrapper).find('[href*="List/"]').each(function() {
 		var href = $(this).attr('href');
 		var dt = href.split('/')[1];
-		if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) {
+		if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) {
 			var txt = $(this).text();
 			$(this).parent().css('color', '#999').html(txt);
 		}
@@ -41,7 +41,7 @@
 	// reports
 	$(wrapper).find('[data-doctype]').each(function() {
 		var dt = $(this).attr('data-doctype');
-		if(wn.boot.profile.can_read.indexOf(dt)==-1) {
+		if(wn.boot.profile.all_read.indexOf(dt)==-1) {
 			var txt = $(this).text();
 			$(this).parent().css('color', '#999').html(txt);
 		}
@@ -51,7 +51,7 @@
 	$(wrapper).find('[href*="Form/"]').each(function() {
 		var href = $(this).attr('href');
 		var dt = href.split('/')[1];
-		if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) {
+		if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) {
 			var txt = $(this).text();
 			$(this).parent().css('color', '#999').html(txt);
 		}
diff --git a/js/all-app.js b/js/all-app.js
index 832923c..24bd724 100644
--- a/js/all-app.js
+++ b/js/all-app.js
Binary files differ
diff --git a/version.num b/version.num
index e1233a6..e791c50 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-787
\ No newline at end of file
+787