Merge branch 'develop'
This commit is contained in:
commit
660f3ed0d6
@ -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'''
|
||||
|
@ -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":
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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"))
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
},
|
||||
{
|
||||
|
@ -61,7 +61,11 @@ def get_data():
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Examination"
|
||||
"name": "Assessment"
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Assessment Group"
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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"}
|
||||
]
|
||||
|
||||
|
@ -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']);
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
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
|
||||
|
15
erpnext/patches/v7_0/rename_examination_to_assessment.py
Normal file
15
erpnext/patches/v7_0/rename_examination_to_assessment.py
Normal file
@ -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")
|
||||
|
@ -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()
|
@ -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 ""
|
||||
|
27
erpnext/projects/doctype/timesheet/timesheet_calendar.js
Normal file
27
erpnext/projects/doctype/timesheet/timesheet_calendar.js
Normal file
@ -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"
|
||||
}
|
@ -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()
|
||||
|
@ -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;
|
||||
});
|
@ -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": [
|
@ -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"
|
||||
}
|
12
erpnext/schools/doctype/assessment/test_assessment.py
Normal file
12
erpnext/schools/doctype/assessment/test_assessment.py
Normal file
@ -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
|
@ -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) {
|
||||
|
||||
}
|
||||
});
|
109
erpnext/schools/doctype/assessment_group/assessment_group.json
Normal file
109
erpnext/schools/doctype/assessment_group/assessment_group.json
Normal file
@ -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
|
||||
}
|
@ -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
|
@ -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
|
@ -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": [],
|
@ -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
|
@ -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");
|
||||
});
|
||||
}
|
||||
});
|
@ -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)
|
||||
|
||||
|
@ -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
|
@ -1,8 +1,8 @@
|
||||
frappe.ui.form.on("Fee Amount", {
|
||||
frappe.ui.form.on("Fee Component", {
|
||||
amount: function(frm) {
|
||||
total_amount = 0;
|
||||
for(var i=0;i<frm.doc.amount.length;i++) {
|
||||
total_amount += frm.doc.amount[i].amount;
|
||||
for(var i=0;i<frm.doc.components.length;i++) {
|
||||
total_amount += frm.doc.components[i].amount;
|
||||
}
|
||||
frm.set_value("total_amount", total_amount);
|
||||
}
|
||||
|
@ -46,34 +46,39 @@ frappe.ui.form.on("Fees", {
|
||||
},
|
||||
|
||||
fee_structure: function(frm) {
|
||||
frm.set_value("amount" ,"");
|
||||
frm.set_value("components" ,"");
|
||||
if (frm.doc.fee_structure) {
|
||||
frappe.call({
|
||||
method: "erpnext.schools.api.get_fee_amount",
|
||||
method: "erpnext.schools.api.get_fee_components",
|
||||
args: {
|
||||
"fee_structure": frm.doc.fee_structure
|
||||
},
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
$.each(r.message, function(i, d) {
|
||||
var row = frappe.model.add_child(frm.doc, "Fee Amount", "amount");
|
||||
var row = frappe.model.add_child(frm.doc, "Fee Component", "components");
|
||||
row.fees_category = d.fees_category;
|
||||
row.amount = d.amount;
|
||||
});
|
||||
}
|
||||
refresh_field("amount");
|
||||
refresh_field("components");
|
||||
frm.trigger("calculate_total_amount");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Fee Amount", {
|
||||
amount: function(frm) {
|
||||
},
|
||||
|
||||
calculate_total_amount: function(frm) {
|
||||
total_amount = 0;
|
||||
for(var i=0;i<frm.doc.amount.length;i++) {
|
||||
total_amount += frm.doc.amount[i].amount;
|
||||
for(var i=0;i<frm.doc.components.length;i++) {
|
||||
total_amount += frm.doc.components[i].amount;
|
||||
}
|
||||
frm.set_value("total_amount", total_amount);
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.on("Fee Component", {
|
||||
amount: function(frm) {
|
||||
frm.trigger("calculate_total_amount");
|
||||
}
|
||||
});
|
||||
|
@ -27,11 +27,11 @@ class ProgramEnrollment(Document):
|
||||
frappe.db.set_value("Student", self.student, "joining_date", date)
|
||||
|
||||
def make_fee_records(self):
|
||||
from erpnext.schools.api import get_fee_amount
|
||||
from erpnext.schools.api import get_fee_components
|
||||
fee_list = []
|
||||
for d in self.fees:
|
||||
fee_amount = get_fee_amount(d.fee_structure)
|
||||
if fee_amount:
|
||||
fee_components = get_fee_components(d.fee_structure)
|
||||
if fee_components:
|
||||
fees = frappe.new_doc("Fees")
|
||||
fees.update({
|
||||
"student": self.student,
|
||||
@ -42,7 +42,7 @@ class ProgramEnrollment(Document):
|
||||
"due_date": d.due_date,
|
||||
"student_name": self.student_name,
|
||||
"program_enrollment": self.name,
|
||||
"amount": fee_amount
|
||||
"components": fee_components
|
||||
})
|
||||
|
||||
fees.save()
|
||||
|
@ -9,7 +9,7 @@ data = {
|
||||
'items': ['Student Log', 'Student Group', 'Student Attendance']
|
||||
},
|
||||
{
|
||||
'items': ['Program Enrollment', 'Fees', 'Examination', 'Guardian']
|
||||
'items': ['Program Enrollment', 'Fees', 'Assessment', 'Guardian']
|
||||
}
|
||||
]
|
||||
}
|
@ -9,11 +9,11 @@ frappe.ui.form.on("Student Group", "refresh", function(frm) {
|
||||
frappe.set_route("List", "Course Schedule");
|
||||
});
|
||||
|
||||
frm.add_custom_button(__("Examination"), function() {
|
||||
frm.add_custom_button(__("Assessment"), function() {
|
||||
frappe.route_options = {
|
||||
student_group: frm.doc.name
|
||||
}
|
||||
frappe.set_route("List", "Examination");
|
||||
frappe.set_route("List", "Assessment");
|
||||
});
|
||||
}
|
||||
});
|
@ -18,7 +18,7 @@ def get_domain(domain):
|
||||
'set_value': [
|
||||
['Stock Settings', None, 'show_barcode_field', 1]
|
||||
],
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
|
||||
},
|
||||
|
||||
'Retail': {
|
||||
@ -32,7 +32,7 @@ def get_domain(domain):
|
||||
'set_value': [
|
||||
['Stock Settings', None, 'show_barcode_field', 1]
|
||||
],
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
|
||||
},
|
||||
|
||||
'Distribution': {
|
||||
@ -45,7 +45,7 @@ def get_domain(domain):
|
||||
'set_value': [
|
||||
['Stock Settings', None, 'show_barcode_field', 1]
|
||||
],
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
|
||||
},
|
||||
|
||||
'Services': {
|
||||
@ -58,13 +58,13 @@ def get_domain(domain):
|
||||
'set_value': [
|
||||
['Stock Settings', None, 'show_barcode_field', 0]
|
||||
],
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
|
||||
'remove_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
|
||||
},
|
||||
'Education': {
|
||||
'desktop_icons': ['Student', 'Program', 'Course', 'Student Group', 'Instructor',
|
||||
'Fees', 'ToDo', 'Schools'],
|
||||
'allow_roles': ['Academics User', 'Accounts User', 'Accounts Manager', 'Website Manager'],
|
||||
'allow_sidebar_items': ['/announcement', '/course', '/examination', '/fees']
|
||||
'allow_sidebar_items': ['/announcement', '/course', '/assessment', '/fees']
|
||||
},
|
||||
}
|
||||
if not domain in data:
|
||||
|
Loading…
x
Reference in New Issue
Block a user