copy the older total amount field and corrsp. changes in report (#11322)

diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index f6289f5..805e1ef 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -452,3 +452,4 @@
 erpnext.patches.v9_0.add_healthcare_domain
 erpnext.patches.v9_0.set_variant_item_description
 erpnext.patches.v9_0.set_uoms_in_variant_field
+erpnext.patches.v9_0.copy_old_fees_field_data
diff --git a/erpnext/patches/v9_0/copy_old_fees_field_data.py b/erpnext/patches/v9_0/copy_old_fees_field_data.py
new file mode 100644
index 0000000..fb11ee5
--- /dev/null
+++ b/erpnext/patches/v9_0/copy_old_fees_field_data.py
@@ -0,0 +1,11 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	if "total_amount" not in frappe.db.get_table_columns("Fees"):
+		return
+
+	frappe.db.sql("""update tabFees set grand_total=total_amount where grand_total = 0.0""")
\ No newline at end of file
diff --git a/erpnext/schools/doctype/fees/fees.py b/erpnext/schools/doctype/fees/fees.py
index 42b329e..bfe6af4 100644
--- a/erpnext/schools/doctype/fees/fees.py
+++ b/erpnext/schools/doctype/fees/fees.py
@@ -112,7 +112,7 @@
 	user = frappe.session.user
 	student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user)
 	if student:
-		return frappe. db.sql('''select name, program, due_date, paid_amount, outstanding_amount, total_amount from `tabFees`
+		return frappe. db.sql('''select name, program, due_date, paid_amount, outstanding_amount, grand_total from `tabFees`
 			where student= %s and docstatus=1
 			order by due_date asc limit {0} , {1}'''
 			.format(limit_start, limit_page_length), student, as_dict = True)
diff --git a/erpnext/schools/report/student_fee_collection/student_fee_collection.json b/erpnext/schools/report/student_fee_collection/student_fee_collection.json
index 264638f..5c63765 100644
--- a/erpnext/schools/report/student_fee_collection/student_fee_collection.json
+++ b/erpnext/schools/report/student_fee_collection/student_fee_collection.json
@@ -5,14 +5,14 @@
  "disabled": 0, 
  "docstatus": 0, 
  "doctype": "Report", 
- "idx": 2, 
+ "idx": 3, 
  "is_standard": "Yes", 
- "modified": "2017-02-24 20:05:08.514320", 
+ "modified": "2017-10-25 11:59:26.003899", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Fee Collection", 
  "owner": "Administrator", 
- "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(paid_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(total_amount) as \"Total Amount:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student", 
+ "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(paid_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nGROUP BY\n student", 
  "ref_doctype": "Fees", 
  "report_name": "Student Fee Collection", 
  "report_type": "Query Report",