diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 6bb9a1f713..ca55b5f9d7 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 94709a7b72..4e00c32808 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -772,6 +772,9 @@ def get_account_balance_and_party_type(account, date, company, debit=None, credi 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 364b78c876..a092e56928 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 6f5a663e49..d68e29157b 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 @@ class TestPeriodClosingVoucher(unittest.TestCase): 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 a7e49dd48f..cb637d254a 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 176e529665..d17e80f757 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -301,7 +301,7 @@ class PurchaseInvoice(BuyingController): 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 9643764ab9..53144cbf2b 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -91,7 +91,7 @@ def update_multi_mode_option(doc, pos_profile): 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 3a594c8c93..843937fd94 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -52,10 +52,10 @@ class ReceivablePayableReport(object): 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 08f9d23af2..2b8dce0394 100644 --- a/erpnext/config/desktop.py +++ b/erpnext/config/desktop.py @@ -229,12 +229,12 @@ def get_data(): "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 @@ def get_data(): "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 78688c95a7..5e73fce0b5 100644 --- a/erpnext/config/schools.py +++ b/erpnext/config/schools.py @@ -61,7 +61,11 @@ def get_data(): }, { "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 46ed9bc072..fcdff21591 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -38,6 +38,7 @@ class StockController(AccountsController): 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 @@ def update_gl_entries_after(posting_date, posting_time, for_warehouses=None, for 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 82d23de2ac..566a98ba83 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -101,7 +101,7 @@ portal_menu_items = [ {"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 d42f7359da..9b97bd1cd2 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -38,7 +38,7 @@ frappe.ui.form.on("Production Order", { 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 @@ erpnext.production_order = { } // 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 0f6dae6459..2bf32048aa 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -105,7 +105,7 @@ class ProductionOrder(Document): 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 @@ class ProductionOrder(Document): 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 4e99afa6aa..73eac92c88 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -307,4 +307,6 @@ erpnext.patches.v7_0.fix_nonwarehouse_ledger_gl_entries_for_transactions 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 0000000000..31c8aedc4f --- /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 0000000000..3a6526ca23 --- /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 abcffad1c7..9140927279 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals 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 @@ def get_activity_cost(employee=None, activity_type=None): ["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 0000000000..6db3e5aacd --- /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 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/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 b1091f3080..799ae7ba8c 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 @@ frappe.ui.form.on("Examination" ,{ 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 92% rename from erpnext/schools/doctype/examination/examination.json rename to erpnext/schools/doctype/assessment/assessment.json index 2a76d1dfcc..30ac1ed962 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, @@ -137,6 +137,32 @@ "set_only_once": 0, "unique": 0 }, + { + "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, @@ -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/examination/examination.py b/erpnext/schools/doctype/assessment/assessment.py similarity index 57% rename from erpnext/schools/doctype/examination/examination.py rename to erpnext/schools/doctype/assessment/assessment.py index c1a3d1ac12..a23d5cc851 100644 --- a/erpnext/schools/doctype/examination/examination.py +++ b/erpnext/schools/doctype/assessment/assessment.py @@ -1,5 +1,5 @@ # -*- 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 @@ -7,7 +7,7 @@ from frappe.model.document import Document import frappe from frappe import _ -class Examination(Document): +class Assessment(Document): def validate(self): self.validate_overlap() @@ -16,31 +16,31 @@ class Examination(Document): from erpnext.schools.utils import validate_overlap_for - validate_overlap_for(self, "Examination", "student_group") + validate_overlap_for(self, "Assessment", "student_group") validate_overlap_for(self, "Course Schedule", "student_group" ) if self.room: - validate_overlap_for(self, "Examination", "room") + validate_overlap_for(self, "Assessment", "room") validate_overlap_for(self, "Course Schedule", "room") if self.supervisor: - validate_overlap_for(self, "Examination", "supervisor") + validate_overlap_for(self, "Assessment", "supervisor") validate_overlap_for(self, "Course Schedule", "instructor", self.supervisor) -def get_examination_list(doctype, txt, filters, limit_start, limit_page_length=20): +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 `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}''' + 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": _("Examination Schedule"), - "get_list": get_examination_list, - "row_template": "templates/includes/examination/examination_row.html" + "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 0000000000..ce060074a9 --- /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_result/__init__.py b/erpnext/schools/doctype/assessment_group/__init__.py similarity index 100% rename from erpnext/schools/doctype/examination_result/__init__.py rename 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 0000000000..8847472dd9 --- /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 0000000000..fb370a959f --- /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 0d7a435f36..88acc124d3 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 0000000000..2fd98b6d02 --- /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/assessment_result/__init__.py b/erpnext/schools/doctype/assessment_result/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/schools/doctype/examination_result/examination_result.json b/erpnext/schools/doctype/assessment_result/assessment_result.json similarity index 97% rename from erpnext/schools/doctype/examination_result/examination_result.json rename to erpnext/schools/doctype/assessment_result/assessment_result.json index 932dff1d1c..19339eb712 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/assessment_result/assessment_result.py b/erpnext/schools/doctype/assessment_result/assessment_result.py new file mode 100644 index 0000000000..84cbcfa43b --- /dev/null +++ b/erpnext/schools/doctype/assessment_result/assessment_result.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# 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 AssessmentResult(Document): + pass diff --git a/erpnext/schools/doctype/course/course.js b/erpnext/schools/doctype/course/course.js index 75cf4f8d2b..fe38806ff7 100644 --- a/erpnext/schools/doctype/course/course.js +++ b/erpnext/schools/doctype/course/course.js @@ -21,11 +21,11 @@ frappe.ui.form.on("Course", "refresh", function(frm) { 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 36ad29beb4..11f3894d8c 100644 --- a/erpnext/schools/doctype/course_schedule/course_schedule.py +++ b/erpnext/schools/doctype/course_schedule/course_schedule.py @@ -31,7 +31,7 @@ class CourseSchedule(Document): 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/test_examination.py b/erpnext/schools/doctype/examination/test_examination.py deleted file mode 100644 index be276f941c..0000000000 --- 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 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