Merge branch 'develop' of github.com:frappe/erpnext into call-summary-dialog

This commit is contained in:
Suraj Shetty 2019-06-10 09:25:39 +05:30
commit 54bb3e4b9f
249 changed files with 8958 additions and 35360 deletions

View File

@ -0,0 +1,33 @@
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Accounting Dimension', {
refresh: function(frm) {
if (!frm.is_new()) {
frm.add_custom_button(__('Show {0}', [frm.doc.document_type]), function () {
frappe.set_route("List", frm.doc.document_type);
});
}
},
document_type: function(frm) {
frm.set_value('label', frm.doc.document_type);
frm.set_value('fieldname', frappe.scrub(frm.doc.document_type));
frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
if (r.document_type) {
frm.set_df_property('document_type', 'description', "Document type is already set as dimension");
}
});
},
disabled: function(frm) {
frappe.call({
method: "erpnext.accounts.doctype.accounting_dimension.accounting_dimension.disable_dimension",
args: {
doc: frm.doc
}
});
}
});

View File

@ -0,0 +1,79 @@
{
"_comments": "[]",
"_liked_by": "[]",
"autoname": "field:label",
"creation": "2019-05-04 18:13:37.002352",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"document_type",
"label",
"fieldname",
"mandatory_for_bs",
"mandatory_for_pl",
"disabled"
],
"fields": [
{
"fieldname": "label",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Dimension Name",
"unique": 1
},
{
"fieldname": "fieldname",
"fieldtype": "Data",
"hidden": 1,
"label": "Fieldname"
},
{
"fieldname": "document_type",
"fieldtype": "Link",
"label": "Reference Document Type",
"options": "DocType",
"reqd": 1
},
{
"default": "0",
"fieldname": "disabled",
"fieldtype": "Check",
"label": "Disable"
},
{
"default": "0",
"fieldname": "mandatory_for_bs",
"fieldtype": "Check",
"label": "Mandatory For Balance Sheet"
},
{
"default": "0",
"fieldname": "mandatory_for_pl",
"fieldtype": "Check",
"label": "Mandatory For Profit and Loss Account"
}
],
"modified": "2019-05-27 18:18:17.792726",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounting Dimension",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "ASC",
"track_changes": 1
}

View File

@ -0,0 +1,163 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import json
from frappe.model.document import Document
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from frappe import scrub
from frappe.utils import cstr
from frappe.utils.background_jobs import enqueue
class AccountingDimension(Document):
def before_insert(self):
self.set_fieldname_and_label()
if frappe.flags.in_test:
make_dimension_in_accounting_doctypes(doc=self)
else:
frappe.enqueue(make_dimension_in_accounting_doctypes, doc=self)
def on_trash(self):
if frappe.flags.in_test:
delete_accounting_dimension(doc=self)
else:
frappe.enqueue(delete_accounting_dimension, doc=self)
def set_fieldname_and_label(self):
if not self.label:
self.label = cstr(self.document_type)
if not self.fieldname:
self.fieldname = scrub(self.label)
def make_dimension_in_accounting_doctypes(doc):
doclist = get_doctypes_with_dimensions()
doc_count = len(get_accounting_dimensions())
count = 0
for doctype in doclist:
if (doc_count + 1) % 2 == 0:
insert_after_field = 'dimension_col_break'
else:
insert_after_field = 'accounting_dimensions_section'
df = {
"fieldname": doc.fieldname,
"label": doc.label,
"fieldtype": "Link",
"options": doc.document_type,
"insert_after": insert_after_field
}
if doctype == "Budget":
add_dimension_to_budget_doctype(df, doc)
else:
create_custom_field(doctype, df)
count += 1
frappe.publish_progress(count*100/len(doclist), title = _("Creating Dimensions..."))
frappe.clear_cache(doctype=doctype)
def add_dimension_to_budget_doctype(df, doc):
df.update({
"insert_after": "cost_center",
"depends_on": "eval:doc.budget_against == '{0}'".format(doc.document_type)
})
create_custom_field("Budget", df)
property_setter = frappe.db.exists("Property Setter", "Budget-budget_against-options")
if property_setter:
property_setter_doc = frappe.get_doc("Property Setter", "Budget-budget_against-options")
property_setter_doc.value = property_setter_doc.value + "\n" + doc.document_type
property_setter_doc.save()
frappe.clear_cache(doctype='Budget')
else:
frappe.get_doc({
"doctype": "Property Setter",
"doctype_or_field": "DocField",
"doc_type": "Budget",
"field_name": "budget_against",
"property": "options",
"property_type": "Text",
"value": "\nCost Center\nProject\n" + doc.document_type
}).insert(ignore_permissions=True)
def delete_accounting_dimension(doc):
doclist = get_doctypes_with_dimensions()
frappe.db.sql("""
DELETE FROM `tabCustom Field`
WHERE fieldname = %s
AND dt IN (%s)""" % #nosec
('%s', ', '.join(['%s']* len(doclist))), tuple([doc.fieldname] + doclist))
frappe.db.sql("""
DELETE FROM `tabProperty Setter`
WHERE field_name = %s
AND doc_type IN (%s)""" % #nosec
('%s', ', '.join(['%s']* len(doclist))), tuple([doc.fieldname] + doclist))
budget_against_property = frappe.get_doc("Property Setter", "Budget-budget_against-options")
value_list = budget_against_property.value.split('\n')[3:]
if doc.document_type in value_list:
value_list.remove(doc.document_type)
budget_against_property.value = "\nCost Center\nProject\n" + "\n".join(value_list)
budget_against_property.save()
for doctype in doclist:
frappe.clear_cache(doctype=doctype)
@frappe.whitelist()
def disable_dimension(doc):
if frappe.flags.in_test:
frappe.enqueue(start_dimension_disabling, doc=doc)
else:
start_dimension_disabling(doc=doc)
def start_dimension_disabling(doc):
doc = json.loads(doc)
if doc.get('disabled'):
df = {"read_only": 1}
else:
df = {"read_only": 0}
doclist = get_doctypes_with_dimensions()
for doctype in doclist:
field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": doc.get('fieldname')})
if field:
custom_field = frappe.get_doc("Custom Field", field)
custom_field.update(df)
custom_field.save()
frappe.clear_cache(doctype=doctype)
def get_doctypes_with_dimensions():
doclist = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
"Expense Claim", "Stock Entry", "Budget", "Payroll Entry", "Delivery Note", "Sales Invoice Item", "Purchase Invoice Item",
"Purchase Order Item", "Journal Entry Account", "Material Request Item", "Delivery Note Item", "Purchase Receipt Item",
"Stock Entry Detail", "Payment Entry Deduction", "Sales Taxes and Charges", "Purchase Taxes and Charges", "Shipping Rule",
"Landed Cost Item", "Asset Value Adjustment", "Loyalty Program", "Fee Schedule", "Fee Structure", "Stock Reconciliation",
"Travel Request", "Fees", "POS Profile"]
return doclist
def get_accounting_dimensions(as_list=True):
accounting_dimensions = frappe.get_all("Accounting Dimension", fields=["label", "fieldname", "mandatory_for_pl", "mandatory_for_bs", "disabled"])
if as_list:
return [d.fieldname for d in accounting_dimensions]
else:
return accounting_dimensions

View File

@ -0,0 +1,107 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import delete_accounting_dimension
class TestAccountingDimension(unittest.TestCase):
def setUp(self):
frappe.set_user("Administrator")
if not frappe.db.exists("Accounting Dimension", {"document_type": "Department"}):
dimension = frappe.get_doc({
"doctype": "Accounting Dimension",
"document_type": "Department",
}).insert()
else:
dimension1 = frappe.get_doc("Accounting Dimension", "Department")
dimension1.disabled = 0
dimension1.save()
if not frappe.db.exists("Accounting Dimension", {"document_type": "Location"}):
dimension1 = frappe.get_doc({
"doctype": "Accounting Dimension",
"document_type": "Location",
"mandatory_for_pl": 1
}).insert()
else:
dimension1 = frappe.get_doc("Accounting Dimension", "Location")
dimension1.disabled = 0
dimension1.mandatory_for_pl = 1
dimension1.save()
def test_dimension_against_sales_invoice(self):
si = create_sales_invoice(do_not_save=1)
si.location = "Block 1"
si.append("items", {
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"department": "_Test Department - _TC",
"location": "Block 1"
})
si.save()
si.submit()
gle = frappe.get_doc("GL Entry", {"voucher_no": si.name, "account": "Sales - _TC"})
self.assertEqual(gle.get('department'), "_Test Department - _TC")
def test_dimension_against_journal_entry(self):
je = make_journal_entry("Sales - _TC", "Sales Expenses - _TC", 500, save=False)
je.accounts[0].update({"department": "_Test Department - _TC"})
je.accounts[1].update({"department": "_Test Department - _TC"})
je.accounts[0].update({"location": "Block 1"})
je.accounts[1].update({"location": "Block 1"})
je.save()
je.submit()
gle = frappe.get_doc("GL Entry", {"voucher_no": je.name, "account": "Sales - _TC"})
gle1 = frappe.get_doc("GL Entry", {"voucher_no": je.name, "account": "Sales Expenses - _TC"})
self.assertEqual(gle.get('department'), "_Test Department - _TC")
self.assertEqual(gle1.get('department'), "_Test Department - _TC")
def test_mandatory(self):
si = create_sales_invoice(do_not_save=1)
si.append("items", {
"item_code": "_Test Item",
"warehouse": "_Test Warehouse - _TC",
"qty": 1,
"rate": 100,
"income_account": "Sales - _TC",
"expense_account": "Cost of Goods Sold - _TC",
"cost_center": "_Test Cost Center - _TC",
"location": ""
})
si.save()
self.assertRaises(frappe.ValidationError, si.submit)
def tearDown(self):
disable_dimension()
def disable_dimension():
dimension1 = frappe.get_doc("Accounting Dimension", "Department")
dimension1.disabled = 1
dimension1.save()
dimension2 = frappe.get_doc("Accounting Dimension", "Location")
dimension2.mandatory_for_pl = 0
dimension2.disabled = 1
dimension2.save()

View File

@ -12,6 +12,7 @@ from erpnext.accounts.party import validate_party_gle_currency, validate_party_f
from erpnext.accounts.utils import get_account_currency from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.utils import get_fiscal_year from erpnext.accounts.utils import get_fiscal_year
from erpnext.exceptions import InvalidAccountCurrency from erpnext.exceptions import InvalidAccountCurrency
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
exclude_from_linked_with = True exclude_from_linked_with = True
class GLEntry(Document): class GLEntry(Document):
@ -28,6 +29,7 @@ class GLEntry(Document):
self.validate_and_set_fiscal_year() self.validate_and_set_fiscal_year()
self.pl_must_have_cost_center() self.pl_must_have_cost_center()
self.validate_cost_center() self.validate_cost_center()
self.validate_dimensions_for_pl_and_bs()
if not self.flags.from_repost: if not self.flags.from_repost:
self.check_pl_account() self.check_pl_account()
@ -80,6 +82,25 @@ class GLEntry(Document):
if self.project: if self.project:
self.project = None self.project = None
def validate_dimensions_for_pl_and_bs(self):
account_type = frappe.db.get_value("Account", self.account, "report_type")
for dimension in get_accounting_dimensions(as_list=False):
if account_type == "Profit and Loss" \
and dimension.mandatory_for_pl and not dimension.disabled:
if not self.get(dimension.fieldname):
frappe.throw(_("{0} is required for 'Profit and Loss' account {1}.")
.format(dimension.label, self.account))
if account_type == "Balance Sheet" \
and dimension.mandatory_for_bs and not dimension.disabled:
if not self.get(dimension.fieldname):
frappe.throw(_("{0} is required for 'Balance Sheet' account {1}.")
.format(dimension.label, self.account))
def check_pl_account(self): def check_pl_account(self):
if self.is_opening=='Yes' and \ if self.is_opening=='Yes' and \
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \ frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
@ -260,7 +281,7 @@ def rename_gle_sle_docs():
def rename_temporarily_named_docs(doctype): def rename_temporarily_named_docs(doctype):
"""Rename temporarily named docs using autoname options""" """Rename temporarily named docs using autoname options"""
docs_to_rename = frappe.get_all(doctype, {"to_rename": "1"}, order_by="creation") docs_to_rename = frappe.get_all(doctype, {"to_rename": "1"}, order_by="creation", limit=50000)
for doc in docs_to_rename: for doc in docs_to_rename:
oldname = doc.name oldname = doc.name
set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc) set_name_from_naming_options(frappe.get_meta(doctype).autoname, doc)

View File

@ -509,7 +509,7 @@ class JournalEntry(AccountsController):
"cost_center": d.cost_center, "cost_center": d.cost_center,
"project": d.project, "project": d.project,
"finance_book": self.finance_book "finance_book": self.finance_book
}) }, item=d)
) )
if gl_map: if gl_map:

View File

@ -1,678 +1,171 @@
{ {
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:loyalty_program_name", "autoname": "field:loyalty_program_name",
"beta": 0,
"creation": "2018-01-23 06:23:05.731431", "creation": "2018-01-23 06:23:05.731431",
"custom": 0,
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [
"loyalty_program_name",
"loyalty_program_type",
"from_date",
"to_date",
"column_break_7",
"customer_group",
"customer_territory",
"auto_opt_in",
"rules",
"collection_rules",
"redemption",
"conversion_factor",
"expiry_duration",
"column_break_10",
"expense_account",
"company",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"help_section",
"loyalty_program_help"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "loyalty_program_name", "fieldname": "loyalty_program_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Loyalty Program Name", "label": "Loyalty Program Name",
"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": 1, "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "loyalty_program_type", "fieldname": "loyalty_program_type",
"fieldtype": "Select", "fieldtype": "Select",
"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": "Loyalty Program Type", "label": "Loyalty Program Type",
"length": 0, "options": "Single Tier Program\nMultiple Tier Program"
"no_copy": 0,
"options": "Single Tier Program\nMultiple Tier 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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "",
"fieldname": "from_date", "fieldname": "from_date",
"fieldtype": "Date", "fieldtype": "Date",
"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": "From Date", "label": "From Date",
"length": 0, "reqd": 1
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "to_date", "fieldname": "to_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0, "label": "To Date"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "To Date",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_7", "fieldname": "column_break_7",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_group", "fieldname": "customer_group",
"fieldtype": "Link", "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": "Customer Group", "label": "Customer Group",
"length": 0, "options": "Customer Group"
"no_copy": 0,
"options": "Customer 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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "customer_territory", "fieldname": "customer_territory",
"fieldtype": "Link", "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": "Customer Territory", "label": "Customer Territory",
"length": 0, "options": "Territory"
"no_copy": 0,
"options": "Territory",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "auto_opt_in", "fieldname": "auto_opt_in",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "label": "Auto Opt In (For all customers)"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Auto Opt In (For all customers)",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "rules", "fieldname": "rules",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Collection Tier"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Collection Tier",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "collection_rules", "fieldname": "collection_rules",
"fieldtype": "Table", "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": "Collection Rules", "label": "Collection Rules",
"length": 0,
"no_copy": 0,
"options": "Loyalty Program Collection", "options": "Loyalty Program Collection",
"permlevel": 0, "reqd": 1
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "redemption", "fieldname": "redemption",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Redemption"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Redemption",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "1 Loyalty Points = How much base currency?", "description": "1 Loyalty Points = How much base currency?",
"fieldname": "conversion_factor", "fieldname": "conversion_factor",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "label": "Conversion Factor"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Conversion Factor",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "expiry_duration", "fieldname": "expiry_duration",
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 0, "label": "Expiry Duration (in days)"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Expiry Duration (in days)",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_10", "fieldname": "column_break_10",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "expense_account", "fieldname": "expense_account",
"fieldtype": "Link", "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": "Expense Account", "label": "Expense Account",
"length": 0, "options": "Account"
"no_copy": 0,
"options": "Account",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "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": "Cost Center", "label": "Cost Center",
"length": 0, "options": "Cost Center"
"no_copy": 0,
"options": "Cost Center",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "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": "Company", "label": "Company",
"length": 0, "options": "Company"
"no_copy": 0,
"options": "Company",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "help_section", "fieldname": "help_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Help Section"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Help Section",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "loyalty_program_help", "fieldname": "loyalty_program_help",
"fieldtype": "HTML", "fieldtype": "HTML",
"hidden": 0, "label": "Loyalty Program Help"
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0, {
"in_filter": 0, "fieldname": "accounting_dimensions_section",
"in_global_search": 0, "fieldtype": "Section Break",
"in_list_view": 0, "label": "Accounting Dimensions"
"in_standard_filter": 0, },
"label": "Loyalty Program Help", {
"length": 0, "fieldname": "dimension_col_break",
"no_copy": 0, "fieldtype": "Column Break"
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-05-26 09:11:46.120251",
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-07-10 19:15:24.994385",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Loyalty Program", "name": "Loyalty Program",
"name_case": "",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "System Manager", "role": "System Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1, "track_changes": 1
"track_seen": 0,
"track_views": 0
} }

View File

@ -3,6 +3,7 @@
"autoname": "naming_series:", "autoname": "naming_series:",
"creation": "2016-06-01 14:38:51.012597", "creation": "2016-06-01 14:38:51.012597",
"doctype": "DocType", "doctype": "DocType",
"engine": "InnoDB",
"field_order": [ "field_order": [
"type_of_payment", "type_of_payment",
"naming_series", "naming_series",
@ -11,7 +12,6 @@
"column_break_5", "column_break_5",
"posting_date", "posting_date",
"company", "company",
"cost_center",
"mode_of_payment", "mode_of_payment",
"party_section", "party_section",
"party_type", "party_type",
@ -57,8 +57,11 @@
"column_break_23", "column_break_23",
"reference_date", "reference_date",
"clearance_date", "clearance_date",
"section_break_12", "accounting_dimensions_section",
"project", "project",
"dimension_col_break",
"cost_center",
"section_break_12",
"remarks", "remarks",
"column_break_16", "column_break_16",
"letter_head", "letter_head",
@ -554,10 +557,20 @@
"label": "Payment Order Status", "label": "Payment Order Status",
"options": "Initiated\nPayment Ordered", "options": "Initiated\nPayment Ordered",
"read_only": 1 "read_only": 1
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"modified": "2019-05-15 15:43:29.229496", "modified": "2019-05-25 22:02:40.575822",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Payment Entry", "name": "Payment Entry",

View File

@ -507,7 +507,7 @@ class PaymentEntry(AccountsController):
"debit_in_account_currency": d.amount, "debit_in_account_currency": d.amount,
"debit": d.amount, "debit": d.amount,
"cost_center": d.cost_center "cost_center": d.cost_center
}) }, item=d)
) )
def update_advance_paid(self): def update_advance_paid(self):

View File

@ -68,7 +68,7 @@ frappe.ui.form.on('Payment Order', {
docstatus: 1, docstatus: 1,
bank_account: frm.doc.company_bank_account, bank_account: frm.doc.company_bank_account,
paid_from: frm.doc.account, paid_from: frm.doc.account,
status: ["=", "Initiated"], payment_order_status: ["=", "Initiated"],
} }
}); });
}, },

View File

@ -8,7 +8,7 @@ frappe.ui.form.on('Payment Order', {
}, },
generate_text_and_download_file: (frm) => { generate_text_and_download_file: (frm) => {
return frappe.call({ return frappe.call({
method: "erpnext.regional.india.bank_remittance_txt.generate_report", method: "erpnext.regional.india.bank_remittance.generate_report",
args: { args: {
name: frm.doc.name name: frm.doc.name
}, },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -456,7 +456,7 @@ class PurchaseInvoice(BuyingController):
"remarks": self.get("remarks") or _("Accounting Entry for Stock"), "remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"cost_center": item.cost_center, "cost_center": item.cost_center,
"project": item.project "project": item.project
}, account_currency) }, account_currency, item=item)
) )
# Amount added through landed-cost-voucher # Amount added through landed-cost-voucher
@ -468,7 +468,7 @@ class PurchaseInvoice(BuyingController):
"remarks": self.get("remarks") or _("Accounting Entry for Stock"), "remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.landed_cost_voucher_amount), "credit": flt(item.landed_cost_voucher_amount),
"project": item.project "project": item.project
})) }, item=item))
# sub-contracting warehouse # sub-contracting warehouse
if flt(item.rm_supp_cost): if flt(item.rm_supp_cost):
@ -482,7 +482,7 @@ class PurchaseInvoice(BuyingController):
"cost_center": item.cost_center, "cost_center": item.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"), "remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": flt(item.rm_supp_cost) "credit": flt(item.rm_supp_cost)
}, warehouse_account[self.supplier_warehouse]["account_currency"])) }, warehouse_account[self.supplier_warehouse]["account_currency"], item=item))
elif not item.is_fixed_asset or (item.is_fixed_asset and is_cwip_accounting_disabled()): elif not item.is_fixed_asset or (item.is_fixed_asset and is_cwip_accounting_disabled()):
gl_entries.append( gl_entries.append(
self.get_gl_dict({ self.get_gl_dict({
@ -494,7 +494,7 @@ class PurchaseInvoice(BuyingController):
else flt(item.net_amount, item.precision("net_amount"))), else flt(item.net_amount, item.precision("net_amount"))),
"cost_center": item.cost_center, "cost_center": item.cost_center,
"project": item.project "project": item.project
}, account_currency) }, account_currency, item=item)
) )
if self.auto_accounting_for_stock and self.is_opening == "No" and \ if self.auto_accounting_for_stock and self.is_opening == "No" and \
@ -513,7 +513,7 @@ class PurchaseInvoice(BuyingController):
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")), "debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
"remarks": self.remarks or "Accounting Entry for Stock", "remarks": self.remarks or "Accounting Entry for Stock",
"cost_center": self.cost_center "cost_center": self.cost_center
}) }, item=item)
) )
self.negative_expense_to_be_booked += flt(item.item_tax_amount, \ self.negative_expense_to_be_booked += flt(item.item_tax_amount, \
@ -542,7 +542,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": (base_asset_amount "debit_in_account_currency": (base_asset_amount
if asset_rbnb_currency == self.company_currency else asset_amount), if asset_rbnb_currency == self.company_currency else asset_amount),
"cost_center": item.cost_center "cost_center": item.cost_center
})) }, item=item))
if item.item_tax_amount: if item.item_tax_amount:
asset_eiiav_currency = get_account_currency(eiiav_account) asset_eiiav_currency = get_account_currency(eiiav_account)
@ -555,7 +555,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": (item.item_tax_amount "credit_in_account_currency": (item.item_tax_amount
if asset_eiiav_currency == self.company_currency else if asset_eiiav_currency == self.company_currency else
item.item_tax_amount / self.conversion_rate) item.item_tax_amount / self.conversion_rate)
})) }, item=item))
else: else:
cwip_account = get_asset_account("capital_work_in_progress_account", cwip_account = get_asset_account("capital_work_in_progress_account",
item.asset, company = self.company) item.asset, company = self.company)
@ -569,7 +569,7 @@ class PurchaseInvoice(BuyingController):
"debit_in_account_currency": (base_asset_amount "debit_in_account_currency": (base_asset_amount
if cwip_account_currency == self.company_currency else asset_amount), if cwip_account_currency == self.company_currency else asset_amount),
"cost_center": self.cost_center "cost_center": self.cost_center
})) }, item=item))
if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)): if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
asset_eiiav_currency = get_account_currency(eiiav_account) asset_eiiav_currency = get_account_currency(eiiav_account)
@ -582,7 +582,7 @@ class PurchaseInvoice(BuyingController):
"credit_in_account_currency": (item.item_tax_amount "credit_in_account_currency": (item.item_tax_amount
if asset_eiiav_currency == self.company_currency else if asset_eiiav_currency == self.company_currency else
item.item_tax_amount / self.conversion_rate) item.item_tax_amount / self.conversion_rate)
})) }, item=item))
return gl_entries return gl_entries
@ -609,7 +609,7 @@ class PurchaseInvoice(BuyingController):
"remarks": self.get("remarks") or _("Stock Adjustment"), "remarks": self.get("remarks") or _("Stock Adjustment"),
"cost_center": item.cost_center, "cost_center": item.cost_center,
"project": item.project "project": item.project
}, account_currency) }, account_currency, item=item)
) )
warehouse_debit_amount = stock_amount warehouse_debit_amount = stock_amount

View File

@ -4,6 +4,7 @@
"doctype": "DocType", "doctype": "DocType",
"document_type": "Document", "document_type": "Document",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB",
"field_order": [ "field_order": [
"item_code", "item_code",
"col_break1", "col_break1",
@ -15,6 +16,10 @@
"image_section", "image_section",
"image", "image",
"image_view", "image_view",
"manufacture_details",
"manufacturer",
"column_break_13",
"manufacturer_part_no",
"quantity_and_rate", "quantity_and_rate",
"received_qty", "received_qty",
"qty", "qty",
@ -64,9 +69,7 @@
"rejected_serial_no", "rejected_serial_no",
"accounting", "accounting",
"expense_account", "expense_account",
"cost_center",
"col_break5", "col_break5",
"project",
"is_fixed_asset", "is_fixed_asset",
"asset", "asset",
"asset_location", "asset_location",
@ -87,6 +90,10 @@
"po_detail", "po_detail",
"purchase_receipt", "purchase_receipt",
"pr_detail", "pr_detail",
"accounting_dimensions_section",
"project",
"dimension_col_break",
"cost_center",
"section_break_82", "section_break_82",
"page_break" "page_break"
], ],
@ -306,6 +313,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "is_free_item", "fieldname": "is_free_item",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Free Item", "label": "Is Free Item",
@ -497,6 +505,7 @@
"label": "Service Stop Date" "label": "Service Stop Date"
}, },
{ {
"default": "0",
"fieldname": "enable_deferred_expense", "fieldname": "enable_deferred_expense",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Enable Deferred Expense" "label": "Enable Deferred Expense"
@ -523,6 +532,7 @@
"label": "Reference" "label": "Reference"
}, },
{ {
"default": "0",
"fieldname": "allow_zero_valuation_rate", "fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Zero Valuation Rate", "label": "Allow Zero Valuation Rate",
@ -592,6 +602,7 @@
"options": "BOM" "options": "BOM"
}, },
{ {
"default": "0",
"depends_on": "eval:parent.is_subcontracted == 'Yes'", "depends_on": "eval:parent.is_subcontracted == 'Yes'",
"fieldname": "include_exploded_items", "fieldname": "include_exploded_items",
"fieldtype": "Check", "fieldtype": "Check",
@ -603,6 +614,7 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"default": "0",
"fieldname": "is_fixed_asset", "fieldname": "is_fixed_asset",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 1, "hidden": 1,
@ -652,6 +664,7 @@
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"default": "0",
"fieldname": "page_break", "fieldname": "page_break",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Page Break", "label": "Page Break",
@ -710,11 +723,42 @@
"fieldname": "image_section", "fieldname": "image_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Image" "label": "Image"
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "manufacture_details",
"fieldtype": "Section Break",
"label": "Manufacture"
},
{
"fieldname": "manufacturer",
"fieldtype": "Link",
"label": "Manufacturer",
"options": "Manufacturer"
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break"
},
{
"fieldname": "manufacturer_part_no",
"fieldtype": "Data",
"label": "Manufacturer Part Number",
"read_only": 1
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2019-05-01 18:01:49.605029", "modified": "2019-06-02 06:36:17.078419",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Purchase Invoice Item", "name": "Purchase Invoice Item",

View File

@ -1,737 +1,227 @@
{ {
"allow_copy": 0, "autoname": "hash",
"allow_guest_to_view": 0, "creation": "2013-05-21 16:16:04",
"allow_import": 0, "doctype": "DocType",
"allow_rename": 0, "document_type": "Setup",
"autoname": "hash", "editable_grid": 1,
"beta": 0, "engine": "InnoDB",
"creation": "2013-05-21 16:16:04", "field_order": [
"custom": 0, "category",
"docstatus": 0, "add_deduct_tax",
"doctype": "DocType", "charge_type",
"document_type": "Setup", "row_id",
"editable_grid": 1, "included_in_print_rate",
"engine": "InnoDB", "col_break1",
"account_head",
"description",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"section_break_10",
"rate",
"section_break_9",
"tax_amount",
"tax_amount_after_discount_amount",
"total",
"column_break_14",
"base_tax_amount",
"base_total",
"base_tax_amount_after_discount_amount",
"item_wise_tax_detail",
"parenttype"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "default": "Total",
"allow_in_quick_entry": 0, "fieldname": "category",
"allow_on_submit": 0, "fieldtype": "Select",
"bold": 0, "label": "Consider Tax or Charge for",
"collapsible": 0, "oldfieldname": "category",
"columns": 0, "oldfieldtype": "Select",
"default": "Total", "options": "Valuation and Total\nValuation\nTotal",
"fieldname": "category", "reqd": 1
"fieldtype": "Select", },
"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": "Consider Tax or Charge for",
"length": 0,
"no_copy": 0,
"oldfieldname": "category",
"oldfieldtype": "Select",
"options": "Valuation and Total\nValuation\nTotal",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "default": "Add",
"allow_in_quick_entry": 0, "fieldname": "add_deduct_tax",
"allow_on_submit": 0, "fieldtype": "Select",
"bold": 0, "label": "Add or Deduct",
"collapsible": 0, "oldfieldname": "add_deduct_tax",
"columns": 0, "oldfieldtype": "Select",
"default": "Add", "options": "Add\nDeduct",
"fieldname": "add_deduct_tax", "reqd": 1
"fieldtype": "Select", },
"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": "Add or Deduct",
"length": 0,
"no_copy": 0,
"oldfieldname": "add_deduct_tax",
"oldfieldtype": "Select",
"options": "Add\nDeduct",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "charge_type",
"allow_on_submit": 0, "fieldtype": "Select",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Type",
"columns": 2, "oldfieldname": "charge_type",
"fieldname": "charge_type", "oldfieldtype": "Select",
"fieldtype": "Select", "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total\nOn Item Quantity",
"hidden": 0, "reqd": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total\nOn Item Quantity",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"allow_in_quick_entry": 0, "fieldname": "row_id",
"allow_on_submit": 0, "fieldtype": "Data",
"bold": 0, "label": "Reference Row #",
"collapsible": 0, "oldfieldname": "row_id",
"columns": 0, "oldfieldtype": "Data"
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", },
"fieldname": "row_id",
"fieldtype": "Data",
"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": "Reference Row #",
"length": 0,
"no_copy": 0,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0, "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
"allow_on_submit": 0, "fieldname": "included_in_print_rate",
"bold": 0, "fieldtype": "Check",
"collapsible": 0, "label": "Is this Tax included in Basic Rate?",
"columns": 0, "report_hide": 1
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", },
"fieldname": "included_in_print_rate",
"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": "Is this Tax included in Basic Rate?",
"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": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "col_break1",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break1",
"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,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "account_head",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Account Head",
"columns": 2, "oldfieldname": "account_head",
"fieldname": "account_head", "oldfieldtype": "Link",
"fieldtype": "Link", "options": "Account",
"hidden": 0, "reqd": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "default": ":Company",
"allow_in_quick_entry": 0, "fieldname": "cost_center",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "label": "Cost Center",
"collapsible": 0, "oldfieldname": "cost_center",
"columns": 0, "oldfieldtype": "Link",
"default": ":Company", "options": "Cost Center"
"fieldname": "cost_center", },
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "description",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "label": "Description",
"bold": 0, "oldfieldname": "description",
"collapsible": 0, "oldfieldtype": "Small Text",
"columns": 0, "print_width": "300px",
"fieldname": "description", "reqd": 1,
"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": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_10",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_10",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "rate",
"allow_on_submit": 0, "fieldtype": "Float",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Rate",
"columns": 2, "oldfieldname": "rate",
"fieldname": "rate", "oldfieldtype": "Currency"
"fieldtype": "Float", },
"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": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_9",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "tax_amount",
"allow_on_submit": 0, "fieldtype": "Currency",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Amount",
"columns": 2, "oldfieldname": "tax_amount",
"fieldname": "tax_amount", "oldfieldtype": "Currency",
"fieldtype": "Currency", "options": "currency"
"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": "Amount",
"length": 0,
"no_copy": 0,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "currency",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "tax_amount_after_discount_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Tax Amount After Discount Amount",
"bold": 0, "options": "currency",
"collapsible": 0, "print_hide": 1,
"columns": 0, "read_only": 1
"fieldname": "tax_amount_after_discount_amount", },
"fieldtype": "Currency",
"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": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "total",
"allow_on_submit": 0, "fieldtype": "Currency",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Total",
"columns": 2, "oldfieldname": "total",
"fieldname": "total", "oldfieldtype": "Currency",
"fieldtype": "Currency", "options": "currency",
"hidden": 0, "read_only": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Total",
"length": 0,
"no_copy": 0,
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_14",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_14",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "base_tax_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Amount (Company Currency)",
"bold": 0, "options": "Company:company:default_currency",
"collapsible": 0, "print_hide": 1,
"columns": 0, "read_only": 1
"fieldname": "base_tax_amount", },
"fieldtype": "Currency",
"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": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "base_total",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Total (Company Currency)",
"collapsible": 0, "options": "Company:company:default_currency",
"columns": 0, "print_hide": 1
"fieldname": "base_total", },
"fieldtype": "Currency",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Total (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "base_tax_amount_after_discount_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Tax Amount After Discount Amount",
"bold": 0, "options": "Company:company:default_currency",
"collapsible": 0, "print_hide": 1,
"columns": 0, "read_only": 1
"fieldname": "base_tax_amount_after_discount_amount", },
"fieldtype": "Currency",
"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": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "item_wise_tax_detail",
"allow_in_quick_entry": 0, "fieldtype": "Code",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Item Wise Tax Detail ",
"collapsible": 0, "oldfieldname": "item_wise_tax_detail",
"columns": 0, "oldfieldtype": "Small Text",
"fieldname": "item_wise_tax_detail", "print_hide": 1,
"fieldtype": "Code", "read_only": 1
"hidden": 1, },
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Wise Tax Detail ",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "parenttype",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Parenttype",
"collapsible": 0, "oldfieldname": "parenttype",
"columns": 0, "oldfieldtype": "Data",
"fieldname": "parenttype", "print_hide": 1
"fieldtype": "Data", },
"hidden": 1, {
"ignore_user_permissions": 0, "fieldname": "accounting_dimensions_section",
"ignore_xss_filter": 0, "fieldtype": "Section Break",
"in_filter": 0, "label": "Accounting Dimensions"
"in_global_search": 0, },
"in_list_view": 0, {
"in_standard_filter": 0, "fieldname": "dimension_col_break",
"label": "Parenttype", "fieldtype": "Column Break"
"length": 0,
"no_copy": 0,
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "idx": 1,
"hide_heading": 1, "istable": 1,
"hide_toolbar": 0, "modified": "2019-05-25 23:08:38.281025",
"idx": 1, "modified_by": "Administrator",
"image_view": 0, "module": "Accounts",
"in_create": 0, "name": "Purchase Taxes and Charges",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0, "permissions": [],
"istable": 1, "track_changes": 1
"max_attachments": 0,
"modified": "2018-09-19 13:48:32.755198",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",
"owner": "Administrator",
"permissions": [],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"track_changes": 1,
"track_seen": 0,
"track_views": 0
} }

File diff suppressed because it is too large Load Diff

View File

@ -786,7 +786,7 @@ class SalesInvoice(SellingController):
if account_currency==self.company_currency if account_currency==self.company_currency
else flt(item.net_amount, item.precision("net_amount"))), else flt(item.net_amount, item.precision("net_amount"))),
"cost_center": item.cost_center "cost_center": item.cost_center
}, account_currency) }, account_currency, item=item)
) )
# expense account gl entries # expense account gl entries

View File

@ -55,7 +55,6 @@
"delivered_by_supplier", "delivered_by_supplier",
"accounting", "accounting",
"income_account", "income_account",
"cost_center",
"is_fixed_asset", "is_fixed_asset",
"asset", "asset",
"col_break4", "col_break4",
@ -90,6 +89,9 @@
"delivery_note", "delivery_note",
"dn_detail", "dn_detail",
"delivered_qty", "delivered_qty",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"section_break_54", "section_break_54",
"page_break" "page_break"
], ],
@ -351,6 +353,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "is_free_item", "fieldname": "is_free_item",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Free Item", "label": "Is Free Item",
@ -405,6 +408,7 @@
"label": "Drop Ship" "label": "Drop Ship"
}, },
{ {
"default": "0",
"fieldname": "delivered_by_supplier", "fieldname": "delivered_by_supplier",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Delivered By Supplier", "label": "Delivered By Supplier",
@ -582,6 +586,7 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"default": "0",
"fieldname": "allow_zero_valuation_rate", "fieldname": "allow_zero_valuation_rate",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Allow Zero Valuation Rate", "label": "Allow Zero Valuation Rate",
@ -715,6 +720,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "is_fixed_asset", "fieldname": "is_fixed_asset",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 1, "hidden": 1,
@ -736,6 +742,7 @@
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"default": "0",
"fieldname": "page_break", "fieldname": "page_break",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Page Break", "label": "Page Break",
@ -754,11 +761,20 @@
"fieldname": "image_section", "fieldname": "image_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Image" "label": "Image"
},
{
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions"
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2019-05-01 17:59:59.666382", "modified": "2019-05-25 22:05:59.971263",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice Item", "name": "Sales Invoice Item",

View File

@ -1,669 +1,206 @@
{ {
"allow_copy": 0, "creation": "2013-04-24 11:39:32",
"allow_guest_to_view": 0, "doctype": "DocType",
"allow_import": 0, "document_type": "Setup",
"allow_rename": 0, "editable_grid": 1,
"autoname": "", "field_order": [
"beta": 0, "charge_type",
"creation": "2013-04-24 11:39:32", "row_id",
"custom": 0, "account_head",
"docstatus": 0, "col_break_1",
"doctype": "DocType", "description",
"document_type": "Setup", "included_in_print_rate",
"editable_grid": 1, "accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"section_break_8",
"rate",
"section_break_9",
"tax_amount",
"total",
"tax_amount_after_discount_amount",
"column_break_13",
"base_tax_amount",
"base_total",
"base_tax_amount_after_discount_amount",
"item_wise_tax_detail",
"parenttype"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "charge_type",
"allow_on_submit": 0, "fieldtype": "Select",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Type",
"columns": 2, "oldfieldname": "charge_type",
"fieldname": "charge_type", "oldfieldtype": "Select",
"fieldtype": "Select", "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total\nOn Item Quantity",
"hidden": 0, "reqd": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Type",
"length": 0,
"no_copy": 0,
"oldfieldname": "charge_type",
"oldfieldtype": "Select",
"options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total\nOn Item Quantity",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
"allow_in_quick_entry": 0, "fieldname": "row_id",
"allow_on_submit": 0, "fieldtype": "Data",
"bold": 0, "label": "Reference Row #",
"collapsible": 0, "oldfieldname": "row_id",
"columns": 0, "oldfieldtype": "Data"
"depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1", },
"fieldname": "row_id",
"fieldtype": "Data",
"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": "Reference Row #",
"length": 0,
"no_copy": 0,
"oldfieldname": "row_id",
"oldfieldtype": "Data",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "account_head",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Account Head",
"columns": 2, "oldfieldname": "account_head",
"fieldname": "account_head", "oldfieldtype": "Link",
"fieldtype": "Link", "options": "Account",
"hidden": 0, "reqd": 1,
"ignore_user_permissions": 0, "search_index": 1
"ignore_xss_filter": 0, },
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Account Head",
"length": 0,
"no_copy": 0,
"oldfieldname": "account_head",
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "default": ":Company",
"allow_in_quick_entry": 0, "fieldname": "cost_center",
"allow_on_submit": 0, "fieldtype": "Link",
"bold": 0, "label": "Cost Center",
"collapsible": 0, "oldfieldname": "cost_center_other_charges",
"columns": 0, "oldfieldtype": "Link",
"default": ":Company", "options": "Cost Center"
"fieldname": "cost_center", },
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"oldfieldname": "cost_center_other_charges",
"oldfieldtype": "Link",
"options": "Cost Center",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "col_break_1",
"allow_in_quick_entry": 0, "fieldtype": "Column Break",
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "col_break_1",
"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,
"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,
"translatable": 0,
"unique": 0,
"width": "50%" "width": "50%"
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "description",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "label": "Description",
"bold": 0, "oldfieldname": "description",
"collapsible": 0, "oldfieldtype": "Small Text",
"columns": 0, "print_width": "300px",
"fieldname": "description", "reqd": 1,
"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": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0, "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
"allow_on_submit": 0, "fieldname": "included_in_print_rate",
"bold": 0, "fieldtype": "Check",
"collapsible": 0, "label": "Is this Tax included in Basic Rate?",
"columns": 0, "print_hide": 1,
"description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", "print_width": "150px",
"fieldname": "included_in_print_rate", "report_hide": 1,
"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": "Is this Tax included in Basic Rate?",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "150px" "width": "150px"
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_8",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "rate",
"allow_on_submit": 0, "fieldtype": "Float",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Rate",
"columns": 2, "oldfieldname": "rate",
"fieldname": "rate", "oldfieldtype": "Currency"
"fieldtype": "Float", },
"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": "Rate",
"length": 0,
"no_copy": 0,
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_9",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_9",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "tax_amount",
"allow_on_submit": 0, "fieldtype": "Currency",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Amount",
"columns": 2, "options": "currency"
"fieldname": "tax_amount", },
"fieldtype": "Currency",
"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": "Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "columns": 2,
"allow_in_quick_entry": 0, "fieldname": "total",
"allow_on_submit": 0, "fieldtype": "Currency",
"bold": 0, "in_list_view": 1,
"collapsible": 0, "label": "Total",
"columns": 2, "options": "currency",
"fieldname": "total", "read_only": 1
"fieldtype": "Currency", },
"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": "Total",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "tax_amount_after_discount_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Tax Amount After Discount Amount",
"bold": 0, "options": "currency",
"collapsible": 0, "read_only": 1
"columns": 0, },
"fieldname": "tax_amount_after_discount_amount",
"fieldtype": "Currency",
"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": "Tax Amount After Discount Amount",
"length": 0,
"no_copy": 0,
"options": "currency",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_13",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_13",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "base_tax_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Amount (Company Currency)",
"bold": 0, "oldfieldname": "tax_amount",
"collapsible": 0, "oldfieldtype": "Currency",
"columns": 0, "options": "Company:company:default_currency",
"fieldname": "base_tax_amount", "read_only": 1
"fieldtype": "Currency", },
"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": "Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "tax_amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "base_total",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Total (Company Currency)",
"bold": 0, "oldfieldname": "total",
"collapsible": 0, "oldfieldtype": "Currency",
"columns": 0, "options": "Company:company:default_currency",
"fieldname": "base_total", "read_only": 1
"fieldtype": "Currency", },
"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": "Total (Company Currency)",
"length": 0,
"no_copy": 0,
"oldfieldname": "total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "depends_on": "eval:parent.discount_amount",
"allow_in_quick_entry": 0, "fieldname": "base_tax_amount_after_discount_amount",
"allow_on_submit": 0, "fieldtype": "Currency",
"bold": 0, "label": "Tax Amount After Discount Amount (Company Currency)",
"collapsible": 0, "options": "Company:company:default_currency",
"columns": 0, "read_only": 1
"depends_on": "eval:parent.discount_amount", },
"fieldname": "base_tax_amount_after_discount_amount",
"fieldtype": "Currency",
"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": "Tax Amount After Discount Amount (Company Currency)",
"length": 0,
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "item_wise_tax_detail",
"allow_in_quick_entry": 0, "fieldtype": "Code",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "label": "Item Wise Tax Detail",
"collapsible": 0, "oldfieldname": "item_wise_tax_detail",
"columns": 0, "oldfieldtype": "Small Text",
"fieldname": "item_wise_tax_detail", "read_only": 1
"fieldtype": "Code", },
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Item Wise Tax Detail",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_wise_tax_detail",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "parenttype",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "hidden": 1,
"bold": 0, "in_filter": 1,
"collapsible": 0, "label": "Parenttype",
"columns": 0, "oldfieldname": "parenttype",
"fieldname": "parenttype", "oldfieldtype": "Data",
"fieldtype": "Data", "print_hide": 1,
"hidden": 1, "search_index": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0, {
"in_filter": 1, "fieldname": "accounting_dimensions_section",
"in_global_search": 0, "fieldtype": "Section Break",
"in_list_view": 0, "label": "Accounting Dimensions"
"in_standard_filter": 0, },
"label": "Parenttype", {
"length": 0, "fieldname": "dimension_col_break",
"no_copy": 0, "fieldtype": "Column Break"
"oldfieldname": "parenttype",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "idx": 1,
"hide_heading": 1, "istable": 1,
"hide_toolbar": 0, "modified": "2019-05-25 22:59:38.740883",
"idx": 1, "modified_by": "Administrator",
"image_view": 0, "module": "Accounts",
"in_create": 0, "name": "Sales Taxes and Charges",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0, "permissions": [],
"istable": 1, "sort_order": "ASC"
"max_attachments": 0, }
"modified": "2018-09-19 13:48:59.341454",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",
"owner": "Administrator",
"permissions": [],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
}

View File

@ -1,664 +1,193 @@
{ {
"allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 0,
"autoname": "field:label", "autoname": "field:label",
"beta": 0,
"creation": "2013-06-25 11:48:03", "creation": "2013-06-25 11:48:03",
"custom": 0,
"description": "Specify conditions to calculate shipping amount", "description": "Specify conditions to calculate shipping amount",
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 0, "field_order": [
"label",
"disabled",
"column_break_4",
"shipping_rule_type",
"section_break_10",
"company",
"column_break_12",
"account",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break",
"shipping_amount_section",
"calculate_based_on",
"column_break_8",
"shipping_amount",
"rule_conditions_section",
"conditions",
"section_break_6",
"countries"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "example: Next Day Shipping", "description": "example: Next Day Shipping",
"fieldname": "label", "fieldname": "label",
"fieldtype": "Data", "fieldtype": "Data",
"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": "Shipping Rule Label", "label": "Shipping Rule Label",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1, "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "disabled", "fieldname": "disabled",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "label": "Disabled"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Disabled",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4", "fieldname": "column_break_4",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_rule_type", "fieldname": "shipping_rule_type",
"fieldtype": "Select", "fieldtype": "Select",
"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": "Shipping Rule Type", "label": "Shipping Rule Type",
"length": 0, "options": "Selling\nBuying"
"no_copy": 0,
"options": "Selling\nBuying",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:!doc.disabled", "depends_on": "eval:!doc.disabled",
"fieldname": "section_break_10", "fieldname": "section_break_10",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Accounting"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Accounting",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "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": "Company", "label": "Company",
"length": 0,
"no_copy": 0,
"options": "Company", "options": "Company",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 1, "remember_last_selected_value": 1,
"report_hide": 0, "reqd": 1
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_12", "fieldname": "column_break_12",
"fieldtype": "Column Break", "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,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "account", "fieldname": "account",
"fieldtype": "Link", "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": "Shipping Account", "label": "Shipping Account",
"length": 0,
"no_copy": 0,
"options": "Account", "options": "Account",
"permlevel": 0, "reqd": 1
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "cost_center", "fieldname": "cost_center",
"fieldtype": "Link", "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": "Cost Center", "label": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center", "options": "Cost Center",
"permlevel": 0, "reqd": 1
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "shipping_amount_section", "fieldname": "shipping_amount_section",
"fieldtype": "Section Break", "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": "",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Fixed", "default": "Fixed",
"fieldname": "calculate_based_on", "fieldname": "calculate_based_on",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1, "in_standard_filter": 1,
"label": "Calculate Based On", "label": "Calculate Based On",
"length": 0, "options": "Fixed\nNet Total\nNet Weight"
"no_copy": 0,
"options": "Fixed\nNet Total\nNet Weight",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_8", "fieldname": "column_break_8",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.calculate_based_on==='Fixed'", "depends_on": "eval:doc.calculate_based_on==='Fixed'",
"fieldname": "shipping_amount", "fieldname": "shipping_amount",
"fieldtype": "Currency", "fieldtype": "Currency",
"hidden": 0, "label": "Shipping Amount"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Shipping Amount",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "eval:doc.calculate_based_on!=='Fixed'", "depends_on": "eval:doc.calculate_based_on!=='Fixed'",
"fieldname": "rule_conditions_section", "fieldname": "rule_conditions_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Shipping Rule Conditions"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Shipping Rule Conditions",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "conditions", "fieldname": "conditions",
"fieldtype": "Table", "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": "Shipping Rule Conditions", "label": "Shipping Rule Conditions",
"length": 0, "options": "Shipping Rule Condition"
"no_copy": 0,
"options": "Shipping Rule Condition",
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "section_break_6", "fieldname": "section_break_6",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Restrict to Countries"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Restrict to Countries",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fieldname": "countries", "fieldname": "countries",
"fieldtype": "Table", "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": "Valid for Countries", "label": "Valid for Countries",
"length": 0, "options": "Shipping Rule Country"
"no_copy": 0, },
"options": "Shipping Rule Country", {
"permlevel": 0, "fieldname": "accounting_dimensions_section",
"precision": "", "fieldtype": "Section Break",
"print_hide": 0, "label": "Accounting Dimensions"
"print_hide_if_no_value": 0, },
"read_only": 0, {
"remember_last_selected_value": 0, "fieldname": "dimension_col_break",
"report_hide": 0, "fieldtype": "Column Break"
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-truck", "icon": "fa fa-truck",
"idx": 1, "idx": 1,
"image_view": 0, "modified": "2019-05-25 23:12:26.156405",
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-29 06:26:43.983024",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Shipping Rule", "name": "Shipping Rule",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Accounts User", "role": "Accounts User"
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1, "email": 1,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Sales User", "role": "Sales User"
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 1, "import": 1,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Accounts Manager", "role": "Accounts Manager",
"set_user_permissions": 1, "set_user_permissions": 1,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 1, "import": 1,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Sales Master Manager", "role": "Sales Master Manager",
"set_user_permissions": 1, "set_user_permissions": 1,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 0, "sort_order": "ASC"
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_order": "ASC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
} }

View File

@ -7,6 +7,7 @@ from frappe.utils import flt, cstr, cint
from frappe import _ from frappe import _
from frappe.model.meta import get_field_precision from frappe.model.meta import get_field_precision
from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget from erpnext.accounts.doctype.budget.budget import validate_expense_against_budget
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
class StockAccountInvalidTransaction(frappe.ValidationError): pass class StockAccountInvalidTransaction(frappe.ValidationError): pass
@ -49,10 +50,11 @@ def process_gl_map(gl_map, merge_entries=True):
def merge_similar_entries(gl_map): def merge_similar_entries(gl_map):
merged_gl_map = [] merged_gl_map = []
accounting_dimensions = get_accounting_dimensions()
for entry in gl_map: for entry in gl_map:
# if there is already an entry in this account then just add it # if there is already an entry in this account then just add it
# to that entry # to that entry
same_head = check_if_in_list(entry, merged_gl_map) same_head = check_if_in_list(entry, merged_gl_map, accounting_dimensions)
if same_head: if same_head:
same_head.debit = flt(same_head.debit) + flt(entry.debit) same_head.debit = flt(same_head.debit) + flt(entry.debit)
same_head.debit_in_account_currency = \ same_head.debit_in_account_currency = \
@ -69,16 +71,24 @@ def merge_similar_entries(gl_map):
return merged_gl_map return merged_gl_map
def check_if_in_list(gle, gl_map): def check_if_in_list(gle, gl_map, dimensions=None):
account_head_fieldnames = ['party_type', 'party', 'against_voucher', 'against_voucher_type',
'cost_center', 'project']
if dimensions:
account_head_fieldnames = account_head_fieldnames + dimensions
for e in gl_map: for e in gl_map:
if e.account == gle.account \ same_head = True
and cstr(e.get('party_type'))==cstr(gle.get('party_type')) \ if e.account != gle.account:
and cstr(e.get('party'))==cstr(gle.get('party')) \ same_head = False
and cstr(e.get('against_voucher'))==cstr(gle.get('against_voucher')) \
and cstr(e.get('against_voucher_type')) == cstr(gle.get('against_voucher_type')) \ for fieldname in account_head_fieldnames:
and cstr(e.get('cost_center')) == cstr(gle.get('cost_center')) \ if cstr(e.get(fieldname)) != cstr(gle.get(fieldname)):
and cstr(e.get('project')) == cstr(gle.get('project')): same_head = False
return e
if same_head:
return e
def save_entries(gl_map, adv_adj, update_outstanding, from_repost=False): def save_entries(gl_map, adv_adj, update_outstanding, from_repost=False):
if not from_repost: if not from_repost:

View File

@ -62,3 +62,11 @@ frappe.query_reports["Budget Variance Report"] = {
}, },
] ]
} }
let dimension_filters = erpnext.get_dimension_filters();
dimension_filters.then((dimensions) => {
dimensions.forEach((dimension) => {
frappe.query_reports["Budget Variance Report"].filters[4].options.push(dimension["document_type"]);
});
});

View File

@ -45,8 +45,8 @@ def execute(filters=None):
if(filters.get("show_cumulative")): if(filters.get("show_cumulative")):
last_total = period_data[0] - period_data[1] last_total = period_data[0] - period_data[1]
period_data[2] = period_data[0] - period_data[1] period_data[2] = period_data[0] - period_data[1]
row += period_data row += period_data
totals[2] = totals[0] - totals[1] totals[2] = totals[0] - totals[1]
if filters["period"] != "Yearly" : if filters["period"] != "Yearly" :
@ -56,7 +56,7 @@ def execute(filters=None):
return columns, data return columns, data
def validate_filters(filters): def validate_filters(filters):
if filters.get("budget_against")=="Project" and filters.get("cost_center"): if filters.get("budget_against") != "Cost Center" and filters.get("cost_center"):
frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center")) frappe.throw(_("Filter based on Cost Center is only applicable if Budget Against is selected as Cost Center"))
def get_columns(filters): def get_columns(filters):
@ -92,8 +92,11 @@ def get_cost_centers(filters):
if filters.get("budget_against") == "Cost Center": if filters.get("budget_against") == "Cost Center":
cond = "order by lft" cond = "order by lft"
return frappe.db.sql_list("""select name from `tab{tab}` where company=%s if filters.get("budget_against") in ["Cost Center", "Project"]:
{cond}""".format(tab=filters.get("budget_against"), cond=cond), filters.get("company")) return frappe.db.sql_list("""select name from `tab{tab}` where company=%s
{cond}""".format(tab=filters.get("budget_against"), cond=cond), filters.get("company"))
else:
return frappe.db.sql_list("""select name from `tab{tab}`""".format(tab=filters.get("budget_against"))) #nosec
#Get cost center & target details #Get cost center & target details
def get_cost_center_target_details(filters): def get_cost_center_target_details(filters):
@ -109,7 +112,7 @@ def get_cost_center_target_details(filters):
""".format(budget_against=filters.get("budget_against").replace(" ", "_").lower(), cond=cond), """.format(budget_against=filters.get("budget_against").replace(" ", "_").lower(), cond=cond),
(filters.from_fiscal_year,filters.to_fiscal_year,filters.budget_against, filters.company), as_dict=True) (filters.from_fiscal_year,filters.to_fiscal_year,filters.budget_against, filters.company), as_dict=True)
#Get target distribution details of accounts of cost center #Get target distribution details of accounts of cost center
def get_target_distribution_details(filters): def get_target_distribution_details(filters):
@ -118,7 +121,7 @@ def get_target_distribution_details(filters):
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
where mdp.parent=md.name and md.fiscal_year between %s and %s order by md.fiscal_year""",(filters.from_fiscal_year, filters.to_fiscal_year), as_dict=1): where mdp.parent=md.name and md.fiscal_year between %s and %s order by md.fiscal_year""",(filters.from_fiscal_year, filters.to_fiscal_year), as_dict=1):
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation)) target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
return target_details return target_details
#Get actual details from gl entry #Get actual details from gl entry
@ -129,7 +132,7 @@ def get_actual_details(name, filters):
if filters.get("budget_against") == "Cost Center": if filters.get("budget_against") == "Cost Center":
cc_lft, cc_rgt = frappe.db.get_value("Cost Center", name, ["lft", "rgt"]) cc_lft, cc_rgt = frappe.db.get_value("Cost Center", name, ["lft", "rgt"])
cond = "lft>='{lft}' and rgt<='{rgt}'".format(lft = cc_lft, rgt=cc_rgt) cond = "lft>='{lft}' and rgt<='{rgt}'".format(lft = cc_lft, rgt=cc_rgt)
ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,gl.fiscal_year, ac_details = frappe.db.sql("""select gl.account, gl.debit, gl.credit,gl.fiscal_year,
MONTHNAME(gl.posting_date) as month_name, b.{budget_against} as budget_against MONTHNAME(gl.posting_date) as month_name, b.{budget_against} as budget_against
from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b from `tabGL Entry` gl, `tabBudget Account` ba, `tabBudget` b

View File

@ -39,7 +39,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for(var j=0, k=data.length; j<k; j++) { %} {% for(var j=0, k=data.length-1; j<k; j++) { %}
{% {%
var row = data[j]; var row = data[j];
var row_class = data[j].parent_account ? "" : "financial-statements-important"; var row_class = data[j].parent_account ? "" : "financial-statements-important";

View File

@ -16,6 +16,7 @@ from frappe import _
from frappe.utils import (flt, getdate, get_first_day, add_months, add_days, formatdate) from frappe.utils import (flt, getdate, get_first_day, add_months, add_days, formatdate)
from six import itervalues from six import itervalues
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, accumulated_values=False, def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, accumulated_values=False,
company=None, reset_period_on_fy_change=True): company=None, reset_period_on_fy_change=True):
@ -348,20 +349,23 @@ def set_gl_entries_by_account(
additional_conditions += " and account in ({})"\ additional_conditions += " and account in ({})"\
.format(", ".join([frappe.db.escape(d) for d in accounts])) .format(", ".join([frappe.db.escape(d) for d in accounts]))
gl_filters = {
"company": company,
"from_date": from_date,
"to_date": to_date,
}
for key, value in filters.items():
if value:
gl_filters.update({
key: value
})
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry` gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
where company=%(company)s where company=%(company)s
{additional_conditions} {additional_conditions}
and posting_date <= %(to_date)s and posting_date <= %(to_date)s
order by account, posting_date""".format(additional_conditions=additional_conditions), order by account, posting_date""".format(additional_conditions=additional_conditions), gl_filters, as_dict=True) #nosec
{
"company": company,
"from_date": from_date,
"to_date": to_date,
"cost_center": filters.cost_center,
"project": filters.project,
"finance_book": filters.get("finance_book")
},
as_dict=True)
if filters and filters.get('presentation_currency'): if filters and filters.get('presentation_currency'):
convert_to_presentation_currency(gl_entries, get_currency(filters)) convert_to_presentation_currency(gl_entries, get_currency(filters))
@ -375,6 +379,8 @@ def set_gl_entries_by_account(
def get_additional_conditions(from_date, ignore_closing_entries, filters): def get_additional_conditions(from_date, ignore_closing_entries, filters):
additional_conditions = [] additional_conditions = []
accounting_dimensions = get_accounting_dimensions()
if ignore_closing_entries: if ignore_closing_entries:
additional_conditions.append("ifnull(voucher_type, '')!='Period Closing Voucher'") additional_conditions.append("ifnull(voucher_type, '')!='Period Closing Voucher'")
@ -395,6 +401,11 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters):
if filters.get("finance_book"): if filters.get("finance_book"):
additional_conditions.append("ifnull(finance_book, '') in (%(finance_book)s, '')") additional_conditions.append("ifnull(finance_book, '') in (%(finance_book)s, '')")
if accounting_dimensions:
for dimension in accounting_dimensions:
if filters.get(dimension):
additional_conditions.append("{0} in (%({0})s)".format(dimension))
return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else "" return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else ""
def get_cost_centers_with_children(cost_centers): def get_cost_centers_with_children(cost_centers):

View File

@ -33,7 +33,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for(var i=0, l=data.length; i<l; i++) { %} {% for(var i=0, l=data.length-1; i<l; i++) { %}
<tr> <tr>
{% if(data[i].posting_date) { %} {% if(data[i].posting_date) { %}
<td>{%= frappe.datetime.str_to_user(data[i].posting_date) %}</td> <td>{%= frappe.datetime.str_to_user(data[i].posting_date) %}</td>

View File

@ -56,67 +56,6 @@ frappe.query_reports["General Ledger"] = {
frappe.query_report.set_filter_value('group_by', ""); frappe.query_report.set_filter_value('group_by', "");
} }
}, },
{
"fieldname":"cost_center",
"label": __("Cost Center"),
"fieldtype": "MultiSelect",
get_data: function() {
var cost_centers = frappe.query_report.get_filter_value("cost_center") || "";
const values = cost_centers.split(/\s*,\s*/).filter(d => d);
const txt = cost_centers.match(/[^,\s*]*$/)[0] || '';
let data = [];
frappe.call({
type: "GET",
method:'frappe.desk.search.search_link',
async: false,
no_spinner: true,
args: {
doctype: "Cost Center",
txt: txt,
filters: {
"company": frappe.query_report.get_filter_value("company"),
"name": ["not in", values]
}
},
callback: function(r) {
data = r.results;
}
});
return data;
}
},
{
"fieldname":"project",
"label": __("Project"),
"fieldtype": "MultiSelect",
get_data: function() {
var projects = frappe.query_report.get_filter_value("project") || "";
const values = projects.split(/\s*,\s*/).filter(d => d);
const txt = projects.match(/[^,\s*]*$/)[0] || '';
let data = [];
frappe.call({
type: "GET",
method:'frappe.desk.search.search_link',
async: false,
no_spinner: true,
args: {
doctype: "Project",
txt: txt,
filters: {
"name": ["not in", values]
}
},
callback: function(r) {
data = r.results;
}
});
return data;
}
},
{ {
"fieldtype": "Break", "fieldtype": "Break",
}, },
@ -212,10 +151,85 @@ frappe.query_reports["General Ledger"] = {
"fieldtype": "Select", "fieldtype": "Select",
"options": erpnext.get_presentation_currency_list() "options": erpnext.get_presentation_currency_list()
}, },
{
"fieldname":"cost_center",
"label": __("Cost Center"),
"fieldtype": "MultiSelect",
get_data: function() {
var cost_centers = frappe.query_report.get_filter_value("cost_center") || "";
const values = cost_centers.split(/\s*,\s*/).filter(d => d);
const txt = cost_centers.match(/[^,\s*]*$/)[0] || '';
let data = [];
frappe.call({
type: "GET",
method:'frappe.desk.search.search_link',
async: false,
no_spinner: true,
args: {
doctype: "Cost Center",
txt: txt,
filters: {
"company": frappe.query_report.get_filter_value("company"),
"name": ["not in", values]
}
},
callback: function(r) {
data = r.results;
}
});
return data;
}
},
{
"fieldname":"project",
"label": __("Project"),
"fieldtype": "MultiSelect",
get_data: function() {
var projects = frappe.query_report.get_filter_value("project") || "";
const values = projects.split(/\s*,\s*/).filter(d => d);
const txt = projects.match(/[^,\s*]*$/)[0] || '';
let data = [];
frappe.call({
type: "GET",
method:'frappe.desk.search.search_link',
async: false,
no_spinner: true,
args: {
doctype: "Project",
txt: txt,
filters: {
"name": ["not in", values]
}
},
callback: function(r) {
data = r.results;
}
});
return data;
}
},
{ {
"fieldname": "show_opening_entries", "fieldname": "show_opening_entries",
"label": __("Show Opening Entries"), "label": __("Show Opening Entries"),
"fieldtype": "Check" "fieldtype": "Check"
} },
] ]
} }
let dimension_filters = erpnext.get_dimension_filters();
dimension_filters.then((dimensions) => {
dimensions.forEach((dimension) => {
frappe.query_reports["General Ledger"].filters.splice(15, 0 ,{
"fieldname": dimension["fieldname"],
"label": __(dimension["label"]),
"fieldtype": "Link",
"options": dimension["document_type"]
});
});
});

View File

@ -10,6 +10,7 @@ from frappe import _, _dict
from erpnext.accounts.utils import get_account_currency from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.report.financial_statements import get_cost_centers_with_children from erpnext.accounts.report.financial_statements import get_cost_centers_with_children
from six import iteritems from six import iteritems
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
def execute(filters=None): def execute(filters=None):
if not filters: if not filters:
@ -195,6 +196,13 @@ def get_conditions(filters):
if match_conditions: if match_conditions:
conditions.append(match_conditions) conditions.append(match_conditions)
accounting_dimensions = get_accounting_dimensions()
if accounting_dimensions:
for dimension in accounting_dimensions:
if filters.get(dimension):
conditions.append("{0} in (%({0})s)".format(dimension))
return "and {}".format(" and ".join(conditions)) if conditions else "" return "and {}".format(" and ".join(conditions)) if conditions else ""

View File

@ -102,7 +102,9 @@ def get_conditions(filters):
("customer", " and `tabSales Invoice`.customer = %(customer)s"), ("customer", " and `tabSales Invoice`.customer = %(customer)s"),
("item_code", " and `tabSales Invoice Item`.item_code = %(item_code)s"), ("item_code", " and `tabSales Invoice Item`.item_code = %(item_code)s"),
("from_date", " and `tabSales Invoice`.posting_date>=%(from_date)s"), ("from_date", " and `tabSales Invoice`.posting_date>=%(from_date)s"),
("to_date", " and `tabSales Invoice`.posting_date<=%(to_date)s")): ("to_date", " and `tabSales Invoice`.posting_date<=%(to_date)s"),
("company_gstin", " and `tabSales Invoice`.company_gstin = %(company_gstin)s"),
("invoice_type", " and `tabSales Invoice`.invoice_type = %(invoice_type)s")):
if filters.get(opts[0]): if filters.get(opts[0]):
conditions += opts[1] conditions += opts[1]

View File

@ -18,22 +18,22 @@ def execute(filters=None):
data = [] data = []
for d in entries: for d in entries:
invoice = invoice_details.get(d.against_voucher) or frappe._dict() invoice = invoice_details.get(d.against_voucher) or frappe._dict()
if d.reference_type=="Purchase Invoice": if d.reference_type=="Purchase Invoice":
payment_amount = flt(d.debit) or -1 * flt(d.credit) payment_amount = flt(d.debit) or -1 * flt(d.credit)
else: else:
payment_amount = flt(d.credit) or -1 * flt(d.debit) payment_amount = flt(d.credit) or -1 * flt(d.debit)
row = [d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher, row = [d.voucher_type, d.voucher_no, d.party_type, d.party, d.posting_date, d.against_voucher,
invoice.posting_date, invoice.due_date, d.debit, d.credit, d.remarks] invoice.posting_date, invoice.due_date, d.debit, d.credit, d.remarks]
if d.against_voucher: if d.against_voucher:
row += get_ageing_data(30, 60, 90, d.posting_date, invoice.posting_date, payment_amount) row += get_ageing_data(30, 60, 90, 120, d.posting_date, invoice.posting_date, payment_amount)
else: else:
row += ["", "", "", "", ""] row += ["", "", "", "", ""]
if invoice.due_date: if invoice.due_date:
row.append((getdate(d.posting_date) - getdate(invoice.due_date)).days or 0) row.append((getdate(d.posting_date) - getdate(invoice.due_date)).days or 0)
data.append(row) data.append(row)
return columns, data return columns, data
@ -48,19 +48,19 @@ def get_columns(filters):
return [ return [
_("Payment Document") + ":: 100", _("Payment Document") + ":: 100",
_("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":140", _("Payment Entry") + ":Dynamic Link/"+_("Payment Document")+":140",
_("Party Type") + "::100", _("Party Type") + "::100",
_("Party") + ":Dynamic Link/Party Type:140", _("Party") + ":Dynamic Link/Party Type:140",
_("Posting Date") + ":Date:100", _("Posting Date") + ":Date:100",
_("Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"), _("Invoice") + (":Link/Purchase Invoice:130" if filters.get("payment_type") == "Outgoing" else ":Link/Sales Invoice:130"),
_("Invoice Posting Date") + ":Date:130", _("Invoice Posting Date") + ":Date:130",
_("Payment Due Date") + ":Date:130", _("Payment Due Date") + ":Date:130",
_("Debit") + ":Currency:120", _("Debit") + ":Currency:120",
_("Credit") + ":Currency:120", _("Credit") + ":Currency:120",
_("Remarks") + "::150", _("Remarks") + "::150",
_("Age") +":Int:40", _("Age") +":Int:40",
"0-30:Currency:100", "0-30:Currency:100",
"30-60:Currency:100", "30-60:Currency:100",
"60-90:Currency:100", "60-90:Currency:100",
_("90-Above") + ":Currency:100", _("90-Above") + ":Currency:100",
_("Delay in payment (Days)") + "::150" _("Delay in payment (Days)") + "::150"
] ]
@ -79,21 +79,21 @@ def get_conditions(filters):
if filters.party: if filters.party:
conditions.append("party=%(party)s") conditions.append("party=%(party)s")
if filters.party_type: if filters.party_type:
conditions.append("against_voucher_type=%(reference_type)s") conditions.append("against_voucher_type=%(reference_type)s")
filters["reference_type"] = "Sales Invoice" if filters.party_type=="Customer" else "Purchase Invoice" filters["reference_type"] = "Sales Invoice" if filters.party_type=="Customer" else "Purchase Invoice"
if filters.get("from_date"): if filters.get("from_date"):
conditions.append("posting_date >= %(from_date)s") conditions.append("posting_date >= %(from_date)s")
if filters.get("to_date"): if filters.get("to_date"):
conditions.append("posting_date <= %(to_date)s") conditions.append("posting_date <= %(to_date)s")
return "and " + " and ".join(conditions) if conditions else "" return "and " + " and ".join(conditions) if conditions else ""
def get_entries(filters): def get_entries(filters):
return frappe.db.sql("""select return frappe.db.sql("""select
voucher_type, voucher_no, party_type, party, posting_date, debit, credit, remarks, against_voucher voucher_type, voucher_no, party_type, party, posting_date, debit, credit, remarks, against_voucher
from `tabGL Entry` from `tabGL Entry`
where company=%(company)s and voucher_type in ('Journal Entry', 'Payment Entry') {0} where company=%(company)s and voucher_type in ('Journal Entry', 'Payment Entry') {0}

File diff suppressed because it is too large Load Diff

View File

@ -1,490 +1,170 @@
{ {
"allow_copy": 0, "creation": "2018-05-11 00:22:43.695151",
"allow_guest_to_view": 0, "doctype": "DocType",
"allow_import": 0, "editable_grid": 1,
"allow_rename": 0, "engine": "InnoDB",
"beta": 0, "field_order": [
"creation": "2018-05-11 00:22:43.695151", "company",
"custom": 0, "asset",
"docstatus": 0, "asset_category",
"doctype": "DocType", "finance_book",
"document_type": "", "journal_entry",
"editable_grid": 1, "column_break_4",
"engine": "InnoDB", "date",
"current_asset_value",
"new_asset_value",
"difference_amount",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "company",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Company",
"bold": 0, "options": "Company"
"collapsible": 0, },
"columns": 0,
"fieldname": "company",
"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": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "asset",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Asset",
"bold": 0, "options": "Asset",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fieldname": "asset",
"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": "Asset",
"length": 0,
"no_copy": 0,
"options": "Asset",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fetch_from": "asset.asset_category",
"allow_in_quick_entry": 0, "fieldname": "asset_category",
"allow_on_submit": 0, "fieldtype": "Read Only",
"bold": 0, "label": "Asset Category"
"collapsible": 0, },
"columns": 0,
"fetch_from": "asset.asset_category",
"fieldname": "asset_category",
"fieldtype": "Read Only",
"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": "Asset Category",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "finance_book",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Finance Book",
"collapsible": 0, "options": "Finance Book"
"columns": 0, },
"fieldname": "finance_book",
"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": "Finance Book",
"length": 0,
"no_copy": 0,
"options": "Finance Book",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "journal_entry",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Journal Entry",
"bold": 0, "options": "Journal Entry",
"collapsible": 0, "read_only": 1
"columns": 0, },
"fieldname": "journal_entry",
"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": "Journal Entry",
"length": 0,
"no_copy": 0,
"options": "Journal Entry",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_4",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_4",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "date",
"allow_in_quick_entry": 0, "fieldtype": "Date",
"allow_on_submit": 0, "label": "Date"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "date",
"fieldtype": "Date",
"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": "Date",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "current_asset_value",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Current Asset Value",
"collapsible": 0, "read_only": 1,
"columns": 0, "reqd": 1
"fieldname": "current_asset_value", },
"fieldtype": "Currency",
"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": "Current Asset Value",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "new_asset_value",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "New Asset Value",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fieldname": "new_asset_value",
"fieldtype": "Currency",
"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": "New Asset Value",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "difference_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "label": "Difference Amount",
"bold": 0, "no_copy": 1,
"collapsible": 0, "read_only": 1
"columns": 0, },
"fieldname": "difference_amount",
"fieldtype": "Currency",
"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": "Difference Amount",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "cost_center",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Cost Center",
"bold": 0, "options": "Cost Center"
"collapsible": 0, },
"columns": 0,
"fieldname": "cost_center",
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "amended_from",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Amended From",
"bold": 0, "no_copy": 1,
"collapsible": 0, "options": "Asset Value Adjustment",
"columns": 0, "print_hide": 1,
"fieldname": "amended_from", "read_only": 1
"fieldtype": "Link", },
"hidden": 0, {
"ignore_user_permissions": 0, "fieldname": "accounting_dimensions_section",
"ignore_xss_filter": 0, "fieldtype": "Section Break",
"in_filter": 0, "label": "Accounting Dimensions"
"in_global_search": 0, },
"in_list_view": 0, {
"in_standard_filter": 0, "fieldname": "dimension_col_break",
"label": "Amended From", "fieldtype": "Column Break"
"length": 0,
"no_copy": 1,
"options": "Asset Value Adjustment",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "is_submittable": 1,
"hide_heading": 0, "modified": "2019-05-26 09:46:23.613412",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Assets",
"image_view": 0, "name": "Asset Value Adjustment",
"in_create": 0, "owner": "Administrator",
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-06-18 17:44:42.383087",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Value Adjustment",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 1, "amend": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0, "print": 1,
"import": 0, "read": 1,
"permlevel": 0, "report": 1,
"print": 1, "role": "System Manager",
"read": 1, "share": 1,
"report": 1, "submit": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 1, "amend": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0, "print": 1,
"import": 0, "read": 1,
"permlevel": 0, "report": 1,
"print": 1, "role": "Accounts User",
"read": 1, "share": 1,
"report": 1, "submit": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 1, "amend": 1,
"cancel": 1, "cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0, "print": 1,
"import": 0, "read": 1,
"permlevel": 0, "report": 1,
"print": 1, "role": "Accounts Manager",
"read": 1, "share": 1,
"report": 1, "submit": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1 "write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0, "sort_field": "modified",
"read_only_onload": 0, "sort_order": "DESC",
"show_name_in_global_search": 0, "title_field": "asset",
"sort_field": "modified", "track_changes": 1
"sort_order": "DESC",
"title_field": "asset",
"track_changes": 1,
"track_seen": 0
} }

View File

@ -17,6 +17,10 @@
"col_break1", "col_break1",
"image", "image",
"image_view", "image_view",
"manufacture_details",
"manufacturer",
"column_break_14",
"manufacturer_part_no",
"quantity_and_rate", "quantity_and_rate",
"qty", "qty",
"stock_uom", "stock_uom",
@ -76,7 +80,9 @@
"accounting_details", "accounting_details",
"expense_account", "expense_account",
"column_break_68", "column_break_68",
"accounting_dimensions_section",
"cost_center", "cost_center",
"dimension_col_break",
"section_break_72", "section_break_72",
"page_break", "page_break",
"item_tax_rate" "item_tax_rate"
@ -333,6 +339,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "is_free_item", "fieldname": "is_free_item",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Free Item", "label": "Is Free Item",
@ -494,6 +501,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "delivered_by_supplier", "fieldname": "delivered_by_supplier",
"fieldtype": "Check", "fieldtype": "Check",
"label": "To be delivered to customer", "label": "To be delivered to customer",
@ -640,6 +648,7 @@
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"default": "0",
"fieldname": "page_break", "fieldname": "page_break",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Page Break", "label": "Page Break",
@ -657,11 +666,42 @@
{ {
"fieldname": "section_break_72", "fieldname": "section_break_72",
"fieldtype": "Section Break" "fieldtype": "Section Break"
},
{
"collapsible": 1,
"fieldname": "accounting_dimensions_section",
"fieldtype": "Section Break",
"label": "Accounting Dimensions "
},
{
"fieldname": "dimension_col_break",
"fieldtype": "Column Break"
},
{
"fieldname": "manufacture_details",
"fieldtype": "Section Break",
"label": "Manufacture"
},
{
"fieldname": "manufacturer",
"fieldtype": "Link",
"label": "Manufacturer",
"options": "Manufacturer"
},
{
"fieldname": "column_break_14",
"fieldtype": "Column Break"
},
{
"fieldname": "manufacturer_part_no",
"fieldtype": "Data",
"label": "Manufacturer Part Number",
"read_only": 1
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2019-05-01 17:21:24.913429", "modified": "2019-06-02 06:34:47.495730",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Purchase Order Item", "name": "Purchase Order Item",

View File

@ -18,6 +18,10 @@
"col_break1", "col_break1",
"image", "image",
"image_view", "image_view",
"manufacture_details",
"manufacturer",
"column_break_15",
"manufacturer_part_no",
"quantity_and_rate", "quantity_and_rate",
"qty", "qty",
"stock_uom", "stock_uom",
@ -285,6 +289,7 @@
"read_only": 1 "read_only": 1
}, },
{ {
"default": "0",
"fieldname": "is_free_item", "fieldname": "is_free_item",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Is Free Item", "label": "Is Free Item",
@ -493,6 +498,7 @@
}, },
{ {
"allow_on_submit": 1, "allow_on_submit": 1,
"default": "0",
"fieldname": "page_break", "fieldname": "page_break",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Page Break", "label": "Page Break",
@ -500,11 +506,33 @@
"oldfieldname": "page_break", "oldfieldname": "page_break",
"oldfieldtype": "Check", "oldfieldtype": "Check",
"print_hide": 1 "print_hide": 1
},
{
"collapsible": 1,
"fieldname": "manufacture_details",
"fieldtype": "Section Break",
"label": "Manufacture"
},
{
"fieldname": "manufacturer",
"fieldtype": "Link",
"label": "Manufacturer",
"options": "Manufacturer"
},
{
"fieldname": "manufacturer_part_no",
"fieldtype": "Data",
"label": "Manufacturer Part Number",
"read_only": 1
},
{
"fieldname": "column_break_15",
"fieldtype": "Column Break"
} }
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2019-05-01 17:35:05.078030", "modified": "2019-06-02 05:32:46.019237",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Buying", "module": "Buying",
"name": "Supplier Quotation Item", "name": "Supplier Quotation Item",

View File

@ -174,6 +174,11 @@ def get_data():
"name": "Cheque Print Template", "name": "Cheque Print Template",
"description": _("Setup cheque dimensions for printing") "description": _("Setup cheque dimensions for printing")
}, },
{
"type": "doctype",
"name": "Accounting Dimension",
"description": _("Setup custom dimensions for accounting")
},
] ]
}, },
{ {

View File

@ -59,14 +59,14 @@ def get_data():
"items": [ "items": [
{ {
"type": "doctype", "type": "doctype",
"name": "Customer Feedback", "name": "Quality Feedback",
"description":_("Customer Feedback"), "description":_("Quality Feedback"),
"onboard": 1, "onboard": 1,
}, },
{ {
"type": "doctype", "type": "doctype",
"name": "Customer Feedback Template", "name": "Quality Feedback Template",
"description":_("Customer Feedback Template"), "description":_("Quality Feedback Template"),
} }
] ]
}, },

View File

@ -161,6 +161,10 @@ def get_data():
"type": "doctype", "type": "doctype",
"name": "Item Alternative", "name": "Item Alternative",
}, },
{
"type": "doctype",
"name": "Item Manufacturer",
},
{ {
"type": "doctype", "type": "doctype",
"name": "Item Variant Settings", "name": "Item Variant Settings",

View File

@ -16,6 +16,7 @@ from erpnext.accounts.party import get_party_account_currency, validate_party_fr
from erpnext.accounts.doctype.pricing_rule.utils import validate_pricing_rules from erpnext.accounts.doctype.pricing_rule.utils import validate_pricing_rules
from erpnext.exceptions import InvalidCurrency from erpnext.exceptions import InvalidCurrency
from six import text_type from six import text_type
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_accounting_dimensions
force_item_fields = ("item_group", "brand", "stock_uom", "is_fixed_asset", "item_tax_rate", "pricing_rules") force_item_fields = ("item_group", "brand", "stock_uom", "is_fixed_asset", "item_tax_rate", "pricing_rules")
@ -338,7 +339,7 @@ class AccountsController(TransactionBase):
frappe.throw(_("Row #{0}: Account {1} does not belong to company {2}") frappe.throw(_("Row #{0}: Account {1} does not belong to company {2}")
.format(d.idx, d.account_head, self.company)) .format(d.idx, d.account_head, self.company))
def get_gl_dict(self, args, account_currency=None): def get_gl_dict(self, args, account_currency=None, item=None):
"""this method populates the common properties of a gl entry record""" """this method populates the common properties of a gl entry record"""
posting_date = args.get('posting_date') or self.get('posting_date') posting_date = args.get('posting_date') or self.get('posting_date')
@ -365,6 +366,16 @@ class AccountsController(TransactionBase):
'party': None, 'party': None,
'project': self.get("project") 'project': self.get("project")
}) })
accounting_dimensions = get_accounting_dimensions()
dimension_dict = frappe._dict()
for dimension in accounting_dimensions:
dimension_dict[dimension] = self.get(dimension)
if item and item.get(dimension):
dimension_dict[dimension] = item.get(dimension)
gl_dict.update(dimension_dict)
gl_dict.update(args) gl_dict.update(args)
if not account_currency: if not account_currency:

View File

@ -437,3 +437,20 @@ def get_batch_numbers(doctype, txt, searchfield, start, page_len, filters):
query += " and item = {item}".format(item = frappe.db.escape(filters.get('item'))) query += " and item = {item}".format(item = frappe.db.escape(filters.get('item')))
return frappe.db.sql(query, filters) return frappe.db.sql(query, filters)
@frappe.whitelist()
def item_manufacturer_query(doctype, txt, searchfield, start, page_len, filters):
search_txt = "{0}%".format(txt)
item_filters = {
'manufacturer': ('like', search_txt),
'item_code': filters.get("item_code")
}
return frappe.get_all("Item Manufacturer",
fields = "manufacturer",
filters = item_filters,
limit_start=start,
limit_page_length=page_len,
as_list=1
)

View File

@ -81,7 +81,7 @@ class StockController(AccountsController):
"remarks": self.get("remarks") or "Accounting Entry for Stock", "remarks": self.get("remarks") or "Accounting Entry for Stock",
"debit": flt(sle.stock_value_difference, 2), "debit": flt(sle.stock_value_difference, 2),
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No", "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
}, warehouse_account[sle.warehouse]["account_currency"])) }, warehouse_account[sle.warehouse]["account_currency"], item=item_row))
# to target warehouse / expense account # to target warehouse / expense account
gl_list.append(self.get_gl_dict({ gl_list.append(self.get_gl_dict({
@ -92,7 +92,7 @@ class StockController(AccountsController):
"credit": flt(sle.stock_value_difference, 2), "credit": flt(sle.stock_value_difference, 2),
"project": item_row.get("project") or self.get("project"), "project": item_row.get("project") or self.get("project"),
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No" "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No"
})) }, item=item_row))
elif sle.warehouse not in warehouse_with_no_account: elif sle.warehouse not in warehouse_with_no_account:
warehouse_with_no_account.append(sle.warehouse) warehouse_with_no_account.append(sle.warehouse)

View File

@ -397,7 +397,7 @@ class calculate_taxes_and_totals(object):
net_total += item.net_amount net_total += item.net_amount
# discount amount rounding loss adjustment if no taxes # discount amount rounding loss adjustment if no taxes
if (not taxes or self.doc.apply_discount_on == "Net Total") \ if (self.doc.apply_discount_on == "Net Total" or not taxes or total_for_discount_amount==self.doc.net_total) \
and i == len(self.doc.get("items")) - 1: and i == len(self.doc.get("items")) - 1:
discount_amount_loss = flt(self.doc.net_total - net_total - self.doc.discount_amount, discount_amount_loss = flt(self.doc.net_total - net_total - self.doc.discount_amount,
self.doc.precision("net_total")) self.doc.precision("net_total"))

View File

@ -39,8 +39,8 @@
"item_name": "Atocopherol", "item_name": "Atocopherol",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.577151", "modified": "2017-07-06 12:53:16.577151",
@ -123,8 +123,8 @@
"item_name": "Abacavir", "item_name": "Abacavir",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.678257", "modified": "2017-07-06 12:53:16.678257",
@ -207,8 +207,6 @@
"item_name": "Abciximab", "item_name": "Abciximab",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.695413", "modified": "2017-07-06 12:53:16.695413",
@ -291,8 +289,6 @@
"item_name": "Acacia", "item_name": "Acacia",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.797774", "modified": "2017-07-06 12:53:16.797774",
@ -375,8 +371,6 @@
"item_name": "Acamprosate", "item_name": "Acamprosate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.826952", "modified": "2017-07-06 12:53:16.826952",
@ -459,8 +453,6 @@
"item_name": "Acarbose", "item_name": "Acarbose",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.843890", "modified": "2017-07-06 12:53:16.843890",
@ -543,8 +535,6 @@
"item_name": "Acebrofylline", "item_name": "Acebrofylline",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.969984", "modified": "2017-07-06 12:53:16.969984",
@ -627,8 +617,6 @@
"item_name": "Acebrofylline (SR)", "item_name": "Acebrofylline (SR)",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:16.987354", "modified": "2017-07-06 12:53:16.987354",
@ -711,8 +699,6 @@
"item_name": "Aceclofenac", "item_name": "Aceclofenac",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.004369", "modified": "2017-07-06 12:53:17.004369",
@ -795,8 +781,6 @@
"item_name": "Ash", "item_name": "Ash",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.021192", "modified": "2017-07-06 12:53:17.021192",
@ -879,8 +863,6 @@
"item_name": "Asparaginase", "item_name": "Asparaginase",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.038058", "modified": "2017-07-06 12:53:17.038058",
@ -963,8 +945,6 @@
"item_name": "Aspartame", "item_name": "Aspartame",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.054463", "modified": "2017-07-06 12:53:17.054463",
@ -1047,8 +1027,6 @@
"item_name": "Aspartic Acid", "item_name": "Aspartic Acid",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.071001", "modified": "2017-07-06 12:53:17.071001",
@ -1131,8 +1109,6 @@
"item_name": "Bleomycin", "item_name": "Bleomycin",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.087170", "modified": "2017-07-06 12:53:17.087170",
@ -1215,8 +1191,6 @@
"item_name": "Bleomycin Sulphate", "item_name": "Bleomycin Sulphate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.103691", "modified": "2017-07-06 12:53:17.103691",
@ -1299,8 +1273,6 @@
"item_name": "Blue cap contains", "item_name": "Blue cap contains",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.120040", "modified": "2017-07-06 12:53:17.120040",
@ -1383,8 +1355,6 @@
"item_name": "Boran", "item_name": "Boran",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.135964", "modified": "2017-07-06 12:53:17.135964",
@ -1467,8 +1437,6 @@
"item_name": "Borax", "item_name": "Borax",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.152575", "modified": "2017-07-06 12:53:17.152575",
@ -1551,8 +1519,6 @@
"item_name": "Chlorbutanol", "item_name": "Chlorbutanol",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.168998", "modified": "2017-07-06 12:53:17.168998",
@ -1635,8 +1601,6 @@
"item_name": "Chlorbutol", "item_name": "Chlorbutol",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.185316", "modified": "2017-07-06 12:53:17.185316",
@ -1719,8 +1683,6 @@
"item_name": "Chlordiazepoxide", "item_name": "Chlordiazepoxide",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.208361", "modified": "2017-07-06 12:53:17.208361",
@ -1803,8 +1765,6 @@
"item_name": "Chlordiazepoxide and Clidinium Bromide", "item_name": "Chlordiazepoxide and Clidinium Bromide",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.224341", "modified": "2017-07-06 12:53:17.224341",
@ -1887,8 +1847,6 @@
"item_name": "Chlorhexidine", "item_name": "Chlorhexidine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.240634", "modified": "2017-07-06 12:53:17.240634",
@ -1971,8 +1929,6 @@
"item_name": "Chlorhexidine 40%", "item_name": "Chlorhexidine 40%",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.256922", "modified": "2017-07-06 12:53:17.256922",
@ -2055,8 +2011,6 @@
"item_name": "Chlorhexidine Acetate", "item_name": "Chlorhexidine Acetate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.274789", "modified": "2017-07-06 12:53:17.274789",
@ -2139,8 +2093,6 @@
"item_name": "Chlorhexidine Gluconate", "item_name": "Chlorhexidine Gluconate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.295371", "modified": "2017-07-06 12:53:17.295371",
@ -2223,8 +2175,6 @@
"item_name": "Chlorhexidine HCL", "item_name": "Chlorhexidine HCL",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.312916", "modified": "2017-07-06 12:53:17.312916",
@ -2307,8 +2257,6 @@
"item_name": "Chlorhexidine Hydrochloride", "item_name": "Chlorhexidine Hydrochloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.329570", "modified": "2017-07-06 12:53:17.329570",
@ -2391,8 +2339,6 @@
"item_name": "Chloride", "item_name": "Chloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.346088", "modified": "2017-07-06 12:53:17.346088",
@ -2475,8 +2421,6 @@
"item_name": "Fosfomycin Tromethamine", "item_name": "Fosfomycin Tromethamine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.362777", "modified": "2017-07-06 12:53:17.362777",
@ -2559,8 +2503,6 @@
"item_name": "Fosinopril", "item_name": "Fosinopril",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.379465", "modified": "2017-07-06 12:53:17.379465",
@ -2643,8 +2585,6 @@
"item_name": "Iodochlorhydroxyquinoline", "item_name": "Iodochlorhydroxyquinoline",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.396068", "modified": "2017-07-06 12:53:17.396068",
@ -2727,8 +2667,6 @@
"item_name": "Iodochlorohydroxyquinoline", "item_name": "Iodochlorohydroxyquinoline",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.412734", "modified": "2017-07-06 12:53:17.412734",
@ -2811,8 +2749,6 @@
"item_name": "Ipratropium", "item_name": "Ipratropium",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.429333", "modified": "2017-07-06 12:53:17.429333",
@ -2895,8 +2831,6 @@
"item_name": "Mebeverine hydrochloride", "item_name": "Mebeverine hydrochloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.445814", "modified": "2017-07-06 12:53:17.445814",
@ -2979,8 +2913,6 @@
"item_name": "Mecetronium ethylsulphate", "item_name": "Mecetronium ethylsulphate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.461696", "modified": "2017-07-06 12:53:17.461696",
@ -3063,8 +2995,6 @@
"item_name": "Meclizine", "item_name": "Meclizine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.478020", "modified": "2017-07-06 12:53:17.478020",
@ -3147,8 +3077,8 @@
"item_name": "Oxaprozin", "item_name": "Oxaprozin",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.496221", "modified": "2017-07-06 12:53:17.496221",
@ -3231,8 +3161,6 @@
"item_name": "Oxazepam", "item_name": "Oxazepam",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.511933", "modified": "2017-07-06 12:53:17.511933",
@ -3315,8 +3243,6 @@
"item_name": "Oxcarbazepine", "item_name": "Oxcarbazepine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.528472", "modified": "2017-07-06 12:53:17.528472",
@ -3399,8 +3325,6 @@
"item_name": "Oxetacaine", "item_name": "Oxetacaine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.544177", "modified": "2017-07-06 12:53:17.544177",
@ -3483,8 +3407,6 @@
"item_name": "Oxethazaine", "item_name": "Oxethazaine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.560193", "modified": "2017-07-06 12:53:17.560193",
@ -3567,8 +3489,6 @@
"item_name": "Suxamethonium Chloride", "item_name": "Suxamethonium Chloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.576447", "modified": "2017-07-06 12:53:17.576447",
@ -3651,8 +3571,6 @@
"item_name": "Tacrolimus", "item_name": "Tacrolimus",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.593481", "modified": "2017-07-06 12:53:17.593481",
@ -3735,8 +3653,6 @@
"item_name": "Ubiquinol", "item_name": "Ubiquinol",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.609930", "modified": "2017-07-06 12:53:17.609930",
@ -3819,8 +3735,6 @@
"item_name": "Vitamin B12", "item_name": "Vitamin B12",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.626225", "modified": "2017-07-06 12:53:17.626225",
@ -3903,8 +3817,6 @@
"item_name": "Vitamin B1Hydrochloride", "item_name": "Vitamin B1Hydrochloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.642423", "modified": "2017-07-06 12:53:17.642423",
@ -3987,8 +3899,6 @@
"item_name": "Vitamin B1Monohydrate", "item_name": "Vitamin B1Monohydrate",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.658946", "modified": "2017-07-06 12:53:17.658946",
@ -4071,8 +3981,6 @@
"item_name": "Vitamin B2", "item_name": "Vitamin B2",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.675234", "modified": "2017-07-06 12:53:17.675234",
@ -4155,8 +4063,6 @@
"item_name": "Vitamin B3", "item_name": "Vitamin B3",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.691598", "modified": "2017-07-06 12:53:17.691598",
@ -4239,8 +4145,6 @@
"item_name": "Vitamin D4", "item_name": "Vitamin D4",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.707840", "modified": "2017-07-06 12:53:17.707840",
@ -4323,8 +4227,6 @@
"item_name": "Vitamin E", "item_name": "Vitamin E",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.723859", "modified": "2017-07-06 12:53:17.723859",
@ -4407,8 +4309,6 @@
"item_name": "Wheat Germ Oil", "item_name": "Wheat Germ Oil",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.739829", "modified": "2017-07-06 12:53:17.739829",
@ -4491,8 +4391,6 @@
"item_name": "Wheatgrass extr", "item_name": "Wheatgrass extr",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.757695", "modified": "2017-07-06 12:53:17.757695",
@ -4575,8 +4473,6 @@
"item_name": "Whey Protein", "item_name": "Whey Protein",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.774098", "modified": "2017-07-06 12:53:17.774098",
@ -4659,8 +4555,6 @@
"item_name": "Xylometazoline", "item_name": "Xylometazoline",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.790224", "modified": "2017-07-06 12:53:17.790224",
@ -4743,8 +4637,6 @@
"item_name": "Xylometazoline Hydrochloride", "item_name": "Xylometazoline Hydrochloride",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.806359", "modified": "2017-07-06 12:53:17.806359",
@ -4827,8 +4719,6 @@
"item_name": "Yeast", "item_name": "Yeast",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.823305", "modified": "2017-07-06 12:53:17.823305",
@ -4911,8 +4801,6 @@
"item_name": "Yellow Fever Vaccine", "item_name": "Yellow Fever Vaccine",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.840250", "modified": "2017-07-06 12:53:17.840250",
@ -4995,8 +4883,6 @@
"item_name": "Zafirlukast", "item_name": "Zafirlukast",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.856856", "modified": "2017-07-06 12:53:17.856856",
@ -5079,8 +4965,6 @@
"item_name": "Zaleplon", "item_name": "Zaleplon",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.873287", "modified": "2017-07-06 12:53:17.873287",
@ -5163,8 +5047,6 @@
"item_name": "Zaltoprofen", "item_name": "Zaltoprofen",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.889263", "modified": "2017-07-06 12:53:17.889263",
@ -5247,8 +5129,6 @@
"item_name": "Zanamivir", "item_name": "Zanamivir",
"last_purchase_rate": 0.0, "last_purchase_rate": 0.0,
"lead_time_days": 0, "lead_time_days": 0,
"manufacturer": null,
"manufacturer_part_no": null,
"max_discount": 0.0, "max_discount": 0.0,
"min_order_qty": 0.0, "min_order_qty": 0.0,
"modified": "2017-07-06 12:53:17.905022", "modified": "2017-07-06 12:53:17.905022",

View File

@ -14,7 +14,7 @@ data = {
'Student Attendance Tool', 'Student Attendance Tool',
'Student Applicant' 'Student Applicant'
], ],
'default_portal_role': 'LMS User', 'default_portal_role': 'Student',
'restricted_roles': [ 'restricted_roles': [
'Student', 'Student',
'Instructor', 'Instructor',

View File

@ -1,514 +1,135 @@
{ {
"allow_copy": 0, "allow_import": 1,
"allow_events_in_timeline": 0, "allow_rename": 1,
"allow_guest_to_view": 0, "autoname": "field:course_code",
"allow_import": 1, "creation": "2015-09-07 12:39:55.181893",
"allow_rename": 1, "doctype": "DocType",
"autoname": "field:course_code", "engine": "InnoDB",
"beta": 0, "field_order": [
"creation": "2015-09-07 12:39:55.181893", "course_name",
"custom": 0, "department",
"docstatus": 0, "parent_course",
"doctype": "DocType", "column_break_3",
"document_type": "", "course_code",
"editable_grid": 0, "course_abbreviation",
"engine": "InnoDB", "section_break_6",
"topics",
"description",
"hero_image",
"assessment",
"default_grading_scale",
"assessment_criteria"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "course_name",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Course Name",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fetch_if_empty": 0,
"fieldname": "course_name",
"fieldtype": "Data",
"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 Name",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "department",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "in_standard_filter": 1,
"collapsible": 0, "label": "Department",
"columns": 0, "options": "Department"
"fetch_if_empty": 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": 1,
"in_standard_filter": 1,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "parent_course",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "label": "Parent Course (Leave blank, if this isn't part of Parent Course)"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "parent_course",
"fieldtype": "Data",
"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": "Parent Course (Leave blank, if this isn't part of Parent Course)",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_3",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "course_code",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "label": "Course Code",
"bold": 0, "reqd": 1,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "course_code",
"fieldtype": "Data",
"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": "Course Code",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "course_abbreviation",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Course Abbreviation"
"collapsible": 0, },
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "course_abbreviation",
"fieldtype": "Data",
"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 Abbreviation",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_6",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_6",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "topics",
"allow_in_quick_entry": 0, "fieldtype": "Table",
"allow_on_submit": 0, "label": "Topics",
"bold": 0, "options": "Course Topic"
"collapsible": 0, },
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "topics",
"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": "Topics",
"length": 0,
"no_copy": 0,
"options": "Course Topic",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "hero_image",
"allow_in_quick_entry": 0, "fieldtype": "Attach Image",
"allow_on_submit": 0, "label": "Hero Image"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "course_intro",
"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": "Course Intro",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "assessment",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "Assessment"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "hero_image",
"fieldtype": "Attach Image",
"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": "Hero Image",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "default_grading_scale",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Default Grading Scale",
"bold": 0, "options": "Grading Scale"
"collapsible": 0, },
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "assessment",
"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": "Assessment",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "assessment_criteria",
"allow_in_quick_entry": 0, "fieldtype": "Table",
"allow_on_submit": 0, "label": "Assessment Criteria",
"bold": 0, "options": "Course Assessment Criteria"
"collapsible": 0, },
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "default_grading_scale",
"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": "Default Grading Scale",
"length": 0,
"no_copy": 0,
"options": "Grading Scale",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "description",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "label": "Description"
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "assessment_criteria",
"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": "Assessment Criteria",
"length": 0,
"no_copy": 0,
"options": "Course Assessment Criteria",
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-06-05 18:39:11.870605",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Education",
"in_create": 0, "name": "Course",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2019-04-09 11:35:27.354877",
"modified_by": "Administrator",
"module": "Education",
"name": "Course",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Academics User",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Instructor",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Instructor",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 0, "restrict_to_domain": "Education",
"read_only": 0, "search_fields": "course_name",
"restrict_to_domain": "Education", "show_name_in_global_search": 1,
"search_fields": "course_name", "sort_field": "modified",
"show_name_in_global_search": 1, "sort_order": "DESC"
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
} }

View File

@ -35,7 +35,7 @@ class CourseEnrollment(Document):
if enrollment: if enrollment:
frappe.throw(_("Student is already enrolled.")) frappe.throw(_("Student is already enrolled."))
def add_quiz_activity(self, quiz_name, quiz_response,answers, score, status): def add_quiz_activity(self, quiz_name, quiz_response, answers, score, status):
result = {k: ('Correct' if v else 'Wrong') for k,v in answers.items()} result = {k: ('Correct' if v else 'Wrong') for k,v in answers.items()}
result_data = [] result_data = []
for key in answers: for key in answers:
@ -43,7 +43,9 @@ class CourseEnrollment(Document):
item['question'] = key item['question'] = key
item['quiz_result'] = result[key] item['quiz_result'] = result[key]
try: try:
if isinstance(quiz_response[key], list): if not quiz_response[key]:
item['selected_option'] = "Unattempted"
elif isinstance(quiz_response[key], list):
item['selected_option'] = ', '.join(frappe.get_value('Options', res, 'option') for res in quiz_response[key]) item['selected_option'] = ', '.join(frappe.get_value('Options', res, 'option') for res in quiz_response[key])
else: else:
item['selected_option'] = frappe.get_value('Options', quiz_response[key], 'option') item['selected_option'] = frappe.get_value('Options', quiz_response[key], 'option')
@ -59,11 +61,12 @@ class CourseEnrollment(Document):
"result": result_data, "result": result_data,
"score": score, "score": score,
"status": status "status": status
}).insert() }).insert(ignore_permissions = True)
def add_activity(self, content_type, content): def add_activity(self, content_type, content):
if check_activity_exists(self.name, content_type, content): activity = check_activity_exists(self.name, content_type, content)
pass if activity:
return activity
else: else:
activity = frappe.get_doc({ activity = frappe.get_doc({
"doctype": "Course Activity", "doctype": "Course Activity",
@ -71,9 +74,14 @@ class CourseEnrollment(Document):
"content_type": content_type, "content_type": content_type,
"content": content, "content": content,
"activity_date": frappe.utils.datetime.datetime.now() "activity_date": frappe.utils.datetime.datetime.now()
}) })
activity.insert()
activity.insert(ignore_permissions=True)
return activity.name
def check_activity_exists(enrollment, content_type, content): def check_activity_exists(enrollment, content_type, content):
activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment, 'content_type': content_type, 'content': content}) activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment, 'content_type': content_type, 'content': content})
return bool(activity) if activity:
return activity[0].name
else:
return None

File diff suppressed because it is too large Load Diff

View File

@ -1,694 +1,213 @@
{ {
"allow_copy": 0, "allow_import": 1,
"allow_guest_to_view": 0, "allow_rename": 1,
"allow_import": 1, "autoname": "naming_series:",
"allow_rename": 1, "creation": "2015-09-16 13:03:20.430704",
"autoname": "naming_series:", "doctype": "DocType",
"beta": 0, "document_type": "Setup",
"creation": "2015-09-16 13:03:20.430704", "engine": "InnoDB",
"custom": 0, "field_order": [
"docstatus": 0, "naming_series",
"doctype": "DocType", "program",
"document_type": "Setup", "student_category",
"editable_grid": 0, "column_break_2",
"engine": "InnoDB", "academic_term",
"academic_year",
"section_break_4",
"components",
"section_break_6",
"column_break_11",
"total_amount",
"accounts",
"receivable_account",
"income_account",
"column_break_16",
"company",
"amended_from",
"accounting_dimensions_section",
"cost_center",
"dimension_col_break"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "naming_series",
"allow_in_quick_entry": 0, "fieldtype": "Select",
"allow_on_submit": 0, "label": "Naming Series",
"bold": 0, "options": "EDU-FST-.YYYY.-",
"collapsible": 0, "set_only_once": 1
"columns": 0, },
"default": "",
"fieldname": "naming_series",
"fieldtype": "Select",
"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": "Naming Series",
"length": 0,
"no_copy": 0,
"options": "EDU-FST-.YYYY.-",
"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": 1,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "program",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_global_search": 1,
"bold": 0, "in_list_view": 1,
"collapsible": 0, "in_standard_filter": 1,
"columns": 0, "label": "Program",
"fieldname": "program", "oldfieldname": "earning_name",
"fieldtype": "Link", "oldfieldtype": "Data",
"hidden": 0, "options": "Program",
"ignore_user_permissions": 0, "search_index": 1
"ignore_xss_filter": 0, },
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Program",
"length": 0,
"no_copy": 0,
"oldfieldname": "earning_name",
"oldfieldtype": "Data",
"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": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "student_category",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Student Category",
"bold": 0, "options": "Student Category"
"collapsible": 0, },
"columns": 0,
"fieldname": "student_category",
"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 Category",
"length": 0,
"no_copy": 0,
"options": "Student Category",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_2",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "academic_term",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "in_standard_filter": 1,
"collapsible": 0, "label": "Academic Term",
"columns": 0, "oldfieldname": "description",
"fieldname": "academic_term", "oldfieldtype": "Small Text",
"fieldtype": "Link", "options": "Academic Term",
"hidden": 0, "search_index": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Academic Term",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"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": 1,
"set_only_once": 0,
"translatable": 0,
"unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "academic_year",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Academic Year",
"bold": 0, "options": "Academic Year"
"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": 0,
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_4",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_4",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "components",
"allow_in_quick_entry": 0, "fieldtype": "Table",
"allow_on_submit": 0, "label": "Components",
"bold": 0, "options": "Fee Component",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fieldname": "components",
"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": "Components",
"length": 0,
"no_copy": 0,
"options": "Fee Component",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_6",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "section_break_6",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_11",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_11",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "total_amount",
"allow_in_quick_entry": 0, "fieldtype": "Currency",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Total Amount",
"collapsible": 0, "read_only": 1
"columns": 0, },
"fieldname": "total_amount",
"fieldtype": "Currency",
"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": "Total Amount",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "accounts",
"allow_in_quick_entry": 0, "fieldtype": "Section Break",
"allow_on_submit": 0, "label": "Accounts"
"bold": 0, },
"collapsible": 0,
"columns": 0,
"fieldname": "accounts",
"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": "Accounts",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "receivable_account",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Receivable Account",
"bold": 0, "options": "Account",
"collapsible": 0, "reqd": 1
"columns": 0, },
"default": "",
"fieldname": "receivable_account",
"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": "Receivable Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "income_account",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Income Account",
"bold": 0, "options": "Account"
"collapsible": 0, },
"columns": 0,
"fieldname": "income_account",
"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": "Income Account",
"length": 0,
"no_copy": 0,
"options": "Account",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_16",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_16",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "cost_center",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Cost Center",
"bold": 0, "options": "Cost Center"
"collapsible": 0, },
"columns": 0,
"fieldname": "cost_center",
"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": "Cost Center",
"length": 0,
"no_copy": 0,
"options": "Cost Center",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "company",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Company",
"bold": 0, "options": "Company"
"collapsible": 0, },
"columns": 0,
"fieldname": "company",
"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": "Company",
"length": 0,
"no_copy": 0,
"options": "Company",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "amended_from",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "label": "Amended From",
"bold": 0, "no_copy": 1,
"collapsible": 0, "options": "Fee Structure",
"columns": 0, "print_hide": 1,
"fieldname": "amended_from", "read_only": 1
"fieldtype": "Link", },
"hidden": 0, {
"ignore_user_permissions": 0, "fieldname": "accounting_dimensions_section",
"ignore_xss_filter": 0, "fieldtype": "Section Break",
"in_filter": 0, "label": "Accounting Dimensions"
"in_global_search": 0, },
"in_list_view": 0, {
"in_standard_filter": 0, "fieldname": "dimension_col_break",
"label": "Amended From", "fieldtype": "Column Break"
"length": 0,
"no_copy": 1,
"options": "Fee Structure",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "icon": "fa fa-flag",
"hide_heading": 0, "is_submittable": 1,
"hide_toolbar": 0, "modified": "2019-05-26 09:04:17.765758",
"icon": "fa fa-flag", "modified_by": "Administrator",
"idx": 0, "module": "Education",
"image_view": 0, "name": "Fee Structure",
"in_create": 0, "owner": "Administrator",
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2018-08-21 14:44:26.803147",
"modified_by": "Administrator",
"module": "Education",
"name": "Fee Structure",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 1, "amend": 1,
"cancel": 0, "create": 1,
"create": 1, "delete": 1,
"delete": 1, "email": 1,
"email": 1, "export": 1,
"export": 1, "import": 1,
"if_owner": 0, "print": 1,
"import": 1, "read": 1,
"permlevel": 0, "report": 1,
"print": 1, "role": "Academics User",
"read": 1, "share": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Accounts User",
"permlevel": 0, "share": 1,
"print": 1, "submit": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "cancel": 1,
"cancel": 1, "create": 1,
"create": 1, "delete": 1,
"delete": 1, "email": 1,
"email": 1, "export": 1,
"export": 1, "print": 1,
"if_owner": 0, "read": 1,
"import": 0, "report": 1,
"permlevel": 0, "role": "Accounts Manager",
"print": 1, "share": 1,
"read": 1, "submit": 1,
"report": 1,
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 1,
"write": 1 "write": 1
} }
], ],
"quick_entry": 0, "restrict_to_domain": "Education",
"read_only": 0, "search_fields": "program, student_category, academic_year",
"read_only_onload": 0, "sort_field": "modified",
"restrict_to_domain": "Education", "sort_order": "DESC",
"search_fields": "program, student_category, academic_year", "title_field": "program"
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "program",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,627 +1,181 @@
{ {
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:program_code", "autoname": "field:program_code",
"beta": 0,
"creation": "2015-09-07 12:54:03.609282", "creation": "2015-09-07 12:54:03.609282",
"custom": 0,
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "",
"editable_grid": 0,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [
"program_name",
"department",
"column_break_3",
"program_code",
"program_abbreviation",
"section_break_5",
"courses",
"section_break_9",
"description",
"intro_video",
"hero_image",
"column_break_11",
"is_published",
"is_featured",
"allow_self_enroll"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "program_name", "fieldname": "program_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Program Name", "label": "Program Name",
"length": 0, "reqd": 1
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "department", "fieldname": "department",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1, "in_standard_filter": 1,
"label": "Department", "label": "Department",
"length": 0, "options": "Department"
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_3", "fieldname": "column_break_3",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "program_code", "fieldname": "program_code",
"fieldtype": "Data", "fieldtype": "Data",
"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": "Program Code", "label": "Program Code",
"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": 1, "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "program_abbreviation", "fieldname": "program_abbreviation",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0, "label": "Program Abbreviation"
"label": "Program Abbreviation",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
"fetch_if_empty": 0,
"fieldname": "section_break_5", "fieldname": "section_break_5",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Portal Settings"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Portal Settings",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "courses", "fieldname": "courses",
"fieldtype": "Table", "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": "Courses", "label": "Courses",
"length": 0, "options": "Program Course"
"no_copy": 0,
"options": "Program 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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_9", "fieldname": "section_break_9",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "LMS Settings"
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Small Text",
"hidden": 0, "label": "Description"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "intro_video", "fieldname": "intro_video",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "label": "Intro Video"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Intro Video",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "hero_image", "fieldname": "hero_image",
"fieldtype": "Attach Image", "fieldtype": "Attach Image",
"hidden": 0, "label": "Hero Image"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Hero Image",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_11", "fieldname": "column_break_11",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0", "default": "0",
"fetch_if_empty": 0,
"fieldname": "is_published", "fieldname": "is_published",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "label": "Is Published"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Is Published",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0", "default": "0",
"fetch_if_empty": 0, "depends_on": "eval: doc.is_published == 1",
"fieldname": "is_featured", "fieldname": "is_featured",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "label": "Is Featured"
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0, {
"in_filter": 0, "default": "0",
"in_global_search": 0, "depends_on": "eval: doc.is_published == 1",
"in_list_view": 0, "description": "Allow students to enroll themselves from the portal",
"in_standard_filter": 0, "fieldname": "allow_self_enroll",
"label": "Is Featured", "fieldtype": "Check",
"length": 0, "label": "Allow Self Enroll"
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-06-05 17:47:26.877296",
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2019-03-18 15:26:56.737903",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Education", "module": "Education",
"name": "Program", "name": "Program",
"name_case": "",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 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
},
{
"amend": 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": "Instructor",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Guest",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "LMS User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
},
{
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "Student",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
},
{
"amend": 0,
"cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "System Manager", "role": "System Manager",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Instructor",
"share": 1,
"write": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Guest",
"share": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Student",
"share": 1
} }
], ],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Education", "restrict_to_domain": "Education",
"route": "",
"search_fields": "program_name", "search_fields": "program_name",
"show_name_in_global_search": 1, "show_name_in_global_search": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC"
"track_changes": 0,
"track_seen": 0,
"track_views": 0
} }

View File

@ -96,29 +96,6 @@ class ProgramEnrollment(Document):
quiz_progress.program = self.program quiz_progress.program = self.program
return quiz_progress return quiz_progress
def get_program_progress(self):
import math
program = frappe.get_doc("Program", self.program)
program_progress = {}
progress = []
for course in program.get_all_children():
course_progress = lms.get_student_course_details(course.course, self.program)
is_complete = False
if course_progress['flag'] == "Completed":
is_complete = True
progress.append({'course_name': course.course_name, 'name': course.course, 'is_complete': is_complete})
program_progress['progress'] = progress
program_progress['name'] = self.program
program_progress['program'] = frappe.get_value("Program", self.program, 'program_name')
try:
program_progress['percentage'] = math.ceil((sum([item['is_complete'] for item in progress] * 100)/len(progress)))
except ZeroDivisionError:
program_progress['percentage'] = 0
return program_progress
@frappe.whitelist() @frappe.whitelist()
def get_program_courses(doctype, txt, searchfield, start, page_len, filters): def get_program_courses(doctype, txt, searchfield, start, page_len, filters):
if filters.get('program'): if filters.get('program'):

View File

@ -1,167 +1,80 @@
{ {
"allow_copy": 0, "allow_import": 1,
"allow_events_in_timeline": 0, "autoname": "format:QUESTION-{#####}",
"allow_guest_to_view": 0, "creation": "2018-10-01 15:58:00.696815",
"allow_import": 1, "doctype": "DocType",
"allow_rename": 0, "editable_grid": 1,
"autoname": "format:QUESTION-{#####}", "engine": "InnoDB",
"beta": 0, "field_order": [
"creation": "2018-10-01 15:58:00.696815", "question",
"custom": 0, "options",
"docstatus": 0, "question_type"
"doctype": "DocType", ],
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "question",
"allow_in_quick_entry": 0, "fieldtype": "Small Text",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Question",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fetch_if_empty": 0,
"fieldname": "question",
"fieldtype": "Small Text",
"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": "Question",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "options",
"allow_in_quick_entry": 0, "fieldtype": "Table",
"allow_on_submit": 0, "label": "Options",
"bold": 0, "options": "Options",
"collapsible": 0, "reqd": 1
"columns": 0, },
"description": "", {
"fetch_if_empty": 0, "fieldname": "question_type",
"fieldname": "options", "fieldtype": "Select",
"fieldtype": "Table", "in_standard_filter": 1,
"hidden": 0, "label": "Type",
"ignore_user_permissions": 0, "options": "\nSingle Correct Answer\nMultiple Correct Answer",
"ignore_xss_filter": 0, "read_only": 1
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Options",
"length": 0,
"no_copy": 0,
"options": "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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-05-30 18:39:21.880974",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Education",
"in_create": 0, "name": "Question",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2019-04-22 14:02:08.140652",
"modified_by": "Administrator",
"module": "Education",
"name": "Question",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Academics User",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Academics User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Instructor",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Instructor",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "email": 1,
"cancel": 0, "export": 1,
"create": 0, "print": 1,
"delete": 0, "read": 1,
"email": 1, "report": 1,
"export": 1, "role": "LMS User",
"if_owner": 0, "share": 1
"import": 0,
"permlevel": 0,
"print": 1,
"read": 1,
"report": 1,
"role": "LMS User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 0
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0, "sort_field": "modified",
"show_name_in_global_search": 0, "sort_order": "DESC"
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0,
"track_views": 0
} }

View File

@ -12,6 +12,7 @@ class Question(Document):
def validate(self): def validate(self):
self.check_at_least_one_option() self.check_at_least_one_option()
self.check_minimum_one_correct_answer() self.check_minimum_one_correct_answer()
self.set_question_type()
def check_at_least_one_option(self): def check_at_least_one_option(self):
if len(self.options) <= 1: if len(self.options) <= 1:
@ -26,6 +27,13 @@ class Question(Document):
else: else:
frappe.throw(_("A qustion must have at least one correct options")) frappe.throw(_("A qustion must have at least one correct options"))
def set_question_type(self):
correct_options = [option for option in self.options if option.is_correct]
if len(correct_options) > 1:
self.question_type = "Multiple Correct Answer"
else:
self.question_type = "Single Correct Answer"
def get_answer(self): def get_answer(self):
options = self.options options = self.options
answers = [item.name for item in options if item.is_correct == True] answers = [item.name for item in options if item.is_correct == True]

View File

@ -1,299 +1,105 @@
{ {
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:title", "autoname": "field:title",
"beta": 0,
"creation": "2018-10-17 05:52:50.149904", "creation": "2018-10-17 05:52:50.149904",
"custom": 0,
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [
"title",
"question",
"quiz_configuration_section",
"passing_score",
"max_attempts",
"grading_basis"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"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": "Title", "label": "Title",
"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": 1, "reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "question", "fieldname": "question",
"fieldtype": "Table", "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": "Question", "label": "Question",
"length": 0,
"no_copy": 0,
"options": "Quiz Question", "options": "Quiz Question",
"permlevel": 0, "reqd": 1
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "quiz_configuration_section", "fieldname": "quiz_configuration_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "label": "Quiz Configuration"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Quiz Configuration",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0, "default": "75",
"allow_in_quick_entry": 0, "description": "Score out of 100",
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "passing_score", "fieldname": "passing_score",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Passing Score", "label": "Passing Score",
"length": 0, "reqd": 1
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"description": "Enter 0 to waive limit", "description": "Enter 0 to waive limit",
"fieldname": "max_attempts", "fieldname": "max_attempts",
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Max Attempts", "label": "Max Attempts",
"length": 0, "reqd": 1
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0, "default": "Latest Highest Score",
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Last Highest Score",
"fieldname": "grading_basis", "fieldname": "grading_basis",
"fieldtype": "Select", "fieldtype": "Select",
"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": "Grading Basis", "label": "Grading Basis",
"length": 0, "options": "Latest Highest Score\nLatest Attempt"
"no_copy": 0,
"options": "\nLast Attempt\nLast Highest Score",
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-05-30 18:50:54.218571",
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-11-25 19:07:36.190116",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Education", "module": "Education",
"name": "Quiz", "name": "Quiz",
"name_case": "",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Academics User", "role": "Academics User",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "LMS User", "role": "LMS User",
"set_user_permissions": 0, "share": 1
"share": 1,
"submit": 0,
"write": 0
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Instructor", "role": "Instructor",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1, "track_changes": 1
"track_seen": 0,
"track_views": 0
} }

View File

@ -7,51 +7,47 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
class Quiz(Document): class Quiz(Document):
def validate(self):
if self.passing_score > 100:
frappe.throw("Passing Score value should be between 0 and 100")
def validate_quiz_attempts(self, enrollment, quiz_name): def allowed_attempt(self, enrollment, quiz_name):
if self.max_attempts > 0: if self.max_attempts == 0:
try: return True
if len(frappe.get_all("Quiz Activity", {'enrollment': enrollment.name, 'quiz': quiz_name})) >= self.max_attempts:
frappe.throw('Maximum attempts reached!') try:
except Exception as e: if len(frappe.get_all("Quiz Activity", {'enrollment': enrollment.name, 'quiz': quiz_name})) >= self.max_attempts:
pass frappe.msgprint("Maximum attempts for this quiz reached!")
return False
else:
return True
except Exception as e:
return False
def evaluate(self, response_dict, quiz_name): def evaluate(self, response_dict, quiz_name):
# self.validate_quiz_attempts(enrollment, quiz_name)
questions = [frappe.get_doc('Question', question.question_link) for question in self.question] questions = [frappe.get_doc('Question', question.question_link) for question in self.question]
answers = {q.name:q.get_answer() for q in questions} answers = {q.name:q.get_answer() for q in questions}
correct_answers = {} result = {}
for key in answers: for key in answers:
try: try:
if isinstance(response_dict[key], list): if isinstance(response_dict[key], list):
result = compare_list_elementwise(response_dict[key], answers[key]) is_correct = compare_list_elementwise(response_dict[key], answers[key])
else: else:
result = (response_dict[key] == answers[key]) is_correct = (response_dict[key] == answers[key])
except: except Exception as e:
result = False is_correct = False
correct_answers[key] = result result[key] = is_correct
score = (sum(correct_answers.values()) * 100 ) / len(answers) score = (sum(result.values()) * 100 ) / len(answers)
if score >= self.passing_score: if score >= self.passing_score:
status = "Pass" status = "Pass"
else: else:
status = "Fail" status = "Fail"
return correct_answers, score, status return result, score, status
def get_questions(self): def get_questions(self):
quiz_question = self.get_all_children() return [frappe.get_doc('Question', question.question_link) for question in self.question]
if quiz_question:
questions = [frappe.get_doc('Question', question.question_link).as_dict() for question in quiz_question]
for question in questions:
correct_options = [option.is_correct for option in question.options]
if sum(correct_options) > 1:
question['type'] = "MultipleChoice"
else:
question['type'] = "SingleChoice"
return questions
else:
return None
def compare_list_elementwise(*args): def compare_list_elementwise(*args):
try: try:

View File

@ -1,145 +1,52 @@
{ {
"allow_copy": 0, "creation": "2018-10-15 15:52:25.766374",
"allow_events_in_timeline": 0, "doctype": "DocType",
"allow_guest_to_view": 0, "editable_grid": 1,
"allow_import": 0, "engine": "InnoDB",
"allow_rename": 0, "field_order": [
"beta": 0, "question",
"creation": "2018-10-15 15:52:25.766374", "selected_option",
"custom": 0, "quiz_result"
"docstatus": 0, ],
"doctype": "DocType",
"document_type": "",
"editable_grid": 1,
"engine": "InnoDB",
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "question",
"allow_in_quick_entry": 0, "fieldtype": "Link",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Question",
"collapsible": 0, "options": "Question",
"columns": 0, "read_only": 1,
"fetch_if_empty": 0, "reqd": 1,
"fieldname": "question", "set_only_once": 1
"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": "Question",
"length": 0,
"no_copy": 0,
"options": "Question",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "selected_option",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Selected Option",
"collapsible": 0, "read_only": 1,
"columns": 0, "set_only_once": 1
"fetch_if_empty": 0, },
"fieldname": "selected_option",
"fieldtype": "Data",
"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": "Selected Option",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "quiz_result",
"allow_in_quick_entry": 0, "fieldtype": "Select",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Result",
"collapsible": 0, "options": "\nCorrect\nWrong",
"columns": 0, "read_only": 1,
"fetch_if_empty": 0, "reqd": 1,
"fieldname": "quiz_result", "set_only_once": 1
"fieldtype": "Select",
"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": "Result",
"length": 0,
"no_copy": 0,
"options": "\nCorrect\nWrong",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "istable": 1,
"hide_heading": 0, "modified": "2019-06-03 12:52:32.267392",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Education",
"image_view": 0, "name": "Quiz Result",
"in_create": 0, "owner": "Administrator",
"is_submittable": 0, "permissions": [],
"issingle": 0, "quick_entry": 1,
"istable": 1, "sort_field": "modified",
"max_attachments": 0, "sort_order": "DESC",
"modified": "2019-03-27 17:58:54.388848", "track_changes": 1
"modified_by": "Administrator",
"module": "Education",
"name": "Quiz Result",
"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,
"track_views": 0
} }

View File

@ -54,7 +54,7 @@ class Student(Document):
'send_welcome_email': 1, 'send_welcome_email': 1,
'user_type': 'Website User' 'user_type': 'Website User'
}) })
student_user.add_roles("Student", "LMS User") student_user.add_roles("Student")
student_user.save() student_user.save()
update_password_link = student_user.reset_password() update_password_link = student_user.reset_password()

View File

@ -1,297 +1,104 @@
{ {
"allow_copy": 0, "autoname": "field:topic_code",
"allow_events_in_timeline": 0, "creation": "2018-12-12 11:37:39.917760",
"allow_guest_to_view": 0, "doctype": "DocType",
"allow_import": 0, "editable_grid": 1,
"allow_rename": 0, "engine": "InnoDB",
"autoname": "field:topic_code", "field_order": [
"beta": 0, "topic_name",
"creation": "2018-12-12 11:37:39.917760", "column_break_2",
"custom": 0, "topic_code",
"docstatus": 0, "section_break_4",
"doctype": "DocType", "topic_content",
"document_type": "", "description",
"editable_grid": 1, "hero_image"
"engine": "InnoDB", ],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0, "fieldname": "topic_name",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Name",
"collapsible": 0, "reqd": 1
"columns": 0, },
"fetch_if_empty": 0,
"fieldname": "topic_name",
"fieldtype": "Data",
"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": "Name",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "column_break_2",
"allow_in_quick_entry": 0, "fieldtype": "Column Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_2",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "topic_code",
"allow_in_quick_entry": 0, "fieldtype": "Data",
"allow_on_submit": 0, "in_list_view": 1,
"bold": 0, "label": "Code",
"collapsible": 0, "reqd": 1,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "topic_code",
"fieldtype": "Data",
"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": "Code",
"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": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0, "fieldname": "section_break_4",
"allow_in_quick_entry": 0, "fieldtype": "Section Break"
"allow_on_submit": 0, },
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_4",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "topic_content",
"allow_in_quick_entry": 0, "fieldtype": "Table",
"allow_on_submit": 0, "label": "Topic Content",
"bold": 0, "options": "Topic Content"
"collapsible": 0, },
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "topic_content",
"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": "Topic Content",
"length": 0,
"no_copy": 0,
"options": "Topic Content",
"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,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "fieldname": "hero_image",
"allow_in_quick_entry": 0, "fieldtype": "Attach Image",
"allow_on_submit": 0, "label": "Hero Image"
"bold": 0, },
"collapsible": 0, {
"columns": 0, "fieldname": "description",
"fetch_if_empty": 0, "fieldtype": "Small Text",
"fieldname": "hero_image", "label": "Description"
"fieldtype": "Attach Image",
"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": "Hero Image",
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-06-05 18:38:44.029711",
"hide_toolbar": 0, "modified_by": "Administrator",
"idx": 0, "module": "Education",
"in_create": 0, "name": "Topic",
"is_submittable": 0, "owner": "Administrator",
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2019-04-09 11:35:34.137040",
"modified_by": "Administrator",
"module": "Education",
"name": "Topic",
"name_case": "",
"owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "System Manager",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Administrator",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Administrator",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0, "create": 1,
"cancel": 0, "delete": 1,
"create": 1, "email": 1,
"delete": 1, "export": 1,
"email": 1, "print": 1,
"export": 1, "read": 1,
"if_owner": 0, "report": 1,
"import": 0, "role": "Instructor",
"permlevel": 0, "share": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Instructor",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1 "write": 1
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0, "sort_field": "modified",
"show_name_in_global_search": 0, "sort_order": "DESC",
"sort_field": "modified", "track_changes": 1
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0,
"track_views": 0
} }

View File

@ -1,262 +1,102 @@
{ {
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 0,
"autoname": "field:title", "autoname": "field:title",
"beta": 0,
"creation": "2018-10-17 05:47:13.087395", "creation": "2018-10-17 05:47:13.087395",
"custom": 0,
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [
"title",
"description",
"duration",
"provider",
"url",
"publish_date"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "in_list_view": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Title", "label": "Title",
"length": 0, "reqd": 1,
"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,
"translatable": 0,
"unique": 1 "unique": 1
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"hidden": 0, "in_list_view": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description", "label": "Description",
"length": 0, "reqd": 1
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "duration", "fieldname": "duration",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "label": "Duration"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Duration",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "url", "fieldname": "url",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "in_list_view": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "URL", "label": "URL",
"length": 0, "reqd": 1
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "publish_date", "fieldname": "publish_date",
"fieldtype": "Date", "fieldtype": "Date",
"hidden": 0, "label": "Publish Date"
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0, {
"in_filter": 0, "fieldname": "provider",
"in_global_search": 0, "fieldtype": "Select",
"in_list_view": 0, "in_list_view": 1,
"in_standard_filter": 0, "label": "Provider",
"label": "Publish Date", "options": "YouTube\nVimeo",
"length": 0, "reqd": 1
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0, "modified": "2019-05-20 15:11:53.075093",
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-11-25 19:07:17.134288",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Education", "module": "Education",
"name": "Video", "name": "Video",
"name_case": "",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Academics User", "role": "Academics User",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "Instructor", "role": "Instructor",
"set_user_permissions": 0,
"share": 1, "share": 1,
"submit": 0,
"write": 1 "write": 1
}, },
{ {
"amend": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 1, "email": 1,
"export": 1, "export": 1,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 1, "print": 1,
"read": 1, "read": 1,
"report": 1, "report": 1,
"role": "LMS User", "role": "LMS User",
"set_user_permissions": 0, "share": 1
"share": 1,
"submit": 0,
"write": 0
} }
], ],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1, "track_changes": 1
"track_seen": 0,
"track_views": 0
} }

View File

@ -9,7 +9,8 @@ from erpnext.setup.utils import insert_record
def setup_education(): def setup_education():
if frappe.db.exists('Academic Year', '2015-16'): disable_desk_access_for_student_role()
if frappe.db.exists("Academic Year", "2015-16"):
# already setup # already setup
return return
create_academic_sessions() create_academic_sessions()
@ -26,3 +27,22 @@ def create_academic_sessions():
{"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 2"} {"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 2"}
] ]
insert_record(data) insert_record(data)
def disable_desk_access_for_student_role():
try:
student_role = frappe.get_doc("Role", "Student")
except frappe.DoesNotExistError:
create_student_role()
return
student_role.desk_access = 0
student_role.save()
def create_student_role():
student_role = frappe.get_doc({
"doctype": "Role",
"role_name": "Student",
"desk_access": 0,
"restrict_to_domain": "Education"
})
student_role.insert()

View File

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors # Copyright (c) 2015, Frappe Technologies and contributors
# For lice
from __future__ import unicode_literals, division from __future__ import unicode_literals, division
import frappe import frappe
@ -57,9 +56,10 @@ def validate_duplicate_student(students):
# LMS Utils # LMS Utils
def get_current_student(): def get_current_student():
""" """Returns current student from frappe.session.user
Returns student user name, example EDU-STU-2018-00001 (Based on the naming series).
Takes email from from frappe.session.user Returns:
object: Student Document
""" """
email = frappe.session.user email = frappe.session.user
if email in ('Administrator', 'Guest'): if email in ('Administrator', 'Guest'):
@ -70,44 +70,266 @@ def get_current_student():
except (IndexError, frappe.DoesNotExistError): except (IndexError, frappe.DoesNotExistError):
return None return None
def check_super_access(): def get_portal_programs():
"""Returns a list of all program to be displayed on the portal
Programs are returned based on the following logic
is_published and (student_is_enrolled or student_can_self_enroll)
Returns:
list of dictionary: List of all programs and to be displayed on the portal along with access rights
"""
published_programs = frappe.get_all("Program", filters={"is_published": True})
if not published_programs:
return None
program_list = [frappe.get_doc("Program", program) for program in published_programs]
portal_programs = [{'program': program, 'has_access': allowed_program_access(program.name)} for program in program_list if allowed_program_access(program.name) or program.allow_self_enroll]
return portal_programs
def allowed_program_access(program, student=None):
"""Returns enrollment status for current student
Args:
program (string): Name of the program
student (object): instance of Student document
Returns:
bool: Is current user enrolled or not
"""
if has_super_access():
return True
if not student:
student = get_current_student()
if student and get_enrollment('program', program, student.name):
return True
else:
return False
def get_enrollment(master, document, student):
"""Gets enrollment for course or program
Args:
master (string): can either be program or course
document (string): program or course name
student (string): Student ID
Returns:
string: Enrollment Name if exists else returns empty string
"""
if master == 'program':
enrollments = frappe.get_all("Program Enrollment", filters={'student':student, 'program': document, 'docstatus': 1})
if master == 'course':
enrollments = frappe.get_all("Course Enrollment", filters={'student':student, 'course': document})
if enrollments:
return enrollments[0].name
else:
return None
@frappe.whitelist()
def enroll_in_program(program_name, student=None):
"""Enroll student in program
Args:
program_name (string): Name of the program to be enrolled into
student (string, optional): name of student who has to be enrolled, if not
provided, a student will be created from the current user
Returns:
string: name of the program enrollment document
"""
if has_super_access():
return
if not student == None:
student = frappe.get_doc("Student", student)
else:
# Check if self enrollment in allowed
program = frappe.get_doc('Program', program_name)
if not program.allow_self_enroll:
return frappe.throw("You are not allowed to enroll for this course")
student = get_current_student()
if not student:
student = create_student_from_current_user()
# Check if student is already enrolled in program
enrollment = get_enrollment('program', program_name, student.name)
if enrollment:
return enrollment
# Check if self enrollment in allowed
program = frappe.get_doc('Program', program_name)
if not program.allow_self_enroll:
return frappe.throw("You are not allowed to enroll for this course")
# Enroll in program
program_enrollment = student.enroll_in_program(program_name)
return program_enrollment.name
def has_super_access():
"""Check if user has a role that allows full access to LMS
Returns:
bool: true if user has access to all lms content
"""
current_user = frappe.get_doc('User', frappe.session.user) current_user = frappe.get_doc('User', frappe.session.user)
roles = set([role.role for role in current_user.roles]) roles = set([role.role for role in current_user.roles])
return bool(roles & {'Administrator', 'Instructor', 'Education Manager', 'System Manager', 'Academic User'}) return bool(roles & {'Administrator', 'Instructor', 'Education Manager', 'System Manager', 'Academic User'})
def get_program_enrollment(program_name): @frappe.whitelist()
""" def add_activity(course, content_type, content, program):
Function to get program enrollments for a particular student for a program if has_super_access():
""" return None
student = get_current_student() student = get_current_student()
if not student: if not student:
return None return frappe.throw("Student with email {0} does not exist".format(frappe.session.user), frappe.DoesNotExistError)
enrollment = get_or_create_course_enrollment(course, program)
if content_type == 'Quiz':
return
else: else:
enrollment = frappe.get_all("Program Enrollment", filters={'student':student.name, 'program': program_name}) return enrollment.add_activity(content_type, content)
if enrollment:
return enrollment[0].name @frappe.whitelist()
def evaluate_quiz(quiz_response, quiz_name, course, program):
import json
student = get_current_student()
quiz_response = json.loads(quiz_response)
quiz = frappe.get_doc("Quiz", quiz_name)
result, score, status = quiz.evaluate(quiz_response, quiz_name)
if has_super_access():
return {'result': result, 'score': score, 'status': status}
if student:
enrollment = get_or_create_course_enrollment(course, program)
if quiz.allowed_attempt(enrollment, quiz_name):
enrollment.add_quiz_activity(quiz_name, quiz_response, result, score, status)
return {'result': result, 'score': score, 'status': status}
else: else:
return None return None
def get_program_and_enrollment_status(program_name): @frappe.whitelist()
program = frappe.get_doc('Program', program_name) def get_quiz(quiz_name, course):
is_enrolled = bool(get_program_enrollment(program_name)) or check_super_access() try:
return {'program': program, 'is_enrolled': is_enrolled} quiz = frappe.get_doc("Quiz", quiz_name)
questions = quiz.get_questions()
except:
frappe.throw("Quiz {0} does not exist".format(quiz_name))
return None
def get_course_enrollment(course_name): questions = [{
'name': question.name,
'question': question.question,
'type': question.question_type,
'options': [{'name': option.name, 'option': option.option}
for option in question.options],
} for question in questions]
if has_super_access():
return {'questions': questions, 'activity': None}
student = get_current_student()
course_enrollment = get_enrollment("course", course, student.name)
status, score, result = check_quiz_completion(quiz, course_enrollment)
return {'questions': questions, 'activity': {'is_complete': status, 'score': score, 'result': result}}
def get_topic_progress(topic, course_name, program):
"""
Return the porgress of a course in a program as well as the content to continue from.
:param topic_name:
:param course_name:
"""
student = get_current_student() student = get_current_student()
if not student: if not student:
return None return None
enrollment_name = frappe.get_all("Course Enrollment", filters={'student': student.name, 'course':course_name}) course_enrollment = get_or_create_course_enrollment(course_name, program)
try: progress = student.get_topic_progress(course_enrollment.name, topic)
name = enrollment_name[0].name if not progress:
enrollment = frappe.get_doc("Course Enrollment", name)
return enrollment
except:
return None return None
count = sum([activity['is_complete'] for activity in progress])
if count == 0:
return {'completed': False, 'started': False}
elif count == len(progress):
return {'completed': True, 'started': True}
elif count < len(progress):
return {'completed': False, 'started': True}
def get_course_progress(course, program):
"""
Return the porgress of a course in a program as well as the content to continue from.
:param topic_name:
:param course_name:
"""
course_progress = []
for course_topic in course.topics:
topic = frappe.get_doc("Topic", course_topic.topic)
progress = get_topic_progress(topic, course.name, program)
if progress:
course_progress.append(progress)
if course_progress:
number_of_completed_topics = sum([activity['completed'] for activity in course_progress])
total_topics = len(course_progress)
if total_topics == 1:
return course_progress[0]
if number_of_completed_topics == 0:
return {'completed': False, 'started': False}
if number_of_completed_topics == total_topics:
return {'completed': True, 'started': True}
if number_of_completed_topics < total_topics:
return {'completed': False, 'started': True}
return None
def get_program_progress(program):
program_progress = []
if not program.courses:
return None
for program_course in program.courses:
course = frappe.get_doc("Course", program_course.course)
progress = get_course_progress(course, program.name)
if progress:
progress['name'] = course.name
progress['course'] = course.course_name
program_progress.append(progress)
if program_progress:
return program_progress
return None
def get_program_completion(program):
topics = frappe.db.sql("""select `tabCourse Topic`.topic, `tabCourse Topic`.parent
from `tabCourse Topic`,
`tabProgram Course`
where `tabCourse Topic`.parent = `tabProgram Course`.course
and `tabProgram Course`.parent = %s""", program.name)
progress = []
for topic in topics:
topic_doc = frappe.get_doc('Topic', topic[0])
topic_progress = get_topic_progress(topic_doc, topic[1], program.name)
if topic_progress:
progress.append(topic_progress)
if progress:
number_of_completed_topics = sum([activity['completed'] for activity in progress if activity])
total_topics = len(progress)
try:
return int((float(number_of_completed_topics)/total_topics)*100)
except ZeroDivisionError:
return 0
return 0
def create_student_from_current_user(): def create_student_from_current_user():
user = frappe.get_doc("User", frappe.session.user) user = frappe.get_doc("User", frappe.session.user)
student = frappe.get_doc({ student = frappe.get_doc({
"doctype": "Student", "doctype": "Student",
"first_name": user.first_name, "first_name": user.first_name,
@ -115,12 +337,21 @@ def create_student_from_current_user():
"student_email_id": user.email, "student_email_id": user.email,
"user": frappe.session.user "user": frappe.session.user
}) })
student.save(ignore_permissions=True) student.save(ignore_permissions=True)
return student return student
def enroll_in_course(course_name, program_name): def get_or_create_course_enrollment(course, program):
student = get_current_student() student = get_current_student()
return student.enroll_in_course(course_name=course_name, program_enrollment=get_program_enrollment(program_name)) course_enrollment = get_enrollment("course", course, student.name)
if not course_enrollment:
program_enrollment = get_enrollment('program', program, student.name)
if not program_enrollment:
frappe.throw("You are not enrolled in program {0}".format(program))
return
return student.enroll_in_course(course_name=course, program_enrollment=get_enrollment('program', program, student.name))
else:
return frappe.get_doc('Course Enrollment', course_enrollment)
def check_content_completion(content_name, content_type, enrollment_name): def check_content_completion(content_name, content_type, enrollment_name):
activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment_name, 'content_type': content_type, 'content': content_name}) activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment_name, 'content_type': content_type, 'content': content_name})
@ -131,7 +362,7 @@ def check_content_completion(content_name, content_type, enrollment_name):
def check_quiz_completion(quiz, enrollment_name): def check_quiz_completion(quiz, enrollment_name):
attempts = frappe.get_all("Quiz Activity", filters={'enrollment': enrollment_name, 'quiz': quiz.name}, fields=["name", "activity_date", "score", "status"]) attempts = frappe.get_all("Quiz Activity", filters={'enrollment': enrollment_name, 'quiz': quiz.name}, fields=["name", "activity_date", "score", "status"])
status = False if quiz.max_attempts == 0 else bool(len(attempts) == quiz.max_attempts) status = False if quiz.max_attempts == 0 else bool(len(attempts) >= quiz.max_attempts)
score = None score = None
result = None result = None
if attempts: if attempts:

View File

@ -300,11 +300,15 @@ def insert_lab_test_to_medical_record(doc):
elif doc.special_test_items: elif doc.special_test_items:
item = doc.special_test_items[0] item = doc.special_test_items[0]
table_row = item.lab_test_particulars +" "+ item.result_value
if item.lab_test_particulars and item.result_value:
table_row = item.lab_test_particulars +" "+ item.result_value
elif doc.sensitivity_test_items: elif doc.sensitivity_test_items:
item = doc.sensitivity_test_items[0] item = doc.sensitivity_test_items[0]
table_row = item.antibiotic +" "+ item.antibiotic_sensitivity
if item.antibiotic and item.antibiotic_sensitivity:
table_row = item.antibiotic +" "+ item.antibiotic_sensitivity
if table_row: if table_row:
subject += "<br/>"+table_row subject += "<br/>"+table_row

View File

@ -14,8 +14,6 @@ source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop' develop_version = '12.x.x-develop'
error_report_email = "support@erpnext.com"
app_include_js = "assets/js/erpnext.min.js" app_include_js = "assets/js/erpnext.min.js"
app_include_css = "assets/css/erpnext.css" app_include_css = "assets/css/erpnext.css"
web_include_js = "assets/js/erpnext-web.min.js" web_include_js = "assets/js/erpnext-web.min.js"

View File

@ -122,6 +122,7 @@
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fetch_from": "employee.employee_name",
"fieldname": "employee_name", "fieldname": "employee_name",
"fieldtype": "Read Only", "fieldtype": "Read Only",
"hidden": 0, "hidden": 0,
@ -461,7 +462,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2019-03-08 12:00:14.043535", "modified": "2019-06-05 12:00:14.043535",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Attendance", "name": "Attendance",

View File

@ -7,7 +7,6 @@ import frappe
from frappe.utils import getdate, nowdate from frappe.utils import getdate, nowdate
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
from frappe.utils import cstr from frappe.utils import cstr
class Attendance(Document): class Attendance(Document):
@ -18,8 +17,6 @@ class Attendance(Document):
if res: if res:
frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee)) frappe.throw(_("Attendance for employee {0} is already marked").format(self.employee))
set_employee_name(self)
def check_leave_record(self): def check_leave_record(self):
leave_record = frappe.db.sql("""select leave_type, half_day, half_day_date from `tabLeave Application` leave_record = frappe.db.sql("""select leave_type, half_day, half_day_date from `tabLeave Application`
where employee = %s and %s between from_date and to_date and status = 'Approved' where employee = %s and %s between from_date and to_date and status = 'Approved'

View File

@ -1,341 +1,83 @@
{ {
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2018-05-09 05:37:18.439763", "creation": "2018-05-09 05:37:18.439763",
"custom": 0,
"docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [
"activity_name",
"user",
"role",
"column_break_3",
"task",
"task_weight",
"required_for_employee_creation",
"section_break_6",
"description"
],
"fields": [ "fields": [
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "activity_name", "fieldname": "activity_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0, "label": "Activity Name"
"label": "Activity Name",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "user", "fieldname": "user",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "User", "label": "User",
"length": 0, "options": "User"
"no_copy": 0,
"options": "User",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "role", "fieldname": "role",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0,
"label": "Role", "label": "Role",
"length": 0, "options": "Role"
"no_copy": 0,
"options": "Role",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_3", "fieldname": "column_break_3",
"fieldtype": "Column Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "task", "fieldname": "task",
"fieldtype": "Link", "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": "Task", "label": "Task",
"length": 0,
"no_copy": 1, "no_copy": 1,
"options": "Task", "options": "Task",
"permlevel": 0, "read_only": 1
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "1",
"fetch_if_empty": 0,
"fieldname": "task_weight", "fieldname": "task_weight",
"fieldtype": "Float", "fieldtype": "Float",
"hidden": 0, "label": "Task Weight"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Task Weight",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0, "default": "0",
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"description": "Applicable in the case of Employee Onboarding", "description": "Applicable in the case of Employee Onboarding",
"fetch_if_empty": 0,
"fieldname": "required_for_employee_creation", "fieldname": "required_for_employee_creation",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "label": "Required for Employee Creation"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Required for Employee Creation",
"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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "section_break_6", "fieldname": "section_break_6",
"fieldtype": "Section Break", "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,
"translatable": 0,
"unique": 0
}, },
{ {
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"hidden": 0, "label": "Description"
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Description",
"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,
"translatable": 0,
"unique": 0
} }
], ],
"has_web_view": 0,
"hide_toolbar": 0,
"idx": 0,
"in_create": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "modified": "2019-06-03 19:22:42.965762",
"menu_index": 0,
"modified": "2019-04-12 11:31:27.080747",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Boarding Activity", "name": "Employee Boarding Activity",
"name_case": "",
"owner": "Administrator", "owner": "Administrator",
"permissions": [], "permissions": [],
"quick_entry": 1, "quick_entry": 1,
"read_only": 0,
"show_name_in_global_search": 0,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1, "track_changes": 1
"track_seen": 0,
"track_views": 0
} }

View File

@ -60,12 +60,11 @@ frappe.ui.form.on('Employee Onboarding', {
}, },
callback: function(r) { callback: function(r) {
if (r.message) { if (r.message) {
$.each(r.message, function(i, d) { r.message.forEach((d) => {
var row = frappe.model.add_child(frm.doc, "Employee Boarding Activity", "activities"); frm.add_child("activities", d);
$.extend(row, d);
}); });
refresh_field("activities");
} }
refresh_field("activities");
} }
}); });
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -446,7 +446,7 @@ class SalarySlip(TransactionBase):
else: else:
component_row.additional_amount = amount component_row.additional_amount = amount
if not overwrite: if not overwrite and component_row.default_amount:
amount += component_row.default_amount amount += component_row.default_amount
component_row.amount = amount component_row.amount = amount
@ -619,6 +619,10 @@ class SalarySlip(TransactionBase):
elif not row.amount: elif not row.amount:
amount = row.default_amount + row.additional_amount amount = row.default_amount + row.additional_amount
# apply rounding
if frappe.get_cached_value("Salary Component", row.salary_component, "round_to_the_nearest_integer"):
amount, additional_amount = rounded(amount), rounded(additional_amount)
return amount, additional_amount return amount, additional_amount
def calculate_unclaimed_taxable_benefits(self, payroll_period): def calculate_unclaimed_taxable_benefits(self, payroll_period):

View File

@ -211,7 +211,7 @@ class TestSalarySlip(unittest.TestCase):
tax_paid = get_tax_paid_in_period(employee) tax_paid = get_tax_paid_in_period(employee)
# total taxable income 586000, 250000 @ 5%, 86000 @ 20% ie. 12500 + 17200 # total taxable income 586000, 250000 @ 5%, 86000 @ 20% ie. 12500 + 17200
annual_tax = 113567.79 annual_tax = 113568
try: try:
self.assertEqual(tax_paid, annual_tax) self.assertEqual(tax_paid, annual_tax)
except AssertionError: except AssertionError:
@ -250,7 +250,7 @@ class TestSalarySlip(unittest.TestCase):
# total taxable income 416000, 166000 @ 5% ie. 8300 # total taxable income 416000, 166000 @ 5% ie. 8300
try: try:
self.assertEqual(tax_paid, 88607.79) self.assertEqual(tax_paid, 88608)
except AssertionError: except AssertionError:
print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n") print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n")
raise raise
@ -265,7 +265,7 @@ class TestSalarySlip(unittest.TestCase):
# total taxable income 566000, 250000 @ 5%, 66000 @ 20%, 12500 + 13200 # total taxable income 566000, 250000 @ 5%, 66000 @ 20%, 12500 + 13200
tax_paid = get_tax_paid_in_period(employee) tax_paid = get_tax_paid_in_period(employee)
try: try:
self.assertEqual(tax_paid, 121211.48) self.assertEqual(tax_paid, 121211)
except AssertionError: except AssertionError:
print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n") print("\nSalary Slip - Tax calculation failed on following case\n", data, "\n")
raise raise
@ -443,7 +443,8 @@ def make_deduction_salary_component(setup=False, test_tax=False):
"type": "Deduction", "type": "Deduction",
"amount_based_on_formula": 1, "amount_based_on_formula": 1,
"depends_on_payment_days": 0, "depends_on_payment_days": 0,
"variable_based_on_taxable_salary": 1 "variable_based_on_taxable_salary": 1,
"round_to_the_nearest_integer": 1
} }
] ]
if not test_tax: if not test_tax:
@ -453,7 +454,8 @@ def make_deduction_salary_component(setup=False, test_tax=False):
"condition": 'employment_type=="Intern"', "condition": 'employment_type=="Intern"',
"formula": 'base*.1', "formula": 'base*.1',
"type": "Deduction", "type": "Deduction",
"amount_based_on_formula": 1 "amount_based_on_formula": 1,
"round_to_the_nearest_integer": 1
}) })
if setup or test_tax: if setup or test_tax:
make_salary_component(data, test_tax) make_salary_component(data, test_tax)

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ class EmployeeBoardingController(Document):
@frappe.whitelist() @frappe.whitelist()
def get_onboarding_details(parent, parenttype): def get_onboarding_details(parent, parenttype):
return frappe.get_all("Employee Boarding Activity", return frappe.get_all("Employee Boarding Activity",
fields=["activity_name", "role", "user", "required_for_employee_creation", "description"], fields=["activity_name", "role", "user", "required_for_employee_creation", "description", "task_weight"],
filters={"parent": parent, "parenttype": parenttype}, filters={"parent": parent, "parenttype": parenttype},
order_by= "idx") order_by= "idx")

View File

@ -2,7 +2,7 @@
// For license information, please see license.txt // For license information, please see license.txt
/* eslint-disable */ /* eslint-disable */
frappe.query_reports["BOM Items and Scraps"] = { frappe.query_reports["BOM Explorer"] = {
"filters": [ "filters": [
{ {
fieldname: "bom", fieldname: "bom",

View File

@ -1,20 +1,20 @@
{ {
"add_total_row": 0, "add_total_row": 0,
"creation": "2019-05-14 12:06:14.998746", "creation": "2019-06-06 15:42:53.021714",
"disable_prepared_report": 0, "disable_prepared_report": 0,
"disabled": 0, "disabled": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 0, "idx": 0,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2019-05-14 12:06:14.998746", "modified": "2019-06-06 15:42:53.021714",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "BOM Items and Scraps", "name": "BOM Explorer",
"owner": "Administrator", "owner": "Administrator",
"prepared_report": 0, "prepared_report": 0,
"ref_doctype": "BOM", "ref_doctype": "BOM",
"report_name": "BOM Items and Scraps ", "report_name": "BOM Explorer",
"report_type": "Script Report", "report_type": "Script Report",
"roles": [ "roles": [
{ {

View File

@ -602,4 +602,6 @@ erpnext.patches.v11_1.set_salary_details_submittable
erpnext.patches.v11_1.rename_depends_on_lwp erpnext.patches.v11_1.rename_depends_on_lwp
execute:frappe.delete_doc("Report", "Inactive Items") execute:frappe.delete_doc("Report", "Inactive Items")
erpnext.patches.v11_1.delete_scheduling_tool erpnext.patches.v11_1.delete_scheduling_tool
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
erpnext.patches.v12_0.make_item_manufacturer

View File

@ -0,0 +1,27 @@
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "item_manufacturer")
item_manufacturer = []
for d in frappe.db.sql(""" SELECT name, manufacturer, manufacturer_part_no, creation, owner
FROM `tabItem` WHERE manufacturer is not null and manufacturer != ''""", as_dict=1):
item_manufacturer.append((
frappe.generate_hash("", 10),
d.name,
d.manufacturer,
d.manufacturer_part_no,
d.creation,
d.owner
))
if item_manufacturer:
frappe.db.sql('''
INSERT INTO `tabItem Manufacturer`
(`name`, `item_code`, `manufacturer`, `manufacturer_part_no`, `creation`, `owner`)
VALUES {}'''.format(', '.join(['%s'] * len(item_manufacturer))), tuple(item_manufacturer)
)

View File

@ -26,23 +26,17 @@ frappe.ui.form.on("Task", {
} }
} }
} }
if(!frm.is_group){
var doc = frm.doc;
if(doc.__islocal) {
if(!frm.doc.exp_end_date) {
frm.set_value("exp_end_date", frappe.datetime.add_days(new Date(), 7));
}
}
if(!doc.__islocal) { if(!frm.doc.is_group){
if(frm.perm[0].write) { if (!frm.is_new()) {
if(frm.doc.status!=="Completed" && frm.doc.status!=="Cancelled") { if (frm.perm[0].write) {
frm.add_custom_button(__("Completed"), function() { if (!["Closed", "Cancelled"].includes(frm.doc.status)) {
frm.set_value("status", "Completed"); frm.add_custom_button(__("Close"), () => {
frm.set_value("status", "Closed");
frm.save(); frm.save();
}); });
} else { } else {
frm.add_custom_button(__("Reopen"), function() { frm.add_custom_button(__("Reopen"), () => {
frm.set_value("status", "Open"); frm.set_value("status", "Open");
frm.save(); frm.save();
}); });

View File

@ -50,14 +50,12 @@
"public/js/education/student_button.html", "public/js/education/student_button.html",
"public/js/education/assessment_result_tool.html", "public/js/education/assessment_result_tool.html",
"public/js/hub/hub_factory.js", "public/js/hub/hub_factory.js",
"public/js/call_popup/call_popup.js" "public/js/call_popup/call_popup.js",
"public/js/utils/dimension_tree_filter.js"
], ],
"js/item-dashboard.min.js": [ "js/item-dashboard.min.js": [
"stock/dashboard/item_dashboard.html", "stock/dashboard/item_dashboard.html",
"stock/dashboard/item_dashboard_list.html", "stock/dashboard/item_dashboard_list.html",
"stock/dashboard/item_dashboard.js" "stock/dashboard/item_dashboard.js"
],
"js/lms.min.js": [
"public/js/education/lms/lms.js"
] ]
} }

View File

@ -14,8 +14,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
this._super(); this._super();
}, },
onload: function() { onload: function(doc, cdt, cdn) {
this.setup_queries(); this.setup_queries(doc, cdt, cdn);
this._super(); this._super();
this.frm.set_query('shipping_rule', function() { this.frm.set_query('shipping_rule', function() {
@ -50,7 +50,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
/* eslint-enable */ /* eslint-enable */
}, },
setup_queries: function() { setup_queries: function(doc, cdt, cdn) {
var me = this; var me = this;
if(this.frm.fields_dict.buying_price_list) { if(this.frm.fields_dict.buying_price_list) {
@ -90,6 +90,15 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
} }
} }
}); });
this.frm.set_query("manufacturer", "items", function(doc, cdt, cdn) {
const row = locals[cdt][cdn];
return {
query: "erpnext.controllers.queries.item_manufacturer_query",
filters:{ 'item_code': row.item_code }
}
});
}, },
refresh: function(doc) { refresh: function(doc) {
@ -338,6 +347,25 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
} }
}) })
} }
},
manufacturer: function(doc, cdt, cdn) {
const row = locals[cdt][cdn];
if(row.manufacturer) {
frappe.call({
method: "erpnext.stock.doctype.item_manufacturer.item_manufacturer.get_item_manufacturer_part_no",
args: {
'item_code': row.item_code,
'manufacturer': row.manufacturer
},
callback: function(r) {
if (r.message) {
frappe.model.set_value(cdt, cdn, 'manufacturer_part_no', r.message);
}
}
});
}
} }
}); });

View File

@ -515,7 +515,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
net_total += item.net_amount; net_total += item.net_amount;
// discount amount rounding loss adjustment if no taxes // discount amount rounding loss adjustment if no taxes
if ((!(me.frm.doc.taxes || []).length || (me.frm.doc.apply_discount_on == "Net Total")) if ((!(me.frm.doc.taxes || []).length || total_for_discount_amount==me.frm.doc.net_total || (me.frm.doc.apply_discount_on == "Net Total"))
&& i == (me.frm.doc.items || []).length - 1) { && i == (me.frm.doc.items || []).length - 1) {
var discount_amount_loss = flt(me.frm.doc.net_total - net_total var discount_amount_loss = flt(me.frm.doc.net_total - net_total
- me.frm.doc.discount_amount, precision("net_total")); - me.frm.doc.discount_amount, precision("net_total"));

View File

@ -460,6 +460,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
weight_per_unit: item.weight_per_unit, weight_per_unit: item.weight_per_unit,
weight_uom: item.weight_uom, weight_uom: item.weight_uom,
uom : item.uom, uom : item.uom,
manufacturer: item.manufacturer,
stock_uom: item.stock_uom, stock_uom: item.stock_uom,
pos_profile: me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : '', pos_profile: me.frm.doc.doctype == 'Sales Invoice' ? me.frm.doc.pos_profile : '',
cost_center: item.cost_center, cost_center: item.cost_center,

View File

@ -1,15 +0,0 @@
frappe.ready(() => {
frappe.provide('lms');
lms.call = (method, args) => {
const method_path = 'erpnext.www.lms.' + method;
return new Promise((resolve, reject) => {
return frappe.call({
method: method_path,
args,
})
.then(r => resolve(r.message))
.fail(reject);
});
};
});

View File

@ -1,44 +0,0 @@
<template>
<div>
<ContentTitle :title="contentData.title" :author="contentData.author" :publishDate="contentData.publish_date">
<slot></slot>
</ContentTitle>
<section class="article-content-section">
<div>
<div class="content" v-html="contentData.content"></div>
<div class="text-right">
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>
</div>
</template>
<script>
import ContentTitle from './ContentTitle.vue'
export default {
props: ['content', 'type'],
name: 'Article',
data() {
return {
contentData: ''
}
},
mounted() {
this.getContent().then(data => this.contentData = data);
},
methods: {
getContent() {
return lms.call('get_content', {
content_type: this.type,
content: this.content
})
}
},
components: {
ContentTitle
}
};
</script>

View File

@ -1,56 +0,0 @@
<template>
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li v-for="(route, index) in routeData" class="breadcrumb-item active" aria-current="page">
<router-link v-if="index != routeData.length - 1" :to="route.route">
{{ route.label }}
</router-link>
<span v-else>{{ route.label }}</span>
</li>
</ol>
</nav>
</div>
</template>
<script type="text/javascript">
export default {
name: "Breadcrumb",
data() {
return {
routeName: this.$route.name,
routeParams: this.$route.params,
routeData: [{
label: "All Programs",
route: "/List/Program"
}]
}
},
mounted() {
this.buildBreadcrumb()
},
methods: {
buildBreadcrumb() {
if(this.routeName == 'program') {
return
}
if(this.routeName == 'course') {
let routeObject = {
label: this.routeParams.program_name,
route: `/Program/${this.routeParams.program_name}`
}
this.routeData.push(routeObject)
}
if(this.routeName == 'content') {
this.routeData.push({
label: this.routeParams.program_name,
route: `/Program/${this.routeParams.program_name}`
})
this.routeData.push({
label: this.routeParams.course_name,
route: `/Program/${this.routeParams.program_name}/${this.routeParams.course_name}`
})
}
}
}
};
</script>

View File

@ -1,25 +0,0 @@
<template>
<button :class="classList" v-on="$listeners" v-bind="$attrs" @click="goToRoute">
<slot></slot>
</button>
</template>
<script>
export default {
name: 'AButton',
props: ['type', 'size', 'route'],
computed: {
classList() {
return [
'btn',
'btn-' + this.type,
'btn-' + this.size
]
}
},
methods: {
goToRoute() {
this.$router.push(this.route);
}
}
}
</script>

View File

@ -1,28 +0,0 @@
<template>
<div class="featured-products-section py-3">
<h5 class='featured-heading' v-html="title"></h5>
<div class="featured-products row">
<!-- <p class='lead text-center' v-html="description"></p> -->
<slot name="card-list-slot"></slot>
</div>
<div class='mt-4 text-center'>
<slot name="list-bottom"></slot>
</div>
</div>
</template>
<script>
export default {
props:['title', 'description'],
name: "CardList",
};
</script>
<style scoped>
.featured-heading {
text-transform: uppercase;
letter-spacing: 0.5px;
font-size: 12px;
font-weight: 500;
}
</style>

View File

@ -1,40 +0,0 @@
<template>
<div class="nav-buttons">
<button class='btn btn-outline-secondary' @click="$router.go(-1)">Back</button>
<button v-if="nextContent" class='btn btn-primary' @click="goNext()">Next</button>
<button v-else class='btn btn-primary' @click="finish()">Finish Topic</button>
</div>
</template>
<script>
export default {
props: ['nextContent', 'nextContentType'],
name: 'ContentNavigation',
methods: {
addActivity() {
if(this.$route.params.type != "Quiz"){
console.log("Adding Activity")
lms.call("add_activity",
{
course: this.$route.params.course_name,
content_type: this.$route.params.type,
content: this.$route.params.content,
}
)
}
},
goNext() {
this.addActivity()
this.$router.push({ name: 'content', params: { course: this.$route.params.course_name, type:this.nextContentType, content:this.nextContent }})
},
finish() {
this.addActivity()
this.$router.push({ name: 'course', params: { program_name: this.$route.params.program_name, course_name: this.$route.params.course_name}})
lms.trigger('course-completed', course_name);
}
}
};
</script>
<style lang="css" scoped>
</style>

View File

@ -1,29 +0,0 @@
<template>
<section class='article-top-section video-section-bg'>
<div>
<div class="row">
<div class="col-md-8">
<h2>{{ title }}</h2>
<span v-if="typeof author !== 'undefined' || author !== null" class="text-muted">
<span v-if="publishDate">Published on {{ publishDate }}</span>
<span v-if="author"> {{ author }}</span>
</span>
</div>
<div class="col-md-4 text-right">
<slot></slot>
</div>
</div>
<hr>
</div>
</section>
</template>
<script>
export default {
props: ['title', 'publishDate', 'author'],
name: 'ContentTitle',
};
</script>
<style lang="css" scoped>
</style>

View File

@ -1,87 +0,0 @@
<template>
<div class="py-3 col-md-4 col-sm-12">
<div class="card h-100">
<div class="card-hero-img" v-if="course.hero_image" v-bind:style="{ 'background-image': 'url(' + image + ')' }"></div>
<div v-else class="card-image-wrapper">
<div class="image-body">{{ course.course_name }}</div>
</div>
<div class='card-body'>
<h5 class="card-title">{{ course.course_name }}</h5>
<span class="course-list text-muted" id="getting-started">
{{ course.course_intro.substring(0,120) }}
</span>
</div>
<div class='p-3' style="display: flex; justify-content: space-between;">
<div>
<span v-if="complete"><i class="mr-2 text-success fa fa-check-circle" aria-hidden="true"></i>Course Complete</span>
</div>
<div class='text-right'>
<a-button
:type="'primary'"
size="sm"
:route="courseRoute"
>
{{ buttonName }}
</a-button>
</div>
</div>
</div>
</div>
</template>
<script>
import AButton from './Button.vue';
export default {
props: ['course', 'program_name'],
name: "CourseCard",
components: {
AButton
},
data() {
return {
courseDetails: {},
}
},
mounted() {
if(lms.store.checkLogin()) this.getCourseDetails().then(data => this.courseDetails = data)
},
computed: {
courseRoute() {
return `${this.program_name}/${this.course.name}`
},
complete() {
if(lms.store.checkProgramEnrollment(this.program_name)){
if (this.courseDetails.flag === "Completed" ) {
return true
}
else {
return false
}
}
else {
return false
}
},
isLogin() {
return lms.store.checkLogin()
},
buttonName() {
if(lms.store.checkProgramEnrollment(this.program_name)){
return "Start Course"
}
else {
return "Explore"
}
}
},
methods: {
getCourseDetails() {
return lms.call('get_student_course_details', {
course_name: this.course.name,
program_name: this.program_name
})
},
}
};
</script>

View File

@ -1,85 +0,0 @@
<template>
<nav class="navbar navbar-light bg-white navbar-expand-lg sticky-top shadow-sm">
<div class="container">
<a class="navbar-brand" href="/lms">
<span>{{ portal.title }}</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="lms#/List/Program">
All Programs
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/lms#/Profile">
Profile
</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<!-- post login tools -->
<li v-if="isLogin" class="nav-item dropdown logged-in" id="website-post-login" data-label="website-post-login">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="user-image-wrapper">
<span class="avatar avatar-small" :title="fullName">
<span class="avatar-frame" :style="avatarStyle" :title="fullName"></span>
</span>
</span>
<span class="full-name">{{ fullName }}</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<a class="dropdown-item" href="/me" rel="nofollow"> My Account </a>
<a class="dropdown-item" href="/?cmd=web_logout" rel="nofollow"> Logout </a>
</ul>
</li>
<li v-else class="nav-item">
<a class="nav-link btn-login-area" href="/login">Login</a>
</li>
</ul>
</div>
</div>
</nav>
</template>
<script>
export default {
name: "Home",
data() {
return{
portal: {},
avatar: frappe.user_image,
fullName: frappe.full_name,
isLogin: frappe.is_user_logged_in()
}
},
mounted() {
this.getPortalDetails().then(data => this.portal = data);
},
methods: {
getPortalDetails() {
return lms.call("get_portal_details")
}
},
computed: {
avatarStyle() {
return `background-image: url("${this.avatar}")`
},
// isLogin() {
// return frappe.is_user_logged_in()
// },
}
};
</script>
<style scoped>
a {
text-decoration: none;
}
</style>

View File

@ -1,83 +0,0 @@
<template>
<div class="py-5">
<div class="row">
<div class="col-sm-12">
<div>
<h3>{{ fullName }}</h3>
<ul>
<li class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Email:</div>
<div class="col-md-9 col-sm-8">{{ email }}</div>
</li>
<li v-if="joiningDate" class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Date of Joining:</div>
<div class="col-md-9 col-sm-8">{{ joiningDate }}</div>
</li>
<li class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Programs Enrolled:</div>
<div class="col-md-9 col-sm-8">
<ul v-if="enrolledPrograms">
<li v-for="program in enrolledPrograms" :key="program">{{ program }}</li>
</ul>
<span v-else>None</span>
</div>
</li>
</ul>
</div>
<a href="/update-profile" class="edit-button text-muted">Edit Profile</a>
</div>
</div>
<div ></div>
</div>
</template>
<script>
export default {
props: ['enrolledPrograms'],
name: "ProfileInfo",
data() {
return {
avatar: frappe.user_image,
fullName: frappe.full_name,
abbr: frappe.get_abbr(frappe.get_cookie("full_name")),
email: frappe.session.user,
joiningDate: ''
}
},
mounted(){
this.getJoiningDate().then(data => {
if(data) {
this.joiningDate = lms.moment(String(data)).format('D MMMM YYYY')
}
})
},
computed: {
avatarStyle() {
return `background-image: url("${this.avatar}")`
},
},
methods: {
getJoiningDate() {
return lms.call("get_joining_date")
}
}
};
</script>
<style scoped>
.edit-button {
position: absolute;
top: 0;
right: 0;
}
.standard-image {
font-size: 72px;
border-radius: 6px;
}
ul {
list-style-type: none;
padding: 0;
margin: 0
}
</style>

View File

@ -1,82 +0,0 @@
<template>
<div class='py-3 col-md-4 col-sm-12'>
<div class="card h-100">
<router-link :to="'/Program/' + program.name">
<div class="card-hero-img" v-if="program.hero_image" v-bind:style="{ 'background-image': 'url(' + image + ')' }"></div>
<div v-else class="card-image-wrapper text-center">
<div class="image-body">{{ program.program_name }}</div>
</div>
<div class='card-body'>
<h5 class='card-title'>{{ program.program_name }}</h5>
<div class="text-muted">{{ program.description.substring(0,120) }}...</div>
</div>
</router-link>
<div class='text-right p-3'>
<button v-if="program.intro_video" class='btn btn-light btn-sm' data-toggle="modal" data-target="#videoModal">Watch Intro</button>
<a-button v-if="enrolled" type="dark" size="sm" :route="programPageRoute">
{{ buttonName }}
</a-button>
<button v-else-if="isLogin" class='btn btn-dark btn-sm' @click="enroll()">{{ enrollButton }}</button>
<a v-else class='btn btn-secondary btn-sm' href="/login#signup">Sign Up</a>
</div>
<VideoModal v-if="program.intro_video" :title="program.program_name" :video="program.intro_video"/>
</div>
</div>
</template>
<script>
import AButton from './Button.vue';
import VideoModal from './VideoModal.vue';
export default {
props: ['program', 'enrolled'],
name: "ProgramCard",
data() {
return {
isLogin: frappe.is_user_logged_in(),
enrollButton: 'Enroll Now',
programRoute: { name: 'program', params: { program_name: this.program.name }},
image: "'" + this.program.hero_image + "'"
};
},
methods: {
enroll() {
this.enrollButton = 'Enrolling...'
lms.call('enroll_in_program', {
program_name: this.program.name,
}).then(data => {
lms.store.updateEnrolledPrograms()
this.$router.push(this.programRoute)
})
}
},
computed: {
buttonName() {
if(this.enrolled){
return "Start Program"
}
else {
return "Enroll"
}
},
programPageRoute() {
return this.programRoute
},
isEnrolled() {
return lms.store.enrolledPrograms.includes(this.program.name)
}
},
components: {
AButton,
VideoModal
}
};
</script>
<style lang="css" scoped>
a {
text-decoration: none;
color: black;
}
a.btn-secondary {
color: white !important;
}
</style>

View File

@ -1,89 +0,0 @@
<template>
<div class='py-3 col-md-4 col-sm-12'>
<div class="card h-100">
<div class='card-body'>
<router-link :to="'/Program/' + programData.name">
<h5 class='card-title'>{{ programData.program }}</h5>
</router-link>
<span class="course-list text-muted" id="getting-started">
Courses
<ul class="mb-0 mt-1 list-unstyled" style="padding-left: 1.5em;">
<li v-for="item in programData.progress" :key="item.name">
<span v-if="item.is_complete"><i class="text-success fa fa-check-circle" aria-hidden="true"></i></span>
<span v-else><i class="text-secondary fa fa-circle-o" aria-hidden="true"></i></span>
{{ item.course_name }}
</li>
</ul>
</span>
</div>
<div class='p-3' style="display: flex; justify-content: space-between;">
<div></div>
<div class='text-right'>
<a-button
:type="buttonType"
size="sm btn-block"
:route="programRoute"
>
{{ buttonName }}
</a-button>
</div>
</div>
</div>
</div>
</template>
<script>
import AButton from './Button.vue';
export default {
props: ['program'],
name: "ProgressCard",
data() {
return {
programData: {}
};
},
mounted() {
this.getProgramProgress().then(data => this.programData = data)
},
methods: {
getProgramProgress() {
return lms.call('get_program_progress', {
program_name: this.program
})
},
},
computed: {
programRoute() {
return {name: 'program', params: {program_name: this.program}}
},
buttonType() {
if (this.programData.percentage == 100 ){
return "success"
}
else if (this.programData.percentage == "0" ) {
return "secondary"
}
else {
return "info"
}
},
buttonName() {
if (this.programData.percentage == 100 ){
return "Program Complete"
}
else {
return `${this.programData.percentage}% Completed`
}
}
},
components: {
AButton
},
};
</script>
<style scoped>
a {
text-decoration: none;
color: black;
}
</style>

View File

@ -1,119 +0,0 @@
<template>
<section class="quiz-section">
<div>
<div class="row">
<div class="col-md-8">
<h2>{{ content }}</h2>
</div>
</div>
<div class="content">
<hr>
<div id="quiz" :name="content">
<div id="quiz-body">
<component v-for="question in quizData" :key="question.name" v-bind:is="question.type" :question="question" @updateResponse="updateResponse" :isDisabled="isDisabled"></component>
</div>
<div class="mt-3">
<div>
<div v-if="isDisabled || submitted" id="post-quiz-actions" class="row">
<div class="col-md-8 text-left">
<span v-html="message"></span>
</div>
<div class="col-md-4 text-right">
<slot></slot>
</div>
</div>
<div v-else id="quiz-actions" class="text-right">
<button class='btn btn-outline-secondary' type="reset" :disabled="isDisabled">Reset</button>
<button class='btn btn-primary' @click="submitQuiz" type="button" :disabled="isDisabled">Submit</button>
</div>
</div>
</div>
</div>
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>
</template>
<script>
import QuizSingleChoice from "./Quiz/QuizSingleChoice.vue"
import QuizMultipleChoice from "./Quiz/QuizMultipleChoice.vue"
export default {
props: ['content', 'type'],
name: 'Quiz',
data() {
return {
quizData: '',
quizResponse: {},
score: '',
submitted: false,
isDisabled: false,
quizStatus: {},
}
},
mounted() {
this.getQuizWithoutAnswers().then(data => {
this.quizData = data.quizData
this.quizStatus = data.status
this.isDisabled = data.status.is_complete
});
},
components: {
'SingleChoice': QuizSingleChoice,
'MultipleChoice': QuizMultipleChoice
},
methods: {
getQuizWithoutAnswers() {
return lms.call("get_quiz_without_answers",
{
quiz_name: this.content,
course_name: this.$route.params.course_name
}
)
},
updateResponse(res) {
this.quizResponse[res.question] = res.option
},
submitQuiz() {
lms.call("evaluate_quiz",
{
quiz_response: this.quizResponse,
quiz_name: this.content,
course: this.$route.params.course_name
}
).then(data => {
this.score = data
this.submitted = true
this.quizResponse = null
});
}
},
computed: {
currentComponent: function() {
if(this.quizData.type === "MultipleChoice") {
return 'QuizMultipleChoice'
}
else {
return 'QuizSingleChoice'
}
},
message: function() {
if(this.submitted) {
return '<h3>Your Score: <span id="result">'+ this.score +'</span></h3>'
}
let message = '<h4>You have exhausted all attempts for this quiz.</h4>'
if(this.quizStatus.result == 'Pass') {
message = "<h4>You have successfully completed this quiz.</h4>Score: " + this.quizStatus.score
}
return message
}
},
};
</script>
<style lang="css" scoped>
</style>

Some files were not shown because too many files have changed in this diff Show More