From f02a0d4d24a15164798fea85fde2ffbd33013675 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 5 Aug 2016 15:50:52 +0530 Subject: [PATCH] [bug fix] Fixed bug in fee caclulation, renamed functions --- erpnext/schools/api.py | 6 ++--- .../doctype/fee_structure/fee_structure.js | 6 ++--- erpnext/schools/doctype/fees/fees.js | 27 +++++++++++-------- .../program_enrollment/program_enrollment.py | 8 +++--- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/erpnext/schools/api.py b/erpnext/schools/api.py index 26577b4adb..4649d0cc04 100644 --- a/erpnext/schools/api.py +++ b/erpnext/schools/api.py @@ -94,13 +94,13 @@ def get_fee_structure(program, academic_term=None): return fee_structure[0].name if fee_structure else None @frappe.whitelist() -def get_fee_amount(fee_structure): - """Returns Fee Amount. +def get_fee_components(fee_structure): + """Returns Fee Components. :param fee_structure: Fee Structure. """ if fee_structure: - fs = frappe.get_list("Fee Amount", fields=["fees_category", "amount"] , filters={"parent": fee_structure}, order_by= "idx") + fs = frappe.get_list("Fee Component", fields=["fees_category", "amount"] , filters={"parent": fee_structure}, order_by= "idx") return fs @frappe.whitelist() diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.js b/erpnext/schools/doctype/fee_structure/fee_structure.js index e3d4544870..391c935b05 100644 --- a/erpnext/schools/doctype/fee_structure/fee_structure.js +++ b/erpnext/schools/doctype/fee_structure/fee_structure.js @@ -1,8 +1,8 @@ -frappe.ui.form.on("Fee Amount", { +frappe.ui.form.on("Fee Component", { amount: function(frm) { total_amount = 0; - for(var i=0;i