Merge branch 'master' into develop
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 95f03f5..26dca9a 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
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 f169b99..eefb3d1 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -200,8 +200,15 @@
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 07319a8..4547ac1 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -544,6 +544,7 @@
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 @@
)
)
+
+@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 8ea86bb..d69f194 100644
--- a/erpnext/docs/assets/img/education/setup/instructor.png
+++ b/erpnext/docs/assets/img/education/setup/instructor.png
Binary files 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 0bf16df..6fe9692 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
<img class="screenshot" alt="Student Applicant Enrollment" src="/docs/assets/img/education/admission/program-enrollment.gif">
-- 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 2b53ce1..219413d 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
<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/instructor.png">
-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**.
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/instructor.gif">
-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.
-<img class="screenshot" alt="Instructor" src="/docs/assets/img/education/setup/student-group-instructor.gif">
+While creating the **Assessment Plan** for a Student Group, **Instructor** can be linked as the Examiner or the Supervisor for that assessment.
-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.
+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.
+
{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 1ea5062..ddef100 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 51d2886..62d73b3 100644
--- a/erpnext/education/doctype/instructor/instructor.js
+++ b/erpnext/education/doctype/instructor/instructor.js
@@ -3,11 +3,29 @@
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 865e07c..0aeedb6 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,7 +269,7 @@
"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",
@@ -219,6 +280,26 @@
"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,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -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 0000000..e69de29
--- /dev/null
+++ b/erpnext/education/doctype/instructor_log/__init__.py
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 0000000..631bfc0
--- /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 0000000..75217b2
--- /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 9badf93..00b1373 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,
@@ -232,37 +230,6 @@
},
{
"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,
"bold": 0,
"collapsible": 0,
@@ -294,7 +261,7 @@
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 1,
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -358,6 +325,39 @@
"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,
+ "bold": 0,
"collapsible": 1,
"collapsible_depends_on": "vehicle_no",
"columns": 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 79772b0..0f9bb96 100644
--- a/erpnext/education/doctype/program_enrollment/program_enrollment.py
+++ b/erpnext/education/doctype/program_enrollment/program_enrollment.py
@@ -22,8 +22,14 @@
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 2745366..71071cd 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 d759b91..fe7cbdb 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 573c180..6265e1a 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -258,5 +258,11 @@
'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 f42799f..e8f3997 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -478,9 +478,10 @@
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 37e6707..38b04ce 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 @@
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 0000000..6825f19
--- /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 9d80e6b..587fee1 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 @@
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 b90520b..ab56c6b 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\": \"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>TAX Invoice<br><small>{{ doc.name }}</small>\\t\\t\\t\\t</h2></div>\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name_in_arabic\", \"label\": \"Customer Name in Arabic\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"project\", \"align\": \"left\", \"label\": \"Reverse Charge Applicable\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"tax_id\", \"label\": \"Tax Id\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"print_hide\": 0, \"fieldname\": \"contact_mobile\", \"label\": \"Mobile No\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"print_hide\": 0, \"fieldname\": \"company_trn\", \"label\": \"Company TRN\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"image\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_code\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"charge_type\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"row_id\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"account_head\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"cost_center\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"item_wise_tax_detail\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"align\": \"left\", \"label\": \"Tax Breakup\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"label\": \"Taxes and Charges Calculation\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}]",
+ "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>TAX Invoice<br><small>{{ doc.name }}</small>\\t\\t\\t\\t</h2></div>\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name_in_arabic\", \"label\": \"Customer Name in Arabic\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"project\", \"align\": \"left\", \"label\": \"Reverse Charge Applicable\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"tax_id\", \"label\": \"Tax Id\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"print_hide\": 0, \"fieldname\": \"contact_mobile\", \"label\": \"Mobile No\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"print_hide\": 0, \"fieldname\": \"company_trn\", \"label\": \"Company TRN\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"200px\"}, {\"print_hide\": 0, \"fieldname\": \"image\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_code\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"charge_type\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"row_id\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"account_head\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"cost_center\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"item_wise_tax_detail\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"print_hide\": 0, \"fieldname\": \"in_words\", \"align\": \"left\", \"label\": \"In Words\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"other_charges_calculation\", \"label\": \"Taxes and Charges Calculation\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}]",
"idx": 0,
"line_breaks": 0,
- "modified": "2017-12-15 11:57:16.661876",
+ "modified": "2017-12-28 13:39:26.068659",
"modified_by": "Administrator",
"module": "Regional",
"name": "Detailed Tax Invoice",
diff --git a/erpnext/regional/print_format/tax_invoice/__init__.py b/erpnext/regional/print_format/tax_invoice/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/regional/print_format/tax_invoice/__init__.py
diff --git a/erpnext/regional/print_format/tax_invoice/tax_invoice.json b/erpnext/regional/print_format/tax_invoice/tax_invoice.json
new file mode 100644
index 0000000..74db067
--- /dev/null
+++ b/erpnext/regional/print_format/tax_invoice/tax_invoice.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0,
+ "creation": "2017-12-27 15:21:46.620466",
+ "custom_format": 0,
+ "disabled": 1,
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "font": "Default",
+ "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"<div class=\\\"print-heading\\\">\\t\\t\\t\\t<h2>TAX Invoice<br><small>{{ doc.name }}</small>\\t\\t\\t\\t</h2></div>\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name\", \"label\": \"Customer Name\"}, {\"print_hide\": 0, \"fieldname\": \"customer_name_in_arabic\", \"label\": \"Customer Name in Arabic\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"posting_date\", \"label\": \"Date\"}, {\"print_hide\": 0, \"fieldname\": \"project\", \"align\": \"left\", \"label\": \"Reverse Charge Applicable\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Address\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"address_display\", \"label\": \"Address\"}, {\"print_hide\": 0, \"fieldname\": \"tax_id\", \"label\": \"Tax Id\"}, {\"print_hide\": 0, \"fieldname\": \"contact_display\", \"label\": \"Contact\"}, {\"print_hide\": 0, \"fieldname\": \"contact_mobile\", \"label\": \"Mobile No\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"company\", \"label\": \"Company\"}, {\"print_hide\": 0, \"fieldname\": \"company_address_display\", \"label\": \"Company Address\"}, {\"print_hide\": 0, \"fieldname\": \"company_trn\", \"label\": \"Company TRN\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"item_code\", \"print_width\": \"50px\"}, {\"print_hide\": 0, \"fieldname\": \"tax_code\", \"print_width\": \"50px\"}, {\"print_hide\": 0, \"fieldname\": \"qty\", \"print_width\": \"30px\"}, {\"print_hide\": 0, \"fieldname\": \"uom\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_rate\", \"print_width\": \"10px\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"delivery_date\", \"print_width\": \"30px\"}], \"print_hide\": 0, \"fieldname\": \"items\", \"label\": \"Items\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"label\": \"Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"visible_columns\": [{\"print_hide\": 0, \"fieldname\": \"charge_type\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"row_id\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"account_head\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"cost_center\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"description\", \"print_width\": \"300px\"}, {\"print_hide\": 0, \"fieldname\": \"rate\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_total\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"base_tax_amount_after_discount_amount\", \"print_width\": \"\"}, {\"print_hide\": 0, \"fieldname\": \"item_wise_tax_detail\", \"print_width\": \"\"}], \"print_hide\": 0, \"fieldname\": \"taxes\", \"label\": \"Sales Taxes and Charges\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"grand_total\", \"label\": \"Grand Total\"}, {\"print_hide\": 0, \"fieldname\": \"rounded_total\", \"label\": \"Rounded Total\"}, {\"fieldtype\": \"Section Break\", \"label\": \"Terms\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"terms\", \"label\": \"Terms and Conditions Details\"}]",
+ "idx": 0,
+ "line_breaks": 0,
+ "modified": "2017-12-27 16:05:27.785367",
+ "modified_by": "Administrator",
+ "module": "Regional",
+ "name": "Tax Invoice",
+ "owner": "Administrator",
+ "print_format_builder": 1,
+ "print_format_type": "Server",
+ "show_section_headings": 0,
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py
index 5e038e7..f88c32f 100644
--- a/erpnext/regional/united_arab_emirates/setup.py
+++ b/erpnext/regional/united_arab_emirates/setup.py
@@ -43,9 +43,22 @@
options='customer.customer_name_in_arabic', print_hide=1),
]
- tax_code_field = dict(fieldname='tax_code', label='Tax Code',
- fieldtype='Read Only', options='item_code.tax_code', insert_after='description',
- allow_on_submit=1, print_hide=1)
+ invoice_item_fields = [
+ dict(fieldname='tax_code', label='Tax Code',
+ fieldtype='Read Only', options='item_code.tax_code', insert_after='description',
+ allow_on_submit=1, print_hide=1),
+ dict(fieldname='tax_rate', label='Tax Rate',
+ fieldtype='Float', insert_after='tax_code',
+ print_hide=1, hidden=1, read_only=1),
+ dict(fieldname='tax_amount', label='Tax Amount',
+ fieldtype='Currency', insert_after='tax_rate',
+ print_hide=1, hidden=1, read_only=1, options="currency"),
+ dict(fieldname='total_amount', label='Total Amount',
+ fieldtype='Currency', insert_after='tax_amount',
+ print_hide=1, hidden=1, read_only=1, options="currency"),
+ dict(fieldname='delivery_date', label='Delivery Date',
+ fieldtype='Date', insert_after='item_name', print_hide=1),
+ ]
custom_fields = {
'Item': [
@@ -62,8 +75,8 @@
],
'Purchase Invoice': purchase_invoice_fields + invoice_fields,
'Sales Invoice': sales_invoice_fields + invoice_fields,
- 'Sales Invoice Item': [tax_code_field],
- 'Purchase Invoice Item': [tax_code_field]
+ 'Sales Invoice Item': invoice_item_fields,
+ 'Purchase Invoice Item': invoice_item_fields
}
create_custom_fields(custom_fields)
@@ -71,6 +84,7 @@
def add_print_formats():
frappe.reload_doc("regional", "print_format", "detailed_tax_invoice")
frappe.reload_doc("regional", "print_format", "simplified_tax_invoice")
+ frappe.reload_doc("regional", "print_format", "tax_invoice")
frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
- name in('Simplified Tax Invoice', 'Detailed Tax Invoice') """)
+ name in('Simplified Tax Invoice', 'Detailed Tax Invoice', 'Tax Invoice') """)
diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py
new file mode 100644
index 0000000..3ba2030
--- /dev/null
+++ b/erpnext/regional/united_arab_emirates/utils.py
@@ -0,0 +1,14 @@
+from frappe.utils import flt
+from erpnext.controllers.taxes_and_totals import get_itemised_tax
+
+def update_itemised_tax_data(doc):
+ if not doc.taxes: return
+
+ itemised_tax = get_itemised_tax(doc.taxes)
+
+ for row in doc.items:
+ tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
+
+ row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
+ row.tax_amount = flt((row.net_amount * tax_rate) / 100, row.precision("net_amount"))
+ row.total_amount = flt((row.net_amount + row.tax_amount), row.precision("total_amount"))
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py
index ee225d3..a2466fe 100644
--- a/erpnext/setup/setup_wizard/operations/taxes_setup.py
+++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py
@@ -47,7 +47,7 @@
"root_type": "Liability",
"account_type": "Tax",
"tax_rate": flt(tax_rate) if tax_rate else None
- }).insert(ignore_permissions=True)
+ }).insert(ignore_permissions=True, ignore_mandatory=True)
def make_sales_and_purchase_tax_templates(accounts, template_name=None):
if not template_name:
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 428e366..7d18dd6 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1532,7 +1532,7 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
- "set_only_once": 1,
+ "set_only_once": 0,
"unique": 0
},
{
@@ -3453,7 +3453,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2017-12-13 07:20:25.932499",
+ "modified": "2017-12-27 15:47:17.039337",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",