Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f26dcbc1a6 | ||
|
|
ecd46588ec | ||
|
|
96c247c834 | ||
|
|
db8f41ba55 | ||
|
|
f7d81c7a7f | ||
|
|
5b73a4864a | ||
|
|
85622f9ccb | ||
|
|
c27d9f712b | ||
|
|
175646572a | ||
|
|
7cfacb315b | ||
|
|
d5d8db7a3f | ||
|
|
39bcb3de4b | ||
|
|
09fe8e0522 | ||
|
|
17737e4ab1 | ||
|
|
2fca72ae8e | ||
|
|
0dbe8547e7 | ||
|
|
e1ed5ba726 | ||
|
|
0fc57a7df2 | ||
|
|
c7a72684fd | ||
|
|
e0c34bfd77 | ||
|
|
020dedd00e | ||
|
|
28dad095fa | ||
|
|
e7125c0ea2 | ||
|
|
8590d5b05d | ||
|
|
66951e528f | ||
|
|
9b20e07431 | ||
|
|
d7afa69c6f | ||
|
|
c61dc9c7ea | ||
|
|
9cf6d630e9 | ||
|
|
5687e2da9d | ||
|
|
e3c122d8c4 | ||
|
|
4cc5e61f60 | ||
|
|
6293263095 | ||
|
|
810e483757 | ||
|
|
398f144833 | ||
|
|
e2741e85fd | ||
|
|
dd70fbfdae | ||
|
|
6eaf281b2b | ||
|
|
134487ab2a | ||
|
|
7bd7df3742 | ||
|
|
56c1b2a625 | ||
|
|
b12e15dcc4 | ||
|
|
e5fdd47fd8 | ||
|
|
04c69fb46d | ||
|
|
f04ef8dfe0 | ||
|
|
7544904857 | ||
|
|
c44910370b | ||
|
|
551406ab11 | ||
|
|
e385b5b97b | ||
|
|
bb2670d57a | ||
|
|
0b293133be | ||
|
|
83c1c3a171 | ||
|
|
c3d642e5d1 | ||
|
|
8230ce095f | ||
|
|
e713a7d840 | ||
|
|
557847a5ba | ||
|
|
9bac58cdc6 | ||
|
|
5650bf9ba5 | ||
|
|
9afb53203f | ||
|
|
825e053e66 | ||
|
|
3e519770de | ||
|
|
e42fb32f6f | ||
|
|
00bec1c272 | ||
|
|
68ae9f3f88 | ||
|
|
8f3cc81302 | ||
|
|
9e9d242a24 | ||
|
|
287fe81329 | ||
|
|
24053478a1 | ||
|
|
f382373cf4 | ||
|
|
61f4a8e757 | ||
|
|
eef55185fc | ||
|
|
8691e0777b | ||
|
|
2de3bf7a0f | ||
|
|
2e6f12b850 | ||
|
|
ba41242f1f | ||
|
|
0633df5872 | ||
|
|
f4f774d1df | ||
|
|
695327a513 | ||
|
|
019501e4a0 | ||
|
|
2704162f5a | ||
|
|
117be7ddd5 | ||
|
|
f59920500c | ||
|
|
8a01980757 | ||
|
|
5123a8519b | ||
|
|
d7de3c606b | ||
|
|
dc981dc546 | ||
|
|
83c8ed0827 | ||
|
|
3fc3305251 | ||
|
|
033e2fa8b6 |
@@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '8.0.13'
|
__version__ = '8.0.19'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
@@ -25,7 +26,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Make Accounting Entry For Every Stock Movement",
|
"label": "Make Accounting Entry For Every Stock Movement",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -33,6 +36,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -51,7 +55,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Accounts Frozen Upto",
|
"label": "Accounts Frozen Upto",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -59,6 +65,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -77,7 +84,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -86,6 +95,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -103,7 +113,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -111,6 +123,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -129,7 +142,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Credit Controller",
|
"label": "Credit Controller",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -138,6 +153,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -155,7 +171,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Check Supplier Invoice Number Uniqueness",
|
"label": "Check Supplier Invoice Number Uniqueness",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -164,6 +182,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -181,7 +200,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Make Payment via Journal Entry",
|
"label": "Make Payment via Journal Entry",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -190,6 +211,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -208,7 +230,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Unlink Payment on Cancellation of Invoice",
|
"label": "Unlink Payment on Cancellation of Invoice",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -217,6 +241,37 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "book_asset_depreciation_entry_automatically",
|
||||||
|
"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": "Book Asset Depreciation Entry Automatically",
|
||||||
|
"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,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -224,18 +279,18 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-cog",
|
"icon": "icon-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2016-10-20 16:12:38.595075",
|
"modified": "2017-04-18 13:35:59.166250",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Accounts Settings",
|
"name": "Accounts Settings",
|
||||||
@@ -251,7 +306,6 @@
|
|||||||
"export": 0,
|
"export": 0,
|
||||||
"if_owner": 0,
|
"if_owner": 0,
|
||||||
"import": 0,
|
"import": 0,
|
||||||
"is_custom": 0,
|
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
@@ -266,6 +320,8 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
|
"track_changes": 1,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,10 @@ from frappe import _
|
|||||||
from frappe.utils import flt, today, getdate
|
from frappe.utils import flt, today, getdate
|
||||||
|
|
||||||
def post_depreciation_entries(date=None):
|
def post_depreciation_entries(date=None):
|
||||||
|
# Return if automatic booking of asset depreciation is disabled
|
||||||
|
if not frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically"):
|
||||||
|
return
|
||||||
|
|
||||||
if not date:
|
if not date:
|
||||||
date = today()
|
date = today()
|
||||||
for asset in get_depreciable_assets(date):
|
for asset in get_depreciable_assets(date):
|
||||||
|
|||||||
@@ -167,6 +167,23 @@ class TestAsset(unittest.TestCase):
|
|||||||
self.assertEqual(gle, expected_gle)
|
self.assertEqual(gle, expected_gle)
|
||||||
self.assertEqual(asset.get("value_after_depreciation"), 70000)
|
self.assertEqual(asset.get("value_after_depreciation"), 70000)
|
||||||
|
|
||||||
|
def test_depreciation_entry_cancellation(self):
|
||||||
|
asset = frappe.get_doc("Asset", "Macbook Pro 1")
|
||||||
|
asset.submit()
|
||||||
|
post_depreciation_entries(date="2021-01-01")
|
||||||
|
|
||||||
|
asset.load_from_db()
|
||||||
|
|
||||||
|
# cancel depreciation entry
|
||||||
|
depr_entry = asset.get("schedules")[0].journal_entry
|
||||||
|
self.assertTrue(depr_entry)
|
||||||
|
frappe.get_doc("Journal Entry", depr_entry).cancel()
|
||||||
|
|
||||||
|
asset.load_from_db()
|
||||||
|
depr_entry = asset.get("schedules")[0].journal_entry
|
||||||
|
self.assertFalse(depr_entry)
|
||||||
|
|
||||||
|
|
||||||
def test_scrap_asset(self):
|
def test_scrap_asset(self):
|
||||||
asset = frappe.get_doc("Asset", "Macbook Pro 1")
|
asset = frappe.get_doc("Asset", "Macbook Pro 1")
|
||||||
asset.submit()
|
asset.submit()
|
||||||
@@ -298,3 +315,6 @@ def set_depreciation_settings_in_company():
|
|||||||
company.disposal_account = "_Test Gain/Loss on Asset Disposal - _TC"
|
company.disposal_account = "_Test Gain/Loss on Asset Disposal - _TC"
|
||||||
company.depreciation_cost_center = "_Test Cost Center - _TC"
|
company.depreciation_cost_center = "_Test Cost Center - _TC"
|
||||||
company.save()
|
company.save()
|
||||||
|
|
||||||
|
# Enable booking asset depreciation entry automatically
|
||||||
|
frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
|
||||||
0
erpnext/accounts/doctype/bank_guarantee/__init__.py
Normal file
30
erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Bank Guarantee', {
|
||||||
|
refresh: function(frm) {
|
||||||
|
cur_frm.set_query("account", function() {
|
||||||
|
return {
|
||||||
|
"filters": {
|
||||||
|
"account_type": "Bank",
|
||||||
|
"is_group": 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
cur_frm.set_query("project", function() {
|
||||||
|
return {
|
||||||
|
"filters": {
|
||||||
|
"customer": cur_frm.doc.customer
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
|
start_date: function(frm) {
|
||||||
|
end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
|
||||||
|
cur_frm.set_value("end_date", end_date);
|
||||||
|
},
|
||||||
|
validity: function(frm) {
|
||||||
|
end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
|
||||||
|
cur_frm.set_value("end_date", end_date);
|
||||||
|
}
|
||||||
|
});
|
||||||
448
erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
Normal file
@@ -0,0 +1,448 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 0,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"autoname": "BG-.#####",
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2016-12-17 10:43:35.731631",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "Document",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "customer",
|
||||||
|
"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",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Customer",
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 1,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "project",
|
||||||
|
"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": "Project",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Project",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "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": "Bank 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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "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,
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "column_break_6",
|
||||||
|
"fieldtype": "Column Break",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "start_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": "Start 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": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"description": "",
|
||||||
|
"fieldname": "validity",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"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": "Validity 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": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "end_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": "End Date",
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "bank_guarantee_number",
|
||||||
|
"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": "Bank Guarantee Number",
|
||||||
|
"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,
|
||||||
|
"unique": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 1,
|
||||||
|
"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,
|
||||||
|
"label": "More Information",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "more_information",
|
||||||
|
"fieldtype": "Text Editor",
|
||||||
|
"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": "Notes",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "amended_from",
|
||||||
|
"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": "Amended From",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 1,
|
||||||
|
"options": "Bank Guarantee",
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 1,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 0,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2017-04-25 13:31:49.627831",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bank Guarantee",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"apply_user_permissions": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 0,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts User",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"apply_user_permissions": 0,
|
||||||
|
"cancel": 1,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"search_fields": "customer",
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"title_field": "customer",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0
|
||||||
|
}
|
||||||
10
erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class BankGuarantee(Document):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
# test_records = frappe.get_test_records('Bank Guarantee')
|
||||||
|
|
||||||
|
class TestBankGuarantee(unittest.TestCase):
|
||||||
|
pass
|
||||||
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
frappe.ui.form.on("Bank Reconciliation", {
|
frappe.ui.form.on("Bank Reconciliation", {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.get_docfield("payment_entries").allow_bulk_edit = 1;
|
|
||||||
frm.add_fetch("bank_account", "account_currency", "account_currency");
|
frm.add_fetch("bank_account", "account_currency", "account_currency");
|
||||||
},
|
},
|
||||||
|
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
var default_bank_account = locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"];
|
|
||||||
|
|
||||||
|
let default_bank_account = frappe.defaults.get_user_default("Company")?
|
||||||
|
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
|
||||||
frm.set_value("bank_account", default_bank_account);
|
frm.set_value("bank_account", default_bank_account);
|
||||||
|
|
||||||
frm.set_query("bank_account", function() {
|
frm.set_query("bank_account", function() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 1,
|
"allow_copy": 1,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
@@ -7,11 +8,15 @@
|
|||||||
"custom": 0,
|
"custom": 0,
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
|
"document_type": "Document",
|
||||||
|
"editable_grid": 0,
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"description": "Select account head of the bank where cheque was deposited.",
|
"description": "Select account head of the bank where cheque was deposited.",
|
||||||
"fieldname": "bank_account",
|
"fieldname": "bank_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -19,7 +24,9 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Bank Account",
|
"label": "Bank Account",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -28,6 +35,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -35,16 +43,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "account_currency",
|
"fieldname": "account_currency",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Account Currency",
|
"label": "Account Currency",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -53,6 +65,7 @@
|
|||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -60,16 +73,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "from_date",
|
"fieldname": "from_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "From Date",
|
"label": "From Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -77,6 +94,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -84,16 +102,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "to_date",
|
"fieldname": "to_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "To Date",
|
"label": "To Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -101,6 +123,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -108,16 +131,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "include_reconciled_entries",
|
"fieldname": "include_reconciled_entries",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Include Reconciled Entries",
|
"label": "Include Reconciled Entries",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -125,6 +152,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -132,16 +160,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "get_payment_entries",
|
"fieldname": "get_payment_entries",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Get Payment Entries",
|
"label": "Get Payment Entries",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -150,6 +182,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -157,16 +190,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 1,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "payment_entries",
|
"fieldname": "payment_entries",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Payment Entries",
|
"label": "Payment Entries",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -175,6 +212,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -182,16 +220,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "update_clearance_date",
|
"fieldname": "update_clearance_date",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Update Clearance Date",
|
"label": "Update Clearance Date",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -200,6 +242,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -207,16 +250,20 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
"fieldname": "total_amount",
|
"fieldname": "total_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Total Amount",
|
"label": "Total Amount",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -225,6 +272,7 @@
|
|||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
@@ -232,19 +280,19 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 1,
|
"hide_heading": 1,
|
||||||
"hide_toolbar": 1,
|
"hide_toolbar": 1,
|
||||||
"icon": "fa fa-check",
|
"icon": "fa fa-check",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2016-06-28 13:11:09.396353",
|
"modified": "2017-04-21 16:58:26.902732",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Reconciliation",
|
"name": "Bank Reconciliation",
|
||||||
@@ -274,7 +322,8 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"track_seen": 0,
|
"track_changes": 0,
|
||||||
"version": 0
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@@ -72,6 +72,7 @@ class JournalEntry(AccountsController):
|
|||||||
self.update_expense_claim()
|
self.update_expense_claim()
|
||||||
self.update_employee_loan()
|
self.update_employee_loan()
|
||||||
self.unlink_advance_entry_reference()
|
self.unlink_advance_entry_reference()
|
||||||
|
self.unlink_asset_reference()
|
||||||
|
|
||||||
def unlink_advance_entry_reference(self):
|
def unlink_advance_entry_reference(self):
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
@@ -82,6 +83,18 @@ class JournalEntry(AccountsController):
|
|||||||
d.reference_name = ''
|
d.reference_name = ''
|
||||||
d.db_update()
|
d.db_update()
|
||||||
|
|
||||||
|
def unlink_asset_reference(self):
|
||||||
|
for d in self.get("accounts"):
|
||||||
|
if d.reference_type=="Asset" and d.reference_name:
|
||||||
|
asset = frappe.get_doc("Asset", d.reference_name)
|
||||||
|
for s in asset.get("schedules"):
|
||||||
|
if s.journal_entry == self.name:
|
||||||
|
s.db_set("journal_entry", None)
|
||||||
|
asset.value_after_depreciation += s.depreciation_amount
|
||||||
|
|
||||||
|
asset.db_set("value_after_depreciation", asset.value_after_depreciation)
|
||||||
|
asset.set_status()
|
||||||
|
|
||||||
def validate_party(self):
|
def validate_party(self):
|
||||||
for d in self.get("accounts"):
|
for d in self.get("accounts"):
|
||||||
account_type = frappe.db.get_value("Account", d.account, "account_type")
|
account_type = frappe.db.get_value("Account", d.account, "account_type")
|
||||||
@@ -501,7 +514,7 @@ class JournalEntry(AccountsController):
|
|||||||
|
|
||||||
def update_expense_claim(self):
|
def update_expense_claim(self):
|
||||||
for d in self.accounts:
|
for d in self.accounts:
|
||||||
if d.reference_type=="Expense Claim" and d.party:
|
if d.reference_type=="Expense Claim" and d.reference_name:
|
||||||
doc = frappe.get_doc("Expense Claim", d.reference_name)
|
doc = frappe.get_doc("Expense Claim", d.reference_name)
|
||||||
update_reimbursed_amount(doc)
|
update_reimbursed_amount(doc)
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ class PricingRule(Document):
|
|||||||
self.validate_price_or_discount()
|
self.validate_price_or_discount()
|
||||||
self.validate_max_discount()
|
self.validate_max_discount()
|
||||||
|
|
||||||
|
if not self.margin_type: self.margin_rate_or_amount = 0.0
|
||||||
|
|
||||||
def validate_mandatory(self):
|
def validate_mandatory(self):
|
||||||
for field in ["apply_on", "applicable_for"]:
|
for field in ["apply_on", "applicable_for"]:
|
||||||
tocheck = frappe.scrub(self.get(field) or "")
|
tocheck = frappe.scrub(self.get(field) or "")
|
||||||
@@ -143,7 +145,7 @@ def get_pricing_rule_for_item(args):
|
|||||||
})
|
})
|
||||||
|
|
||||||
if args.ignore_pricing_rule or not args.item_code:
|
if args.ignore_pricing_rule or not args.item_code:
|
||||||
if frappe.db.exists(args.doctype, args.name) and args.get("pricing_rule"):
|
if args.get("pricing_rule"):
|
||||||
item_details = remove_pricing_rule(args, item_details)
|
item_details = remove_pricing_rule(args, item_details)
|
||||||
return item_details
|
return item_details
|
||||||
|
|
||||||
@@ -178,7 +180,7 @@ def get_pricing_rule_for_item(args):
|
|||||||
item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
|
item_details.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
|
||||||
if pricing_rule.price_or_discount == "Price":
|
if pricing_rule.price_or_discount == "Price":
|
||||||
item_details.update({
|
item_details.update({
|
||||||
"price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
|
"price_list_rate": (pricing_rule.price/flt(args.conversion_rate)) * args.conversion_factor or 1.0 \
|
||||||
if args.conversion_rate else 0.0,
|
if args.conversion_rate else 0.0,
|
||||||
"discount_percentage": 0.0
|
"discount_percentage": 0.0
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1422,7 +1422,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@@ -1508,7 +1508,7 @@
|
|||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 1,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
@@ -1939,7 +1939,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-17 13:44:17.460674",
|
"modified": "2017-04-19 11:54:16.112134",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice Item",
|
"name": "Purchase Invoice Item",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def get_pos_data():
|
|||||||
'doc': doc,
|
'doc': doc,
|
||||||
'default_customer': pos_profile.get('customer'),
|
'default_customer': pos_profile.get('customer'),
|
||||||
'items': get_items_list(pos_profile),
|
'items': get_items_list(pos_profile),
|
||||||
'item_groups': get_item_group(pos_profile),
|
'item_groups': get_item_groups(pos_profile),
|
||||||
'customers': customers,
|
'customers': customers,
|
||||||
'address': get_customers_address(customers),
|
'address': get_customers_address(customers),
|
||||||
'serial_no_data': get_serial_no_data(pos_profile, doc.company),
|
'serial_no_data': get_serial_no_data(pos_profile, doc.company),
|
||||||
@@ -132,7 +132,7 @@ def get_items_list(pos_profile):
|
|||||||
if pos_profile.get('item_groups'):
|
if pos_profile.get('item_groups'):
|
||||||
# Get items based on the item groups defined in the POS profile
|
# Get items based on the item groups defined in the POS profile
|
||||||
for d in pos_profile.get('item_groups'):
|
for d in pos_profile.get('item_groups'):
|
||||||
item_groups.extend(get_child_nodes('Item Group', d.item_group))
|
item_groups.extend([d.name for d in get_child_nodes('Item Group', d.item_group)])
|
||||||
cond = "item_group in (%s)"%(', '.join(['%s']*len(item_groups)))
|
cond = "item_group in (%s)"%(', '.join(['%s']*len(item_groups)))
|
||||||
|
|
||||||
return frappe.db.sql("""
|
return frappe.db.sql("""
|
||||||
@@ -146,14 +146,19 @@ def get_items_list(pos_profile):
|
|||||||
disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
|
disabled = 0 and has_variants = 0 and is_sales_item = 1 and {cond}
|
||||||
""".format(cond=cond), tuple(item_groups), as_dict=1)
|
""".format(cond=cond), tuple(item_groups), as_dict=1)
|
||||||
|
|
||||||
def get_item_group(pos_profile):
|
def get_item_groups(pos_profile):
|
||||||
|
item_group_dict = {}
|
||||||
if pos_profile.get('item_groups'):
|
if pos_profile.get('item_groups'):
|
||||||
item_groups = []
|
item_groups = []
|
||||||
for d in pos_profile.get('item_groups'):
|
for d in pos_profile.get('item_groups'):
|
||||||
item_groups.extend(get_child_nodes('Item Group', d.item_group))
|
item_groups.extend(get_child_nodes('Item Group', d.item_group))
|
||||||
return item_groups
|
|
||||||
else:
|
else:
|
||||||
return frappe.db.sql_list("""Select name from `tabItem Group` order by name""")
|
item_groups = frappe.db.sql("""Select name,
|
||||||
|
lft, rgt from `tabItem Group` order by lft""", as_dict=1)
|
||||||
|
|
||||||
|
for data in item_groups:
|
||||||
|
item_group_dict[data.name] = [data.lft, data.rgt]
|
||||||
|
return item_group_dict
|
||||||
|
|
||||||
def get_customers_list(pos_profile):
|
def get_customers_list(pos_profile):
|
||||||
cond = "1=1"
|
cond = "1=1"
|
||||||
@@ -161,7 +166,7 @@ def get_customers_list(pos_profile):
|
|||||||
if pos_profile.get('customer_groups'):
|
if pos_profile.get('customer_groups'):
|
||||||
# Get customers based on the customer groups defined in the POS profile
|
# Get customers based on the customer groups defined in the POS profile
|
||||||
for d in pos_profile.get('customer_groups'):
|
for d in pos_profile.get('customer_groups'):
|
||||||
customer_groups.extend(get_child_nodes('Customer Group', d.customer_group))
|
customer_groups.extend([d.name for d in get_child_nodes('Customer Group', d.customer_group)])
|
||||||
cond = "customer_group in (%s)"%(', '.join(['%s']*len(customer_groups)))
|
cond = "customer_group in (%s)"%(', '.join(['%s']*len(customer_groups)))
|
||||||
|
|
||||||
return frappe.db.sql(""" select name, customer_name, customer_group,
|
return frappe.db.sql(""" select name, customer_name, customer_group,
|
||||||
@@ -187,8 +192,8 @@ def get_customers_address(customers):
|
|||||||
|
|
||||||
def get_child_nodes(group_type, root):
|
def get_child_nodes(group_type, root):
|
||||||
lft, rgt = frappe.db.get_value(group_type, root, ["lft", "rgt"])
|
lft, rgt = frappe.db.get_value(group_type, root, ["lft", "rgt"])
|
||||||
return frappe.db.sql_list(""" Select name from `tab{tab}` where
|
return frappe.db.sql(""" Select name, lft, rgt from `tab{tab}` where
|
||||||
lft >= {lft} and rgt <= {rgt}""".format(tab=group_type, lft=lft, rgt=rgt))
|
lft >= {lft} and rgt <= {rgt} order by lft""".format(tab=group_type, lft=lft, rgt=rgt), as_dict=1)
|
||||||
|
|
||||||
def get_serial_no_data(pos_profile, company):
|
def get_serial_no_data(pos_profile, company):
|
||||||
# get itemwise serial no data
|
# get itemwise serial no data
|
||||||
|
|||||||
@@ -147,9 +147,9 @@
|
|||||||
"price_list_rate": 50,
|
"price_list_rate": 50,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
"rate": 50,
|
"rate": 50,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM 1",
|
||||||
"conversion_factor": 1,
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM 1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cost_center": "_Test Cost Center - _TC",
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
@@ -273,9 +273,9 @@
|
|||||||
"parentfield": "items",
|
"parentfield": "items",
|
||||||
"price_list_rate": 62.5,
|
"price_list_rate": 62.5,
|
||||||
"qty": 10,
|
"qty": 10,
|
||||||
"uom": "_Test UOM",
|
"uom": "_Test UOM 1",
|
||||||
"conversion_factor": 1,
|
"conversion_factor": 1,
|
||||||
"stock_uom": "_Test UOM"
|
"stock_uom": "_Test UOM 1"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1043,6 +1043,25 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
#check outstanding after advance cancellation
|
#check outstanding after advance cancellation
|
||||||
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
|
self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount")))
|
||||||
|
|
||||||
|
def test_multiple_uom_in_selling(self):
|
||||||
|
si = frappe.copy_doc(test_records[1])
|
||||||
|
|
||||||
|
si.items[0].uom = "_Test UOM 1"
|
||||||
|
si.items[0].conversion_factor = None
|
||||||
|
si.items[0].price_list_rate = None
|
||||||
|
si.save()
|
||||||
|
|
||||||
|
expected_values = {
|
||||||
|
"keys": ["price_list_rate", "stock_uom", "uom", "conversion_factor", "rate", "amount",
|
||||||
|
"base_price_list_rate", "base_rate", "base_amount"],
|
||||||
|
"_Test Item": [1000, "_Test UOM", "_Test UOM 1", 10.0, 1000, 1000, 1000, 1000, 1000]
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if the conversion_factor and price_list_rate is calculated according to uom
|
||||||
|
for d in si.get("items"):
|
||||||
|
for i, k in enumerate(expected_values["keys"]):
|
||||||
|
self.assertEquals(d.get(k), expected_values[d.item_code][i])
|
||||||
|
|
||||||
def create_sales_invoice(**args):
|
def create_sales_invoice(**args):
|
||||||
si = frappe.new_doc("Sales Invoice")
|
si = frappe.new_doc("Sales Invoice")
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|||||||
@@ -1548,7 +1548,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
@@ -2094,7 +2094,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-05 23:28:13.520429",
|
"modified": "2017-04-19 11:53:26.682964",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice Item",
|
"name": "Sales Invoice Item",
|
||||||
|
|||||||
@@ -407,8 +407,8 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.search_item_group = this.wrapper.find('.search-item-group');
|
this.search_item_group = this.wrapper.find('.search-item-group');
|
||||||
|
sorted_item_groups = this.get_sorted_item_groups()
|
||||||
var dropdown_html = me.item_groups.map(function(item_group) {
|
var dropdown_html = sorted_item_groups.map(function(item_group) {
|
||||||
return "<li><a class='option' data-value='"+item_group+"'>"+item_group+"</a></li>";
|
return "<li><a class='option' data-value='"+item_group+"'>"+item_group+"</a></li>";
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
||||||
@@ -437,6 +437,15 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get_sorted_item_groups: function() {
|
||||||
|
list = {}
|
||||||
|
$.each(this.item_groups, function(i, data) {
|
||||||
|
list[i] = data[0]
|
||||||
|
})
|
||||||
|
|
||||||
|
return Object.keys(list).sort(function(a,b){return list[a]-list[b]})
|
||||||
|
},
|
||||||
|
|
||||||
toggle_more_btn: function() {
|
toggle_more_btn: function() {
|
||||||
if(!this.items || this.items.length <= this.page_len) {
|
if(!this.items || this.items.length <= this.page_len) {
|
||||||
this.wrapper.find(".btn-more").hide();
|
this.wrapper.find(".btn-more").hide();
|
||||||
@@ -1091,9 +1100,9 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
// $(me.wrapper).find(".pos-item-wrapper").on("click", function () {
|
// $(me.wrapper).find(".pos-item-wrapper").on("click", function () {
|
||||||
$(this.wrapper).on("click", ".pos-item-wrapper", function () {
|
$(this.wrapper).on("click", ".pos-item-wrapper", function () {
|
||||||
me.item_code = '';
|
me.item_code = '';
|
||||||
|
me.customer_validate();
|
||||||
if($(me.pos_bill).is(":hidden")) return;
|
if($(me.pos_bill).is(":hidden")) return;
|
||||||
|
|
||||||
me.customer_validate();
|
|
||||||
if (me.frm.doc.docstatus == 0) {
|
if (me.frm.doc.docstatus == 0) {
|
||||||
me.items = me.get_items($(this).attr("data-item-code"))
|
me.items = me.get_items($(this).attr("data-item-code"))
|
||||||
me.add_to_cart();
|
me.add_to_cart();
|
||||||
@@ -1768,7 +1777,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
return $.grep(this.pricing_rules, function (data) {
|
return $.grep(this.pricing_rules, function (data) {
|
||||||
if (item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty))) {
|
if (item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty))) {
|
||||||
if (data.item_code == item.item_code || in_list(['All Item Groups', item.item_group], data.item_group) || item.brand == data.brand) {
|
if (me.validate_item_condition(data, item)) {
|
||||||
if (in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)) {
|
if (in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)) {
|
||||||
return me.validate_condition(data)
|
return me.validate_condition(data)
|
||||||
} else {
|
} else {
|
||||||
@@ -1779,6 +1788,26 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
validate_item_condition: function (data, item) {
|
||||||
|
var apply_on = frappe.model.scrub(data.apply_on);
|
||||||
|
|
||||||
|
return (data.apply_on == 'Item Group')
|
||||||
|
? this.validate_item_group(data.item_group, item.item_group) : (data[apply_on] == item[apply_on]);
|
||||||
|
},
|
||||||
|
|
||||||
|
validate_item_group: function (pr_item_group, cart_item_group) {
|
||||||
|
//pr_item_group = pricing rule's item group
|
||||||
|
//cart_item_group = cart item's item group
|
||||||
|
//this.item_groups has information about item group's lft and rgt
|
||||||
|
//for example: {'Foods': [12, 19]}
|
||||||
|
|
||||||
|
pr_item_group = this.item_groups[pr_item_group]
|
||||||
|
cart_item_group = this.item_groups[cart_item_group]
|
||||||
|
|
||||||
|
return (cart_item_group[0] >= pr_item_group[0] &&
|
||||||
|
cart_item_group[1] <= pr_item_group[1])
|
||||||
|
},
|
||||||
|
|
||||||
validate_condition: function (data) {
|
validate_condition: function (data) {
|
||||||
//This method check condition based on applicable for
|
//This method check condition based on applicable for
|
||||||
condition = this.get_mapper_for_pricing_rule(data)[data.applicable_for]
|
condition = this.get_mapper_for_pricing_rule(data)[data.applicable_for]
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Print Format",
|
"doctype": "Print Format",
|
||||||
"font": "Default",
|
"font": "Default",
|
||||||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }}{{offline_pos_name}}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tfont-family: Monospace;\n\t\tline-height: 200%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n<p class=\"text-center\">\n\t{{ company }}<br>\n\t{{ __(\"POS No : \") }} {{ offline_pos_name }}<br>\n</p>\n<p>\n\t<b>{{ __(\"Date\") }}:</b> {{ dateutil.global_date_format(posting_date) }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed cart no-border\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"50%\">{{ __(\"Item\") }}</b></th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Qty\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ __(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{% for item in items %}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_name }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ format_number(item.qty, null,precision(\"difference\")) }}<br>@ {{ format_currency(item.rate, currency) }}</td>\n\t\t\t<td class=\"text-right\">{{ format_currency(item.amount, currency) }}</td>\n\t\t</tr>\n\t\t{% endfor %}\n\t</tbody>\n</table>\n\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% for row in taxes %}\n\t\t{% if not row.included_in_print_rate %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 70%\">\n\t\t\t\t{{ row.description }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t{% endfor %}\n\t\t{% if discount_amount %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{% endif %}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 75%\">\n\t\t\t\t<b>{{ __(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n\n<hr>\n<p>{{ terms }}</p>\n<p class=\"text-center\">{{ __(\"Thank you, please visit again.\") }}</p>",
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"line_breaks": 0,
|
"line_breaks": 0,
|
||||||
"modified": "2017-04-17 12:12:00.153763",
|
"modified": "2017-04-19 13:28:05.129504",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Point of Sale",
|
"name": "Point of Sale",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
|
||||||
|
{% if(letterhead) { %}
|
||||||
<div style="margin-bottom: 7px;" class="text-center">
|
<div style="margin-bottom: 7px;" class="text-center">
|
||||||
{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
|
{%= frappe.boot.letter_heads[letterhead].header %}
|
||||||
</div>
|
</div>
|
||||||
|
{% } %}
|
||||||
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
||||||
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
|
<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
|
||||||
<h5 class="text-center">
|
<h5 class="text-center">
|
||||||
|
|||||||
@@ -16,6 +16,21 @@ frappe.query_reports["Accounts Receivable"] = {
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Customer"
|
"options": "Customer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"customer_group",
|
||||||
|
"label": __("Customer Group"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Customer Group"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"credit_days_based_on",
|
||||||
|
"label": __("Credit Days Based On"),
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"options": "" + NEWLINE + "Fixed Days" + NEWLINE + "Last Day of the Next Month"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldtype": "Break",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"report_date",
|
"fieldname":"report_date",
|
||||||
"label": __("As on Date"),
|
"label": __("As on Date"),
|
||||||
@@ -29,9 +44,6 @@ frappe.query_reports["Accounts Receivable"] = {
|
|||||||
"options": 'Posting Date' + NEWLINE + 'Due Date',
|
"options": 'Posting Date' + NEWLINE + 'Due Date',
|
||||||
"default": "Posting Date"
|
"default": "Posting Date"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldtype": "Break",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname":"range1",
|
"fieldname":"range1",
|
||||||
"label": __("Ageing Range 1"),
|
"label": __("Ageing Range 1"),
|
||||||
|
|||||||
@@ -71,7 +71,10 @@ class ReceivablePayableReport(object):
|
|||||||
"width": 100
|
"width": 100
|
||||||
})
|
})
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
columns += [_("Territory") + ":Link/Territory:80"]
|
columns += [
|
||||||
|
_("Territory") + ":Link/Territory:80",
|
||||||
|
_("Customer Group") + ":Link/Customer Group:120"
|
||||||
|
]
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
|
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
|
||||||
|
|
||||||
@@ -139,7 +142,7 @@ class ReceivablePayableReport(object):
|
|||||||
|
|
||||||
# customer territory / supplier type
|
# customer territory / supplier type
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
row += [self.get_territory(gle.party)]
|
row += [self.get_territory(gle.party), self.get_customer_group(gle.party)]
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
row += [self.get_supplier_type(gle.party)]
|
row += [self.get_supplier_type(gle.party)]
|
||||||
|
|
||||||
@@ -187,18 +190,21 @@ class ReceivablePayableReport(object):
|
|||||||
def get_territory(self, party_name):
|
def get_territory(self, party_name):
|
||||||
return self.get_party_map("Customer").get(party_name, {}).get("territory") or ""
|
return self.get_party_map("Customer").get(party_name, {}).get("territory") or ""
|
||||||
|
|
||||||
|
def get_customer_group(self, party_name):
|
||||||
|
return self.get_party_map("Customer").get(party_name, {}).get("customer_group") or ""
|
||||||
|
|
||||||
def get_supplier_type(self, party_name):
|
def get_supplier_type(self, party_name):
|
||||||
return self.get_party_map("Supplier").get(party_name, {}).get("supplier_type") or ""
|
return self.get_party_map("Supplier").get(party_name, {}).get("supplier_type") or ""
|
||||||
|
|
||||||
def get_party_map(self, party_type):
|
def get_party_map(self, party_type):
|
||||||
if not hasattr(self, "party_map"):
|
if not hasattr(self, "party_map"):
|
||||||
if party_type == "Customer":
|
if party_type == "Customer":
|
||||||
self.party_map = dict(((r.name, r) for r in frappe.db.sql("""select {0}, {1}, {2} from `tab{3}`"""
|
select_fields = "name, customer_name, territory, customer_group"
|
||||||
.format("name", "customer_name", "territory", party_type), as_dict=True)))
|
|
||||||
|
|
||||||
elif party_type == "Supplier":
|
elif party_type == "Supplier":
|
||||||
self.party_map = dict(((r.name, r) for r in frappe.db.sql("""select {0}, {1}, {2} from `tab{3}`"""
|
select_fields = "name, supplier_name, supplier_type"
|
||||||
.format("name", "supplier_name", "supplier_type", party_type), as_dict=True)))
|
|
||||||
|
self.party_map = dict(((r.name, r) for r in frappe.db.sql("select {0} from `tab{1}`"
|
||||||
|
.format(select_fields, party_type), as_dict=True)))
|
||||||
|
|
||||||
return self.party_map
|
return self.party_map
|
||||||
|
|
||||||
@@ -251,6 +257,19 @@ class ReceivablePayableReport(object):
|
|||||||
conditions.append("party=%s")
|
conditions.append("party=%s")
|
||||||
values.append(self.filters.get(party_type_field))
|
values.append(self.filters.get(party_type_field))
|
||||||
|
|
||||||
|
if party_type_field=="customer":
|
||||||
|
if self.filters.get("customer_group"):
|
||||||
|
lft, rgt = frappe.db.get_value("Customer Group",
|
||||||
|
self.filters.get("customer_group"), ["lft", "rgt"])
|
||||||
|
|
||||||
|
conditions.append("""party in (select name from tabCustomer
|
||||||
|
where exists(select name from `tabCustomer Group` where lft >= {0} and rgt <= {1}
|
||||||
|
and name=tabCustomer.customer_group))""".format(lft, rgt))
|
||||||
|
|
||||||
|
if self.filters.get("credit_days_based_on"):
|
||||||
|
conditions.append("party in (select name from tabCustomer where credit_days_based_on=%s)")
|
||||||
|
values.append(self.filters.get("credit_days_based_on"))
|
||||||
|
|
||||||
return " and ".join(conditions), values
|
return " and ".join(conditions), values
|
||||||
|
|
||||||
def get_gl_entries_for(self, party, party_type, against_voucher_type, against_voucher):
|
def get_gl_entries_for(self, party, party_type, against_voucher_type, against_voucher):
|
||||||
|
|||||||
@@ -16,6 +16,21 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Customer"
|
"options": "Customer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"customer_group",
|
||||||
|
"label": __("Customer Group"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Customer Group"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"credit_days_based_on",
|
||||||
|
"label": __("Credit Days Based On"),
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"options": "" + NEWLINE + "Fixed Days" + NEWLINE + "Last Day of the Next Month"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldtype": "Break",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"report_date",
|
"fieldname":"report_date",
|
||||||
"label": __("Date"),
|
"label": __("Date"),
|
||||||
@@ -29,9 +44,6 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
|||||||
"options": 'Posting Date' + NEWLINE + 'Due Date',
|
"options": 'Posting Date' + NEWLINE + 'Due Date',
|
||||||
"default": "Posting Date"
|
"default": "Posting Date"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldtype": "Break",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname":"range1",
|
"fieldname":"range1",
|
||||||
"label": __("Ageing Range 1"),
|
"label": __("Ageing Range 1"),
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
str(self.filters.range3) + _("-Above") + ":Currency/currency:100"]
|
str(self.filters.range3) + _("-Above") + ":Currency/currency:100"]
|
||||||
|
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
columns += [_("Territory") + ":Link/Territory:80"]
|
columns += [
|
||||||
|
_("Territory") + ":Link/Territory:80",
|
||||||
|
_("Customer Group") + ":Link/Customer Group:120"
|
||||||
|
]
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
|
columns += [_("Supplier Type") + ":Link/Supplier Type:80"]
|
||||||
|
|
||||||
@@ -58,7 +61,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
]
|
]
|
||||||
|
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
row += [self.get_territory(party)]
|
row += [self.get_territory(party), self.get_customer_group(party)]
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
row += [self.get_supplier_type(party)]
|
row += [self.get_supplier_type(party)]
|
||||||
|
|
||||||
@@ -107,7 +110,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
cols += ["supplier_type", "remarks"]
|
cols += ["supplier_type", "remarks"]
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
cols += ["territory", "remarks"]
|
cols += ["territory", "customer_group", "remarks"]
|
||||||
|
|
||||||
return self.make_data_dict(cols, voucherwise_data)
|
return self.make_data_dict(cols, voucherwise_data)
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
frappe.require("assets/erpnext/js/financial_statements.js", function() {
|
frappe.require("assets/erpnext/js/financial_statements.js", function() {
|
||||||
frappe.query_reports["Balance Sheet"] = erpnext.financial_statements;
|
frappe.query_reports["Balance Sheet"] = erpnext.financial_statements;
|
||||||
|
|
||||||
|
frappe.query_reports["Balance Sheet"]["filters"].push({
|
||||||
|
"fieldname": "accumulated_values",
|
||||||
|
"label": __("Accumulated Values"),
|
||||||
|
"fieldtype": "Check"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,23 @@ from frappe.utils import flt, cint
|
|||||||
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
|
from erpnext.accounts.report.financial_statements import (get_period_list, get_columns, get_data)
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year, filters.periodicity, filters.company)
|
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
||||||
|
filters.periodicity, filters.accumulated_values, filters.company)
|
||||||
|
|
||||||
asset = get_data(filters.company, "Asset", "Debit", period_list, only_current_fiscal_year=False)
|
asset = get_data(filters.company, "Asset", "Debit", period_list,
|
||||||
liability = get_data(filters.company, "Liability", "Credit", period_list, only_current_fiscal_year=False)
|
only_current_fiscal_year=False, filters=filters,
|
||||||
equity = get_data(filters.company, "Equity", "Credit", period_list, only_current_fiscal_year=False)
|
accumulated_values=filters.accumulated_values,
|
||||||
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy=True)
|
||||||
|
|
||||||
|
liability = get_data(filters.company, "Liability", "Credit", period_list,
|
||||||
|
only_current_fiscal_year=False, filters=filters,
|
||||||
|
accumulated_values=filters.accumulated_values,
|
||||||
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy=True)
|
||||||
|
|
||||||
|
equity = get_data(filters.company, "Equity", "Credit", period_list,
|
||||||
|
only_current_fiscal_year=False, filters=filters,
|
||||||
|
accumulated_values=filters.accumulated_values,
|
||||||
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy=True)
|
||||||
|
|
||||||
provisional_profit_loss, total_credit = get_provisional_profit_loss(asset, liability, equity,
|
provisional_profit_loss, total_credit = get_provisional_profit_loss(asset, liability, equity,
|
||||||
period_list, filters.company)
|
period_list, filters.company)
|
||||||
@@ -43,9 +55,9 @@ def execute(filters=None):
|
|||||||
if total_credit:
|
if total_credit:
|
||||||
data.append(total_credit)
|
data.append(total_credit)
|
||||||
|
|
||||||
columns = get_columns(filters.periodicity, period_list, company=filters.company)
|
columns = get_columns(filters.periodicity, period_list, filters.accumulated_values, company=filters.company)
|
||||||
|
|
||||||
chart = get_chart_data(columns, asset, liability, equity)
|
chart = get_chart_data(filters, columns, asset, liability, equity)
|
||||||
|
|
||||||
return columns, data, message, chart
|
return columns, data, message, chart
|
||||||
|
|
||||||
@@ -107,7 +119,7 @@ def check_opening_balance(asset, liability, equity):
|
|||||||
return _("Previous Financial Year is not closed"),opening_balance
|
return _("Previous Financial Year is not closed"),opening_balance
|
||||||
return None,None
|
return None,None
|
||||||
|
|
||||||
def get_chart_data(columns, asset, liability, equity):
|
def get_chart_data(filters, columns, asset, liability, equity):
|
||||||
x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
|
x_intervals = ['x'] + [d.get("label") for d in columns[2:]]
|
||||||
|
|
||||||
asset_data, liability_data, equity_data = [], [], []
|
asset_data, liability_data, equity_data = [], [], []
|
||||||
@@ -128,9 +140,14 @@ def get_chart_data(columns, asset, liability, equity):
|
|||||||
if equity_data:
|
if equity_data:
|
||||||
columns.append(["Equity"] + equity_data)
|
columns.append(["Equity"] + equity_data)
|
||||||
|
|
||||||
return {
|
chart = {
|
||||||
"data": {
|
"data": {
|
||||||
'x': 'x',
|
'x': 'x',
|
||||||
'columns': columns
|
'columns': columns
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not filters.accumulated_values:
|
||||||
|
chart["chart_type"] = "bar"
|
||||||
|
|
||||||
|
return chart
|
||||||
@@ -22,7 +22,8 @@ frappe.query_reports["Bank Clearance Summary"] = {
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"default": locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
|
"default": frappe.defaults.get_user_default("Company")?
|
||||||
|
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
|
||||||
"get_query": function() {
|
"get_query": function() {
|
||||||
return {
|
return {
|
||||||
"query": "erpnext.controllers.queries.get_account_list",
|
"query": "erpnext.controllers.queries.get_account_list",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ frappe.query_reports["Bank Reconciliation Statement"] = {
|
|||||||
"label": __("Bank Account"),
|
"label": __("Bank Account"),
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"default": locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
|
"default": frappe.defaults.get_user_default("Company")?
|
||||||
|
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"get_query": function() {
|
"get_query": function() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from erpnext.accounts.utils import get_fiscal_year
|
|||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
||||||
filters.periodicity, filters.company)
|
filters.periodicity, filters.accumulated_values, filters.company)
|
||||||
|
|
||||||
operation_accounts = {
|
operation_accounts = {
|
||||||
"section_name": "Operations",
|
"section_name": "Operations",
|
||||||
|
|||||||
@@ -13,12 +13,16 @@
|
|||||||
height: 37px;
|
height: 37px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
|
||||||
|
{% if(letterhead) { %}
|
||||||
<div style="margin-bottom: 7px;" class="text-center">
|
<div style="margin-bottom: 7px;" class="text-center">
|
||||||
{%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
|
{%= frappe.boot.letter_heads[letterhead].header %}
|
||||||
</div>
|
</div>
|
||||||
|
{% } %}
|
||||||
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
<h2 class="text-center">{%= __(report.report_name) %}</h2>
|
||||||
<h4 class="text-center">{%= filters.company %}</h3>
|
<h3 class="text-center">{%= filters.company %}</h3>
|
||||||
<h4 class="text-center">{%= filters.fiscal_year %}</h3>
|
<h3 class="text-center">{%= filters.fiscal_year %}</h3>
|
||||||
|
<h5 class="text-center">{%= __("Currency") %} : {%= erpnext.get_currency(filters.company) %} </h4>
|
||||||
{% if (filters.from_date) { %}
|
{% if (filters.from_date) { %}
|
||||||
<h4 class="text-center">{%= dateutil.str_to_user(filters.from_date) %} - {%= dateutil.str_to_user(filters.to_date) %}</h3>
|
<h4 class="text-center">{%= dateutil.str_to_user(filters.from_date) %} - {%= dateutil.str_to_user(filters.to_date) %}</h3>
|
||||||
{% } %}
|
{% } %}
|
||||||
@@ -47,7 +51,7 @@
|
|||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% var fieldname = report.columns[i].field; %}
|
{% var fieldname = report.columns[i].field; %}
|
||||||
{% if (!is_null(row[fieldname])) { %}
|
{% if (!is_null(row[fieldname])) { %}
|
||||||
{%= format_currency(row[fieldname], row.currency) %}
|
{%= format_number(row[fieldname], null)%}
|
||||||
{% } %}
|
{% } %}
|
||||||
</td>
|
</td>
|
||||||
{% } %}
|
{% } %}
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
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, get_last_day, date_diff,
|
||||||
|
add_months, add_days, formatdate, cint)
|
||||||
|
|
||||||
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, company):
|
def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, accumulated_values=False, company=None):
|
||||||
"""Get a list of dict {"from_date": from_date, "to_date": to_date, "key": key, "label": label}
|
"""Get a list of dict {"from_date": from_date, "to_date": to_date, "key": key, "label": label}
|
||||||
Periodicity can be (Yearly, Quarterly, Monthly)"""
|
Periodicity can be (Yearly, Quarterly, Monthly)"""
|
||||||
|
|
||||||
@@ -58,10 +59,13 @@ def get_period_list(from_fiscal_year, to_fiscal_year, periodicity, company):
|
|||||||
# common processing
|
# common processing
|
||||||
for opts in period_list:
|
for opts in period_list:
|
||||||
key = opts["to_date"].strftime("%b_%Y").lower()
|
key = opts["to_date"].strftime("%b_%Y").lower()
|
||||||
if periodicity == "Monthly":
|
if periodicity == "Monthly" and not accumulated_values:
|
||||||
label = formatdate(opts["to_date"], "MMM YYYY")
|
label = formatdate(opts["to_date"], "MMM YYYY")
|
||||||
else:
|
else:
|
||||||
label = get_label(periodicity, opts["from_date"], opts["to_date"])
|
if not accumulated_values:
|
||||||
|
label = get_label(periodicity, opts["from_date"], opts["to_date"])
|
||||||
|
else:
|
||||||
|
label = get_label(periodicity, period_list[0]["from_date"], opts["to_date"])
|
||||||
|
|
||||||
opts.update({
|
opts.update({
|
||||||
"key": key.replace(" ", "_").replace("-", "_"),
|
"key": key.replace(" ", "_").replace("-", "_"),
|
||||||
@@ -139,7 +143,8 @@ def calculate_values(accounts_by_name, gl_entries_by_account, period_list, accum
|
|||||||
|
|
||||||
if entry.posting_date <= period.to_date:
|
if entry.posting_date <= period.to_date:
|
||||||
if (accumulated_values or entry.posting_date >= period.from_date) and \
|
if (accumulated_values or entry.posting_date >= period.from_date) and \
|
||||||
(not ignore_accumulated_values_for_fy or entry.fiscal_year == period.to_date_fiscal_year):
|
(not ignore_accumulated_values_for_fy or
|
||||||
|
entry.fiscal_year == period.to_date_fiscal_year):
|
||||||
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
|
d[period.key] = d.get(period.key, 0.0) + flt(entry.debit) - flt(entry.credit)
|
||||||
|
|
||||||
if entry.posting_date < period_list[0].year_start_date:
|
if entry.posting_date < period_list[0].year_start_date:
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
{% var letterhead= filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head"); %}
|
||||||
|
{% if(letterhead) { %}
|
||||||
<div style="margin-bottom: 7px;" class="text-center">
|
<div style="margin-bottom: 7px;" class="text-center">
|
||||||
{%= frappe.boot.letter_heads[filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}
|
{%= frappe.boot.letter_heads[letterhead].header %}
|
||||||
</div>
|
</div>
|
||||||
|
{% } %}
|
||||||
<h2 class="text-center">{%= __("Statement of Account") %}</h2>
|
<h2 class="text-center">{%= __("Statement of Account") %}</h2>
|
||||||
<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}</h4>
|
<h4 class="text-center">{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}</h4>
|
||||||
<h5 class="text-center">
|
<h5 class="text-center">
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ from erpnext.accounts.report.financial_statements import (get_period_list, get_c
|
|||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
period_list = get_period_list(filters.from_fiscal_year, filters.to_fiscal_year,
|
||||||
filters.periodicity, filters.company)
|
filters.periodicity, filters.accumulated_values, filters.company)
|
||||||
|
|
||||||
income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
|
income = get_data(filters.company, "Income", "Credit", period_list, filters = filters,
|
||||||
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
accumulated_values=filters.accumulated_values,
|
||||||
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
||||||
|
|
||||||
expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
|
expense = get_data(filters.company, "Expense", "Debit", period_list, filters=filters,
|
||||||
accumulated_values=filters.accumulated_values, ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
accumulated_values=filters.accumulated_values,
|
||||||
|
ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
|
||||||
|
|
||||||
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
|
net_profit_loss = get_net_profit_loss(income, expense, period_list, filters.company)
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
|
import frappe.defaults
|
||||||
from frappe.utils import nowdate, cstr, flt, cint, now, getdate
|
from frappe.utils import nowdate, cstr, flt, cint, now, getdate
|
||||||
from frappe import throw, _
|
from frappe import throw, _
|
||||||
from frappe.utils import formatdate
|
from frappe.utils import formatdate, get_number_format_info
|
||||||
|
|
||||||
# imported to enable erpnext.accounts.utils.get_account_currency
|
# imported to enable erpnext.accounts.utils.get_account_currency
|
||||||
from erpnext.accounts.doctype.account.account import get_account_currency
|
from erpnext.accounts.doctype.account.account import get_account_currency
|
||||||
import frappe.defaults
|
|
||||||
from erpnext.accounts.report.financial_statements import sort_root_accounts
|
from erpnext.accounts.report.financial_statements import sort_root_accounts
|
||||||
|
|
||||||
class FiscalYearError(frappe.ValidationError): pass
|
class FiscalYearError(frappe.ValidationError): pass
|
||||||
@@ -537,14 +537,13 @@ def get_stock_and_account_difference(account_list=None, posting_date=None):
|
|||||||
|
|
||||||
return difference
|
return difference
|
||||||
|
|
||||||
def get_currency_precision(currency=None):
|
def get_currency_precision():
|
||||||
if not currency:
|
precision = cint(frappe.db.get_default("currency_precision"))
|
||||||
currency = frappe.db.get_value("Company",
|
if not precision:
|
||||||
frappe.db.get_default("Company"), "default_currency", cache=True)
|
number_format = frappe.db.get_default("number_format") or "#,###.##"
|
||||||
currency_format = frappe.db.get_value("Currency", currency, "number_format", cache=True)
|
precision = get_number_format_info(number_format)[2]
|
||||||
|
|
||||||
from frappe.utils import get_number_format_info
|
return precision
|
||||||
return get_number_format_info(currency_format)[2]
|
|
||||||
|
|
||||||
def get_stock_rbnb_difference(posting_date, company):
|
def get_stock_rbnb_difference(posting_date, company):
|
||||||
stock_items = frappe.db.sql_list("""select distinct item_code
|
stock_items = frappe.db.sql_list("""select distinct item_code
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
@@ -341,7 +342,7 @@
|
|||||||
"remember_last_selected_value": 1,
|
"remember_last_selected_value": 1,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
@@ -1207,6 +1208,8 @@
|
|||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Link to material requests",
|
"label": "Link to material requests",
|
||||||
@@ -3185,18 +3188,18 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 105,
|
"idx": 105,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-02-28 18:20:15.650815",
|
"modified": "2017-04-18 18:49:49.535066",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Purchase Order",
|
"name": "Purchase Order",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ from frappe import _
|
|||||||
def get_data():
|
def get_data():
|
||||||
return {
|
return {
|
||||||
'fieldname': 'purchase_order',
|
'fieldname': 'purchase_order',
|
||||||
|
'non_standard_fieldnames': {
|
||||||
|
'Journal Entry': 'reference_name',
|
||||||
|
'Payment Entry': 'reference_name'
|
||||||
|
},
|
||||||
'internal_links': {
|
'internal_links': {
|
||||||
'Material Request': ['items', 'material_request'],
|
'Material Request': ['items', 'material_request'],
|
||||||
'Supplier Quotation': ['items', 'supplier_quotation'],
|
'Supplier Quotation': ['items', 'supplier_quotation'],
|
||||||
@@ -13,6 +17,10 @@ def get_data():
|
|||||||
'label': _('Related'),
|
'label': _('Related'),
|
||||||
'items': ['Purchase Receipt', 'Purchase Invoice']
|
'items': ['Purchase Receipt', 'Purchase Invoice']
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'label': _('Payment'),
|
||||||
|
'items': ['Payment Entry', 'Journal Entry']
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'label': _('Reference'),
|
'label': _('Reference'),
|
||||||
'items': ['Material Request', 'Supplier Quotation', 'Project']
|
'items': ['Material Request', 'Supplier Quotation', 'Project']
|
||||||
@@ -20,6 +28,6 @@ def get_data():
|
|||||||
{
|
{
|
||||||
'label': _('Sub-contracting'),
|
'label': _('Sub-contracting'),
|
||||||
'items': ['Stock Entry']
|
'items': ['Stock Entry']
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"autoname": "hash",
|
"autoname": "hash",
|
||||||
@@ -98,7 +99,7 @@
|
|||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
@@ -156,7 +157,7 @@
|
|||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
@@ -799,6 +800,7 @@
|
|||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
"print_width": "100px",
|
"print_width": "100px",
|
||||||
@@ -1647,17 +1649,17 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-02-17 16:44:55.434162",
|
"modified": "2017-04-25 18:49:08.604055",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Purchase Order Item",
|
"name": "Purchase Order Item",
|
||||||
|
|||||||
@@ -159,6 +159,11 @@ def get_data():
|
|||||||
"is_query_report": True,
|
"is_query_report": True,
|
||||||
"doctype": "Journal Entry"
|
"doctype": "Journal Entry"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Bank Guarantee",
|
||||||
|
"doctype": "Bank Guarantee"
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,6 +68,18 @@ def get_data():
|
|||||||
"name": "Inactive Customers",
|
"name": "Inactive Customers",
|
||||||
"doctype": "Sales Order"
|
"doctype": "Sales Order"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Campaign Efficiency",
|
||||||
|
"doctype": "Lead"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Lead Owner Efficiency",
|
||||||
|
"doctype": "Lead"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -186,15 +186,19 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
ret = get_item_details(args)
|
ret = get_item_details(args)
|
||||||
|
|
||||||
|
|
||||||
for fieldname, value in ret.items():
|
for fieldname, value in ret.items():
|
||||||
if item.meta.get_field(fieldname) and value is not None:
|
if item.meta.get_field(fieldname) and value is not None:
|
||||||
if (item.get(fieldname) is None or fieldname in force_item_fields):
|
if (item.get(fieldname) is None or fieldname in force_item_fields):
|
||||||
item.set(fieldname, value)
|
item.set(fieldname, value)
|
||||||
|
|
||||||
elif fieldname == "cost_center" and not item.get("cost_center"):
|
elif fieldname in ['cost_center', 'conversion_factor'] and not item.get(fieldname):
|
||||||
item.set(fieldname, value)
|
item.set(fieldname, value)
|
||||||
|
|
||||||
|
elif fieldname == "serial_no":
|
||||||
|
stock_qty = item.get("stock_qty") * -1 if item.get("stock_qty") < 0 else item.get("stock_qty")
|
||||||
|
if stock_qty != len(item.get('serial_no').split('\n')):
|
||||||
|
item.set(fieldname, value)
|
||||||
|
|
||||||
elif fieldname == "conversion_factor" and not item.get("conversion_factor"):
|
elif fieldname == "conversion_factor" and not item.get("conversion_factor"):
|
||||||
item.set(fieldname, value)
|
item.set(fieldname, value)
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class SellingController(StockController):
|
|||||||
|
|
||||||
# set contact and address details for customer, if they are not mentioned
|
# set contact and address details for customer, if they are not mentioned
|
||||||
self.set_missing_lead_customer_details()
|
self.set_missing_lead_customer_details()
|
||||||
self.set_price_list_and_item_details()
|
self.set_price_list_and_item_details(for_validate=for_validate)
|
||||||
|
|
||||||
def set_missing_lead_customer_details(self):
|
def set_missing_lead_customer_details(self):
|
||||||
if getattr(self, "customer", None):
|
if getattr(self, "customer", None):
|
||||||
@@ -60,9 +60,9 @@ class SellingController(StockController):
|
|||||||
posting_date=self.get('transaction_date') or self.get('posting_date'),
|
posting_date=self.get('transaction_date') or self.get('posting_date'),
|
||||||
company=self.company))
|
company=self.company))
|
||||||
|
|
||||||
def set_price_list_and_item_details(self):
|
def set_price_list_and_item_details(self, for_validate=False):
|
||||||
self.set_price_list_currency("Selling")
|
self.set_price_list_currency("Selling")
|
||||||
self.set_missing_item_details()
|
self.set_missing_item_details(for_validate=for_validate)
|
||||||
|
|
||||||
def apply_shipping_rule(self):
|
def apply_shipping_rule(self):
|
||||||
if self.shipping_rule:
|
if self.shipping_rule:
|
||||||
|
|||||||
@@ -177,6 +177,19 @@ class StockController(AccountsController):
|
|||||||
stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle)
|
stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle)
|
||||||
return stock_ledger
|
return stock_ledger
|
||||||
|
|
||||||
|
def make_batches(self, warehouse_field):
|
||||||
|
'''Create batches if required. Called before submit'''
|
||||||
|
for d in self.items:
|
||||||
|
if d.get(warehouse_field) and not d.batch_no:
|
||||||
|
has_batch_no, create_new_batch = frappe.db.get_value('Item', d.item_code, ['has_batch_no', 'create_new_batch'])
|
||||||
|
if has_batch_no and create_new_batch:
|
||||||
|
d.batch_no = frappe.get_doc(dict(
|
||||||
|
doctype='Batch',
|
||||||
|
item=d.item_code,
|
||||||
|
supplier=getattr(self, 'supplier', None),
|
||||||
|
reference_doctype=self.doctype,
|
||||||
|
reference_name=self.name)).insert().name
|
||||||
|
|
||||||
def make_adjustment_entry(self, expected_gle, voucher_obj):
|
def make_adjustment_entry(self, expected_gle, voucher_obj):
|
||||||
from erpnext.accounts.utils import get_stock_and_account_difference
|
from erpnext.accounts.utils import get_stock_and_account_difference
|
||||||
account_list = [d.account for d in expected_gle]
|
account_list = [d.account for d in expected_gle]
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class calculate_taxes_and_totals(object):
|
|||||||
|
|
||||||
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
|
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
|
||||||
item.total_margin = self.calculate_margin(item)
|
item.total_margin = self.calculate_margin(item)
|
||||||
|
|
||||||
item.rate = flt(item.total_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
|
item.rate = flt(item.total_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
|
||||||
if item.total_margin > 0 else item.rate
|
if item.total_margin > 0 else item.rate
|
||||||
|
|
||||||
|
|||||||
0
erpnext/crm/report/campaign_efficiency/__init__.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
frappe.query_reports["Campaign Efficiency"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"fieldname": "from_date",
|
||||||
|
"label": __("From Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"default": frappe.defaults.get_user_default("year_start_date"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "to_date",
|
||||||
|
"label": __("To Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"default": frappe.defaults.get_user_default("year_end_date"),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"apply_user_permissions": 1,
|
||||||
|
"creation": "2017-04-17 00:20:27.248275",
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "",
|
||||||
|
"modified": "2017-04-17 00:20:27.248275",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "CRM",
|
||||||
|
"name": "Campaign Efficiency",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"ref_doctype": "Lead",
|
||||||
|
"report_name": "Campaign Efficiency",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Sales Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "System Manager"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
columns, data = [], []
|
||||||
|
columns=get_columns()
|
||||||
|
data=get_lead_data(filters, "Campaign Name")
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns():
|
||||||
|
return [
|
||||||
|
_("Campaign Name") + ":data:130",
|
||||||
|
_("Lead Count") + ":Int:80",
|
||||||
|
_("Opp Count") + ":Int:80",
|
||||||
|
_("Quot Count") + ":Int:80",
|
||||||
|
_("Order Count") + ":Int:100",
|
||||||
|
_("Order Value") + ":Float:100",
|
||||||
|
_("Opp/Lead %") + ":Float:100",
|
||||||
|
_("Quot/Lead %") + ":Float:100",
|
||||||
|
_("Order/Quot %") + ":Float:100"
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_lead_data(filters, based_on):
|
||||||
|
based_on_field = frappe.scrub(based_on)
|
||||||
|
conditions = get_filter_conditions(filters)
|
||||||
|
|
||||||
|
lead_details = frappe.db.sql("""
|
||||||
|
select {based_on_field}, name
|
||||||
|
from `tabLead`
|
||||||
|
where {based_on_field} is not null and {based_on_field} != '' {conditions}
|
||||||
|
""".format(based_on_field=based_on_field, conditions=conditions), filters, as_dict=1)
|
||||||
|
|
||||||
|
lead_map = frappe._dict()
|
||||||
|
for d in lead_details:
|
||||||
|
lead_map.setdefault(d.get(based_on_field), []).append(d.name)
|
||||||
|
|
||||||
|
data = []
|
||||||
|
for based_on_value, leads in lead_map.items():
|
||||||
|
row = {
|
||||||
|
based_on: based_on_value,
|
||||||
|
"Lead Count": len(leads)
|
||||||
|
}
|
||||||
|
row["Quot Count"]= get_lead_quotation_count(leads)
|
||||||
|
row["Opp Count"] = get_lead_opp_count(leads)
|
||||||
|
row["Order Count"] = get_quotation_ordered_count(leads)
|
||||||
|
row["Order Value"] = get_order_amount(leads)
|
||||||
|
|
||||||
|
row["Opp/Lead %"] = row["Opp Count"] / row["Lead Count"] * 100
|
||||||
|
row["Quot/Lead %"] = row["Quot Count"] / row["Lead Count"] * 100
|
||||||
|
|
||||||
|
row["Order/Quot %"] = row["Order Count"] / (row["Quot Count"] or 1) * 100
|
||||||
|
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def get_filter_conditions(filters):
|
||||||
|
conditions=""
|
||||||
|
if filters.from_date:
|
||||||
|
conditions += " and date(creation) >= %(from_date)s"
|
||||||
|
if filters.to_date:
|
||||||
|
conditions += " and date(creation) <= %(to_date)s"
|
||||||
|
|
||||||
|
return conditions
|
||||||
|
|
||||||
|
def get_lead_quotation_count(leads):
|
||||||
|
return frappe.db.sql("""select count(name) from `tabQuotation`
|
||||||
|
where lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
|
||||||
|
|
||||||
|
def get_lead_opp_count(leads):
|
||||||
|
return frappe.db.sql("""select count(name) from `tabOpportunity`
|
||||||
|
where lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
|
||||||
|
|
||||||
|
def get_quotation_ordered_count(leads):
|
||||||
|
return frappe.db.sql("""select count(name)
|
||||||
|
from `tabQuotation` where status = 'Ordered'
|
||||||
|
and lead in (%s)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
|
||||||
|
|
||||||
|
def get_order_amount(leads):
|
||||||
|
return frappe.db.sql("""select sum(base_net_amount)
|
||||||
|
from `tabSales Order Item`
|
||||||
|
where prevdoc_docname in (
|
||||||
|
select name from `tabQuotation` where status = 'Ordered'
|
||||||
|
and lead in (%s)
|
||||||
|
)""" % ', '.join(["%s"]*len(leads)), tuple(leads))[0][0]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
frappe.query_reports["Lead Owner Efficiency"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"fieldname": "from_date",
|
||||||
|
"label": __("From Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"default": frappe.defaults.get_user_default("year_start_date"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "to_date",
|
||||||
|
"label": __("To Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"default": frappe.defaults.get_user_default("year_end_date"),
|
||||||
|
}
|
||||||
|
]};
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"apply_user_permissions": 1,
|
||||||
|
"creation": "2017-04-17 00:39:39.885905",
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "",
|
||||||
|
"modified": "2017-04-17 00:45:10.139004",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "CRM",
|
||||||
|
"name": "Lead Owner Efficiency",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"ref_doctype": "Lead",
|
||||||
|
"report_name": "Lead Owner Efficiency",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Sales Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "System Manager"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
columns, data = [], []
|
||||||
|
columns=get_columns()
|
||||||
|
data=get_lead_data(filters, "Lead Owner")
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns():
|
||||||
|
return [
|
||||||
|
_("Lead Owner") + ":Data:130",
|
||||||
|
_("Lead Count") + ":Int:80",
|
||||||
|
_("Opp Count") + ":Int:80",
|
||||||
|
_("Quot Count") + ":Int:80",
|
||||||
|
_("Order Count") + ":Int:100",
|
||||||
|
_("Order Value") + ":Float:100",
|
||||||
|
_("Opp/Lead %") + ":Float:100",
|
||||||
|
_("Quot/Lead %") + ":Float:100",
|
||||||
|
_("Order/Quot %") + ":Float:100"
|
||||||
|
]
|
||||||
@@ -18,6 +18,9 @@ def work():
|
|||||||
# fixed_asset.work() already run
|
# fixed_asset.work() already run
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Enable booking asset depreciation entry automatically
|
||||||
|
frappe.db.set_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically", 1)
|
||||||
|
|
||||||
# post depreciation entries as on today
|
# post depreciation entries as on today
|
||||||
post_depreciation_entries()
|
post_depreciation_entries()
|
||||||
|
|
||||||
|
|||||||
BIN
erpnext/docs/assets/img/accounts/bank-guarantee.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
erpnext/docs/assets/img/accounts/exempted-item.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
erpnext/docs/assets/img/accounts/item-wise-tax.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
erpnext/docs/assets/img/accounts/tax-calulation.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
erpnext/docs/assets/img/accounts/tax-master.png
Normal file
|
After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 50 KiB |
BIN
erpnext/docs/assets/img/stock/batch_view.png
Normal file
|
After Width: | Height: | Size: 167 KiB |
BIN
erpnext/docs/assets/img/stock/item_setup_for_batch.png
Normal file
|
After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
9
erpnext/docs/user/manual/en/accounts/bank-guarantee.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
A Bank Guarantee is a guarantee from a lending institution such as a bank ensuring the liabilities of a debtor will be met. In other words, if the debtor fails to settle a debt, the bank covers it. A Bank Guarantee enables the customer, or debtor, to acquire goods, buy equipment or draw down loans, and thereby expand business activity.
|
||||||
|
|
||||||
|
A client may ask you to provide a Bank Guarantee from a third party such as a bank. This guarantee is for a specified amount, which is usually a percentage of the total value of the contract. The Bank Guarantee is valid for a specified duration after which it expires and must be returned to you by the client.
|
||||||
|
|
||||||
|
This document allows you to track Bank Guarantees given to clients. You can set Email Alerts as the Bank Guarantee expiry date approaches to remind yourself to get the Bank Guarantee back from your client.
|
||||||
|
|
||||||
|
<img class="screenshot" alt="Bank Guarantee" src="{{docs_base_url}}/assets/img/accounts/bank-guarantee.png">
|
||||||
|
|
||||||
|
{next}
|
||||||
@@ -10,6 +10,7 @@ multi-currency-accounting
|
|||||||
advance-payment-entry
|
advance-payment-entry
|
||||||
payment-request
|
payment-request
|
||||||
credit-limit
|
credit-limit
|
||||||
|
bank-guarantee
|
||||||
accounting-reports
|
accounting-reports
|
||||||
accounting-entries
|
accounting-entries
|
||||||
managing-fixed-assets
|
managing-fixed-assets
|
||||||
|
|||||||
@@ -1,29 +1,35 @@
|
|||||||
Taxes selected in the Tax and Other Charges in transactions are applied on all the items. If you need different taxes applied on items selected in the same transaction, you should setup you item and tax master as explained in the steps below.
|
In the sales and purchase transactions, you can apply taxes and other charges on the items. For the ease of applying taxes, you can fetch values from the [Sales Taxes and Charges master](/contents//setting-up/setting-up-taxes). Taxes and charges are applied equally on all the items. For example, if tax GST 16% is added in the tax table, then it will be applied on all the items. However, if you need to have different tax rate applied on some of the items, following is how you should setup Items and Sales Taxes and Other Charges master in your ERPNext account.
|
||||||
|
|
||||||
|
Let's assume that we are creating a Sales Order. We have Sales Taxes and Charges master for GST 16%. Out of all the Sales Items, on one item, only 12% GST will be applied, while one more item is exempted from the tax.
|
||||||
|
|
||||||
####Step 1: Mention Tax Applicable in the Item master
|
####Step 1: Mention Tax Applicable in the Item master
|
||||||
|
|
||||||
Item master has tax table where you can list taxes which will be applied on it.
|
Items on which differential tax rate is applied, you should mention tax rate for that item in the Item master itself. Item master has tax table where you can list taxes which will be applied on it.
|
||||||
|
|
||||||

|
> Tax rate mentioned in the item master gets preference over tax rate entered in the transactions.
|
||||||
|
|
||||||
Tax rate mentioned in the item master gets preference over tax rate entered in the transactions.
|
Here is the example of Item on which 12% GST is applied only.
|
||||||
|
|
||||||
For example, if you provide tax rate for VAT as 10% for item ABC, where for same VAT ledger 12% rate is entered in the Sales Order/Invoice, for item ABC, tax rate applied would be 10%, as mentioned in the item master.
|
<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/item-wise-tax.png">
|
||||||
|
|
||||||
|
For the item which is exempted from GST totally, mention 0% as tax rate in the Item master.
|
||||||
|
|
||||||
|
<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/exempted-item.png">
|
||||||
|
|
||||||
####Step 2: Setup Taxes and Other Charges
|
####Step 2: Setup Taxes and Other Charges
|
||||||
|
|
||||||
In Taxes and Other Charges master, you should select all the applicable taxes which could be applicable on item.
|
In Sales Taxes and Other Charges master, select GST 16% account and mention Tax Rate as 16. This tax rate will be applied on all the Items selected in the Sales Order, unless specific Tax Rate is defined in the Item master.
|
||||||
|
|
||||||
For example, if few items has VAT 5 applied on them, other has Service Tax applied, and some other has Excise Duty applicable, then you tax master should have all these taxes selected.
|
<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/tax-master.png">
|
||||||
|
|
||||||

|
<div class="well">If you want to have tax rate always applied from the Item master, then you should update Rate for the tax account as zero in the Taxes and Charges master.</div>
|
||||||
|
|
||||||
####Step 3: Set Tax Rate as Zero in Taxes and Charges Template
|
####Step 3: Tax Calculation in transaction
|
||||||
|
|
||||||
In the Taxes and Other Charges master, tax rate will be updated as ZERO. It means, tax rate applicable on items will be pulled from the respective Item master. While for other items, 0% tax will be applied, means no other taxes will be applied on that item.
|
In the Sales Order, we have selected many Items. For the items mentioned in blue, tax rate is applied based on tax rate mentioned in the taxes table. For the items highlited in red, tax rate has fetched for them from the respective item master.
|
||||||
|
|
||||||
Based on the above setting, you will have taxes applied on items as mentioned in the respective item master. Check following for an instance.
|
<img class="screenshot" alt="Opening Account" src="{{docs_base_url}}/assets/img/accounts/tax-calulation.png">
|
||||||
|
|
||||||

|
Please note that item's tax rate will be pulled from the item master only if you have update same tax account (GST 16% in this case) in both Item master and tax master.
|
||||||
|
|
||||||
{next}
|
{next}
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ by:
|
|||||||
|
|
||||||
<img class="screenshot" alt="Stock Entry for PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-material-transfer-updated.png">
|
<img class="screenshot" alt="Stock Entry for PO" src="{{docs_base_url}}/assets/img/manufacturing/PO-material-transfer-updated.png">
|
||||||
|
|
||||||
|
#### Material Transfer through Stock Entry
|
||||||
|
Use cases for this option are:
|
||||||
|
* If material transfer is done in bulk and/or is not required to be tracked against a particular Production Order
|
||||||
|
* If the responsibility for Material Transfer and Production Entry lies with two separate users
|
||||||
|
|
||||||
|
If this is the case, you can select the Skip Material Transfer check box, which will allow you to make the “Manufacture” Stock Entry directly by clicking on the ‘Finish’ button.
|
||||||
|
|
||||||
### Making Time Logs
|
### Making Time Logs
|
||||||
|
|
||||||
* Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html)
|
* Progress in the Production Order can be tracked using [Timesheet]({{docs_base_url}}/user/manual/en/projects/timesheet/timesheet-against-production-order.html)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
You can globally switch off certain desktop module via:
|
You can globally switch off certain desktop module via:
|
||||||
|
|
||||||
> Setup > Settings > Show or Hide Modules
|
> Setup > Permissions > Show / Hide Modules
|
||||||
|
|
||||||
For example if you are in the services business, you want to hide the Manufacturing Module, you can do this via **Show or Hide Modules**
|
For example if you are in the services business, you want to hide the Manufacturing Module, you can do this via **Show or Hide Modules**
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,42 @@
|
|||||||
Batch inventory feature in ERPNext allows you to group multiple units of an item,
|
Batch feature in ERPNext allows you to group multiple units of an item,
|
||||||
and assign them a unique value/number/tag called Batch No.
|
and assign them a unique value/number/tag called Batch No.
|
||||||
|
|
||||||
The practice of stocking based on batch is mainly followed in the pharmaceutical industry.
|
This is done based on the Item. If the Item is batched, then a Batch number must be mentioned in every stock transaction. Batch numbers can be maintained manually or automatically
|
||||||
Medicines/drugs produced in a particular batched is assigned a unique id.
|
|
||||||
This helps them updating and tracking manufacturing and expiry date for all the units produced under specific batch.
|
|
||||||
|
|
||||||
> Note: To set item as a batch item, "Has Batch No" field should be updated as Yes in the Item master.
|
### Item Setup
|
||||||
|
|
||||||
On every stock transaction (Purchase Receipt, Delivery Note, POS Invoice) made for batch item,
|
To set item as a batch item, "Has Batch No" field should be checked in the Item master.
|
||||||
you should provide item's Batch No.
|
|
||||||
|
If you want automatic batch creation at the time of Purchase Receipt, you must check "Create New Batches Automatically"
|
||||||
|
|
||||||
|
<img class="screenshot" alt="Item Setup for Batches" src="{{docs_base_url}}/assets/img/stock/item_setup_for_batch.png">
|
||||||
|
|
||||||
|
### Creating Batches
|
||||||
|
|
||||||
|
If you have not selected "Create New Batches Automatically", you will have to make Batches Manually as you go along.
|
||||||
|
|
||||||
To create new Batch No. master for an item, go to:
|
To create new Batch No. master for an item, go to:
|
||||||
|
|
||||||
> Stock > Setup > Batch > New
|
> Stock > Setup > Batch > New
|
||||||
|
|
||||||
Batch master is created before creation of Purchase Receipt.
|
### Splitting and Moving Batches
|
||||||
Hence eveytime there is Purchase Receipt or Production entry being made for a batch item,
|
|
||||||
you will first create its Batch No, and then select it in Purcase order or Production Entry.
|
|
||||||
|
|
||||||
<img class="screenshot" alt="batch" src="{{docs_base_url}}/assets/img/stock/batch.png">
|
When you open a batch, you will see all the quantities relating this that batch on the page.
|
||||||
|
|
||||||
|
<img class="screenshot" alt="Batch View" src="{{docs_base_url}}/assets/img/stock/batch_view.png">
|
||||||
|
|
||||||
|
To move the batch from one warehouse to another, you can click on the move button.
|
||||||
|
|
||||||
|
You can also split the batch into smaller one by clicking on "Split". This will create a new Batch based on this Batch and the quantities will be split between the batches.
|
||||||
|
|
||||||
|
### Transacting Items with Batches
|
||||||
|
|
||||||
|
Batch master is created before creation of Purchase Receipt.
|
||||||
|
Hence eveytime there is Purchase Receipt or Production Order being made for a batch item,
|
||||||
|
you will first create its Batch No, and then select it in Purchase order or Production Entry.
|
||||||
|
|
||||||
|
On every stock transaction (Purchase Receipt, Delivery Note, POS Invoice) made for batch item,
|
||||||
|
you should provide item's Batch No.
|
||||||
|
|
||||||
> Note: In stock transactions, Batch IDs will be filtered based on Item Code, Warehouse,
|
> Note: In stock transactions, Batch IDs will be filtered based on Item Code, Warehouse,
|
||||||
Batch Expiry Date (compared with Posting date of a transaction) and Actual Qty in Warehouse.
|
Batch Expiry Date (compared with Posting date of a transaction) and Actual Qty in Warehouse.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# purchase details
|
# Purchase Details
|
||||||
|
|
||||||
# How Do I Track Warranty Status?
|
# How Do I Track Warranty Status?
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,11 @@ class Attendance(Document):
|
|||||||
frappe.throw(_("No leave record found for employee {0} for {1}").format(self.employee, self.attendance_date))
|
frappe.throw(_("No leave record found for employee {0} for {1}").format(self.employee, self.attendance_date))
|
||||||
|
|
||||||
def validate_attendance_date(self):
|
def validate_attendance_date(self):
|
||||||
|
date_of_joining = frappe.db.get_value("Employee", self.employee, "date_of_joining")
|
||||||
|
|
||||||
if getdate(self.attendance_date) > getdate(nowdate()):
|
if getdate(self.attendance_date) > getdate(nowdate()):
|
||||||
frappe.throw(_("Attendance can not be marked for future dates"))
|
frappe.throw(_("Attendance can not be marked for future dates"))
|
||||||
elif getdate(self.attendance_date) < frappe.db.get_value("Employee", self.employee, "date_of_joining"):
|
elif date_of_joining and getdate(self.attendance_date) < getdate(date_of_joining):
|
||||||
frappe.throw(_("Attendance date can not be less than employee's joining date"))
|
frappe.throw(_("Attendance date can not be less than employee's joining date"))
|
||||||
|
|
||||||
def validate_employee(self):
|
def validate_employee(self):
|
||||||
|
|||||||
@@ -18,14 +18,20 @@ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
expense_type: function(frm, cdt, cdn) {
|
expense_type: function(doc, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
|
if(!doc.company) {
|
||||||
|
d.expense_type = "";
|
||||||
|
frappe.msgprint(__("Please set the Company"));
|
||||||
|
this.frm.refresh_fields()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_claim_account",
|
method: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_claim_account",
|
||||||
args: {
|
args: {
|
||||||
"expense_claim_type": d.expense_type,
|
"expense_claim_type": d.expense_type,
|
||||||
"company": frm.company
|
"company": doc.company
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if (r.message) {
|
if (r.message) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ frappe.ui.form.on("Vehicle Log", {
|
|||||||
vehicle_log=frappe.model.get_doc(cdt,cdn);
|
vehicle_log=frappe.model.get_doc(cdt,cdn);
|
||||||
if (vehicle_log.license_plate) {
|
if (vehicle_log.license_plate) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.fleet_management.doctype.vehicle_log.vehicle_log.get_make_model",
|
method: "erpnext.hr.doctype.vehicle_log.vehicle_log.get_make_model",
|
||||||
args: {
|
args: {
|
||||||
license_plate: vehicle_log.license_plate
|
license_plate: vehicle_log.license_plate
|
||||||
},
|
},
|
||||||
@@ -19,7 +19,7 @@ frappe.ui.form.on("Vehicle Log", {
|
|||||||
},
|
},
|
||||||
expense_claim: function(frm){
|
expense_claim: function(frm){
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.fleet_management.doctype.vehicle_log.vehicle_log.make_expense_claim",
|
method: "erpnext.hr.doctype.vehicle_log.vehicle_log.make_expense_claim",
|
||||||
args:{
|
args:{
|
||||||
docname: frm.doc.name
|
docname: frm.doc.name
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -72,15 +72,17 @@ frappe.ui.form.on("Production Order", {
|
|||||||
message = title;
|
message = title;
|
||||||
|
|
||||||
// pending qty
|
// pending qty
|
||||||
var pending_complete = frm.doc.material_transferred_for_manufacturing - frm.doc.produced_qty;
|
if(!frm.doc.skip_transfer){
|
||||||
if(pending_complete) {
|
var pending_complete = frm.doc.material_transferred_for_manufacturing - frm.doc.produced_qty;
|
||||||
var title = __('{0} items in progress', [pending_complete]);
|
if(pending_complete) {
|
||||||
bars.push({
|
var title = __('{0} items in progress', [pending_complete]);
|
||||||
'title': title,
|
bars.push({
|
||||||
'width': ((pending_complete / frm.doc.qty * 100) - added_min) + '%',
|
'title': title,
|
||||||
'progress_class': 'progress-bar-warning'
|
'width': ((pending_complete / frm.doc.qty * 100) - added_min) + '%',
|
||||||
})
|
'progress_class': 'progress-bar-warning'
|
||||||
message = message + '. ' + title;
|
})
|
||||||
|
message = message + '. ' + title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
frm.dashboard.add_progress(__('Status'), bars, message);
|
frm.dashboard.add_progress(__('Status'), bars, message);
|
||||||
}
|
}
|
||||||
@@ -122,21 +124,32 @@ erpnext.production_order = {
|
|||||||
frm.add_custom_button(__('Re-open'), cur_frm.cscript['Unstop Production Order'], __("Status"));
|
frm.add_custom_button(__('Re-open'), cur_frm.cscript['Unstop Production Order'], __("Status"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
if(!frm.doc.skip_transfer){
|
||||||
|
if ((flt(doc.material_transferred_for_manufacturing) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
||||||
frm.has_start_btn = true;
|
frm.has_start_btn = true;
|
||||||
var btn = frm.add_custom_button(__('Start'),
|
var btn = frm.add_custom_button(__('Start'),
|
||||||
cur_frm.cscript['Transfer Raw Materials']);
|
cur_frm.cscript['Transfer Raw Materials']);
|
||||||
btn.addClass('btn-primary');
|
btn.addClass('btn-primary');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
|
if(!frm.doc.skip_transfer){
|
||||||
frm.has_finish_btn = true;
|
if ((flt(doc.produced_qty) < flt(doc.material_transferred_for_manufacturing)) && frm.doc.status != 'Stopped') {
|
||||||
var btn = frm.add_custom_button(__('Finish'),
|
frm.has_finish_btn = true;
|
||||||
cur_frm.cscript['Update Finished Goods']);
|
var btn = frm.add_custom_button(__('Finish'),
|
||||||
|
cur_frm.cscript['Update Finished Goods']);
|
||||||
|
|
||||||
if(doc.material_transferred_for_manufacturing==doc.qty) {
|
if(doc.material_transferred_for_manufacturing==doc.qty) {
|
||||||
// all materials transferred for manufacturing,
|
// all materials transferred for manufacturing,
|
||||||
// make this primary
|
// make this primary
|
||||||
|
btn.addClass('btn-primary');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((flt(doc.produced_qty) < flt(doc.qty)) && frm.doc.status != 'Stopped') {
|
||||||
|
frm.has_finish_btn = true;
|
||||||
|
var btn = frm.add_custom_button(__('Finish'),
|
||||||
|
cur_frm.cscript['Update Finished Goods']);
|
||||||
btn.addClass('btn-primary');
|
btn.addClass('btn-primary');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,9 +248,13 @@ $.extend(cur_frm.cscript, {
|
|||||||
|
|
||||||
make_se: function(purpose) {
|
make_se: function(purpose) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var max = (purpose === "Manufacture") ?
|
if(!this.frm.doc.skip_transfer){
|
||||||
flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
|
var max = (purpose === "Manufacture") ?
|
||||||
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) :
|
||||||
|
flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing);
|
||||||
|
} else {
|
||||||
|
var max = flt(this.frm.doc.qty) - flt(this.frm.doc.produced_qty);
|
||||||
|
}
|
||||||
|
|
||||||
frappe.prompt({fieldtype:"Float", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
frappe.prompt({fieldtype:"Float", label: __("Qty for {0}", [purpose]), fieldname:"qty",
|
||||||
description: __("Max: {0}", [max]), 'default': max },
|
description: __("Max: {0}", [max]), 'default': max },
|
||||||
|
|||||||
@@ -319,13 +319,43 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"description": "Check if material transfer entry is not required",
|
||||||
|
"fieldname": "skip_transfer",
|
||||||
|
"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": "Skip Material Transfer",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"depends_on": "eval:doc.docstatus==1",
|
"depends_on": "eval:doc.docstatus==1 && doc.skip_transfer==0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"fieldname": "material_transferred_for_manufacturing",
|
"fieldname": "material_transferred_for_manufacturing",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
@@ -1316,7 +1346,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-04-10 12:13:09.312186",
|
"modified": "2017-04-21 16:31:19.509721",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Production Order",
|
"name": "Production Order",
|
||||||
|
|||||||
@@ -535,7 +535,7 @@ def make_stock_entry(production_order_id, purpose, qty=None):
|
|||||||
stock_entry.from_warehouse = production_order.wip_warehouse
|
stock_entry.from_warehouse = production_order.wip_warehouse
|
||||||
stock_entry.to_warehouse = production_order.fg_warehouse
|
stock_entry.to_warehouse = production_order.fg_warehouse
|
||||||
additional_costs = get_additional_costs(production_order, fg_qty=stock_entry.fg_completed_qty)
|
additional_costs = get_additional_costs(production_order, fg_qty=stock_entry.fg_completed_qty)
|
||||||
stock_entry.project = frappe.db.get_value("Stock Entry",{"production_order": production_order_id,"purpose": "Material Transfer for Manufacture"}, "project")
|
stock_entry.project = production_order.project
|
||||||
stock_entry.set("additional_costs", additional_costs)
|
stock_entry.set("additional_costs", additional_costs)
|
||||||
|
|
||||||
stock_entry.get_items()
|
stock_entry.get_items()
|
||||||
|
|||||||
@@ -386,3 +386,7 @@ execute:frappe.delete_doc('DocType', 'Purchase Common')
|
|||||||
erpnext.patches.v8_0.update_stock_qty_value_in_purchase_invoice
|
erpnext.patches.v8_0.update_stock_qty_value_in_purchase_invoice
|
||||||
erpnext.patches.v8_0.update_supplier_address_in_stock_entry
|
erpnext.patches.v8_0.update_supplier_address_in_stock_entry
|
||||||
erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate
|
erpnext.patches.v8_0.rename_is_sample_item_to_allow_zero_valuation_rate
|
||||||
|
erpnext.patches.v8_0.set_null_to_serial_nos_for_disabled_sales_invoices
|
||||||
|
erpnext.patches.v8_0.enable_booking_asset_depreciation_automatically
|
||||||
|
erpnext.patches.v8_0.set_project_copied_from
|
||||||
|
erpnext.patches.v8_0.update_status_as_paid_for_completed_expense_claim
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.db.set_value("Accounts Settings", None,
|
||||||
|
"book_asset_depreciation_entry_automatically", 1)
|
||||||
@@ -9,4 +9,5 @@ def execute():
|
|||||||
|
|
||||||
for doctype in doc_list:
|
for doctype in doc_list:
|
||||||
frappe.reload_doctype(doctype)
|
frappe.reload_doctype(doctype)
|
||||||
rename_field(doctype, "is_sample_item", "allow_zero_valuation_rate")
|
if "is_sample_item" in frappe.db.get_table_columns(doctype):
|
||||||
|
rename_field(doctype, "is_sample_item", "allow_zero_valuation_rate")
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.db.sql("""
|
||||||
|
update
|
||||||
|
`tabSales Invoice Item`
|
||||||
|
set serial_no = NULL
|
||||||
|
where
|
||||||
|
parent in (select name from `tabSales Invoice` where update_stock = 0 and docstatus = 1)""")
|
||||||
11
erpnext/patches/v8_0/set_project_copied_from.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
frappe.reload_doctype("Project")
|
||||||
|
|
||||||
|
frappe.db.sql('''
|
||||||
|
UPDATE `tabProject`
|
||||||
|
SET copied_from=name
|
||||||
|
WHERE copied_from is NULL
|
||||||
|
''')
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
""" set status as Paid in Expense Claim if total_sactioned_amount
|
||||||
|
and total_amount_reimbursed is equal """
|
||||||
|
|
||||||
|
frappe.reload_doctype('Expense Claim')
|
||||||
|
|
||||||
|
frappe.db.sql("""
|
||||||
|
update
|
||||||
|
`tabExpense Claim`
|
||||||
|
set status = 'Paid'
|
||||||
|
where
|
||||||
|
total_sanctioned_amount = total_amount_reimbursed
|
||||||
|
""")
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:project_name",
|
"autoname": "field:project_name",
|
||||||
@@ -553,6 +554,35 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "copied_from",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Copied From",
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
@@ -1174,19 +1204,19 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-puzzle-piece",
|
"icon": "fa fa-puzzle-piece",
|
||||||
"idx": 29,
|
"idx": 29,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 4,
|
"max_attachments": 4,
|
||||||
"modified": "2017-02-17 17:24:04.146872",
|
"modified": "2017-04-19 13:16:32.462005",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "faris@erpnext.com",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Project",
|
"name": "Project",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
|
|||||||
@@ -205,6 +205,32 @@ class Project(Document):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.load_tasks()
|
self.load_tasks()
|
||||||
self.sync_tasks()
|
self.sync_tasks()
|
||||||
|
self.update_dependencies_on_duplicated_project()
|
||||||
|
|
||||||
|
def update_dependencies_on_duplicated_project(self):
|
||||||
|
if self.flags.dont_sync_tasks: return
|
||||||
|
if not self.copied_from:
|
||||||
|
self.copied_from = self.name
|
||||||
|
|
||||||
|
if self.name != self.copied_from and self.get('__unsaved'):
|
||||||
|
# duplicated project
|
||||||
|
dependency_map = {}
|
||||||
|
for task in self.tasks:
|
||||||
|
name, depends_on_tasks = frappe.db.get_value(
|
||||||
|
'Task', { "subject": task.title, "project": self.copied_from }, ['name', 'depends_on_tasks']
|
||||||
|
)
|
||||||
|
depends_on_tasks = [x for x in depends_on_tasks.split(',') if x]
|
||||||
|
dependency_map[task.title] = [ x['subject'] for x in frappe.get_list(
|
||||||
|
'Task Depends On', {"parent": name}, ['subject'])]
|
||||||
|
|
||||||
|
for key, value in dependency_map.iteritems():
|
||||||
|
task_name = frappe.db.get_value('Task', {"subject": key, "project": self.name })
|
||||||
|
task_doc = frappe.get_doc('Task', task_name)
|
||||||
|
|
||||||
|
for dt in value:
|
||||||
|
dt_name = frappe.db.get_value('Task', {"subject": dt, "project": self.name })
|
||||||
|
task_doc.append('depends_on', {"task": dt_name})
|
||||||
|
task_doc.save()
|
||||||
|
|
||||||
def get_timeline_data(doctype, name):
|
def get_timeline_data(doctype, name):
|
||||||
'''Return timeline for attendance'''
|
'''Return timeline for attendance'''
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ class Task(Document):
|
|||||||
frappe.throw(_("Progress % for a task cannot be more than 100."))
|
frappe.throw(_("Progress % for a task cannot be more than 100."))
|
||||||
|
|
||||||
def update_depends_on(self):
|
def update_depends_on(self):
|
||||||
depends_on_tasks = ""
|
depends_on_tasks = self.depends_on_tasks or ""
|
||||||
for d in self.depends_on:
|
for d in self.depends_on:
|
||||||
if d.task:
|
if d.task and not d.task in depends_on_tasks:
|
||||||
depends_on_tasks += d.task + ","
|
depends_on_tasks += d.task + ","
|
||||||
self.depends_on_tasks = depends_on_tasks
|
self.depends_on_tasks = depends_on_tasks
|
||||||
|
|
||||||
|
|||||||
@@ -297,6 +297,9 @@ body[data-route="pos"] .item-list {
|
|||||||
body[data-route="pos"] .item-list .image-field {
|
body[data-route="pos"] .item-list .image-field {
|
||||||
height: 140px;
|
height: 140px;
|
||||||
}
|
}
|
||||||
|
body[data-route="pos"] .item-list .image-field .placeholder-text {
|
||||||
|
font-size: 50px;
|
||||||
|
}
|
||||||
body[data-route="pos"] .item-list .pos-item-wrapper {
|
body[data-route="pos"] .item-list .pos-item-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
|||||||
if(item.margin_type == "Percentage"){
|
if(item.margin_type == "Percentage"){
|
||||||
item.total_margin = flt(item.price_list_rate)
|
item.total_margin = flt(item.price_list_rate)
|
||||||
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
|
+ flt(item.price_list_rate) * ( flt(item.margin_rate_or_amount) / 100);
|
||||||
}else{
|
} else {
|
||||||
item.total_margin = flt(item.price_list_rate) + flt(item.margin_rate_or_amount);
|
item.total_margin = flt(item.price_list_rate) + flt(item.margin_rate_or_amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
customer: me.frm.doc.customer,
|
customer: me.frm.doc.customer,
|
||||||
supplier: me.frm.doc.supplier,
|
supplier: me.frm.doc.supplier,
|
||||||
currency: me.frm.doc.currency,
|
currency: me.frm.doc.currency,
|
||||||
|
update_stock: in_list(['Sales Invoice', 'Purchase Invoice'], me.frm.doc.doctype) ? cint(me.frm.doc.update_stock) : 0,
|
||||||
conversion_rate: me.frm.doc.conversion_rate,
|
conversion_rate: me.frm.doc.conversion_rate,
|
||||||
price_list: me.frm.doc.selling_price_list ||
|
price_list: me.frm.doc.selling_price_list ||
|
||||||
me.frm.doc.buying_price_list,
|
me.frm.doc.buying_price_list,
|
||||||
@@ -274,14 +275,16 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
doctype: me.frm.doc.doctype,
|
doctype: me.frm.doc.doctype,
|
||||||
name: me.frm.doc.name,
|
name: me.frm.doc.name,
|
||||||
project: item.project || me.frm.doc.project,
|
project: item.project || me.frm.doc.project,
|
||||||
qty: item.qty,
|
qty: item.qty || 1,
|
||||||
stock_qty: item.stock_qty
|
stock_qty: item.stock_qty,
|
||||||
|
conversion_factor: item.conversion_factor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
me.frm.script_manager.trigger("price_list_rate", cdt, cdn);
|
me.frm.script_manager.trigger("price_list_rate", cdt, cdn);
|
||||||
|
me.toggle_conversion_factor(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -566,11 +569,18 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
frappe.model.round_floats_in(item, ["qty", "conversion_factor"]);
|
frappe.model.round_floats_in(item, ["qty", "conversion_factor"]);
|
||||||
item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item));
|
item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item));
|
||||||
refresh_field("stock_qty", item.name, item.parentfield);
|
refresh_field("stock_qty", item.name, item.parentfield);
|
||||||
|
this.toggle_conversion_factor(item);
|
||||||
|
this.apply_price_list(item, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggle_conversion_factor: function(item) {
|
||||||
|
// toggle read only property for conversion factor field if the uom and stock uom are same
|
||||||
|
this.frm.fields_dict.items.grid.toggle_enable("conversion_factor",
|
||||||
|
(item.uom != item.stock_uom)? true: false)
|
||||||
|
},
|
||||||
|
|
||||||
qty: function(doc, cdt, cdn) {
|
qty: function(doc, cdt, cdn) {
|
||||||
this.apply_pricing_rule(frappe.get_doc(cdt, cdn), true);
|
|
||||||
this.conversion_factor(doc, cdt, cdn);
|
this.conversion_factor(doc, cdt, cdn);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -762,7 +772,9 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
"ignore_pricing_rule": me.frm.doc.ignore_pricing_rule,
|
"ignore_pricing_rule": me.frm.doc.ignore_pricing_rule,
|
||||||
"doctype": me.frm.doc.doctype,
|
"doctype": me.frm.doc.doctype,
|
||||||
"name": me.frm.doc.name,
|
"name": me.frm.doc.name,
|
||||||
"is_return": cint(me.frm.doc.is_return)
|
"is_return": cint(me.frm.doc.is_return),
|
||||||
|
"update_stock": in_list(['Sales Invoice', 'Purchase Invoice'], me.frm.doc.doctype) ? cint(me.frm.doc.update_stock) : 0,
|
||||||
|
"conversion_factor": me.frm.doc.conversion_factor
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -781,7 +793,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
"parent": d.parent,
|
"parent": d.parent,
|
||||||
"pricing_rule": d.pricing_rule,
|
"pricing_rule": d.pricing_rule,
|
||||||
"warehouse": d.warehouse,
|
"warehouse": d.warehouse,
|
||||||
"serial_no": d.serial_no
|
"serial_no": d.serial_no,
|
||||||
|
"conversion_factor": d.conversion_factor || 1.0
|
||||||
});
|
});
|
||||||
|
|
||||||
// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
|
// if doctype is Quotation Item / Sales Order Iten then add Margin Type and rate in item_list
|
||||||
@@ -808,16 +821,13 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
for(var i=0, l=children.length; i<l; i++) {
|
for(var i=0, l=children.length; i<l; i++) {
|
||||||
var d = children[i];
|
var d = children[i];
|
||||||
var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
|
var existing_pricing_rule = frappe.model.get_value(d.doctype, d.name, "pricing_rule");
|
||||||
|
|
||||||
for(var k in d) {
|
for(var k in d) {
|
||||||
var v = d[k];
|
var v = d[k];
|
||||||
if (["doctype", "name"].indexOf(k)===-1) {
|
if (["doctype", "name"].indexOf(k)===-1) {
|
||||||
if(k=="price_list_rate") {
|
if(k=="price_list_rate") {
|
||||||
if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
|
if(flt(v) != flt(d.price_list_rate)) price_list_rate_changed = true;
|
||||||
}
|
}
|
||||||
if(v) {
|
frappe.model.set_value(d.doctype, d.name, k, v);
|
||||||
frappe.model.set_value(d.doctype, d.name, k, v);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,13 +26,14 @@ erpnext.financial_statements = {
|
|||||||
},
|
},
|
||||||
"open_general_ledger": function(data) {
|
"open_general_ledger": function(data) {
|
||||||
if (!data.account) return;
|
if (!data.account) return;
|
||||||
|
var project = $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; })
|
||||||
|
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
"account": data.account,
|
"account": data.account,
|
||||||
"company": frappe.query_report_filters_by_name.company.get_value(),
|
"company": frappe.query_report_filters_by_name.company.get_value(),
|
||||||
"from_date": data.from_date || data.year_start_date,
|
"from_date": data.from_date || data.year_start_date,
|
||||||
"to_date": data.to_date || data.year_end_date,
|
"to_date": data.to_date || data.year_end_date,
|
||||||
"project": $.grep(frappe.query_report.filters, function(e){ return e.df.fieldname == 'project'; })[0].$input.val()
|
"project": (project && project.length > 0) ? project[0].$input.val() : ""
|
||||||
};
|
};
|
||||||
frappe.set_route("query-report", "General Ledger");
|
frappe.set_route("query-report", "General Ledger");
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
{% for(var i=0, l=addr_list.length; i<l; i++) { %}
|
{% for(var i=0, l=addr_list.length; i<l; i++) { %}
|
||||||
<p class="h6">
|
<p class="h6">
|
||||||
{%= i+1 %}. {%= addr_list[i].address_type!="Other" ? addr_list[i].address_type : addr_list[i].address_title %}
|
{%= i+1 %}. {%= addr_list[i].address_type!="Other" ? __(addr_list[i].address_type) : addr_list[i].address_title %}
|
||||||
{% if(addr_list[i].is_primary_address) { %}
|
{% if(addr_list[i].is_primary_address) { %}
|
||||||
<span class="text-muted">({%= __("Primary") %})</span>{% } %}
|
<span class="text-muted">({%= __("Primary") %})</span>{% } %}
|
||||||
{% if(addr_list[i].is_shipping_address) { %}
|
{% if(addr_list[i].is_shipping_address) { %}
|
||||||
|
|||||||
@@ -351,6 +351,10 @@ body[data-route="pos"] {
|
|||||||
|
|
||||||
.image-field {
|
.image-field {
|
||||||
height: 140px;
|
height: 140px;
|
||||||
|
|
||||||
|
.placeholder-text {
|
||||||
|
font-size: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pos-item-wrapper {
|
.pos-item-wrapper {
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
|
|||||||
|
|
||||||
frappe.ui.form.on("Assessment Plan", {
|
frappe.ui.form.on("Assessment Plan", {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if (!frm.doc.__islocal) {
|
if (frm.doc.docstatus == 1) {
|
||||||
frm.add_custom_button(__("Assessment Result"), function() {
|
frm.add_custom_button(__("Assessment Result"), function() {
|
||||||
frappe.route_options = {
|
frappe.route_options = {
|
||||||
assessment_plan: frm.doc.name
|
assessment_plan: frm.doc.name,
|
||||||
|
student_batch: frm.doc.student_batch
|
||||||
}
|
}
|
||||||
frappe.set_route("Form", "Assessment Result Tool");
|
frappe.set_route("Form", "Assessment Result Tool");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"autoname": "field:assessment_name",
|
"autoname": "field:assessment_name",
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -42,36 +44,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "assessment_code",
|
|
||||||
"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": "Assessment Code",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Assessment Code",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -102,209 +75,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_bulk_edit": 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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "course",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 1,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Course",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Course",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "maximum_assessment_score",
|
|
||||||
"fieldtype": "Float",
|
|
||||||
"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": "Maximum Assessment Score",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "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": 1,
|
|
||||||
"label": "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": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "student_group",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 1,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Student Group",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Student Group",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_10",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -335,6 +106,159 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "student_group",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 1,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 1,
|
||||||
|
"label": "Student Group",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Student Group",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "course",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 1,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 1,
|
||||||
|
"label": "Course",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Course",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "maximum_assessment_score",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"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": "Maximum Assessment Score",
|
||||||
|
"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,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "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": 1,
|
||||||
|
"label": "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": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -366,6 +290,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -396,6 +321,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -426,6 +352,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -456,6 +383,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -485,6 +413,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -513,6 +442,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -542,6 +472,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -571,6 +502,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -601,6 +533,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -630,6 +563,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -658,6 +592,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -688,6 +623,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -717,18 +653,18 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-02-13 19:34:09.724549",
|
"modified": "2017-04-25 12:23:32.528982",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Schools",
|
"module": "Schools",
|
||||||
"name": "Assessment Plan",
|
"name": "Assessment Plan",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
@@ -5,10 +6,15 @@ cur_frm.add_fetch("assessment_plan", "student_group", "student_group");
|
|||||||
cur_frm.add_fetch("assessment_plan", "student_batch", "student_batch");
|
cur_frm.add_fetch("assessment_plan", "student_batch", "student_batch");
|
||||||
|
|
||||||
frappe.ui.form.on('Assessment Result Tool', {
|
frappe.ui.form.on('Assessment Result Tool', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frm.disable_save();
|
if (frappe.route_options) {
|
||||||
frm.page.clear_indicator();
|
frm.set_value("student_batch", frappe.route_options.student_batch);
|
||||||
},
|
frm.set_value("assessment_plan", frappe.route_options.assessment_plan);
|
||||||
|
frappe.route_options = null;
|
||||||
|
}
|
||||||
|
frm.disable_save();
|
||||||
|
frm.page.clear_indicator();
|
||||||
|
},
|
||||||
|
|
||||||
assessment_plan: function(frm) {
|
assessment_plan: function(frm) {
|
||||||
if(!(frm.doc.student_batch || frm.doc.student_group)) return;
|
if(!(frm.doc.student_batch || frm.doc.student_group)) return;
|
||||||
|
|||||||
@@ -15,6 +15,6 @@ class Course(Document):
|
|||||||
if self.assessment_criteria:
|
if self.assessment_criteria:
|
||||||
total_weightage = 0
|
total_weightage = 0
|
||||||
for criteria in self.assessment_criteria:
|
for criteria in self.assessment_criteria:
|
||||||
total_weightage += criteria.weightage
|
total_weightage += criteria.weightage or 0
|
||||||
if total_weightage != 100:
|
if total_weightage != 100:
|
||||||
frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%"))
|
frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%"))
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"autoname": "",
|
"autoname": "",
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Assessment Criteria",
|
"label": "Assessment Criteria",
|
||||||
@@ -52,6 +54,7 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "",
|
"label": "",
|
||||||
@@ -80,6 +83,7 @@
|
|||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Weightage",
|
"label": "Weightage",
|
||||||
@@ -92,23 +96,23 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-02-01 18:01:40.682674",
|
"modified": "2017-04-21 20:04:26.621419",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Schools",
|
"module": "Schools",
|
||||||
"name": "Course Assessment Criteria",
|
"name": "Course Assessment Criteria",
|
||||||
@@ -118,6 +122,7 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 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": 0,
|
"track_changes": 0,
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ class CourseSchedule(Document):
|
|||||||
self.set_title()
|
self.set_title()
|
||||||
self.validate_mandatory()
|
self.validate_mandatory()
|
||||||
self.validate_course()
|
self.validate_course()
|
||||||
self.set_student_batch()
|
|
||||||
self.validate_date()
|
self.validate_date()
|
||||||
self.validate_overlap()
|
self.validate_overlap()
|
||||||
|
|
||||||
|
|||||||
@@ -24,28 +24,28 @@ class TestCourseSchedule(unittest.TestCase):
|
|||||||
cs1 = make_course_schedule_test_record(simulate= True)
|
cs1 = make_course_schedule_test_record(simulate= True)
|
||||||
|
|
||||||
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
||||||
student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
|
student_group="Course-TC101-2014-2015 (_Test Academic Term)", room="RM0002", do_not_save= 1)
|
||||||
self.assertRaises(OverlapError, cs2.save)
|
self.assertRaises(OverlapError, cs2.save)
|
||||||
|
|
||||||
def test_room_conflict(self):
|
def test_room_conflict(self):
|
||||||
cs1 = make_course_schedule_test_record(simulate= True)
|
cs1 = make_course_schedule_test_record(simulate= True)
|
||||||
|
|
||||||
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
cs2 = make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
||||||
student_group="TC1-TP2--2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
|
student_group="Course-TC101-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", do_not_save= 1)
|
||||||
self.assertRaises(OverlapError, cs2.save)
|
self.assertRaises(OverlapError, cs2.save)
|
||||||
|
|
||||||
def test_no_conflict(self):
|
def test_no_conflict(self):
|
||||||
cs1 = make_course_schedule_test_record(simulate= True)
|
cs1 = make_course_schedule_test_record(simulate= True)
|
||||||
|
|
||||||
make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
make_course_schedule_test_record(from_time= cs1.from_time, to_time= cs1.to_time,
|
||||||
student_group="TC1-TP2-2014-2015-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
|
student_group="Course-TC102-2014-2015 (_Test Academic Term)", instructor="_T-Instructor-00002", room="RM0002")
|
||||||
|
|
||||||
def make_course_schedule_test_record(**args):
|
def make_course_schedule_test_record(**args):
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|
||||||
course_schedule = frappe.new_doc("Course Schedule")
|
course_schedule = frappe.new_doc("Course Schedule")
|
||||||
course_schedule.student_group = args.student_group or "TC-TP1-2014-2015-2014-2015 (_Test Academic Term)"
|
course_schedule.student_group = args.student_group or "Course-TC101-2014-2015 (_Test Academic Term)"
|
||||||
course_schedule.course = args.course or "TC100"
|
course_schedule.course = args.course or "TC101"
|
||||||
course_schedule.instructor = args.instructor or "_T-Instructor-00001"
|
course_schedule.instructor = args.instructor or "_T-Instructor-00001"
|
||||||
course_schedule.room = args.room or "RM0001"
|
course_schedule.room = args.room or "RM0001"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"autoname": "PE.#####",
|
"autoname": "PE.#####",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -74,6 +76,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -104,6 +107,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -134,6 +138,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -164,6 +169,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -192,6 +198,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -222,6 +229,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -252,6 +260,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -282,6 +291,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -312,6 +322,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -341,6 +352,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -370,6 +382,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -400,6 +413,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -429,6 +443,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -460,6 +475,7 @@
|
|||||||
"width": ""
|
"width": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -489,6 +505,7 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -530,7 +547,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-04-12 12:12:10.148274",
|
"modified": "2017-04-24 18:22:43.567607",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Schools",
|
"module": "Schools",
|
||||||
"name": "Program Enrollment",
|
"name": "Program Enrollment",
|
||||||
|
|||||||