Merge branch 'develop'
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 6bb9a1f..ca55b5f 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
-__version__ = '7.0.20'
+__version__ = '7.0.21'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 94709a7..4e00c32 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -772,6 +772,9 @@
company_currency = get_company_currency(company)
account_details = frappe.db.get_value("Account", account, ["account_type", "account_currency"], as_dict=1)
+ if not account_details:
+ return
+
if account_details.account_type == "Receivable":
party_type = "Customer"
elif account_details.account_type == "Payable":
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
index 364b78c..a092e56 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.js
@@ -1,21 +1,37 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-
-//========================== On Load =================================================
-cur_frm.cscript.onload = function(doc, cdt, cdn) {
- if (!doc.transaction_date) doc.transaction_date = dateutil.obj_to_str(new Date());
-}
-
-
-// ***************** Get Account Head *****************
-cur_frm.fields_dict['closing_account_head'].get_query = function(doc, cdt, cdn) {
- return {
- filters: [
- ['Account', 'company', '=', doc.company],
- ['Account', 'is_group', '=', '0'],
- ['Account', 'freeze_account', '=', 'No'],
- ['Account', 'root_type', 'in', 'Liability, Equity']
- ]
+frappe.ui.form.on('Period Closing Voucher', {
+ onload: function(frm) {
+ if (!frm.doc.transaction_date) frm.doc.transaction_date = dateutil.obj_to_str(new Date());
+ },
+
+ setup: function(frm) {
+ frm.set_query("closing_account_head", function() {
+ return {
+ filters: [
+ ['Account', 'company', '=', frm.doc.company],
+ ['Account', 'is_group', '=', '0'],
+ ['Account', 'freeze_account', '=', 'No'],
+ ['Account', 'root_type', 'in', 'Liability, Equity']
+ ]
+ }
+ });
+ },
+
+ refresh: function(frm) {
+ if(frm.doc.docstatus==1) {
+ frm.add_custom_button(__('Ledger'), function() {
+ frappe.route_options = {
+ "voucher_no": frm.doc.name,
+ "from_date": frm.doc.posting_date,
+ "to_date": frm.doc.posting_date,
+ "company": frm.doc.company,
+ group_by_voucher: 0
+ };
+ frappe.set_route("query-report", "General Ledger");
+ }, "icon-table");
+ }
}
-}
+
+})
diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
index 6f5a663..d68e291 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
+++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py
@@ -55,9 +55,8 @@
if random_expense_account:
# Check posted value for teh above random_expense_account
gle_for_random_expense_account = frappe.db.sql("""
- select debit - credit as amount,
- debit_in_account_currency - credit_in_account_currency
- as amount_in_account_currency
+ select sum(debit - credit) as amount,
+ sum(debit_in_account_currency - credit_in_account_currency) as amount_in_account_currency
from `tabGL Entry`
where voucher_type='Period Closing Voucher' and voucher_no=%s and account =%s""",
(pcv.name, random_expense_account[0].account), as_dict=True)
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index a7e49dd..cb637d2 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -8,6 +8,7 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
+ "editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -832,7 +833,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-06-13 21:20:13.805101",
+ "modified": "2016-08-06 17:05:59.990031",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -879,7 +880,7 @@
"write": 0
}
],
- "quick_entry": 1,
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index 176e529..d17e80f 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -301,7 +301,7 @@
asset.flags.ignore_validate_update_after_submit = True
asset.save()
- def make_gl_entries(self, repost_future_gle=False):
+ def make_gl_entries(self, repost_future_gle=True):
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 9643764..53144cb 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -91,7 +91,7 @@
def get_mode_of_payment(doc):
return frappe.db.sql(""" select mpa.default_account, mpa.parent, mp.type as type from `tabMode of Payment Account` mpa,
- `tabMode of Payment` mp where mpa.parent = mp.name and company = %(company)s""", {'company': doc.company}, as_dict=1)
+ `tabMode of Payment` mp where mpa.parent = mp.name and mpa.company = %(company)s""", {'company': doc.company}, as_dict=1)
def update_tax_table(doc):
taxes = get_taxes_and_charges('Sales Taxes and Charges Template', doc.taxes_and_charges)
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 3a594c8..843937f 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -52,10 +52,10 @@
if not "range3" in self.filters:
self.filters["range3"] = "90"
- for label in ("0-{range1}".format(**self.filters),
- "{range1}-{range2}".format(**self.filters),
- "{range2}-{range3}".format(**self.filters),
- "{range3}-{above}".format(range3=self.filters.range3, above=_("Above"))):
+ for label in ("0-{range1}".format(range1=self.filters["range1"]),
+ "{range1}-{range2}".format(range1=self.filters["range1"]+1, range2=self.filters["range2"]),
+ "{range2}-{range3}".format(range2=self.filters["range2"]+1, range3=self.filters["range3"]),
+ "{range3}-{above}".format(range3=self.filters["range3"] + 1, above=_("Above"))):
columns.append({
"label": label,
"fieldtype": "Currency",
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index 08f9d23..2b8dce0 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -229,12 +229,12 @@
"type": "list"
},
{
- "module_name": "Examination",
+ "module_name": "Assessment",
"color": "#8a70be",
"icon": "icon-file-text-alt",
- "label": _("Examination"),
- "link": "List/Examination",
- "_doctype": "Examination",
+ "label": _("Assessment"),
+ "link": "List/Assessment",
+ "_doctype": "Assessment",
"type": "list"
},
{
@@ -261,7 +261,7 @@
"icon": "icon-map-marker",
"label": _("Room"),
"link": "List/Room",
- "_doctype": "Examination",
+ "_doctype": "Room",
"type": "list"
},
{
diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py
index 78688c9..5e73fce 100644
--- a/erpnext/config/schools.py
+++ b/erpnext/config/schools.py
@@ -61,7 +61,11 @@
},
{
"type": "doctype",
- "name": "Examination"
+ "name": "Assessment"
+ },
+ {
+ "type": "doctype",
+ "name": "Assessment Group"
},
{
"type": "doctype",
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 46ed9bc..fcdff21 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -38,6 +38,7 @@
gl_list = []
warehouse_with_no_account = []
+
for detail in voucher_details:
sle_list = sle_map.get(detail.name)
if sle_list:
@@ -266,10 +267,9 @@
voucher_obj = frappe.get_doc(voucher_type, voucher_no)
expected_gle = voucher_obj.get_gl_entries(warehouse_account)
if expected_gle:
- if not existing_gle or not compare_existing_and_expected_gle(existing_gle,
- expected_gle):
- _delete_gl_entries(voucher_type, voucher_no)
- voucher_obj.make_gl_entries(repost_future_gle=False)
+ if not existing_gle or not compare_existing_and_expected_gle(existing_gle, expected_gle):
+ _delete_gl_entries(voucher_type, voucher_no)
+ voucher_obj.make_gl_entries(repost_future_gle=False)
else:
_delete_gl_entries(voucher_type, voucher_no)
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 82d23de..566a98b 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -101,7 +101,7 @@
{"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"},
{"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"},
{"title": _("Courses"), "route": "/course", "reference_doctype": "Course"},
- {"title": _("Examination Schedule"), "route": "/examination", "reference_doctype": "Examination"},
+ {"title": _("Assessment Schedule"), "route": "/Assessment", "reference_doctype": "Assessment"},
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees"}
]
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index d42f735..9b97bd1 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -38,7 +38,7 @@
frm.trigger('show_progress');
}
- if(frm.doc.docstatus == 1){
+ if(frm.doc.docstatus == 1 && frm.doc.status != 'Stopped'){
frm.add_custom_button(__('Make Timesheet'), function(){
frappe.model.open_mapped_doc({
method: "erpnext.manufacturing.doctype.production_order.production_order.make_new_timesheet",
@@ -124,20 +124,20 @@
}
// opertions
- if ((doc.operations || []).length) {
+ if (((doc.operations || []).length) && frm.doc.status != 'Stopped') {
frm.add_custom_button(__('Timesheet'), function() {
frappe.route_options = {"production_order": frm.doc.name};
frappe.set_route("List", "Timesheet");
}, __("View"));
}
- if (flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) {
+ if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
var btn = frm.add_custom_button(__('Start'),
cur_frm.cscript['Transfer Raw Materials']);
btn.addClass('btn-primary');
}
- if (flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) {
+ if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
var btn = frm.add_custom_button(__('Finish'),
cur_frm.cscript['Update Finished Goods']);
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index 0f6dae6..2bf3204 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -105,7 +105,7 @@
def stop_unstop(self, status):
""" Called from client side on Stop/Unstop event"""
- self.update_status(status)
+ status = self.update_status(status)
self.update_planned_qty()
frappe.msgprint(_("Production Order status is {0}").format(status))
self.notify_update()
@@ -114,13 +114,15 @@
def update_status(self, status=None):
'''Update status of production order if unknown'''
if not status:
- status = self.get_status()
+ status = self.get_status(status)
if status != self.status:
self.db_set("status", status)
self.update_required_items()
+ return status
+
def get_status(self, status=None):
'''Return the status based on stock entries against this production order'''
if not status:
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 4e99afa..73eac92 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -307,4 +307,6 @@
erpnext.patches.v7_0.remove_old_earning_deduction_doctypes
erpnext.patches.v7_0.make_guardian
erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher
-erpnext.patches.v7_0.set_material_request_type_in_item
\ No newline at end of file
+erpnext.patches.v7_0.set_material_request_type_in_item
+erpnext.patches.v7_0.rename_examination_to_assessment
+erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice
diff --git a/erpnext/patches/v7_0/rename_examination_to_assessment.py b/erpnext/patches/v7_0/rename_examination_to_assessment.py
new file mode 100644
index 0000000..31c8aed
--- /dev/null
+++ b/erpnext/patches/v7_0/rename_examination_to_assessment.py
@@ -0,0 +1,15 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+from frappe.model.utils.rename_field import rename_field
+
+def execute():
+ if frappe.db.exists("DocType", "Examination"):
+ frappe.rename_doc("DocType", "Examination", "Assessment")
+ frappe.reload_doctype("Assessment")
+ rename_field("Assessment", "exam_name", "assessment_name")
+ rename_field("Assessment", "exam_code", "assessment_code")
+
\ No newline at end of file
diff --git a/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py b/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py
new file mode 100644
index 0000000..3a6526c
--- /dev/null
+++ b/erpnext/patches/v7_0/repost_future_gle_for_purchase_invoice.py
@@ -0,0 +1,20 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.utils import cint
+from erpnext.controllers.stock_controller import get_warehouse_account, update_gl_entries_after
+
+def execute():
+ if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
+ return
+
+ wh_account = get_warehouse_account()
+
+ for pi in frappe.get_all("Purchase Invoice", filters={"docstatus": 1, "update_stock": 1}):
+ pi_doc = frappe.get_doc("Purchase Invoice", pi.name)
+ items, warehouses = pi_doc.get_items_and_warehouses()
+ update_gl_entries_after(pi_doc.posting_date, pi_doc.posting_time, warehouses, items, wh_account)
+
+ frappe.db.commit()
\ No newline at end of file
diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py
index abcffad..9140927 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.py
+++ b/erpnext/projects/doctype/timesheet/timesheet.py
@@ -6,6 +6,7 @@
import frappe
from frappe import _
+import json
from datetime import timedelta
from frappe.utils import flt, time_diff_in_hours, get_datetime, getdate, cint, get_datetime_str
from frappe.model.document import Document
@@ -290,3 +291,31 @@
["costing_rate", "billing_rate"], as_dict=True)
return rate[0] if rate else {}
+
+@frappe.whitelist()
+def get_events(start, end, filters=None):
+ """Returns events for Gantt / Calendar view rendering.
+ :param start: Start date-time.
+ :param end: End date-time.
+ :param filters: Filters (JSON).
+ """
+ filters = json.loads(filters)
+
+ conditions = get_conditions(filters)
+ return frappe.db.sql("""select `tabTimesheet Detail`.name as name, `tabTimesheet Detail`.parent as parent,
+ from_time, hours, activity_type, project, to_time from `tabTimesheet Detail`,
+ `tabTimesheet` where `tabTimesheet Detail`.parent = `tabTimesheet`.name and
+ (from_time between %(start)s and %(end)s) {conditions}""".format(conditions=conditions),
+ {
+ "start": start,
+ "end": end
+ }, as_dict=True, update={"allDay": 0})
+
+def get_conditions(filters):
+ conditions = []
+ abbr = {'employee': 'tabTimesheet', 'project': 'tabTimesheet Detail'}
+ for key in filters:
+ if filters.get(key):
+ conditions.append("`%s`.%s = '%s'"%(abbr.get(key), key, filters.get(key)))
+
+ return " and {}".format(" and ".join(conditions)) if conditions else ""
diff --git a/erpnext/projects/doctype/timesheet/timesheet_calendar.js b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
new file mode 100644
index 0000000..6db3e5a
--- /dev/null
+++ b/erpnext/projects/doctype/timesheet/timesheet_calendar.js
@@ -0,0 +1,27 @@
+frappe.views.calendar["Timesheet"] = {
+ field_map: {
+ "start": "from_time",
+ "end": "to_time",
+ "name": "parent",
+ "id": "parent",
+ "title": "activity_type",
+ "allDay": "allDay",
+ "child_name": "name"
+ },
+ gantt: true,
+ filters: [
+ {
+ "fieldtype": "Link",
+ "fieldname": "project",
+ "options": "Project",
+ "label": __("Project")
+ },
+ {
+ "fieldtype": "Link",
+ "fieldname": "employee",
+ "options": "Employee",
+ "label": __("Employee")
+ }
+ ],
+ get_events_method: "erpnext.projects.doctype.timesheet.timesheet.get_events"
+}
\ No newline at end of file
diff --git a/erpnext/schools/api.py b/erpnext/schools/api.py
index 26577b4..4649d0c 100644
--- a/erpnext/schools/api.py
+++ b/erpnext/schools/api.py
@@ -94,13 +94,13 @@
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/examination/__init__.py b/erpnext/schools/doctype/assessment/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/examination/__init__.py
rename to erpnext/schools/doctype/assessment/__init__.py
diff --git a/erpnext/schools/doctype/examination/examination.js b/erpnext/schools/doctype/assessment/assessment.js
similarity index 74%
rename from erpnext/schools/doctype/examination/examination.js
rename to erpnext/schools/doctype/assessment/assessment.js
index b1091f3..799ae7b 100644
--- a/erpnext/schools/doctype/examination/examination.js
+++ b/erpnext/schools/doctype/assessment/assessment.js
@@ -1,9 +1,12 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
cur_frm.add_fetch("student_group", "course", "course");
cur_frm.add_fetch("examiner", "instructor_name", "examiner_name");
cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
cur_frm.add_fetch("student", "title", "student_name");
-frappe.ui.form.on("Examination" ,{
+frappe.ui.form.on("Assessment" ,{
student_group : function(frm) {
frm.set_value("results" ,"");
if (frm.doc.student_group) {
@@ -15,7 +18,7 @@
callback: function(r) {
if (r.message) {
$.each(r.message, function(i, d) {
- var row = frappe.model.add_child(cur_frm.doc, "Examination Result", "results");
+ var row = frappe.model.add_child(cur_frm.doc, "Assessment Result", "results");
row.student = d.student;
row.student_name = d.student_name;
});
diff --git a/erpnext/schools/doctype/examination/examination.json b/erpnext/schools/doctype/assessment/assessment.json
similarity index 91%
rename from erpnext/schools/doctype/examination/examination.json
rename to erpnext/schools/doctype/assessment/assessment.json
index 2a76d1d..30ac1ed 100644
--- a/erpnext/schools/doctype/examination/examination.json
+++ b/erpnext/schools/doctype/assessment/assessment.json
@@ -2,7 +2,7 @@
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
- "autoname": "field:exam_name",
+ "autoname": "field:assessment_name",
"beta": 0,
"creation": "2015-11-12 16:34:34.658092",
"custom": 0,
@@ -15,14 +15,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "exam_name",
+ "fieldname": "assessment_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Exam Name",
+ "label": "Assessment Name",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -40,14 +40,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "exam_code",
+ "fieldname": "assessment_code",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Exam Code",
+ "label": "Assessment Code",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -141,6 +141,32 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "assessment_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Assessment Group",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Assessment Group",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "supervisor",
"fieldtype": "Link",
"hidden": 0,
@@ -431,7 +457,7 @@
"label": "results",
"length": 0,
"no_copy": 0,
- "options": "Examination Result",
+ "options": "Assessment Result",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -457,7 +483,7 @@
"label": "Amended From",
"length": 0,
"no_copy": 1,
- "options": "Examination",
+ "options": "Assessment",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -480,10 +506,10 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-07-25 06:24:11.126911",
+ "modified": "2016-08-05 04:57:41.018614",
"modified_by": "Administrator",
"module": "Schools",
- "name": "Examination",
+ "name": "Assessment",
"name_case": "",
"owner": "Administrator",
"permissions": [
diff --git a/erpnext/schools/doctype/assessment/assessment.py b/erpnext/schools/doctype/assessment/assessment.py
new file mode 100644
index 0000000..a23d5cc
--- /dev/null
+++ b/erpnext/schools/doctype/assessment/assessment.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+import frappe
+from frappe import _
+
+class Assessment(Document):
+ def validate(self):
+ self.validate_overlap()
+
+ def validate_overlap(self):
+ """Validates overlap for Student Group, Supervisor, Room"""
+
+ from erpnext.schools.utils import validate_overlap_for
+
+ validate_overlap_for(self, "Assessment", "student_group")
+ validate_overlap_for(self, "Course Schedule", "student_group" )
+
+ if self.room:
+ validate_overlap_for(self, "Assessment", "room")
+ validate_overlap_for(self, "Course Schedule", "room")
+
+ if self.supervisor:
+ validate_overlap_for(self, "Assessment", "supervisor")
+ validate_overlap_for(self, "Course Schedule", "instructor", self.supervisor)
+
+def get_assessment_list(doctype, txt, filters, limit_start, limit_page_length=20):
+ 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 course, schedule_date, from_time, to_time, sgs.name from `tabAssessment` as assessment,
+ `tabStudent Group Student` as sgs where assessment.student_group = sgs.parent and sgs.student = %s and assessment.docstatus=1
+ order by assessment.name asc limit {0} , {1}'''
+ .format(limit_start, limit_page_length), student, as_dict = True)
+
+def get_list_context(context=None):
+ return {
+ "show_sidebar": True,
+ 'no_breadcrumbs': True,
+ "title": _("Assessment Schedule"),
+ "get_list": get_assessment_list,
+ "row_template": "templates/includes/assessment/assessment_row.html"
+ }
diff --git a/erpnext/schools/doctype/assessment/test_assessment.py b/erpnext/schools/doctype/assessment/test_assessment.py
new file mode 100644
index 0000000..ce06007
--- /dev/null
+++ b/erpnext/schools/doctype/assessment/test_assessment.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+# test_records = frappe.get_test_records('Assessment')
+
+class TestAssessment(unittest.TestCase):
+ pass
diff --git a/erpnext/schools/doctype/examination/__init__.py b/erpnext/schools/doctype/assessment_group/__init__.py
similarity index 100%
copy from erpnext/schools/doctype/examination/__init__.py
copy to erpnext/schools/doctype/assessment_group/__init__.py
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group.js b/erpnext/schools/doctype/assessment_group/assessment_group.js
new file mode 100644
index 0000000..8847472
--- /dev/null
+++ b/erpnext/schools/doctype/assessment_group/assessment_group.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Assessment Group', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/schools/doctype/assessment_group/assessment_group.json b/erpnext/schools/doctype/assessment_group/assessment_group.json
new file mode 100644
index 0000000..fb370a9
--- /dev/null
+++ b/erpnext/schools/doctype/assessment_group/assessment_group.json
@@ -0,0 +1,109 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:assessment_group_name",
+ "beta": 0,
+ "creation": "2016-08-04 04:42:48.319388",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "assessment_group_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Assessment Group Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "assessment_group_code",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Assessment Group Code",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2016-08-05 04:55:21.429710",
+ "modified_by": "Administrator",
+ "module": "Schools",
+ "name": "Assessment Group",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Academics User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/examination_result/examination_result.py b/erpnext/schools/doctype/assessment_group/assessment_group.py
similarity index 63%
rename from erpnext/schools/doctype/examination_result/examination_result.py
rename to erpnext/schools/doctype/assessment_group/assessment_group.py
index 0d7a435..88acc12 100644
--- a/erpnext/schools/doctype/examination_result/examination_result.py
+++ b/erpnext/schools/doctype/assessment_group/assessment_group.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and contributors
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
-class ExaminationResult(Document):
+class AssessmentGroup(Document):
pass
diff --git a/erpnext/schools/doctype/assessment_group/test_assessment_group.py b/erpnext/schools/doctype/assessment_group/test_assessment_group.py
new file mode 100644
index 0000000..2fd98b6
--- /dev/null
+++ b/erpnext/schools/doctype/assessment_group/test_assessment_group.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+# test_records = frappe.get_test_records('Assessment Group')
+
+class TestAssessmentGroup(unittest.TestCase):
+ pass
diff --git a/erpnext/schools/doctype/examination_result/__init__.py b/erpnext/schools/doctype/assessment_result/__init__.py
similarity index 100%
rename from erpnext/schools/doctype/examination_result/__init__.py
rename to erpnext/schools/doctype/assessment_result/__init__.py
diff --git a/erpnext/schools/doctype/examination_result/examination_result.json b/erpnext/schools/doctype/assessment_result/assessment_result.json
similarity index 96%
rename from erpnext/schools/doctype/examination_result/examination_result.json
rename to erpnext/schools/doctype/assessment_result/assessment_result.json
index 932dff1..19339eb 100644
--- a/erpnext/schools/doctype/examination_result/examination_result.json
+++ b/erpnext/schools/doctype/assessment_result/assessment_result.json
@@ -121,10 +121,10 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-07-21 12:27:02.405667",
+ "modified": "2016-08-01 10:37:23.571679",
"modified_by": "Administrator",
"module": "Schools",
- "name": "Examination Result",
+ "name": "Assessment Result",
"name_case": "",
"owner": "Administrator",
"permissions": [],
diff --git a/erpnext/schools/doctype/examination_result/examination_result.py b/erpnext/schools/doctype/assessment_result/assessment_result.py
similarity index 63%
copy from erpnext/schools/doctype/examination_result/examination_result.py
copy to erpnext/schools/doctype/assessment_result/assessment_result.py
index 0d7a435..84cbcfa 100644
--- a/erpnext/schools/doctype/examination_result/examination_result.py
+++ b/erpnext/schools/doctype/assessment_result/assessment_result.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and contributors
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
-class ExaminationResult(Document):
+class AssessmentResult(Document):
pass
diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/schools/doctype/course/course.js
index 75cf4f8..fe38806 100644
--- a/erpnext/schools/doctype/course/course.js
+++ b/erpnext/schools/doctype/course/course.js
@@ -21,11 +21,11 @@
frappe.set_route("List", "Course Schedule");
});
- frm.add_custom_button(__("Examination"), function() {
+ frm.add_custom_button(__("Assessment"), function() {
frappe.route_options = {
course: frm.doc.name
}
- frappe.set_route("List", "Examination");
+ frappe.set_route("List", "Assessment");
});
}
});
\ No newline at end of file
diff --git a/erpnext/schools/doctype/course_schedule/course_schedule.py b/erpnext/schools/doctype/course_schedule/course_schedule.py
index 36ad29b..11f3894 100644
--- a/erpnext/schools/doctype/course_schedule/course_schedule.py
+++ b/erpnext/schools/doctype/course_schedule/course_schedule.py
@@ -31,7 +31,7 @@
validate_overlap_for(self, "Course Schedule", "instructor")
validate_overlap_for(self, "Course Schedule", "room")
- validate_overlap_for(self, "Examination", "student_group")
- validate_overlap_for(self, "Examination", "room")
- validate_overlap_for(self, "Examination", "supervisor", self.instructor)
+ validate_overlap_for(self, "Assessment", "student_group")
+ validate_overlap_for(self, "Assessment", "room")
+ validate_overlap_for(self, "Assessment", "supervisor", self.instructor)
diff --git a/erpnext/schools/doctype/examination/examination.py b/erpnext/schools/doctype/examination/examination.py
deleted file mode 100644
index c1a3d1a..0000000
--- a/erpnext/schools/doctype/examination/examination.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-from frappe.model.document import Document
-import frappe
-from frappe import _
-
-class Examination(Document):
- def validate(self):
- self.validate_overlap()
-
- def validate_overlap(self):
- """Validates overlap for Student Group, Supervisor, Room"""
-
- from erpnext.schools.utils import validate_overlap_for
-
- validate_overlap_for(self, "Examination", "student_group")
- validate_overlap_for(self, "Course Schedule", "student_group" )
-
- if self.room:
- validate_overlap_for(self, "Examination", "room")
- validate_overlap_for(self, "Course Schedule", "room")
-
- if self.supervisor:
- validate_overlap_for(self, "Examination", "supervisor")
- validate_overlap_for(self, "Course Schedule", "instructor", self.supervisor)
-
-def get_examination_list(doctype, txt, filters, limit_start, limit_page_length=20):
- 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 course, schedule_date, from_time, to_time, sgs.name from `tabExamination` as exam,
- `tabStudent Group Student` as sgs where exam.student_group = sgs.parent and sgs.student = %s and exam.docstatus=1
- order by exam.name asc limit {0} , {1}'''
- .format(limit_start, limit_page_length), student, as_dict = True)
-
-def get_list_context(context=None):
- return {
- "show_sidebar": True,
- 'no_breadcrumbs': True,
- "title": _("Examination Schedule"),
- "get_list": get_examination_list,
- "row_template": "templates/includes/examination/examination_row.html"
- }
diff --git a/erpnext/schools/doctype/examination/test_examination.py b/erpnext/schools/doctype/examination/test_examination.py
deleted file mode 100644
index be276f9..0000000
--- a/erpnext/schools/doctype/examination/test_examination.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-# test_records = frappe.get_test_records('Examination')
-
-class TestExamination(unittest.TestCase):
- pass
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.js b/erpnext/schools/doctype/fee_structure/fee_structure.js
index e3d4544..391c935 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<frm.doc.amount.length;i++) {
- total_amount += frm.doc.amount[i].amount;
+ for(var i=0;i<frm.doc.components.length;i++) {
+ total_amount += frm.doc.components[i].amount;
}
frm.set_value("total_amount", total_amount);
}
diff --git a/erpnext/schools/doctype/fees/fees.js b/erpnext/schools/doctype/fees/fees.js
index 0e9ad76..22c6d8a 100644
--- a/erpnext/schools/doctype/fees/fees.js
+++ b/erpnext/schools/doctype/fees/fees.js
@@ -46,34 +46,39 @@
},
fee_structure: function(frm) {
- frm.set_value("amount" ,"");
+ frm.set_value("components" ,"");
if (frm.doc.fee_structure) {
frappe.call({
- method: "erpnext.schools.api.get_fee_amount",
+ method: "erpnext.schools.api.get_fee_components",
args: {
"fee_structure": frm.doc.fee_structure
},
callback: function(r) {
if (r.message) {
$.each(r.message, function(i, d) {
- var row = frappe.model.add_child(frm.doc, "Fee Amount", "amount");
+ var row = frappe.model.add_child(frm.doc, "Fee Component", "components");
row.fees_category = d.fees_category;
row.amount = d.amount;
});
}
- refresh_field("amount");
+ refresh_field("components");
+ frm.trigger("calculate_total_amount");
}
});
}
+ },
+
+ calculate_total_amount: function(frm) {
+ total_amount = 0;
+ for(var i=0;i<frm.doc.components.length;i++) {
+ total_amount += frm.doc.components[i].amount;
+ }
+ frm.set_value("total_amount", total_amount);
}
});
-frappe.ui.form.on("Fee Amount", {
+frappe.ui.form.on("Fee Component", {
amount: function(frm) {
- total_amount = 0;
- for(var i=0;i<frm.doc.amount.length;i++) {
- total_amount += frm.doc.amount[i].amount;
- }
- frm.set_value("total_amount", total_amount);
+ frm.trigger("calculate_total_amount");
}
});
diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.py b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
index ca193dd..a15a070 100644
--- a/erpnext/schools/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.py
@@ -27,11 +27,11 @@
frappe.db.set_value("Student", self.student, "joining_date", date)
def make_fee_records(self):
- from erpnext.schools.api import get_fee_amount
+ from erpnext.schools.api import get_fee_components
fee_list = []
for d in self.fees:
- fee_amount = get_fee_amount(d.fee_structure)
- if fee_amount:
+ fee_components = get_fee_components(d.fee_structure)
+ if fee_components:
fees = frappe.new_doc("Fees")
fees.update({
"student": self.student,
@@ -42,7 +42,7 @@
"due_date": d.due_date,
"student_name": self.student_name,
"program_enrollment": self.name,
- "amount": fee_amount
+ "components": fee_components
})
fees.save()
diff --git a/erpnext/schools/doctype/student/student_dashboard.py b/erpnext/schools/doctype/student/student_dashboard.py
index da2b9ad..45a2f14 100644
--- a/erpnext/schools/doctype/student/student_dashboard.py
+++ b/erpnext/schools/doctype/student/student_dashboard.py
@@ -9,7 +9,7 @@
'items': ['Student Log', 'Student Group', 'Student Attendance']
},
{
- 'items': ['Program Enrollment', 'Fees', 'Examination', 'Guardian']
+ 'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
}
]
}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_group/student_group.js b/erpnext/schools/doctype/student_group/student_group.js
index a993ff7..eed3342 100644
--- a/erpnext/schools/doctype/student_group/student_group.js
+++ b/erpnext/schools/doctype/student_group/student_group.js
@@ -9,11 +9,11 @@
frappe.set_route("List", "Course Schedule");
});
- frm.add_custom_button(__("Examination"), function() {
+ frm.add_custom_button(__("Assessment"), function() {
frappe.route_options = {
student_group: frm.doc.name
}
- frappe.set_route("List", "Examination");
+ frappe.set_route("List", "Assessment");
});
}
});
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/domainify.py b/erpnext/setup/setup_wizard/domainify.py
index 9aece22..67d77a8 100644
--- a/erpnext/setup/setup_wizard/domainify.py
+++ b/erpnext/setup/setup_wizard/domainify.py
@@ -18,7 +18,7 @@
'set_value': [
['Stock Settings', None, 'show_barcode_field', 1]
],
- 'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
+ 'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
'Retail': {
@@ -32,7 +32,7 @@
'set_value': [
['Stock Settings', None, 'show_barcode_field', 1]
],
- 'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
+ 'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
'Distribution': {
@@ -45,7 +45,7 @@
'set_value': [
['Stock Settings', None, 'show_barcode_field', 1]
],
- 'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
+ 'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
'Services': {
@@ -58,13 +58,13 @@
'set_value': [
['Stock Settings', None, 'show_barcode_field', 0]
],
- 'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
+ 'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
'Education': {
'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
'Fees', 'ToDo', 'Schools'],
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Website Manager'],
- 'allow_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
+ 'allow_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
},
}
if not domain in data:
diff --git a/erpnext/templates/includes/examination/examination_row.html b/erpnext/templates/includes/assessment/assessment_row.html
similarity index 100%
rename from erpnext/templates/includes/examination/examination_row.html
rename to erpnext/templates/includes/assessment/assessment_row.html