diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 95f03f5b2b..26dca9a115 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.0.2' +__version__ = '10.0.3' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index f169b9920b..eefb3d159f 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -200,8 +200,15 @@ def get_data_with_opening_closing(filters, account_details, gl_entries): debit_in_account_currency = totals.closing.get('debit_in_account_currency', 0) credit_in_account_currency = totals.closing.get('credit_in_account_currency', 0) - total_closing['debit'] = total_debit - total_credit - total_closing['debit_in_account_currency'] = debit_in_account_currency - credit_in_account_currency + total_amount = total_debit - total_credit + + if total_amount > 0: + total_closing['debit'] = total_amount + total_closing['debit_in_account_currency'] = debit_in_account_currency - credit_in_account_currency + else: + total_closing['credit'] = abs(total_amount) + total_closing['credit_in_account_currency'] = abs(debit_in_account_currency - credit_in_account_currency) + data.append(totals.total_closing) return data diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 07319a839d..4547ac1113 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -544,6 +544,7 @@ def get_itemised_tax_breakup_html(doc): get_rounded_tax_amount(itemised_tax, doc.precision("tax_amount", "taxes")) + update_itemised_tax_data(doc) frappe.flags.company = None return frappe.render_template( @@ -556,6 +557,12 @@ def get_itemised_tax_breakup_html(doc): ) ) + +@erpnext.allow_regional +def update_itemised_tax_data(doc): + #Don't delete this method, used for localization + pass + @erpnext.allow_regional def get_itemised_tax_breakup_header(item_doctype, tax_accounts): return [_("Item"), _("Taxable Amount")] + tax_accounts diff --git a/erpnext/docs/assets/img/education/setup/instructor.png b/erpnext/docs/assets/img/education/setup/instructor.png index 8ea86bb30f..d69f194b29 100644 Binary files a/erpnext/docs/assets/img/education/setup/instructor.png and b/erpnext/docs/assets/img/education/setup/instructor.png differ diff --git a/erpnext/docs/user/manual/en/education/admission/program-enrollment.md b/erpnext/docs/user/manual/en/education/admission/program-enrollment.md index 0bf16dfd3a..6fe9692a89 100644 --- a/erpnext/docs/user/manual/en/education/admission/program-enrollment.md +++ b/erpnext/docs/user/manual/en/education/admission/program-enrollment.md @@ -1,12 +1,21 @@ # Program Enrollment -Program Enrollment describes an educational model where students must complete a defined set of courses towards their academic objective in a specified sequence. Enrollment is a program driven process in which the student select the Program to enrol for in a Academic Year. +**Program Enrollment** is the record of enrollment of a student in a given program and choose courses for a particular Academic Year and Academic Term (optional). If a student is enrolled in a program then his/her Program Enrollment must be created. The mandatory course in that program is automatically filled in Enrolled Courses table while the elective/optional courses can be selected manually. -Once a student have applied for the **Program** and the application is approved, the program enrollment is done for that student. +If the student has applied online for the admission in a particular **Program** and the application is approved, then the Program Enrollment can be created from within the Student Applicant record via clicking on the **Enroll** button. + +Else, to create the new Program Enrollment manually, go to: +> Education > Program Enrollment > New -- A student can be enrolled in multiple Course for a program in a given academeic year. -- Based on the Fee structure selected at the time of enrollment Fee detials are created of the student. +If any institution has skipped the online admission process then Program Enrollment can also be considered as the confirmation of the admission in a particular Program. -{next} +> TIP: Academic Term is optional in the Program Enrollment. If your institution has only annual curriculum, you can skip the Academic Term + +Student Batch: To categorize student into different sections/batches, you can assign the batch to the student. On the basis of this field, later student groups can be created. + +Student Category: For the Institutions having multiple Fees Structure, this field can be used to differentiate the student enrollment in a given fee category. + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/education/setup/instructor.md b/erpnext/docs/user/manual/en/education/setup/instructor.md index 2b53ce13fe..219413d275 100644 --- a/erpnext/docs/user/manual/en/education/setup/instructor.md +++ b/erpnext/docs/user/manual/en/education/setup/instructor.md @@ -1,18 +1,20 @@ # Instructor -An instructoe is a teacher, or professor, of a specialised subject that involves skill. +An Instructor can be a teacher, tutor, coach, or professor, of a specialised subject that involves any skill. -You can create an Instructor and link it to the Employee master and a Departmemt. +To create new Instructor go to: + +> Education > Instructor > New -An **Instructor** is further linked to a **Course Schedule**, where you can define the schedule for a **Course** for a give date and **Room no**. +An **Instructor** can also be linked to a **Course Schedule**, where you can define the schedule for a **Course** for a give date and **Room no**. - -It is also linked to **Student group** where an **Instructor** is assigned to the Student group. +It is also linked to **Student group** where an **Instructor** is assigned to the Student Group. - +While creating the **Assessment Plan** for a Student Group, **Instructor** can be linked as the Examiner or the Supervisor for that assessment. + +Further, the log for the Instructor can be entered in the Instructor Log table which can be used for keeping the records of subjects taught by that Instructor. -An **Instructor** is also linked to an **Assesment Plan** for a Student group. The Instructor can be an Examiner or the supervisor for the assesment. {next} \ No newline at end of file diff --git a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json index 1ea5062639..ddef100ff5 100644 --- a/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json +++ b/erpnext/education/doctype/assessment_result_tool/assessment_result_tool.json @@ -175,7 +175,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-11-10 18:55:54.438981", + "modified": "2017-12-27 09:36:37.155890", "modified_by": "Administrator", "module": "Education", "name": "Assessment Result Tool", @@ -201,6 +201,26 @@ "share": 0, "submit": 0, "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 0, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Instructor", + "set_user_permissions": 0, + "share": 0, + "submit": 0, + "write": 1 } ], "quick_entry": 1, diff --git a/erpnext/education/doctype/instructor/instructor.js b/erpnext/education/doctype/instructor/instructor.js index 51d28860b0..62d73b32ee 100644 --- a/erpnext/education/doctype/instructor/instructor.js +++ b/erpnext/education/doctype/instructor/instructor.js @@ -3,11 +3,29 @@ cur_frm.add_fetch("employee", "image", "image"); frappe.ui.form.on("Instructor", "refresh", function(frm) { if(!frm.doc.__islocal) { + frm.add_custom_button(__("Student Group"), function() { + frappe.route_options = { + instructor: frm.doc.name + } + frappe.set_route("List", "Student Group"); + }); frm.add_custom_button(__("Course Schedule"), function() { frappe.route_options = { instructor: frm.doc.name } frappe.set_route("List", "Course Schedule"); }); + frm.add_custom_button(__("As Examiner"), function() { + frappe.route_options = { + examiner: frm.doc.name + } + frappe.set_route("List", "Assessment Plan"); + }, __("Assessment Plan")); + frm.add_custom_button(__("As Supervisor"), function() { + frappe.route_options = { + supervisor: frm.doc.name + } + frappe.set_route("List", "Assessment Plan"); + }, __("Assessment Plan")); } }); diff --git a/erpnext/education/doctype/instructor/instructor.json b/erpnext/education/doctype/instructor/instructor.json index 865e07ce21..0aeedb6f93 100644 --- a/erpnext/education/doctype/instructor/instructor.json +++ b/erpnext/education/doctype/instructor/instructor.json @@ -194,6 +194,67 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "log_details", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Instructor Log", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "instructor_log", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Instructor Log", + "length": 0, + "no_copy": 0, + "options": "Instructor Log", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -208,13 +269,33 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-11-10 19:00:20.354954", + "modified": "2017-12-27 09:23:46.973763", "modified_by": "Administrator", "module": "Education", "name": "Instructor", "name_case": "", "owner": "Administrator", "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Instructor", + "set_user_permissions": 0, + "share": 0, + "submit": 0, + "write": 0 + }, { "amend": 0, "apply_user_permissions": 0, @@ -229,8 +310,8 @@ "print": 1, "read": 1, "report": 1, - "role": "Academics User", - "set_user_permissions": 0, + "role": "Education Manager", + "set_user_permissions": 1, "share": 1, "submit": 0, "write": 1 diff --git a/erpnext/education/doctype/instructor_log/__init__.py b/erpnext/education/doctype/instructor_log/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/education/doctype/instructor_log/instructor_log.json b/erpnext/education/doctype/instructor_log/instructor_log.json new file mode 100644 index 0000000000..631bfc0f3b --- /dev/null +++ b/erpnext/education/doctype/instructor_log/instructor_log.json @@ -0,0 +1,315 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-12-27 08:55:52.680284", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "academic_year", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Academic Year", + "length": 0, + "no_copy": 0, + "options": "Academic Year", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "academic_term", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Academic Term", + "length": 0, + "no_copy": 0, + "options": "Academic Term", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "department", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Department", + "length": 0, + "no_copy": 0, + "options": "Department", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "program", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Program", + "length": 0, + "no_copy": 0, + "options": "Program", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "course", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Course", + "length": 0, + "no_copy": 0, + "options": "Course", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "student_group", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Student Group", + "length": 0, + "no_copy": 0, + "options": "Student Group", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_8", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "other_details", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Other details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2017-12-27 10:05:22.307860", + "modified_by": "Administrator", + "module": "Education", + "name": "Instructor Log", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/education/doctype/instructor_log/instructor_log.py b/erpnext/education/doctype/instructor_log/instructor_log.py new file mode 100644 index 0000000000..75217b22f6 --- /dev/null +++ b/erpnext/education/doctype/instructor_log/instructor_log.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, 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 InstructorLog(Document): + pass diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.json b/erpnext/education/doctype/program_enrollment/program_enrollment.json index 9badf933e7..00b1373596 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.json +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.json @@ -112,19 +112,19 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "school_house", + "fieldname": "student_batch_name", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, - "label": "School House", + "label": "Student Batch", "length": 0, "no_copy": 0, - "options": "School House", + "options": "Student Batch Name", "permlevel": 0, "precision": "", "print_hide": 0, @@ -139,14 +139,12 @@ }, { "allow_bulk_edit": 0, - "allow_on_submit": 0, + "allow_on_submit": 1, "bold": 0, "collapsible": 0, "columns": 0, - "default": "0", - "description": "Check this if the Student is residing at the Institute's Hostel.", - "fieldname": "boarding_student", - "fieldtype": "Check", + "fieldname": "school_house", + "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -154,10 +152,10 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Boarding Student", + "label": "School House", "length": 0, "no_copy": 0, - "options": "", + "options": "School House", "permlevel": 0, "precision": "", "print_hide": 0, @@ -230,37 +228,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "student_batch_name", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 1, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Student Batch", - "length": 0, - "no_copy": 0, - "options": "Student Batch Name", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -294,7 +261,7 @@ }, { "allow_bulk_edit": 0, - "allow_on_submit": 1, + "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, @@ -354,6 +321,39 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "description": "Check this if the Student is residing at the Institute's Hostel.", + "fieldname": "boarding_student", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Boarding Student", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -671,7 +671,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-11-16 13:20:28.650637", + "modified": "2017-12-27 10:59:36.838548", "modified_by": "Administrator", "module": "Education", "name": "Program Enrollment", diff --git a/erpnext/education/doctype/program_enrollment/program_enrollment.py b/erpnext/education/doctype/program_enrollment/program_enrollment.py index 79772b0d02..0f9bb96adb 100644 --- a/erpnext/education/doctype/program_enrollment/program_enrollment.py +++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py @@ -22,8 +22,14 @@ class ProgramEnrollment(Document): self.make_fee_records() def validate_duplication(self): - enrollment = frappe.db.sql("""select name from `tabProgram Enrollment` where student= %s and program= %s - and academic_year= %s and docstatus<2 and name != %s""", (self.student, self.program, self.academic_year, self.name)) + enrollment = frappe.get_all("Program Enrollment", filters={ + "student": self.student, + "program": self.program, + "academic_year": self.academic_year, + "academic_term": self.academic_term, + "docstatus": ("<", 2), + "name": ("!=", self.name) + }) if enrollment: frappe.throw(_("Student is already enrolled.")) diff --git a/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json index 2745366f33..71071cdbdc 100644 --- a/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json +++ b/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.json @@ -328,7 +328,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-11-10 19:39:54.858394", + "modified": "2017-12-27 09:35:45.002469", "modified_by": "Administrator", "module": "Education", "name": "Program Enrollment Tool", @@ -349,7 +349,7 @@ "print": 0, "read": 1, "report": 0, - "role": "Academics User", + "role": "Education Manager", "set_user_permissions": 0, "share": 0, "submit": 0, diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json index d759b9178e..fe7cbdb0b8 100644 --- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json +++ b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json @@ -269,7 +269,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-11-10 19:40:07.862203", + "modified": "2017-12-27 09:35:30.211254", "modified_by": "Administrator", "module": "Education", "name": "Student Group Creation Tool", @@ -290,7 +290,7 @@ "print": 0, "read": 1, "report": 0, - "role": "Academics User", + "role": "Education Manager", "set_user_permissions": 0, "share": 0, "submit": 0, diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 573c180d51..6265e1af85 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -258,5 +258,11 @@ regional_overrides = { 'erpnext.tests.test_regional.test_method': 'erpnext.regional.india.utils.test_method', 'erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_header': 'erpnext.regional.india.utils.get_itemised_tax_breakup_header', 'erpnext.controllers.taxes_and_totals.get_itemised_tax_breakup_data': 'erpnext.regional.india.utils.get_itemised_tax_breakup_data' + }, + 'United Arab Emirates': { + 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data' + }, + 'Saudi Arabia': { + 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data' } } diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f42799fb84..e8f3997f60 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -478,9 +478,10 @@ erpnext.patches.v9_2.rename_net_weight_in_item_master erpnext.patches.v9_2.delete_process_payroll erpnext.patches.v10_0.add_agriculture_domain erpnext.patches.v10_0.add_non_profit_domain -erpnext.patches.v10_0.setup_vat_for_uae_and_saudi_arabia +erpnext.patches.v10_0.setup_vat_for_uae_and_saudi_arabia #2017-12-27 erpnext.patches.v10_0.set_primary_contact_for_customer erpnext.patches.v10_0.copy_projects_renamed_fields erpnext.patches.v10_0.enabled_regional_print_format_based_on_country erpnext.patches.v10_0.update_asset_calculate_depreciation erpnext.patches.v10_0.add_guardian_role_for_parent_portal +erpnext.patches.v10_0.set_numeric_ranges_in_template_if_blank \ No newline at end of file diff --git a/erpnext/patches/v10_0/enabled_regional_print_format_based_on_country.py b/erpnext/patches/v10_0/enabled_regional_print_format_based_on_country.py index 37e67076e5..38b04cebc2 100644 --- a/erpnext/patches/v10_0/enabled_regional_print_format_based_on_country.py +++ b/erpnext/patches/v10_0/enabled_regional_print_format_based_on_country.py @@ -7,8 +7,8 @@ import frappe def execute(): print_format_mapper = { 'India': ['GST POS Invoice', 'GST Tax Invoice'], - 'Saudi Arabia': ['Simplified Tax Invoice', 'Detailed Tax Invoice'], - 'United Arab Emirates': ['Simplified Tax Invoice', 'Detailed Tax Invoice'] + 'Saudi Arabia': ['Simplified Tax Invoice', 'Detailed Tax Invoice', 'Tax Invoice'], + 'United Arab Emirates': ['Simplified Tax Invoice', 'Detailed Tax Invoice', 'Tax Invoice'] } frappe.db.sql(""" update `tabPrint Format` set disabled = 1 where name diff --git a/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py b/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py new file mode 100644 index 0000000000..6825f19d74 --- /dev/null +++ b/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py @@ -0,0 +1,35 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + item_numeric_attributes = frappe.db.sql(""" + select name, numeric_values, from_range, to_range, increment + from `tabItem Attribute` + where numeric_values = 1 + """, as_dict=1) + + for d in item_numeric_attributes: + frappe.db.sql(""" + update `tabItem Variant Attribute` + set + from_range = CASE + WHEN from_range = 0 THEN %(from_range)s + ELSE from_range + END, + to_range = CASE + WHEN to_range = 0 THEN %(to_range)s + ELSE to_range + END, + increment = CASE + WHEN increment = 0 THEN %(increment)s + ELSE increment + END, + numeric_values = %(numeric_values)s + where + attribute = %(name)s + and exists(select name from tabItem + where name=`tabItem Variant Attribute`.parent and has_variants=1) + """, d) \ No newline at end of file diff --git a/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py b/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py index 9d80e6bfe5..587fee1f9a 100644 --- a/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py +++ b/erpnext/patches/v10_0/setup_vat_for_uae_and_saudi_arabia.py @@ -7,6 +7,8 @@ from erpnext.setup.doctype.company.company import install_country_fixtures def execute(): frappe.reload_doc("accounts", "doctype", "account") + frappe.reload_doc("hub_node", "doctype", "hub_category") + frappe.reload_doc("accounts", "doctype", "payment_schedule") for d in frappe.get_all('Company', filters={'country': ('in', ['Saudi Arabia', 'United Arab Emirates'])}): install_country_fixtures(d.name) \ No newline at end of file diff --git a/erpnext/regional/print_format/detailed_tax_invoice/detailed_tax_invoice.json b/erpnext/regional/print_format/detailed_tax_invoice/detailed_tax_invoice.json index b90520b456..ab56c6bc3c 100644 --- a/erpnext/regional/print_format/detailed_tax_invoice/detailed_tax_invoice.json +++ b/erpnext/regional/print_format/detailed_tax_invoice/detailed_tax_invoice.json @@ -7,10 +7,10 @@ "docstatus": 0, "doctype": "Print Format", "font": "Default", - "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"