Merge pull request #16102 from deepeshgarg007/fees
Paid Amount not showing for fees in web portal fix
diff --git a/erpnext/education/doctype/fees/fees.json b/erpnext/education/doctype/fees/fees.json
index ac32717..2413967 100644
--- a/erpnext/education/doctype/fees/fees.json
+++ b/erpnext/education/doctype/fees/fees.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -999,39 +1000,6 @@
"collapsible": 0,
"columns": 0,
"default": "0",
- "fieldname": "paid_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Paid Amount",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0",
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"hidden": 0,
@@ -1360,7 +1328,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-08-21 14:44:48.968839",
+ "modified": "2018-11-26 20:42:14.467284",
"modified_by": "Administrator",
"module": "Education",
"name": "Fees",
diff --git a/erpnext/education/doctype/fees/fees.py b/erpnext/education/doctype/fees/fees.py
index bfe6af4..aa616e6 100644
--- a/erpnext/education/doctype/fees/fees.py
+++ b/erpnext/education/doctype/fees/fees.py
@@ -112,7 +112,10 @@
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, grand_total from `tabFees`
+ return frappe. db.sql('''
+ select name, program, due_date, grand_total - outstanding_amount as paid_amount,
+ outstanding_amount, grand_total, currency
+ 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/templates/includes/fee/fee_row.html b/erpnext/templates/includes/fee/fee_row.html
index ac2b100..d5fd682 100644
--- a/erpnext/templates/includes/fee/fee_row.html
+++ b/erpnext/templates/includes/fee/fee_row.html
@@ -5,13 +5,13 @@
{{ doc.program }}
</div>
<div class="col-xs-2">
- {{ doc.get_formatted("total_amount") }}
+ {{ frappe.utils.fmt_money(doc.grand_total, currency=doc.currency) }}
</div>
<div class="col-xs-2">
- {{ doc.get_formatted("paid_amount") }}
+ {{ frappe.utils.fmt_money(doc.paid_amount, currency=doc.currency) }}
</div>
<div class="col-xs-2">
- {{ doc.get_formatted("outstanding_amount") }}
+ {{ frappe.utils.fmt_money(doc.outstanding_amount, currency=doc.currency) }}
</div>
</div>
</a>