diff --git a/.gitignore b/.gitignore
index 68272c7d4d1..473a621326e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,5 @@ erpnext/docs/current
*.swo
__pycache__
*~
+.vscode/
+node_modules/
\ No newline at end of file
diff --git a/README.md b/README.md
index f4a08be548a..8c13e1ed884 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Includes: Accounting, Inventory, Manufacturing, CRM, Sales, Purchase, Project Ma
ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & JavaScript.
-- [User Guide](https://erpnext.org/docs/user)
+- [User Guide](https://erpnext.com/docs/user)
- [Discussion Forum](https://discuss.erpnext.com/)
---
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index a482dac2dfe..465c283ad94 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
-__version__ = '10.1.80'
+__version__ = '11.1.6'
def get_default_company(user=None):
'''Get default company for user'''
@@ -74,7 +74,7 @@ def is_perpetual_inventory_enabled(company):
frappe.local.enable_perpetual_inventory = {}
if not company in frappe.local.enable_perpetual_inventory:
- frappe.local.enable_perpetual_inventory[company] = frappe.get_cached_value('Company',
+ frappe.local.enable_perpetual_inventory[company] = frappe.get_cached_value('Company',
company, "enable_perpetual_inventory") or 0
return frappe.local.enable_perpetual_inventory[company]
@@ -87,7 +87,7 @@ def get_default_finance_book(company=None):
frappe.local.default_finance_book = {}
if not company in frappe.local.default_finance_book:
- frappe.local.default_finance_book[company] = frappe.get_cached_value('Company',
+ frappe.local.default_finance_book[company] = frappe.get_cached_value('Company',
company, "default_finance_book")
return frappe.local.default_finance_book[company]
@@ -108,7 +108,7 @@ def get_region(company=None):
You can also set global company flag in `frappe.flags.company`
'''
if company or frappe.flags.company:
- return frappe.get_cached_value('Company',
+ return frappe.get_cached_value('Company',
company or frappe.flags.company, 'country')
elif frappe.flags.country:
return frappe.flags.country
diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py
index 2ff2644d185..e638fc7b17f 100644
--- a/erpnext/accounts/deferred_revenue.py
+++ b/erpnext/accounts/deferred_revenue.py
@@ -29,7 +29,7 @@ def validate_service_stop_date(doc):
if date_diff(item.service_stop_date, item.service_end_date) > 0:
frappe.throw(_("Service Stop Date cannot be after Service End Date"))
- if old_stop_dates and old_stop_dates[item.name] and item.service_stop_date!=old_stop_dates[item.name]:
+ if old_stop_dates and old_stop_dates.get(item.name) and item.service_stop_date!=old_stop_dates[item.name]:
frappe.throw(_("Cannot change Service Stop Date for item in row {0}".format(item.idx)))
def convert_deferred_expense_to_expense(start_date=None, end_date=None):
@@ -60,7 +60,7 @@ def get_booking_dates(doc, item, start_date=None, end_date=None):
deferred_account = "deferred_revenue_account" if doc.doctype=="Sales Invoice" else "deferred_expense_account"
last_gl_entry, skip = False, False
- booking_end_date = getdate(add_days(today(), -1)) if not end_date else end_date
+ booking_end_date = getdate(add_days(today(), -1) if not end_date else end_date)
if booking_end_date < item.service_start_date or \
(item.service_stop_date and booking_end_date.month > item.service_stop_date.month):
return None, None, None, True
@@ -71,7 +71,7 @@ def get_booking_dates(doc, item, start_date=None, end_date=None):
last_gl_entry = True
booking_end_date = item.service_stop_date
- booking_start_date = getdate(add_months(today(), -1)) if not start_date else start_date
+ booking_start_date = getdate(add_months(today(), -1) if not start_date else start_date)
booking_start_date = booking_start_date \
if booking_start_date > item.service_start_date else item.service_start_date
@@ -113,7 +113,6 @@ def calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total
group by voucher_detail_no
'''.format(total_credit_debit, total_credit_debit_currency),
(doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True)
-
already_booked_amount = gl_entries_details[0].total_credit if gl_entries_details else 0
base_amount = flt(item.base_net_amount - already_booked_amount, item.precision("base_net_amount"))
if account_currency==doc.company_currency:
@@ -128,15 +127,19 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
# book the expense/income on the last day, but it will be trigger on the 1st of month at 12:00 AM
# start_date: 1st of the last month or the start date
# end_date: end_date or today-1
+ enable_check = "enable_deferred_revenue" \
+ if doc.doctype=="Sales Invoice" else "enable_deferred_expense"
gl_entries = []
for item in doc.get('items'):
+ if not item.get(enable_check): continue
+
skip = False
last_gl_entry, booking_start_date, booking_end_date, skip = \
get_booking_dates(doc, item, start_date, end_date)
if skip: continue
- total_days = date_diff(item.service_end_date, item.service_start_date)
+ total_days = date_diff(item.service_end_date, item.service_start_date) + 1
total_booking_days = date_diff(booking_end_date, booking_start_date) + 1
account_currency = get_account_currency(item.expense_account)
@@ -175,6 +178,10 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None):
'project': project
}, account_currency)
)
-
if gl_entries:
- make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True)
+ try:
+ make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True)
+ frappe.db.commit()
+ except:
+ frappe.db.rollback()
+ frappe.log_error(message = frappe.get_traceback(), title = _("Error while processing deferred accounting for {0}").format(doc.name))
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index 9b812a8b56e..bcb163fc198 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -1,5 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe, os, json
diff --git a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
index bf1e967bdbc..014cf45e518 100644
--- a/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
+++ b/erpnext/accounts/doctype/accounts_settings/test_accounts_settings.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import unittest
import frappe
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
index 7814b0883da..917276293d2 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
@@ -26,7 +26,7 @@ class BankReconciliation(Document):
select
"Journal Entry" as payment_document, t1.name as payment_entry,
t1.cheque_no as cheque_number, t1.cheque_date,
- t2.debit_in_account_currency as debit, t2.credit_in_account_currency as credit,
+ sum(t2.debit_in_account_currency) as debit, sum(t2.credit_in_account_currency) as credit,
t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency
from
`tabJournal Entry` t1, `tabJournal Entry Account` t2
@@ -34,6 +34,7 @@ class BankReconciliation(Document):
t2.parent = t1.name and t2.account = %s and t1.docstatus=1
and t1.posting_date >= %s and t1.posting_date <= %s
and ifnull(t1.is_opening, 'No') = 'No' {0}
+ group by t2.account, t1.name
order by t1.posting_date ASC, t1.name DESC
""".format(condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
diff --git a/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py b/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
index 6e7b687c04d..43ebcb0cac9 100644
--- a/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
+++ b/erpnext/accounts/doctype/cash_flow_mapper/default_cash_flow_mapper.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
DEFAULT_MAPPERS = [
{
'doctype': 'Cash Flow Mapper',
diff --git a/erpnext/accounts/doctype/cashier_closing/cashier_closing.json b/erpnext/accounts/doctype/cashier_closing/cashier_closing.json
index 57a9c7aaddf..14e9070f302 100644
--- a/erpnext/accounts/doctype/cashier_closing/cashier_closing.json
+++ b/erpnext/accounts/doctype/cashier_closing/cashier_closing.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -15,6 +16,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -32,7 +34,7 @@
"label": "Series",
"length": 0,
"no_copy": 0,
- "options": "Cashier-closing-\n",
+ "options": "Cashier-closing-",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -43,10 +45,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -74,10 +78,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -105,10 +111,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -135,10 +143,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -166,10 +176,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -188,7 +200,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -197,10 +209,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -219,7 +233,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -228,10 +242,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -250,7 +266,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -259,10 +275,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -291,10 +309,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -321,10 +341,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -351,6 +373,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -364,7 +387,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-03 10:59:54.500567",
+ "modified": "2019-02-19 08:35:23.157327",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cashier Closing",
@@ -373,7 +396,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -399,5 +421,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json
index bdfc70f8b18..7f16beafc31 100644
--- a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json
+++ b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +43,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -63,7 +67,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -72,6 +76,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -85,7 +90,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-09-02 14:45:36.303520",
+ "modified": "2019-02-19 08:34:20.268037",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cashier Closing Payments",
@@ -99,5 +104,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js
index 8f3ae194da0..3df4da52efc 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center.js
@@ -46,7 +46,7 @@ frappe.ui.form.on('Cost Center', {
doctype_name: frm.doc.doctype,
name: frm.doc.name,
field_name: d.fields[0].fieldname,
- field_value: data.cost_center_number,
+ number_value: data.cost_center_number,
company: frm.doc.company
},
callback: function(r) {
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index a00aebe5a23..d80bc7fad10 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -9,6 +9,8 @@ from dateutil.relativedelta import relativedelta
from frappe.model.document import Document
+class FiscalYearIncorrectDate(frappe.ValidationError): pass
+
class FiscalYear(Document):
def set_as_default(self):
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name)
@@ -35,11 +37,14 @@ class FiscalYear(Document):
def validate_dates(self):
if getdate(self.year_start_date) > getdate(self.year_end_date):
- frappe.throw(_("Fiscal Year Start Date should not be greater than Fiscal Year End Date"))
+ frappe.throw(_("Fiscal Year Start Date should be one year earlier than Fiscal Year End Date"),
+ FiscalYearIncorrectDate)
- if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366:
- date = getdate(self.year_start_date) + relativedelta(years=1) - relativedelta(days=1)
- self.year_end_date = date.strftime("%Y-%m-%d")
+ date = getdate(self.year_start_date) + relativedelta(years=1) - relativedelta(days=1)
+
+ if getdate(self.year_end_date) != date:
+ frappe.throw(_("Fiscal Year End Date should be one year after Fiscal Year Start Date"),
+ FiscalYearIncorrectDate)
def on_update(self):
check_duplicate_fiscal_year(self)
diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py
index 5f90bb38670..f7b77827668 100644
--- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py
@@ -5,6 +5,8 @@ from __future__ import unicode_literals
import frappe, unittest
+from erpnext.accounts.doctype.fiscal_year.fiscal_year import FiscalYearIncorrectDate
+
test_records = frappe.get_test_records('Fiscal Year')
test_ignore = ["Company"]
@@ -12,12 +14,12 @@ class TestFiscalYear(unittest.TestCase):
def test_extra_year(self):
if frappe.db.exists("Fiscal Year", "_Test Fiscal Year 2000"):
frappe.delete_doc("Fiscal Year", "_Test Fiscal Year 2000")
+
fy = frappe.get_doc({
"doctype": "Fiscal Year",
"year": "_Test Fiscal Year 2000",
"year_end_date": "2002-12-31",
"year_start_date": "2000-04-01"
})
- fy.insert()
- self.assertEqual(fy.year_end_date, '2001-03-31')
+ self.assertRaises(FiscalYearIncorrectDate, fy.insert)
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 8d50811a6c1..a18883f519b 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -205,6 +205,13 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
};
}
+ // payroll entry
+ if(jvd.reference_type==="Payroll Entry") {
+ return {
+ query: "erpnext.hr.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv",
+ };
+ }
+
var out = {
filters: [
[jvd.reference_type, "docstatus", "=", 1]
@@ -227,10 +234,18 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
out.filters.push([jvd.reference_type, "per_billed", "<", 100]);
}
-
+
if(jvd.party_type && jvd.party) {
- out.filters.push([jvd.reference_type,
- (jvd.reference_type.indexOf("Sales")===0 ? "customer" : "supplier"), "=", jvd.party]);
+ var party_field = "";
+ if(jvd.reference_type.indexOf("Sales")===0) {
+ var party_field = "customer";
+ } else if (jvd.reference_type.indexOf("Purchase")===0) {
+ var party_field = "supplier";
+ }
+
+ if (party_field) {
+ out.filters.push([jvd.reference_type, party_field, "=", jvd.party]);
+ }
}
return out;
diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
index 5a827bea819..32e49dbde49 100644
--- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
+++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -398,7 +399,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "6",
+ "precision": "9",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -911,7 +912,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-08-19 04:08:44.742510",
+ "modified": "2019-02-18 19:00:53.662788",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",
diff --git a/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py
index 834d105d697..efbf4eb105f 100644
--- a/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py
+++ b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
+from __future__ import unicode_literals
import frappe
import unittest
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 7f1f55005c0..f303301a33a 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -171,7 +171,7 @@ class PaymentEntry(AccountsController):
if not frappe.db.exists(self.party_type, self.party):
frappe.throw(_("Invalid {0}: {1}").format(self.party_type, self.party))
- if self.party_account:
+ if self.party_account and self.party_type in ("Customer", "Supplier"):
self.validate_account_type(self.party_account,
[erpnext.get_party_account_type(self.party_type)])
@@ -689,7 +689,7 @@ def get_party_details(company, party_type, party, date, cost_center=None):
account_currency = get_account_currency(party_account)
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
- _party_name = "title" if party_type == "Student" else party_type.lower() + "_name"
+ _party_name = "title" if party_type in ("Student", "Shareholder") else party_type.lower() + "_name"
party_name = frappe.db.get_value(party_type, party, _party_name)
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
if party_type in ["Customer", "Supplier"]:
diff --git a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
index 80ac69fe8e4..6b93f926cdf 100644
--- a/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
+++ b/erpnext/accounts/doctype/payment_order/payment_order_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.js b/erpnext/accounts/doctype/payment_request/payment_request.js
index ef930d04973..2fce7dd6c28 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.js
+++ b/erpnext/accounts/doctype/payment_request/payment_request.js
@@ -54,7 +54,7 @@ frappe.ui.form.on("Payment Request", "is_a_subscription", function(frm) {
frm.toggle_reqd("payment_gateway_account", frm.doc.is_a_subscription);
frm.toggle_reqd("subscription_plans", frm.doc.is_a_subscription);
- if (frm.doc.is_a_subscription) {
+ if (frm.doc.is_a_subscription && frm.doc.reference_doctype && frm.doc.reference_name) {
frappe.call({
method: "erpnext.accounts.doctype.payment_request.payment_request.get_subscription_details",
args: {"reference_doctype": frm.doc.reference_doctype, "reference_name": frm.doc.reference_name},
diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json
index 76fe8841656..bff995ec5a5 100644
--- a/erpnext/accounts/doctype/payment_request/payment_request.json
+++ b/erpnext/accounts/doctype/payment_request/payment_request.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -425,7 +426,7 @@
"no_copy": 0,
"options": "currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1501,7 +1502,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-06 14:44:43.563367",
+ "modified": "2019-02-18 18:52:34.203239",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index fe99763a351..ac0cd7e895c 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -196,8 +196,9 @@ def get_pricing_rule_for_item(args):
pricing_rule_rate = 0.0
if pricing_rule.currency == args.currency:
pricing_rule_rate = pricing_rule.rate
+
item_details.update({
- "price_list_rate": pricing_rule_rate,
+ "price_list_rate": pricing_rule_rate * args.get("conversion_factor"),
"discount_percentage": 0.0
})
else:
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 263b5bb75e6..b4fd91f6e43 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -9,9 +9,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
this.setup_posting_date_time_check();
this._super(doc);
- // formatter for material request item
- this.frm.set_indicator_formatter('item_code',
- function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" })
+ // formatter for purchase invoice item
+ if(this.frm.doc.update_stock) {
+ this.frm.set_indicator_formatter('item_code', function(doc) {
+ return (doc.qty<=doc.received_qty) ? "green" : "orange";
+ });
+ }
},
onload: function() {
this._super();
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index f2d5006cd0a..0dd716df3ff 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -231,7 +231,7 @@ class PurchaseInvoice(BuyingController):
item.expense_account = warehouse_account[item.warehouse]["account"]
else:
item.expense_account = stock_not_billed_account
- elif item.is_fixed_asset and d.pr_detail:
+ elif item.is_fixed_asset and item.pr_detail:
item.expense_account = asset_received_but_not_billed
elif not item.expense_account and for_validate:
throw(_("Expense account is mandatory for item {0}").format(item.item_code or item.item_name))
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
index f101b6aa7ea..173939df008 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index c2309b264a9..6da171f1b95 100644
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -293,7 +293,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -321,7 +321,7 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Qty",
+ "label": "Accepted Qty",
"length": 0,
"no_copy": 0,
"oldfieldname": "qty",
@@ -358,7 +358,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2626,7 +2626,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2019-01-07 16:52:00.749414",
+ "modified": "2019-02-18 19:03:19.250280",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 287da08ef5f..3e013f5d6b3 100755
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
-
-
+from __future__ import unicode_literals
import json
@@ -55,6 +54,7 @@ def get_pos_data():
'barcode_data': get_barcode_data(items_list),
'tax_data': get_item_tax_data(),
'price_list_data': get_price_list_data(doc.selling_price_list),
+ 'customer_wise_price_list': get_customer_wise_price_list(),
'bin_data': get_bin_data(pos_profile),
'pricing_rules': get_pricing_rule_data(doc),
'print_template': print_template,
@@ -328,15 +328,32 @@ def get_price_list_data(selling_price_list):
return itemwise_price_list
+def get_customer_wise_price_list():
+ customer_wise_price = {}
+ customer_price_list_mapping = frappe._dict(frappe.get_all('Customer',fields = ['default_price_list', 'name'], as_list=1))
+
+ price_lists = frappe.db.sql(""" Select ifnull(price_list_rate, 0) as price_list_rate,
+ item_code, price_list from `tabItem Price` """, as_dict=1)
+
+ for item in price_lists:
+ if item.price_list and customer_price_list_mapping.get(item.price_list):
+
+ customer_wise_price.setdefault(customer_price_list_mapping.get(item.price_list),{}).setdefault(
+ item.item_code, item.price_list_rate
+ )
+
+ return customer_wise_price
def get_bin_data(pos_profile):
itemwise_bin_data = {}
cond = "1=1"
if pos_profile.get('warehouse'):
- cond = "warehouse = '{0}'".format(pos_profile.get('warehouse'))
+ cond = "warehouse = %(warehouse)s"
bin_data = frappe.db.sql(""" select item_code, warehouse, actual_qty from `tabBin`
- where actual_qty > 0 and {cond}""".format(cond=cond), as_dict=1)
+ where actual_qty > 0 and {cond}""".format(cond=cond), {
+ 'warehouse': frappe.db.escape(pos_profile.get('warehouse'))
+ }, as_dict=1)
for bins in bin_data:
if bins.item_code not in itemwise_bin_data:
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 91a44b377df..8911ddf4645 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -217,6 +217,9 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
this.get_terms();
},
customer: function() {
+ if (this.frm.doc.is_pos){
+ var pos_profile = this.frm.doc.pos_profile;
+ }
var me = this;
if(this.frm.updating_party_details) return;
erpnext.utils.get_party_details(this.frm,
@@ -226,6 +229,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
party_type: "Customer",
account: this.frm.doc.debit_to,
price_list: this.frm.doc.selling_price_list,
+ pos_profile: pos_profile
}, function() {
me.apply_pricing_rule();
});
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 13ba053baeb..077d99512ac 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1966,7 +1966,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -5644,7 +5644,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2019-01-07 16:51:53.914523",
+ "modified": "2019-02-18 18:56:51.265257",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 6072fb895cd..abd201f5c70 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -24,6 +24,7 @@ from erpnext.accounts.general_ledger import get_round_off_account_and_cost_cente
from erpnext.accounts.doctype.loyalty_program.loyalty_program import \
get_loyalty_program_details_with_points, get_loyalty_details, validate_loyalty_points
from erpnext.accounts.deferred_revenue import validate_service_stop_date
+from erpnext.controllers.accounts_controller import on_submit_regional, on_cancel_regional
from erpnext.healthcare.utils import manage_invoice_submit_cancel
@@ -198,6 +199,8 @@ class SalesInvoice(SellingController):
if "Healthcare" in active_domains:
manage_invoice_submit_cancel(self, "on_submit")
+ on_submit_regional(self)
+
def validate_pos_paid_amount(self):
if len(self.payments) == 0 and self.is_pos:
frappe.throw(_("At least one mode of payment is required for POS invoice."))
@@ -253,6 +256,8 @@ class SalesInvoice(SellingController):
if "Healthcare" in active_domains:
manage_invoice_submit_cancel(self, "on_cancel")
+ on_cancel_regional(self)
+
def update_status_updater_args(self):
if cint(self.update_stock):
self.status_updater.extend([{
@@ -398,11 +403,16 @@ class SalesInvoice(SellingController):
self.account_for_change_amount = pos.get('account_for_change_amount')
for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name',
- 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account', 'company_address',
+ 'company', 'select_print_heading', 'cash_bank_account', 'company_address',
'write_off_account', 'write_off_cost_center', 'apply_discount_on'):
if (not for_validate) or (for_validate and not self.get(fieldname)):
self.set(fieldname, pos.get(fieldname))
+ customer_price_list = frappe.get_value("Customer", self.customer, 'default_price_list')
+
+ if not customer_price_list:
+ self.set('selling_price_list', pos.get('selling_price_list'))
+
if not for_validate:
self.update_stock = cint(pos.get("update_stock"))
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
index 71fce776950..28da8156550 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index d6ce11536e5..a95f3146616 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -779,7 +779,7 @@
"no_copy": 0,
"options": "currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -913,7 +913,7 @@
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -2766,7 +2766,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2019-01-07 16:51:55.018091",
+ "modified": "2019-02-18 18:59:52.223628",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
index 438328d60d3..ccdabfe5444 100644
--- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
+++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -13,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,11 +42,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -72,16 +75,17 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "default": "0.0",
+ "default": "",
"depends_on": "eval:parent.doctype == 'Sales Invoice'",
"fieldname": "amount",
"fieldtype": "Currency",
@@ -97,7 +101,7 @@
"no_copy": 0,
"options": "currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -106,11 +110,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -136,11 +141,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -168,16 +174,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "mode_of_payment.type",
+ "fetch_from": "mode_of_payment.type",
"fieldname": "type",
"fieldtype": "Read Only",
"hidden": 0,
@@ -201,11 +208,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -233,11 +241,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -264,7 +273,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -278,7 +287,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-16 22:42:52.033991",
+ "modified": "2019-02-18 15:03:59.720469",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Payment",
@@ -292,5 +301,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
index 50eed241d45..f7b9aef96cc 100644
--- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
+++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json
@@ -1,5 +1,7 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -12,6 +14,8 @@
"engine": "InnoDB",
"fields": [
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -39,9 +43,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -68,9 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -88,7 +98,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -97,9 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -126,20 +139,21 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
-
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-02-17 16:47:04.413420",
+ "modified": "2019-02-18 18:50:44.770361",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Timesheet",
@@ -153,5 +167,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index c89035c33f3..c3274b9fb5b 100755
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -125,7 +125,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.page.add_menu_item(__("Cashier Closing"), function () {
frappe.set_route('List', 'Cashier Closing');
- });
+ });
this.page.add_menu_item(__("POS Profile"), function () {
frappe.set_route('List', 'POS Profile');
@@ -313,6 +313,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.contacts = r.message.contacts;
this.address = r.message.address || {};
this.price_list_data = r.message.price_list_data;
+ this.customer_wise_price_list = r.message.customer_wise_price_list
this.bin_data = r.message.bin_data;
this.pricing_rules = r.message.pricing_rules;
this.print_template = r.message.print_template;
@@ -602,7 +603,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.remove_item = []
idx = $(this.wrapper).find(".pos-selected-item-action").attr("data-idx")
this.remove_item.push(idx)
- this.remove_zero_qty_item()
+ this.remove_zero_qty_items_from_cart()
this.update_paid_amount_status(false)
},
@@ -798,6 +799,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
if (item.action) {
$(this).val("");
}
+ me.make_item_list(item.customer_name);
});
},
@@ -1037,7 +1039,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.numeric_keypad.show();
},
- make_item_list: function () {
+ make_item_list: function (customer) {
var me = this;
if (!this.price_list) {
frappe.msgprint(__("Price List not found or disabled"));
@@ -1051,10 +1053,17 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
if (this.items.length > 0) {
$.each(this.items, function(index, obj) {
+ let customer_price_list = me.customer_wise_price_list[customer];
+ let item_price
+ if (customer && customer_price_list && customer_price_list[obj.name]) {
+ item_price = format_currency(customer_price_list[obj.name], me.frm.doc.currency);
+ } else {
+ item_price = format_currency(me.price_list_data[obj.name], me.frm.doc.currency);
+ }
if(index < me.page_len) {
$(frappe.render_template("pos_item", {
item_code: obj.name,
- item_price: format_currency(me.price_list_data[obj.name], me.frm.doc.currency),
+ item_price: item_price,
item_name: obj.name === obj.item_name ? "" : obj.item_name,
item_image: obj.image,
item_stock: __('Stock Qty') + ": " + me.get_actual_qty(obj),
@@ -1167,20 +1176,27 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
$(this.wrapper).on("change", ".pos-item-qty", function () {
var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
var qty = $(this).val();
- me.update_qty(item_code, qty)
- me.update_value()
+ me.update_qty(item_code, qty);
+ me.update_value();
+ })
+
+ $(this.wrapper).on("focusout", ".pos-item-qty", function () {
+ var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code");
+ var qty = $(this).val();
+ me.update_qty(item_code, qty, true);
+ me.update_value();
})
$(this.wrapper).find("[data-action='increase-qty']").on("click", function () {
var item_code = $(this).parents(".pos-bill-item").attr("data-item-code");
var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) + 1;
- me.update_qty(item_code, qty)
+ me.update_qty(item_code, qty);
})
$(this.wrapper).find("[data-action='decrease-qty']").on("click", function () {
var item_code = $(this).parents(".pos-bill-item").attr("data-item-code");
var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) - 1;
- me.update_qty(item_code, qty)
+ me.update_qty(item_code, qty);
})
$(this.wrapper).on("change", ".pos-item-disc", function () {
@@ -1219,11 +1235,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
me.bind_delete_event()
},
- update_qty: function (item_code, qty) {
+ update_qty: function (item_code, qty, remove_zero_qty_items) {
var me = this;
this.items = this.get_items(item_code);
this.validate_serial_no()
- this.set_item_details(item_code, "qty", qty);
+ this.set_item_details(item_code, "qty", qty, remove_zero_qty_items);
},
update_discount: function(item_code, discount) {
@@ -1284,7 +1300,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
})
},
- set_item_details: function (item_code, field, value) {
+ set_item_details: function (item_code, field, value, remove_zero_qty_items) {
var me = this;
if (value < 0) {
frappe.throw(__("Enter value must be positive"));
@@ -1299,7 +1315,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
d[field] = flt(value);
d.amount = flt(d.rate) * flt(d.qty);
- if (d.qty == 0) {
+ if (d.qty == 0 && remove_zero_qty_items) {
me.remove_item.push(d.idx)
}
@@ -1309,10 +1325,14 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
}
});
+ if (field == 'qty') {
+ this.remove_zero_qty_items_from_cart();
+ }
+
this.update_paid_amount_status(false)
},
- remove_zero_qty_item: function () {
+ remove_zero_qty_items_from_cart: function () {
var me = this;
var idx = 0;
this.items = []
@@ -1417,8 +1437,20 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.income_account = this.pos_profile_data['income_account'] || this.items[0].income_account;
this.child.warehouse = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][1] : (this.pos_profile_data['warehouse'] || this.items[0].default_warehouse));
- this.child.price_list_rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
- this.child.rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
+
+ customer = this.frm.doc.customer;
+ let rate;
+
+ customer_price_list = this.customer_wise_price_list[customer]
+ if (customer_price_list && customer_price_list[this.child.item_code]){
+ rate = flt(this.customer_wise_price_list[customer][this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
+ }
+ else{
+ rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9);
+ }
+
+ this.child.price_list_rate = rate;
+ this.child.rate = rate;
this.child.actual_qty = me.get_actual_qty(this.items[0]);
this.child.amount = flt(this.child.qty) * flt(this.child.rate);
this.child.batch_no = this.item_batch_no[this.child.item_code];
@@ -1826,10 +1858,25 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
validate: function () {
var me = this;
this.customer_validate();
+ this.validate_zero_qty_items();
this.item_validate();
this.validate_mode_of_payments();
},
+ validate_zero_qty_items: function() {
+ this.remove_item = [];
+
+ this.frm.doc.items.forEach(d => {
+ if (d.qty == 0) {
+ this.remove_item.push(d.idx);
+ }
+ });
+
+ if(this.remove_item) {
+ this.remove_zero_qty_items_from_cart();
+ }
+ },
+
item_validate: function () {
if (this.frm.doc.items.length == 0) {
frappe.throw(__("Select items to save the invoice"))
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 1e1f8b5b830..5855ac3bcd5 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -22,18 +22,20 @@ class DuplicatePartyAccountError(frappe.ValidationError): pass
@frappe.whitelist()
def get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
- bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True, party_address=None, shipping_address=None):
+ bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False, fetch_payment_terms_template=True,
+ party_address=None, shipping_address=None, pos_profile=None):
if not party:
return {}
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
return _get_party_details(party, account, party_type,
- company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions, fetch_payment_terms_template, party_address, shipping_address)
+ company, posting_date, bill_date, price_list, currency, doctype, ignore_permissions,
+ fetch_payment_terms_template, party_address, shipping_address, pos_profile)
def _get_party_details(party=None, account=None, party_type="Customer", company=None, posting_date=None,
bill_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False,
- fetch_payment_terms_template=True, party_address=None, shipping_address=None):
+ fetch_payment_terms_template=True, party_address=None, shipping_address=None, pos_profile=None):
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, bill_date, doctype))
party = out[party_type.lower()]
@@ -49,7 +51,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
set_address_details(out, party, party_type, doctype, company, party_address, shipping_address)
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
- set_price_list(out, party, party_type, price_list)
+ set_price_list(out, party, party_type, price_list, pos_profile)
out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
@@ -149,12 +151,20 @@ def get_default_price_list(party):
return None
-def set_price_list(out, party, party_type, given_price_list):
+def set_price_list(out, party, party_type, given_price_list, pos=None):
# price list
price_list = get_permitted_documents('Price List')
if price_list:
price_list = price_list[0]
+ elif pos and party_type == 'Customer':
+ customer_price_list = frappe.get_value('Customer', party.name, 'default_price_list')
+
+ if customer_price_list:
+ price_list = customer_price_list
+ else:
+ pos_price_list = frappe.get_value('POS Profile', pos, 'selling_price_list')
+ price_list = pos_price_list or given_price_list
else:
price_list = get_default_price_list(party) or given_price_list
diff --git a/erpnext/accounts/print_format/gst_pos_invoice/gst_pos_invoice.json b/erpnext/accounts/print_format/gst_pos_invoice/gst_pos_invoice.json
index 33af3135dd2..8a313688b98 100644
--- a/erpnext/accounts/print_format/gst_pos_invoice/gst_pos_invoice.json
+++ b/erpnext/accounts/print_format/gst_pos_invoice/gst_pos_invoice.json
@@ -7,10 +7,10 @@
"docstatus": 0,
"doctype": "Print Format",
"font": "Default",
- "html": "\n\n
\n\t{{ doc.company }}
\n\t{% if doc.company_address_display %}\n\t\t{% set company_address = doc.company_address_display.replace(\"\\n\", \" \").replace(\"
\", \" \") %}\n\t\t{% if \"GSTIN\" not in company_address %}\n\t\t\t{{ company_address }}\n\t\t\t{{ _(\"GSTIN\") }}:{{ doc.company_gstin }}\n\t\t{% else %}\n\t\t\t{{ company_address.replace(\"GSTIN\", \"
GSTIN\") }}\n\t\t{% endif %}\n\t{% endif %}\n\t
\n\t{% if doc.docstatus == 0 %}\n\t\t{{ doc.status + \" \"+ (doc.select_print_heading or _(\"Invoice\")) }}
\n\t{% else %}\n\t\t{{ doc.select_print_heading or _(\"Invoice\") }}
\n\t{% endif %}\n
\n\n\t{{ _(\"Receipt No\") }}: {{ doc.name }}
\n\t{{ _(\"Date\") }}: {{ doc.get_formatted(\"posting_date\") }}
\n\t{% if doc.grand_total > 50000 %}\n\t\t{% set customer_address = doc.address_display.replace(\"\\n\", \" \").replace(\"
\", \" \") %}\n\t\t{{ _(\"Customer\") }}:
\n\t\t{{ doc.customer_name }}
\n\t\t{{ customer_address }}\n\t{% endif %}\n
\n\n
\n\n\t\n\t\t\n\t\t\t| {{ _(\"Item\") }} | \n\t\t\t{{ _(\"Qty\") }} | \n\t\t\t{{ _(\"Amount\") }} | \n\t\t
\n\t\n\t\n\t\t{%- for item in doc.items -%}\n\t\t\n\t\t\t\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t {{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.gst_hsn_code -%}\n\t\t\t\t\t {{ _(\"HSN/SAC\") }}: {{ item.gst_hsn_code }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t {{ _(\"Serial No\") }}: {{ item.serial_no }}\n\t\t\t\t{%- endif -%}\n\t\t\t | \n\t\t\t{{ item.qty }} @ {{ item.rate }} | \n\t\t\t{{ item.get_formatted(\"amount\") }} | \n\t\t
\n\t\t{%- endfor -%}\n\t\n
\n\n\t\n\t\t\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t| \n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t | \n\t\t\t{% else %}\n\t\t\t\t\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t | \n\t\t\t{% endif %}\n\t\t
\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print -%}\n\t\t\t\n\t\t\t\t| \n\t\t\t\t\t{{ row.description }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t | \n\t\t\t
\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t
\n\t\t\t| \n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t | \n\t\t
\n\t\t{%- endif -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Grand Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t | \n\t\t
\n\t\t{%- if doc.rounded_total -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Rounded Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t | \n\t\t
\n\t\t{%- endif -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Paid Amount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t | \n\t\t
\n\t{%- if doc.change_amount -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Change Amount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t | \n\t\t
\n\t{%- endif -%}\n\t\n
\nTax Breakup:
\n\n\t{{ doc.other_charges_calculation }}\n
\n{{ doc.terms or \"\" }}
\n{{ _(\"Thank you, please visit again.\") }}
",
+ "html": "\n\n\n\t{{ doc.company }}
\n\t{% if doc.company_address_display %}\n\t\t{% set company_address = doc.company_address_display.replace(\"\\n\", \" \").replace(\"
\", \" \") %}\n\t\t{% if \"GSTIN\" not in company_address %}\n\t\t\t{{ company_address }}\n\t\t\t{{ _(\"GSTIN\") }}:{{ doc.company_gstin }}\n\t\t{% else %}\n\t\t\t{{ company_address.replace(\"GSTIN\", \"
GSTIN\") }}\n\t\t{% endif %}\n\t{% endif %}\n\t
\n\t{% if doc.docstatus == 0 %}\n\t\t{{ doc.status + \" \"+ (doc.select_print_heading or _(\"Invoice\")) }}
\n\t{% else %}\n\t\t{{ doc.select_print_heading or _(\"Invoice\") }}
\n\t{% endif %}\n
\n\n\t{{ _(\"Receipt No\") }}: {{ doc.name }}
\n\t{{ _(\"Date\") }}: {{ doc.get_formatted(\"posting_date\") }}
\n\t{% if doc.grand_total > 50000 %}\n\t\t{% set customer_address = doc.address_display.replace(\"\\n\", \" \").replace(\"
\", \" \") %}\n\t\t{{ _(\"Customer\") }}:
\n\t\t{{ doc.customer_name }}
\n\t\t{{ customer_address }}\n\t{% endif %}\n
\n\n
\n\n\t\n\t\t\n\t\t\t| {{ _(\"Item\") }} | \n\t\t\t{{ _(\"Qty\") }} | \n\t\t\t{{ _(\"Amount\") }} | \n\t\t
\n\t\n\t\n\t\t{%- for item in doc.items -%}\n\t\t\n\t\t\t\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t {{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.gst_hsn_code -%}\n\t\t\t\t\t {{ _(\"HSN/SAC\") }}: {{ item.gst_hsn_code }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t {{ _(\"Serial No\") }}: {{ item.serial_no }}\n\t\t\t\t{%- endif -%}\n\t\t\t | \n\t\t\t{{ item.qty }} @ {{ item.rate }} | \n\t\t\t{{ item.get_formatted(\"amount\") }} | \n\t\t
\n\t\t{%- endfor -%}\n\t\n
\n\n\t\n\t\t\n\t\t\t{% if doc.flags.show_inclusive_tax_in_print %}\n\t\t\t\t| \n\t\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t\t | \n\t\t\t{% else %}\n\t\t\t\t\n\t\t\t\t\t{{ _(\"Total\") }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ doc.get_formatted(\"total\", doc) }}\n\t\t\t\t | \n\t\t\t{% endif %}\n\t\t
\n\t\t{%- for row in doc.taxes -%}\n\t\t {%- if (not row.included_in_print_rate or doc.flags.show_inclusive_tax_in_print) and row.tax_amount != 0 -%}\n\t\t\t\n\t\t\t\t| \n\t\t\t\t\t{{ row.description }}\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t | \n\t\t\t
\n\t\t {%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t
\n\t\t\t| \n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t | \n\t\t
\n\t\t{%- endif -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Grand Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t | \n\t\t
\n\t\t{%- if doc.rounded_total -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Rounded Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t | \n\t\t
\n\t\t{%- endif -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Paid Amount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t | \n\t\t
\n\t{%- if doc.change_amount -%}\n\t\t\n\t\t\t| \n\t\t\t\t{{ _(\"Change Amount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t | \n\t\t
\n\t{%- endif -%}\n\t\n
\n{{ doc.terms or \"\" }}
\n{{ _(\"Thank you, please visit again.\") }}
",
"idx": 0,
"line_breaks": 0,
- "modified": "2018-03-20 14:24:08.167930",
+ "modified": "2019-01-24 17:09:27.190929",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GST POS Invoice",
diff --git a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
index f911eaa5c14..43786a44464 100644
--- a/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/test_accounts_receivable.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
import frappe.defaults
import unittest
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index cc21d3427d3..73ca8b48ef5 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -190,7 +190,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
def get_voucherwise_data(self, party_naming_by, args):
voucherwise_data = ReceivablePayableReport(self.filters).run(args)[1]
- cols = ["posting_date", "party", "customer-contact"]
+ cols = ["posting_date", "party"]
if party_naming_by == "Naming Series":
cols += ["party_name"]
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py
index 13424dbcb56..0861b20f14a 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py
@@ -36,8 +36,8 @@ def get_conditions(filters):
def get_entries(filters):
conditions = get_conditions(filters)
journal_entries = frappe.db.sql("""SELECT
- "Journal Entry", jv.name, jv.posting_date, jv.cheque_no, jv.clearance_date, jvd.against_account,
- if((jvd.debit - jvd.credit) < 0, (jvd.debit - jvd.credit) * -1, (jvd.debit - jvd.credit))
+ "Journal Entry", jv.name, jv.posting_date, jv.cheque_no,
+ jv.clearance_date, jvd.against_account, jvd.debit - jvd.credit
FROM
`tabJournal Entry Account` jvd, `tabJournal Entry` jv
WHERE
@@ -46,7 +46,7 @@ def get_entries(filters):
payment_entries = frappe.db.sql("""SELECT
"Payment Entry", name, posting_date, reference_no, clearance_date, party,
- if(paid_from=%(account)s, paid_amount, received_amount)
+ if(paid_from=%(account)s, paid_amount * -1, received_amount)
FROM
`tabPayment Entry`
WHERE
diff --git a/erpnext/accounts/report/customer_ledger_summary/__init__.py b/erpnext/accounts/report/customer_ledger_summary/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
new file mode 100644
index 00000000000..a1236316638
--- /dev/null
+++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.js
@@ -0,0 +1,97 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Customer Ledger Summary"] = {
+ "filters": [
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "default": frappe.defaults.get_user_default("Company")
+ },
+ {
+ "fieldname":"from_date",
+ "label": __("From Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname":"to_date",
+ "label": __("To Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today(),
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
+ "fieldname":"party",
+ "label": __("Customer"),
+ "fieldtype": "Link",
+ "options": "Customer",
+ on_change: () => {
+ var party = frappe.query_report.get_filter_value('party');
+ if (party) {
+ frappe.db.get_value('Customer', party, ["tax_id", "customer_name"], function(value) {
+ frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
+ frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
+ });
+ } else {
+ frappe.query_report.set_filter_value('tax_id', "");
+ frappe.query_report.set_filter_value('customer_name', "");
+ }
+ }
+ },
+ {
+ "fieldname":"customer_group",
+ "label": __("Customer Group"),
+ "fieldtype": "Link",
+ "options": "Customer Group"
+ },
+ {
+ "fieldname":"payment_terms_template",
+ "label": __("Payment Terms Template"),
+ "fieldtype": "Link",
+ "options": "Payment Terms Template"
+ },
+ {
+ "fieldname":"territory",
+ "label": __("Territory"),
+ "fieldtype": "Link",
+ "options": "Territory"
+ },
+ {
+ "fieldname":"sales_partner",
+ "label": __("Sales Partner"),
+ "fieldtype": "Link",
+ "options": "Sales Partner"
+ },
+ {
+ "fieldname":"sales_person",
+ "label": __("Sales Person"),
+ "fieldtype": "Link",
+ "options": "Sales Person"
+ },
+ {
+ "fieldname":"tax_id",
+ "label": __("Tax Id"),
+ "fieldtype": "Data",
+ "hidden": 1
+ },
+ {
+ "fieldname":"customer_name",
+ "label": __("Customer Name"),
+ "fieldtype": "Data",
+ "hidden": 1
+ }
+ ]
+};
diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.json b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.json
new file mode 100644
index 00000000000..91e4e197d3a
--- /dev/null
+++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.json
@@ -0,0 +1,26 @@
+{
+ "add_total_row": 1,
+ "creation": "2018-12-11 00:58:19.078506",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2018-12-11 00:59:21.708343",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Customer Ledger Summary",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Customer Ledger Summary",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Accounts User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
new file mode 100644
index 00000000000..e33bd61411e
--- /dev/null
+++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py
@@ -0,0 +1,321 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+import erpnext
+from frappe import _
+from frappe.utils import getdate, nowdate
+from six import iteritems, itervalues
+
+class PartyLedgerSummaryReport(object):
+ def __init__(self, filters=None):
+ self.filters = frappe._dict(filters or {})
+ self.filters.from_date = getdate(self.filters.from_date or nowdate())
+ self.filters.to_date = getdate(self.filters.to_date or nowdate())
+
+ def run(self, args):
+ if self.filters.from_date > self.filters.to_date:
+ frappe.throw(_("From Date must be before To Date"))
+
+ self.filters.party_type = args.get("party_type")
+ self.party_naming_by = frappe.db.get_value(args.get("naming_by")[0], None, args.get("naming_by")[1])
+
+ discount_account_field = "discount_allowed_account" if self.filters.party_type == "Customer" \
+ else "discount_received_account"
+ self.round_off_account, self.write_off_account, self.discount_account = frappe.get_cached_value('Company',
+ self.filters.company, ["round_off_account", "write_off_account", discount_account_field])
+
+ columns = self.get_columns()
+ data = self.get_data()
+ return columns, data
+
+ def get_columns(self):
+ columns = [{
+ "label": _(self.filters.party_type),
+ "fieldtype": "Link",
+ "fieldname": "party",
+ "options": self.filters.party_type,
+ "width": 200
+ }]
+
+ if self.party_naming_by == "Naming Series":
+ columns.append({
+ "label": _(self.filters.party_type + "Name"),
+ "fieldtype": "Data",
+ "fieldname": "party_name",
+ "width": 110
+ })
+
+ credit_or_debit_note = "Credit Note" if self.filters.party_type == "Customer" else "Debit Note"
+ discount_allowed_or_received = "Discount Allowed" if self.filters.party_type == "Customer" else "Discount Received"
+
+ columns += [
+ {
+ "label": _("Opening Balance"),
+ "fieldname": "opening_balance",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Invoiced Amount"),
+ "fieldname": "invoiced_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Paid Amount"),
+ "fieldname": "paid_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _(credit_or_debit_note),
+ "fieldname": "return_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _(discount_allowed_or_received),
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Write Off Amount"),
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Other Adjustments"),
+ "fieldname": "adjustment_amount",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Closing Balance"),
+ "fieldname": "closing_balance",
+ "fieldtype": "Currency",
+ "options": "currency",
+ "width": 120
+ },
+ {
+ "label": _("Currency"),
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "options": "Currency",
+ "width": 50
+ }
+ ]
+
+ return columns
+
+ def get_data(self):
+ if not self.filters.get("company"):
+ self.filters["company"] = frappe.db.get_single_value('Global Defaults', 'default_company')
+
+ company_currency = frappe.get_cached_value('Company', self.filters.get("company"), "default_currency")
+ invoice_dr_or_cr = "debit" if self.filters.party_type == "Customer" else "credit"
+ reverse_dr_or_cr = "credit" if self.filters.party_type == "Customer" else "debit"
+
+ self.get_gl_entries()
+ self.get_return_invoices()
+ self.get_party_adjustment_amounts()
+
+ self.party_data = frappe._dict({})
+ for gle in self.gl_entries:
+ self.party_data.setdefault(gle.party, frappe._dict({
+ "party": gle.party,
+ "party_name": gle.party_name,
+ "opening_balance": 0,
+ "invoiced_amount": 0,
+ "paid_amount": 0,
+ "return_amount": 0,
+ "closing_balance": 0,
+ "currency": company_currency
+ }))
+
+ amount = gle.get(invoice_dr_or_cr) - gle.get(reverse_dr_or_cr)
+ self.party_data[gle.party].closing_balance += amount
+
+ if gle.posting_date < self.filters.from_date:
+ self.party_data[gle.party].opening_balance += amount
+ else:
+ if amount > 0:
+ self.party_data[gle.party].invoiced_amount += amount
+ elif gle.voucher_no in self.return_invoices:
+ self.party_data[gle.party].return_amount -= amount
+ else:
+ self.party_data[gle.party].paid_amount -= amount
+
+ out = []
+ for party, row in iteritems(self.party_data):
+ if row.opening_balance or row.invoiced_amount or row.paid_amount or row.return_amount or row.closing_amount:
+ total_party_adjustment = sum([amount for amount in itervalues(self.party_adjustment_details.get(party, {}))])
+ row.paid_amount -= total_party_adjustment
+ row.discount_amount = self.party_adjustment_details.get(party, {}).get(self.discount_account, 0)
+ row.write_off_amount = self.party_adjustment_details.get(party, {}).get(self.write_off_account, 0)
+ row.adjustment_amount = total_party_adjustment - row.discount_amount - row.write_off_amount
+
+ out.append(row)
+
+ return out
+
+ def get_gl_entries(self):
+ conditions = self.prepare_conditions()
+ join = join_field = ""
+ if self.filters.party_type == "Customer":
+ join_field = ", p.customer_name as party_name"
+ join = "left join `tabCustomer` p on gle.party = p.name"
+ elif self.filters.party_type == "Supplier":
+ join_field = ", p.supplier_name as party_name"
+ join = "left join `tabSupplier` p on gle.party = p.name"
+
+ self.gl_entries = frappe.db.sql("""
+ select
+ gle.posting_date, gle.party, gle.voucher_type, gle.voucher_no, gle.against_voucher_type,
+ gle.against_voucher, gle.debit, gle.credit {join_field}
+ from `tabGL Entry` gle
+ {join}
+ where
+ gle.docstatus < 2 and gle.party_type=%(party_type)s and ifnull(gle.party, '') != ''
+ and gle.posting_date <= %(to_date)s {conditions}
+ order by gle.posting_date
+ """.format(join=join, join_field=join_field, conditions=conditions), self.filters, as_dict=True)
+
+ def prepare_conditions(self):
+ conditions = [""]
+
+ if self.filters.company:
+ conditions.append("company=%(company)s")
+
+ self.filters.company_finance_book = erpnext.get_default_finance_book(self.filters.company)
+
+ if not self.filters.finance_book or (self.filters.finance_book == self.filters.company_finance_book):
+ conditions.append("ifnull(finance_book,'') in (%(company_finance_book)s, '')")
+ elif self.filters.finance_book:
+ conditions.append("ifnull(finance_book,'') = %(finance_book)s")
+
+ if self.filters.get("party"):
+ conditions.append("party=%(party)s")
+
+ if self.filters.party_type == "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("territory"):
+ lft, rgt = frappe.db.get_value("Territory",
+ self.filters.get("territory"), ["lft", "rgt"])
+
+ conditions.append("""party in (select name from tabCustomer
+ where exists(select name from `tabTerritory` where lft >= {0} and rgt <= {1}
+ and name=tabCustomer.territory))""".format(lft, rgt))
+
+ if self.filters.get("payment_terms_template"):
+ conditions.append("party in (select name from tabCustomer where payment_terms=%(payment_terms_template)s)")
+
+ if self.filters.get("sales_partner"):
+ conditions.append("party in (select name from tabCustomer where default_sales_partner=%(sales_partner)s)")
+
+ if self.filters.get("sales_person"):
+ lft, rgt = frappe.db.get_value("Sales Person",
+ self.filters.get("sales_person"), ["lft", "rgt"])
+
+ conditions.append("""exists(select name from `tabSales Team` steam where
+ steam.sales_person in (select name from `tabSales Person` where lft >= {0} and rgt <= {1})
+ and ((steam.parent = voucher_no and steam.parenttype = voucher_type)
+ or (steam.parent = against_voucher and steam.parenttype = against_voucher_type)
+ or (steam.parent = party and steam.parenttype = 'Customer')))""".format(lft, rgt))
+
+ if self.filters.party_type == "Supplier":
+ if self.filters.get("supplier_group"):
+ conditions.append("""party in (select name from tabSupplier
+ where supplier_group=%(supplier_group)s)""")
+
+ return " and ".join(conditions)
+
+ def get_return_invoices(self):
+ doctype = "Sales Invoice" if self.filters.party_type == "Customer" else "Purchase Invoice"
+ self.return_invoices = [d.name for d in frappe.get_all(doctype, filters={"is_return": 1, "docstatus": 1,
+ "posting_date": ["between", [self.filters.from_date, self.filters.to_date]]})]
+
+ def get_party_adjustment_amounts(self):
+ conditions = self.prepare_conditions()
+ income_or_expense = "Expense" if self.filters.party_type == "Customer" else "Income"
+ invoice_dr_or_cr = "debit" if self.filters.party_type == "Customer" else "credit"
+ reverse_dr_or_cr = "credit" if self.filters.party_type == "Customer" else "debit"
+
+ gl_entries = frappe.db.sql("""
+ select
+ posting_date, account, party, voucher_type, voucher_no, debit, credit
+ from
+ `tabGL Entry`
+ where
+ docstatus < 2
+ and (voucher_type, voucher_no) in (
+ select voucher_type, voucher_no from `tabGL Entry` gle, `tabAccount` acc
+ where acc.name = gle.account and acc.root_type = '{income_or_expense}'
+ and gle.posting_date between %(from_date)s and %(to_date)s and gle.docstatus < 2
+ ) and (voucher_type, voucher_no) in (
+ select voucher_type, voucher_no from `tabGL Entry` gle
+ where gle.party_type=%(party_type)s and ifnull(party, '') != ''
+ and gle.posting_date between %(from_date)s and %(to_date)s and gle.docstatus < 2 {conditions}
+ )
+ """.format(conditions=conditions, income_or_expense=income_or_expense), self.filters, as_dict=True)
+
+ self.party_adjustment_details = {}
+ adjustment_voucher_entries = {}
+ for gle in gl_entries:
+ adjustment_voucher_entries.setdefault((gle.voucher_type, gle.voucher_no), [])
+ adjustment_voucher_entries[(gle.voucher_type, gle.voucher_no)].append(gle)
+
+ for voucher_gl_entries in itervalues(adjustment_voucher_entries):
+ parties = {}
+ accounts = {}
+ has_irrelevant_entry = False
+
+ for gle in voucher_gl_entries:
+ if gle.account == self.round_off_account:
+ continue
+ elif gle.party:
+ parties.setdefault(gle.party, 0)
+ parties[gle.party] += gle.get(reverse_dr_or_cr) - gle.get(invoice_dr_or_cr)
+ elif frappe.get_cached_value("Account", gle.account, "root_type") == income_or_expense:
+ accounts.setdefault(gle.account, 0)
+ accounts[gle.account] += gle.get(invoice_dr_or_cr) - gle.get(reverse_dr_or_cr)
+ else:
+ has_irrelevant_entry = True
+
+ if parties and accounts:
+ if len(parties) == 1:
+ party = parties.keys()[0]
+ for account, amount in iteritems(accounts):
+ self.party_adjustment_details.setdefault(party, {})
+ self.party_adjustment_details[party].setdefault(account, 0)
+ self.party_adjustment_details[party][account] += amount
+ elif len(accounts) == 1 and not has_irrelevant_entry:
+ account = accounts.keys()[0]
+ for party, amount in iteritems(parties):
+ self.party_adjustment_details.setdefault(party, {})
+ self.party_adjustment_details[party].setdefault(account, 0)
+ self.party_adjustment_details[party][account] += amount
+
+def execute(filters=None):
+ args = {
+ "party_type": "Customer",
+ "naming_by": ["Selling Settings", "cust_master_name"],
+ }
+ return PartyLedgerSummaryReport(filters).run(args)
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py
index 8c3deaff484..be6633282ac 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.py
+++ b/erpnext/accounts/report/general_ledger/general_ledger.py
@@ -101,7 +101,7 @@ def set_account_currency(filters):
frappe.db.get_value(filters.party_type, filters.party[0], "default_currency"))
filters["account_currency"] = account_currency or filters.company_currency
- if filters.account_currency != filters.company_currency:
+ if filters.account_currency != filters.company_currency and not filters.presentation_currency:
filters.presentation_currency = filters.account_currency
return filters
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index 5d2409651ee..e33b90d0196 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -193,7 +193,7 @@ def get_invoice_po_pr_map(invoice_list):
pi_items = frappe.db.sql("""
select parent, purchase_order, purchase_receipt, po_detail, project
from `tabPurchase Invoice Item`
- where parent in (%s) and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')
+ where parent in (%s)
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
invoice_po_pr_map = {}
diff --git a/erpnext/accounts/report/supplier_ledger_summary/__init__.py b/erpnext/accounts/report/supplier_ledger_summary/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
new file mode 100644
index 00000000000..6fd16f20908
--- /dev/null
+++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.js
@@ -0,0 +1,97 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Supplier Ledger Summary"] = {
+ "filters": [
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "default": frappe.defaults.get_user_default("Company")
+ },
+ {
+ "fieldname":"from_date",
+ "label": __("From Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname":"to_date",
+ "label": __("To Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today(),
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
+ "fieldname":"party",
+ "label": __("Customer"),
+ "fieldtype": "Link",
+ "options": "Customer",
+ on_change: () => {
+ var party = frappe.query_report.get_filter_value('party');
+ if (party) {
+ frappe.db.get_value('Supplier', party, ["tax_id", "supplier_name"], function(value) {
+ frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
+ frappe.query_report.set_filter_value('supplier_name', value["supplier_name"]);
+ });
+ } else {
+ frappe.query_report.set_filter_value('tax_id', "");
+ frappe.query_report.set_filter_value('supplier_name', "");
+ }
+ }
+ },
+ {
+ "fieldname":"supplier_group",
+ "label": __("Supplier Group"),
+ "fieldtype": "Link",
+ "options": "Supplier Group"
+ },
+ {
+ "fieldname":"payment_terms_template",
+ "label": __("Payment Terms Template"),
+ "fieldtype": "Link",
+ "options": "Payment Terms Template"
+ },
+ {
+ "fieldname":"territory",
+ "label": __("Territory"),
+ "fieldtype": "Link",
+ "options": "Territory"
+ },
+ {
+ "fieldname":"sales_partner",
+ "label": __("Sales Partner"),
+ "fieldtype": "Link",
+ "options": "Sales Partner"
+ },
+ {
+ "fieldname":"sales_person",
+ "label": __("Sales Person"),
+ "fieldtype": "Link",
+ "options": "Sales Person"
+ },
+ {
+ "fieldname":"tax_id",
+ "label": __("Tax Id"),
+ "fieldtype": "Data",
+ "hidden": 1
+ },
+ {
+ "fieldname":"supplier_name",
+ "label": __("Supplier Name"),
+ "fieldtype": "Data",
+ "hidden": 1
+ }
+ ]
+};
diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.json b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.json
new file mode 100644
index 00000000000..eb3b4123e23
--- /dev/null
+++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.json
@@ -0,0 +1,27 @@
+{
+ "add_total_row": 1,
+ "creation": "2018-12-12 05:10:02.987274",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "letter_head": "Capital Traders",
+ "modified": "2018-12-12 05:10:02.987274",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Supplier Ledger Summary",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Supplier Ledger Summary",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Accounts User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py
new file mode 100644
index 00000000000..d2c23ee4e78
--- /dev/null
+++ b/erpnext/accounts/report/supplier_ledger_summary/supplier_ledger_summary.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from erpnext.accounts.report.customer_ledger_summary.customer_ledger_summary import PartyLedgerSummaryReport
+
+def execute(filters=None):
+ args = {
+ "party_type": "Supplier",
+ "naming_by": ["Buying Settings", "supp_master_name"],
+ }
+ return PartyLedgerSummaryReport(filters).run(args)
\ No newline at end of file
diff --git a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
index b19f6306b73..2e805f8d3f5 100644
--- a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
+++ b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py
index e33bd832afb..8a397447383 100644
--- a/erpnext/accounts/report/utils.py
+++ b/erpnext/accounts/report/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext import get_company_currency, get_default_company
from erpnext.setup.utils import get_exchange_rate
@@ -103,7 +104,7 @@ def convert_to_presentation_currency(gl_entries, currency_info):
credit_in_account_currency = flt(entry['credit_in_account_currency'])
account_currency = entry['account_currency']
- if account_currency != presentation_currency or (account_currency == presentation_currency and not is_p_or_l_account(account)):
+ if account_currency != presentation_currency:
value = debit or credit
date = currency_info['report_date'] if not is_p_or_l_account(account) else entry['posting_date']
diff --git a/erpnext/accounts/test/test_utils.py b/erpnext/accounts/test/test_utils.py
index 0fca470fe5e..628c8ce6463 100644
--- a/erpnext/accounts/test/test_utils.py
+++ b/erpnext/accounts/test/test_utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import unittest
from erpnext.accounts.party import get_party_shipping_address
from frappe.test_runner import make_test_objects
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index e145a35b17f..d4e1840eb9c 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -615,38 +615,26 @@ def get_held_invoices(party_type, party):
return held_invoices
-def get_outstanding_invoices(party_type, party, account, condition=None, limit=1000):
+def get_outstanding_invoices(party_type, party, account, condition=None, limit=None):
outstanding_invoices = []
- precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
+ precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
if erpnext.get_party_account_type(party_type) == 'Receivable':
dr_or_cr = "debit_in_account_currency - credit_in_account_currency"
- payment_dr_or_cr = "payment_gl_entry.credit_in_account_currency - payment_gl_entry.debit_in_account_currency"
+ payment_dr_or_cr = "credit_in_account_currency - debit_in_account_currency"
else:
dr_or_cr = "credit_in_account_currency - debit_in_account_currency"
- payment_dr_or_cr = "payment_gl_entry.debit_in_account_currency - payment_gl_entry.credit_in_account_currency"
+ payment_dr_or_cr = "debit_in_account_currency - credit_in_account_currency"
invoice = 'Sales Invoice' if erpnext.get_party_account_type(party_type) == 'Receivable' else 'Purchase Invoice'
held_invoices = get_held_invoices(party_type, party)
- limit_cond = "limit %s" % (limit or 1000)
+ limit_cond = "limit %s" % limit if limit else ""
invoice_list = frappe.db.sql("""
select
- voucher_no, voucher_type, posting_date, ifnull(sum({dr_or_cr}), 0) as invoice_amount,
- (
- select ifnull(sum({payment_dr_or_cr}), 0)
- from `tabGL Entry` payment_gl_entry
- where payment_gl_entry.against_voucher_type = invoice_gl_entry.voucher_type
- and if(invoice_gl_entry.voucher_type='Journal Entry',
- payment_gl_entry.against_voucher = invoice_gl_entry.voucher_no,
- payment_gl_entry.against_voucher = invoice_gl_entry.against_voucher)
- and payment_gl_entry.party_type = invoice_gl_entry.party_type
- and payment_gl_entry.party = invoice_gl_entry.party
- and payment_gl_entry.account = invoice_gl_entry.account
- and {payment_dr_or_cr} > 0
- ) as payment_amount
+ voucher_no, voucher_type, posting_date, ifnull(sum({dr_or_cr}), 0) as invoice_amount
from
- `tabGL Entry` invoice_gl_entry
+ `tabGL Entry`
where
party_type = %(party_type)s and party = %(party)s
and account = %(account)s and {dr_or_cr} > 0
@@ -655,11 +643,9 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=1
and (against_voucher = '' or against_voucher is null))
or (voucher_type not in ('Journal Entry', 'Payment Entry')))
group by voucher_type, voucher_no
- having (invoice_amount - payment_amount) > 0.005
order by posting_date, name {limit_cond}""".format(
dr_or_cr=dr_or_cr,
invoice = invoice,
- payment_dr_or_cr=payment_dr_or_cr,
condition=condition or "",
limit_cond = limit_cond
), {
@@ -668,25 +654,46 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=1
"account": account,
}, as_dict=True)
- for d in invoice_list:
- if not d.voucher_type == "Purchase Invoice" or d.voucher_no not in held_invoices:
- due_date = frappe.db.get_value(
- d.voucher_type, d.voucher_no, "posting_date" if party_type == "Employee" else "due_date")
+ payment_entries = frappe.db.sql("""
+ select against_voucher_type, against_voucher,
+ ifnull(sum({payment_dr_or_cr}), 0) as payment_amount
+ from `tabGL Entry`
+ where party_type = %(party_type)s and party = %(party)s
+ and account = %(account)s
+ and {payment_dr_or_cr} > 0
+ and against_voucher is not null and against_voucher != ''
+ group by against_voucher_type, against_voucher
+ """.format(payment_dr_or_cr=payment_dr_or_cr), {
+ "party_type": party_type,
+ "party": party,
+ "account": account,
+ }, as_dict=True)
- outstanding_invoices.append(
- frappe._dict({
- 'voucher_no': d.voucher_no,
- 'voucher_type': d.voucher_type,
- 'posting_date': d.posting_date,
- 'invoice_amount': flt(d.invoice_amount),
- 'payment_amount': flt(d.payment_amount),
- 'outstanding_amount': flt(d.invoice_amount - d.payment_amount, precision),
- 'due_date': due_date
- })
- )
+ pe_map = frappe._dict()
+ for d in payment_entries:
+ pe_map.setdefault((d.against_voucher_type, d.against_voucher), d.payment_amount)
+
+ for d in invoice_list:
+ payment_amount = pe_map.get((d.voucher_type, d.voucher_no), 0)
+ outstanding_amount = flt(d.invoice_amount - payment_amount, precision)
+ if outstanding_amount > 0.5 / (10**precision):
+ if not d.voucher_type == "Purchase Invoice" or d.voucher_no not in held_invoices:
+ due_date = frappe.db.get_value(
+ d.voucher_type, d.voucher_no, "posting_date" if party_type == "Employee" else "due_date")
+
+ outstanding_invoices.append(
+ frappe._dict({
+ 'voucher_no': d.voucher_no,
+ 'voucher_type': d.voucher_type,
+ 'posting_date': d.posting_date,
+ 'invoice_amount': flt(d.invoice_amount),
+ 'payment_amount': payment_amount,
+ 'outstanding_amount': outstanding_amount,
+ 'due_date': due_date
+ })
+ )
outstanding_invoices = sorted(outstanding_invoices, key=lambda k: k['due_date'] or getdate(nowdate()))
-
return outstanding_invoices
@@ -859,5 +866,3 @@ def get_allow_cost_center_in_entry_of_bs_account():
def generator():
return cint(frappe.db.get_value('Accounts Settings', None, 'allow_cost_center_in_entry_of_bs_account'))
return frappe.local_cache("get_allow_cost_center_in_entry_of_bs_account", (), generator, regenerate_if_none=True)
-
-
diff --git a/erpnext/agriculture/doctype/crop/crop_dashboard.py b/erpnext/agriculture/doctype/crop/crop_dashboard.py
index 715f92b6ebb..9a8f26fe90c 100644
--- a/erpnext/agriculture/doctype/crop/crop_dashboard.py
+++ b/erpnext/agriculture/doctype/crop/crop_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/assets/doctype/asset/asset.json b/erpnext/assets/doctype/asset/asset.json
index 6b3c3cc73d9..bbe92f636a7 100644
--- a/erpnext/assets/doctype/asset/asset.json
+++ b/erpnext/assets/doctype/asset/asset.json
@@ -1812,8 +1812,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fetch_from": "company.default_finance_book",
"fieldname": "default_finance_book",
- "fieldtype": "Read Only",
+ "fieldtype": "Link",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -1824,12 +1825,12 @@
"label": "Default Finance Book",
"length": 0,
"no_copy": 0,
- "options": "company.default_finance_book",
+ "options": "Finance Book",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -1882,7 +1883,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2019-01-15 16:12:48.314196",
+ "modified": "2019-02-12 11:29:01.747819",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset",
diff --git a/erpnext/assets/doctype/asset/asset_dashboard.py b/erpnext/assets/doctype/asset/asset_dashboard.py
index 89699f3edbd..b48989923e2 100644
--- a/erpnext/assets/doctype/asset/asset_dashboard.py
+++ b/erpnext/assets/doctype/asset/asset_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'asset_name',
diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py
index 65629d28181..a12348e451b 100644
--- a/erpnext/assets/doctype/asset/test_asset.py
+++ b/erpnext/assets/doctype/asset/test_asset.py
@@ -69,6 +69,17 @@ class TestAsset(unittest.TestCase):
self.assertFalse(frappe.db.get_value("GL Entry",
{"voucher_type": "Purchase Invoice", "voucher_no": pi.name}))
+ def test_is_fixed_asset_set(self):
+ doc = frappe.new_doc('Purchase Invoice')
+ doc.supplier = '_Test Supplier'
+ doc.append('items', {
+ 'item_code': 'Macbook Pro',
+ 'qty': 1
+ })
+
+ doc.set_missing_values()
+ self.assertEquals(doc.items[0].is_fixed_asset, 1)
+
def test_schedule_for_straight_line_method(self):
pr = make_purchase_receipt(item_code="Macbook Pro",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 3c4ef2b17fe..a4a636d6baa 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -456,7 +456,7 @@ def make_rm_stock_entry(purchase_order, rm_items):
items_dict = {
rm_item_code: {
"item_name": rm_item_data["item_name"],
- "description": item_wh[rm_item_code].get('description'),
+ "description": item_wh.get(rm_item_code, {}).get('description', ""),
'qty': rm_item_data["qty"],
'from_warehouse': rm_item_data["warehouse"],
'stock_uom': rm_item_data["stock_uom"],
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
index cce4b2747be..ab514dac308 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
index 95825230016..6efbc782252 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/buying/doctype/supplier/supplier_dashboard.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py
index f971776948f..aea1e2d38c0 100644
--- a/erpnext/buying/doctype/supplier/supplier_dashboard.py
+++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
index 0387437b329..6b40305e01f 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
index 94d93f6a61f..3c775cd6d9b 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
@@ -848,7 +848,7 @@
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "100px",
@@ -1786,7 +1786,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2019-01-07 16:52:02.125715",
+ "modified": "2019-02-18 18:58:10.351451",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
index e7a704a28af..5f5f54b79f5 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.js
@@ -13,15 +13,23 @@ frappe.ui.form.on("Supplier Scorecard", {
},
onload: function(frm) {
if (frm.doc.__unsaved == 1) {
- loadAllCriteria(frm);
loadAllStandings(frm);
}
-
},
- refresh: function(frm) {
- if (frm.dashboard.hasOwnProperty('heatmap')) {
- frm.dashboard.heatmap.setLegend([0,20,40,60,80,101],["#991600","#169900"]);
- }
+ load_criteria: function(frm) {
+ frappe.call({
+ method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_criteria_list",
+ callback: function(r) {
+ frm.set_value('criteria', []);
+ for (var i = 0; i < r.message.length; i++)
+ {
+ var row = frm.add_child("criteria");
+ row.criteria_name = r.message[i].name;
+ frm.script_manager.trigger("criteria_name", row.doctype, row.name);
+ }
+ refresh_field("criteria");
+ }
+ });
}
});
@@ -29,8 +37,8 @@ frappe.ui.form.on("Supplier Scorecard", {
frappe.ui.form.on("Supplier Scorecard Scoring Standing", {
standing_name: function(frm, cdt, cdn) {
- if (frm.doc.standing_name != undefined) {
- var d = frappe.get_doc(cdt, cdn);
+ var d = frappe.get_doc(cdt, cdn);
+ if (d.standing_name) {
return frm.call({
method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_scoring_standing",
child: d,
@@ -42,86 +50,29 @@ frappe.ui.form.on("Supplier Scorecard Scoring Standing", {
}
});
-frappe.ui.form.on("Supplier Scorecard Scoring Variable", {
-
- variable_label: function(frm, cdt, cdn) {
- if (frm.doc.variable_label != undefined) {
- var d = frappe.get_doc(cdt, cdn);
- return frm.call({
- method: "erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable.get_scoring_variable",
- child: d,
- args: {
- variable_label: d.variable_label
- }
- });
- }
- }
-});
-
frappe.ui.form.on("Supplier Scorecard Scoring Criteria", {
criteria_name: function(frm, cdt, cdn) {
- if (frm.doc.criteria_name != undefined) {
- var d = frappe.get_doc(cdt, cdn);
- frm.call({
- method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_variables",
+ var d = frappe.get_doc(cdt, cdn);
+ if (d.criteria_name) {
+ return frm.call({
+ method: "frappe.client.get",
args: {
- criteria_name: d.criteria_name
+ fieldname: "weight",
+ doctype: "Supplier Scorecard Criteria",
+ filters: {name: d.criteria_name}
},
callback: function(r) {
- for (var i = 0; i < r.message.length; i++)
- {
- var exists = false;
- for (var j = 0; j < frm.doc.variables.length; j++)
- {
- if(!frm.doc.variables[j].hasOwnProperty("variable_label")) {
- frm.get_field("variables").grid.grid_rows[j].remove();
- }
- else if(frm.doc.variables[j].variable_label === r.message[i]) {
- exists = true;
- }
- }
- if (!exists){
- var new_row = frm.add_child("variables");
- new_row.variable_label = r.message[i];
- frm.script_manager.trigger("variable_label", new_row.doctype, new_row.name);
- }
-
+ if(r.message){
+ d.weight = r.message.weight;
+ frm.refresh_field('criteria', 'weight');
}
- refresh_field("variables");
- }
- });
- return frm.call({
- method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_scoring_criteria",
- child: d,
- args: {
- criteria_name: d.criteria_name
}
});
}
}
});
-var loadAllCriteria = function(frm) {
- frappe.call({
- method: "erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria.get_criteria_list",
- callback: function(r) {
- for (var j = 0; j < frm.doc.criteria.length; j++)
- {
- if(!frm.doc.criteria[j].hasOwnProperty("criteria_name")) {
- frm.get_field("criteria").grid.grid_rows[j].remove();
- }
- }
- for (var i = 0; i < r.message.length; i++)
- {
- var new_row = frm.add_child("criteria");
- new_row.criteria_name = r.message[i].name;
- frm.script_manager.trigger("criteria_name", new_row.doctype, new_row.name);
- }
- refresh_field("criteria");
- }
- });
-};
var loadAllStandings = function(frm) {
frappe.call({
method: "erpnext.buying.doctype.supplier_scorecard_standing.supplier_scorecard_standing.get_standings_list",
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
index d7f24c90821..6a077e9c354 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.json
@@ -1,701 +1,700 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "field:supplier",
- "beta": 1,
- "creation": "2017-05-29 01:40:54.786555",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:supplier",
+ "beta": 0,
+ "creation": "2017-05-29 01:40:54.786555",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "supplier",
- "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": "Supplier",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "supplier",
+ "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": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "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": "supplier_score",
- "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": "Supplier Score",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "supplier_score",
+ "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": "Supplier Score",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "indicator_color",
- "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": "Indicator Color",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "indicator_color",
+ "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": "Indicator Color",
+ "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": "status",
- "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": "Status",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "status",
+ "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": "Status",
+ "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": "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,
+ "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,
- "default": "Per Month",
- "fieldname": "period",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Evaluation Period",
- "length": 0,
- "no_copy": 0,
- "options": "Per Month\nPer Week\nPer Year",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Per Month",
+ "fieldname": "period",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Evaluation Period",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Per Week\nPer Month\nPer Year",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "scoring_setup",
- "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": "Scoring Setup",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "scoring_setup",
+ "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": "Scoring Setup",
+ "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,
- "default": "{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )",
- "description": "Scorecard variables can be used, as well as:\n{total_score} (the total score from that period),\n{period_number} (the number of periods to present day)\n",
- "fieldname": "weighting_function",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Weighting Function",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )",
+ "description": "Scorecard variables can be used, as well as:\n{total_score} (the total score from that period),\n{period_number} (the number of periods to present day)\n",
+ "fieldname": "weighting_function",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Weighting Function",
+ "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": "standings",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Scoring Standings",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Scoring Standing",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "standings",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Scoring Standings",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard Scoring Standing",
+ "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": 1,
- "columns": 0,
- "fieldname": "criteria_setup",
- "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": "Criteria Setup",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "criteria_setup",
+ "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": "Criteria Setup",
+ "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": "criteria",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Scoring Criteria",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Scoring Criteria",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "load_criteria",
+ "fieldtype": "Button",
+ "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": "Load All Criteria",
+ "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": "variables",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Supplier Variables",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Scoring Variable",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "criteria",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Scoring Criteria",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard Scoring Criteria",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "eval: doc.status != 'Unknown'",
- "columns": 0,
- "fieldname": "scorecard_actions",
- "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": "Scorecard Actions",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "eval: doc.status != 'Unknown'",
+ "columns": 0,
+ "fieldname": "scorecard_actions",
+ "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": "Scorecard Actions",
+ "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": "warn_rfqs",
- "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": "Warn for new Request for Quotations",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "warn_rfqs",
+ "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": "Warn for new Request for Quotations",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "warn_pos",
- "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": "Warn for new Purchase Orders",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "warn_pos",
+ "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": "Warn for new Purchase Orders",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "prevent_rfqs",
- "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": "Prevent RFQs",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "prevent_rfqs",
+ "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": "Prevent RFQs",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "prevent_pos",
- "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": "Prevent POs",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "prevent_pos",
+ "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": "Prevent POs",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_16",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "notify_supplier",
- "fieldtype": "Check",
- "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": "Notify Supplier",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "notify_supplier",
+ "fieldtype": "Check",
+ "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": "Notify Supplier",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "notify_employee",
- "fieldtype": "Check",
- "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": "Notify Employee",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "notify_employee",
+ "fieldtype": "Check",
+ "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": "Notify Employee",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee",
- "fieldtype": "Link",
- "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": "Employee",
- "length": 0,
- "no_copy": 0,
- "options": "Employee",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "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": "Employee",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "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
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-07-12 07:33:11.874949",
- "modified_by": "Administrator",
- "module": "Buying",
- "name": "Supplier Scorecard",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2019-01-22 11:42:19.918990",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Scorecard",
+ "name_case": "",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py
index e13d22ab576..9e201e31926 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard.py
@@ -54,6 +54,7 @@ class SupplierScorecard(Document):
`tabSupplier Scorecard Period` scp
WHERE
scp.scorecard = %(sc)s
+ AND scp.docstatus = 1
ORDER BY
scp.end_date DESC""",
{"sc": self.name}, as_dict=1)
@@ -110,7 +111,8 @@ def get_timeline_data(doctype, name):
FROM
`tabSupplier Scorecard Period` sc
WHERE
- sc.scorecard = %(scs)s""",
+ sc.scorecard = %(scs)s
+ AND sc.docstatus = 1""",
{"scs": scs.name}, as_dict=1)
for sc in scorecards:
@@ -162,6 +164,7 @@ def make_all_scorecards(docname):
`tabSupplier Scorecard Period` scp
WHERE
scp.scorecard = %(sc)s
+ AND scp.docstatus = 1
AND (
(scp.start_date > %(end_date)s
AND scp.end_date < %(start_date)s)
@@ -170,12 +173,12 @@ def make_all_scorecards(docname):
AND scp.end_date > %(start_date)s))
ORDER BY
scp.end_date DESC""",
- {"sc": docname, "start_date": start_date, "end_date": end_date, "supplier": supplier}, as_dict=1)
+ {"sc": docname, "start_date": start_date, "end_date": end_date}, as_dict=1)
if len(scorecards) == 0:
period_card = make_supplier_scorecard(docname, None)
period_card.start_date = start_date
period_card.end_date = end_date
- period_card.save()
+ period_card.submit()
scp_count = scp_count + 1
if start_date < first_start_date:
first_start_date = start_date
diff --git a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
index ff7f119253d..3d2305e2853 100644
--- a/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
+++ b/erpnext/buying/doctype/supplier_scorecard/supplier_scorecard_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py
index d64d3f683f6..6e6eaed95d3 100644
--- a/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py
+++ b/erpnext/buying/doctype/supplier_scorecard/test_supplier_scorecard.py
@@ -21,12 +21,6 @@ class TestSupplierScorecard(unittest.TestCase):
d.weight = 0
self.assertRaises(frappe.ValidationError,my_doc.insert)
- def test_missing_variable(self):
- delete_test_scorecards()
- my_doc = make_supplier_scorecard()
- del my_doc.variables
- self.assertRaises(frappe.ValidationError,my_doc.insert)
-
def make_supplier_scorecard():
my_doc = frappe.get_doc(valid_scorecard[0])
@@ -118,56 +112,6 @@ valid_scorecard = [
}
],
"prevent_pos":0,
- "variables": [
- {
- "param_name":"cost_of_on_time_shipments",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"Cost of On Time Shipments",
- "path":"get_cost_of_on_time_shipments",
- "parentfield":"variables"
- },
- {
- "param_name":"tot_cost_shipments",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"Total Cost of Shipments",
- "path":"get_total_cost_of_shipments",
- "parentfield":"variables"
- },
- {
- "param_name":"tot_days_late",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"Total Days Late",
- "path":"get_total_days_late",
- "parentfield":"variables"
- },
- {
- "param_name":"total_working_days",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"Total Working Days",
- "path":"get_total_workdays",
- "parentfield":"variables"
- },
- {
- "param_name":"on_time_shipment_num",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"# of On Time Shipments",
- "path":"get_on_time_shipments",
- "parentfield":"variables"
- },
- {
- "param_name":"total_shipments",
- "doctype":"Supplier Scorecard Scoring Variable",
- "parenttype":"Supplier Scorecard",
- "variable_label":"Total Shipments",
- "path":"get_total_shipments",
- "parentfield":"variables"
- }
- ],
"period":"Per Month",
"doctype":"Supplier Scorecard",
"warn_pos":0,
@@ -177,14 +121,12 @@ valid_scorecard = [
{
"weight":100.0,
"doctype":"Supplier Scorecard Scoring Criteria",
- "formula":"(({cost_of_on_time_shipments} / {tot_cost_shipments}) if {tot_cost_shipments} > 0 else 1 )* 100 ",
- "criteria_name":"Delivery",
- "max_score":100.0,
+ "criteria_name":"Delivery"
}
],
"supplier":"_Test Supplier",
"name":"_Test Supplier",
- "weighting_function":"{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )",
+ "weighting_function":"{total_score} * max( 0, min ( 1 , (12 - {period_number}) / 12) )"
}
]
diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json
index 229c3861207..2623585aeae 100644
--- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json
+++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.json
@@ -4,7 +4,7 @@
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:criteria_name",
- "beta": 1,
+ "beta": 0,
"creation": "2017-05-29 01:32:43.064891",
"custom": 0,
"docstatus": 0,
@@ -43,36 +43,6 @@
"set_only_once": 0,
"unique": 1
},
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "weight",
- "fieldtype": "Percent",
- "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": "Criteria Weight",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -87,7 +57,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 0,
"label": "Max Score",
"length": 0,
@@ -114,10 +84,10 @@
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
+ "ignore_xss_filter": 1,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"in_standard_filter": 0,
"label": "Criteria Formula",
"length": 0,
@@ -133,6 +103,36 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "weight",
+ "fieldtype": "Percent",
+ "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": "Criteria Weight",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"has_web_view": 0,
@@ -145,7 +145,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-07-17 10:30:47.458285",
+ "modified": "2019-01-22 10:47:00.000822",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Scorecard Criteria",
diff --git a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py
index 8514022b780..33a0dc78377 100644
--- a/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py
+++ b/erpnext/buying/doctype/supplier_scorecard_criteria/supplier_scorecard_criteria.py
@@ -30,21 +30,11 @@ class SupplierScorecardCriteria(Document):
for dummy2 in range(0, len(match.groups())):
test_formula = test_formula.replace('{' + match.group(1) + '}', "0")
- test_formula = test_formula.replace('<','<').replace('>','>')
try:
frappe.safe_eval(test_formula, None, {'max':max, 'min': min})
except Exception:
frappe.throw(_("Error evaluating the criteria formula"))
-
-
-@frappe.whitelist()
-def get_scoring_criteria(criteria_name):
- criteria = frappe.get_doc("Supplier Scorecard Criteria", criteria_name)
-
- return criteria
-
-
@frappe.whitelist()
def get_criteria_list():
criteria = frappe.db.sql("""
@@ -56,7 +46,6 @@ def get_criteria_list():
return criteria
-@frappe.whitelist()
def get_variables(criteria_name):
criteria = frappe.get_doc("Supplier Scorecard Criteria", criteria_name)
return _get_variables(criteria)
@@ -69,21 +58,16 @@ def _get_variables(criteria):
for dummy1, match in enumerate(mylist):
for dummy2 in range(0, len(match.groups())):
try:
- #var = frappe.get_doc("Supplier Scorecard Variable", {'param_name' : d})
var = frappe.db.sql("""
SELECT
- scv.name
+ scv.variable_label, scv.description, scv.param_name, scv.path
FROM
`tabSupplier Scorecard Variable` scv
WHERE
param_name=%(param)s""",
- {'param':match.group(1)},)[0][0]
+ {'param':match.group(1)}, as_dict=1)[0]
my_variables.append(var)
except Exception:
- # Ignore the ones where the variable can't be found
frappe.throw(_('Unable to find variable: ') + str(match.group(1)), InvalidFormulaVariable)
- #pass
-
- #frappe.msgprint(str(my_variables))
return my_variables
diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
index c51e8ab2df8..a4cdeb31957 100644
--- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
+++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.js
@@ -6,9 +6,11 @@
frappe.ui.form.on("Supplier Scorecard Period", {
onload: function(frm) {
- frm.get_field("variables").grid.toggle_display("value", true);
- frm.get_field("criteria").grid.toggle_display("score", true);
-
-
+ let criteria_grid = frm.get_field("criteria").grid;
+ criteria_grid.toggle_enable("criteria_name", false);
+ criteria_grid.toggle_enable("weight", false);
+ criteria_grid.toggle_display("max_score", true);
+ criteria_grid.toggle_display("formula", true);
+ criteria_grid.toggle_display("score", true);
}
});
diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json
index 50941fd1526..8cdcaa98f7b 100644
--- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json
+++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.json
@@ -1,420 +1,450 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "beta": 1,
- "creation": "2017-05-30 00:38:18.773013",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "beta": 0,
+ "creation": "2017-05-30 00:38:18.773013",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Supplier",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Naming Series",
- "length": 0,
- "no_copy": 0,
- "options": "PU-SSP-.YYYY.-",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Naming Series",
+ "length": 0,
+ "no_copy": 0,
+ "options": "PU-SSP-.YYYY.-",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "total_score",
- "fieldtype": "Percent",
- "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": "Period Score",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_score",
+ "fieldtype": "Percent",
+ "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": "Period Score",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 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,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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": 1,
- "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,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 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": 1,
+ "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,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 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": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "section_break_11",
- "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": "Calculations",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "section_break_11",
+ "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": "Calculations",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "criteria",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Criteria",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Scoring Criteria",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "criteria",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Criteria",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard Scoring Criteria",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "variables",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Variables",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Scoring Variable",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "variables",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Variables",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard Scoring Variable",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "fieldname": "sec_ref",
- "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": "Reference",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "sec_ref",
+ "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": "Reference",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "scorecard",
- "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": "Supplier Scorecard Setup",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "scorecard",
+ "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": "Supplier Scorecard Setup",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_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": "Supplier Scorecard Period",
+ "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": 1,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-08-21 14:44:36.438832",
- "modified_by": "Administrator",
- "module": "Buying",
- "name": "Supplier Scorecard Period",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 1,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2019-01-23 13:58:26.137770",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Scorecard Period",
+ "name_case": "",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 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": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 0,
+ "track_seen": 0,
"track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py
index 90b65bd35aa..737ddd6ddd5 100644
--- a/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py
+++ b/erpnext/buying/doctype/supplier_scorecard_period/supplier_scorecard_period.py
@@ -8,6 +8,7 @@ from frappe import throw, _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
import erpnext.buying.doctype.supplier_scorecard_variable.supplier_scorecard_variable as variable_functions
+from erpnext.buying.doctype.supplier_scorecard_criteria.supplier_scorecard_criteria import get_variables
class SupplierScorecardPeriod(Document):
@@ -28,7 +29,6 @@ class SupplierScorecardPeriod(Document):
def calculate_variables(self):
for var in self.variables:
-
if '.' in var.path:
method_to_call = import_string_path(var.path)
var.value = method_to_call(self)
@@ -39,29 +39,9 @@ class SupplierScorecardPeriod(Document):
def calculate_criteria(self):
- #Get the criteria
for crit in self.criteria:
-
- #me = ""
- my_eval_statement = crit.formula.replace("\r", "").replace("\n", "")
- #for let in my_eval_statement:
- # me += let.encode('hex') + " "
- #frappe.msgprint(me)
-
- for var in self.variables:
- if var.value:
- if var.param_name in my_eval_statement:
- my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value))
- else:
- if var.param_name in my_eval_statement:
- my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0')
-
- #frappe.msgprint(my_eval_statement )
-
- my_eval_statement = my_eval_statement.replace('<','<').replace('>','>')
-
try:
- crit.score = min(crit.max_score, max( 0 ,frappe.safe_eval(my_eval_statement, None, {'max':max, 'min': min})))
+ crit.score = min(crit.max_score, max( 0 ,frappe.safe_eval(self.get_eval_statement(crit.formula), None, {'max':max, 'min': min})))
except Exception:
frappe.throw(_("Could not solve criteria score function for {0}. Make sure the formula is valid.".format(crit.criteria_name)),frappe.ValidationError)
crit.score = 0
@@ -73,26 +53,27 @@ class SupplierScorecardPeriod(Document):
self.total_score = myscore
def calculate_weighted_score(self, weighing_function):
- my_eval_statement = weighing_function.replace("\r", "").replace("\n", "")
-
- for var in self.variables:
- if var.value:
- if var.param_name in my_eval_statement:
- my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value))
- else:
- if var.param_name in my_eval_statement:
- my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0')
-
- my_eval_statement = my_eval_statement.replace('<','<').replace('>','>')
-
try:
- weighed_score = frappe.safe_eval(my_eval_statement, None, {'max':max, 'min': min})
+ weighed_score = frappe.safe_eval(self.get_eval_statement(weighing_function), None, {'max':max, 'min': min})
except Exception:
frappe.throw(_("Could not solve weighted score function. Make sure the formula is valid."),frappe.ValidationError)
weighed_score = 0
return weighed_score
+ def get_eval_statement(self, formula):
+ my_eval_statement = formula.replace("\r", "").replace("\n", "")
+
+ for var in self.variables:
+ if var.value:
+ if var.param_name in my_eval_statement:
+ my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', "{:.2f}".format(var.value))
+ else:
+ if var.param_name in my_eval_statement:
+ my_eval_statement = my_eval_statement.replace('{' + var.param_name + '}', '0.0')
+
+ return my_eval_statement
+
def import_string_path(path):
components = path.split('.')
@@ -102,30 +83,28 @@ def import_string_path(path):
return mod
-def post_process(source, target):
- pass
-
-
@frappe.whitelist()
def make_supplier_scorecard(source_name, target_doc=None):
- #def update_item(obj, target, source_parent):
- # target.qty = flt(obj.qty) - flt(obj.received_qty)
- # target.stock_qty = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)
- # target.amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.rate)
- # target.base_amount = (flt(obj.qty) - flt(obj.received_qty)) * \
- # flt(obj.rate) * flt(source_parent.conversion_rate)
+ def update_criteria_fields(obj, target, source_parent):
+ target.max_score, target.formula = frappe.db.get_value('Supplier Scorecard Criteria',
+ obj.criteria_name, ['max_score', 'formula'])
+
+ def post_process(source, target):
+ variables = []
+ for cr in target.criteria:
+ for var in get_variables(cr.criteria_name):
+ if var not in variables:
+ variables.append(var)
+
+ target.extend('variables', variables)
doc = get_mapped_doc("Supplier Scorecard", source_name, {
"Supplier Scorecard": {
"doctype": "Supplier Scorecard Period"
},
- "Supplier Scorecard Scoring Variable": {
- "doctype": "Supplier Scorecard Scoring Variable",
- "add_if_empty": True
- },
- "Supplier Scorecard Scoring Constraint": {
- "doctype": "Supplier Scorecard Scoring Constraint",
- "add_if_empty": True
+ "Supplier Scorecard Scoring Criteria": {
+ "doctype": "Supplier Scorecard Scoring Criteria",
+ "postprocess": update_criteria_fields,
}
}, target_doc, post_process)
diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json
index 567738a6d09..55ed45e3200 100644
--- a/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json
+++ b/erpnext/buying/doctype/supplier_scorecard_scoring_criteria/supplier_scorecard_scoring_criteria.json
@@ -1,280 +1,252 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 1,
- "creation": "2017-05-29 01:32:17.988454",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-05-29 01:32:17.988454",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 3,
- "fieldname": "criteria_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Criteria Name",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier Scorecard Criteria",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 5,
+ "fieldname": "criteria_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Criteria Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier Scorecard Criteria",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 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": "section_break_2",
- "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,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 2,
+ "fieldname": "score",
+ "fieldtype": "Percent",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Score",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 2,
- "fieldname": "weight",
- "fieldtype": "Percent",
- "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": "Criteria Weight",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 2,
+ "fieldname": "weight",
+ "fieldtype": "Percent",
+ "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": "Criteria Weight",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "100",
- "fieldname": "max_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": "Max 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": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "100",
+ "fieldname": "max_score",
+ "fieldtype": "Float",
+ "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": "Max Score",
+ "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "formula",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Criteria Formula",
- "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": "score",
- "fieldtype": "Percent",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "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": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "formula",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Criteria Formula",
+ "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
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2017-07-12 07:33:41.532361",
- "modified_by": "Administrator",
- "module": "Buying",
- "name": "Supplier Scorecard Scoring Criteria",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2019-01-23 13:49:13.350095",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Scorecard Scoring Criteria",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json
index 1fc04bb1201..e8498efb5e7 100644
--- a/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json
+++ b/erpnext/buying/doctype/supplier_scorecard_scoring_standing/supplier_scorecard_scoring_standing.json
@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
- "beta": 1,
+ "beta": 0,
"creation": "2017-05-29 01:36:22.697234",
"custom": 0,
"docstatus": 0,
@@ -473,7 +473,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-07-12 07:33:20.615684",
+ "modified": "2019-01-22 10:47:41.146704",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Scorecard Scoring Standing",
diff --git a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json
index f0e043e47a2..5e4c5c1e3a6 100644
--- a/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json
+++ b/erpnext/buying/doctype/supplier_scorecard_scoring_variable/supplier_scorecard_scoring_variable.json
@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
- "beta": 1,
+ "beta": 0,
"creation": "2017-05-29 01:30:06.105240",
"custom": 0,
"docstatus": 0,
@@ -35,7 +35,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
@@ -65,7 +65,37 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
+ "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": 2,
+ "fieldname": "value",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Value",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -73,36 +103,6 @@
"set_only_once": 0,
"unique": 0
},
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_custom",
- "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": "Custom?",
- "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,
@@ -111,7 +111,7 @@
"columns": 0,
"fieldname": "param_name",
"fieldtype": "Data",
- "hidden": 0,
+ "hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -128,7 +128,7 @@
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -141,7 +141,7 @@
"columns": 0,
"fieldname": "path",
"fieldtype": "Data",
- "hidden": 0,
+ "hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
@@ -158,36 +158,6 @@
"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": 2,
- "fieldname": "value",
- "fieldtype": "Float",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Value",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
@@ -204,7 +174,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-07-12 07:33:36.671502",
+ "modified": "2019-01-23 09:55:19.749828",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Scorecard Scoring Variable",
diff --git a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json
index b61b4edd725..b57881a096a 100644
--- a/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json
+++ b/erpnext/buying/doctype/supplier_scorecard_standing/supplier_scorecard_standing.json
@@ -4,7 +4,7 @@
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:standing_name",
- "beta": 1,
+ "beta": 0,
"creation": "2017-05-29 01:36:47.893639",
"custom": 0,
"docstatus": 0,
@@ -385,7 +385,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-07-12 07:33:16.560273",
+ "modified": "2019-01-22 10:47:49.195421",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Scorecard Standing",
diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json
index d24484025ca..d372905297f 100644
--- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json
+++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.json
@@ -4,7 +4,7 @@
"allow_import": 0,
"allow_rename": 0,
"autoname": "field:variable_label",
- "beta": 1,
+ "beta": 0,
"creation": "2017-05-29 01:30:34.688389",
"custom": 0,
"docstatus": 0,
@@ -101,7 +101,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
+ "unique": 1
},
{
"allow_bulk_edit": 0,
@@ -203,7 +203,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-07-12 07:33:31.395262",
+ "modified": "2019-01-23 09:39:59.866398",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Scorecard Variable",
diff --git a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py
index 17c911a0004..37fdc5724f5 100644
--- a/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py
+++ b/erpnext/buying/doctype/supplier_scorecard_variable/supplier_scorecard_variable.py
@@ -27,13 +27,6 @@ class SupplierScorecardVariable(Document):
if not hasattr(sys.modules[__name__], self.path):
frappe.throw(_("Could not find path for " + self.path), VariablePathNotFound)
-
-@frappe.whitelist()
-def get_scoring_variable(variable_label):
- variable = frappe.get_doc("Supplier Scorecard Variable", variable_label)
-
- return variable
-
def get_total_workdays(scorecard):
""" Gets the number of days in this period"""
delta = getdate(scorecard.end_date) - getdate(scorecard.start_date)
diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.json b/erpnext/buying/report/purchase_analytics/purchase_analytics.json
index 996e3eef457..7ce779d773b 100644
--- a/erpnext/buying/report/purchase_analytics/purchase_analytics.json
+++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.json
@@ -1,12 +1,13 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"creation": "2018-10-05 16:08:24.156448",
+ "disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
- "modified": "2018-10-05 16:08:33.272201",
+ "modified": "2019-02-12 14:32:29.107109",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Analytics",
diff --git a/erpnext/change_log/v11/v11_1_0.md b/erpnext/change_log/v11/v11_1_0.md
new file mode 100644
index 00000000000..f4dfe16faf3
--- /dev/null
+++ b/erpnext/change_log/v11/v11_1_0.md
@@ -0,0 +1,80 @@
+- Enhancements
+
+ - Accounting
+
+ - Company Tree
+ - Multiple Finance Books
+ - Bank Statement Upload
+ - Tax Withholding
+ - Subscriptions
+ - Deferred Revenue and Expenses
+ - Exchange Rate Revaluation
+ - Inter Company Transactions
+ - Standalone Credit / Debit Note
+ - Reverse Journal Entry
+ - Enhanced Bank Guarantee
+ - Cost Center Numbering
+ - Loyalty Points Management
+ - Enhanced General ledger report
+
+ - Human Resources
+
+ - Department Hierarchy
+ - Leave Management
+ - Leave Period
+ - New Leave Types
+ - Leave Encashment
+ - Compensatory Leave
+ - Attendance Request
+ - Enhanced Payroll
+ - New Salary Structure
+ - Additional Salary
+ - Payroll Period
+ - Employee Benefits
+ - Employee Tax Exemptions
+ - Auto Calculation of Tax Deduction
+ - Enhanced Salary Processing
+ - Employee Onboarding
+ - Employee Separation
+ - Employee Transfer
+ - Employee Promotion
+ - Employee Incentive
+ - Retention Bonus
+ - Shift Planning
+ - Staffing Plan
+
+ - Asset Management
+
+ - Capital-Work-in-Progress (CWIP) Accounting
+ - Multiple depreciation schedule based on finance book
+ - Asset Value Adjustment
+ - Improved Asset Movement between location or employee
+ - New Depreciation method Written Down Value (WDV)
+
+ - POS
+
+ - Allow draft mode print in online POS
+ - Allowed print before pay
+ - Save the invoice before print
+
+ - Other Features
+
+ - A free marketplace where any ERPNext user can list their products and be discovered by thousands of other companies using ERPNext
+ - Add/Update quantity in Sales & Purchase Order without amending document
+ - Enhanced Item Price (Based on UOM, Party, Min. Qty, etc.)
+ - Shareholder Management
+ - Production Plan and Job Card
+ - Delivery Trip
+ - Updated Timesheets
+ - Lead Notes
+ - Better Sales / Purchase / Stock Analytics report
+ - Currency exchange API is changed to frankfurter public domain
+
+ - GST (India)
+ - Auto selection of GST tax template based on company and shipping address
+ - GSTR-1 based on the address
+ - HSN-wise summary of outwards supplies
+
+- Changes have been made to ensure ERPNext is compatible with Python 3
+- Better documentation is now available with support for more languages
+- A lot of other fixes have been done to ensure a better overall user experience
diff --git a/erpnext/change_log/v6/v6_13_1.md b/erpnext/change_log/v6/v6_13_1.md
index 4b2c4a9cca2..d5a930e3b96 100644
--- a/erpnext/change_log/v6/v6_13_1.md
+++ b/erpnext/change_log/v6/v6_13_1.md
@@ -1 +1 @@
-- [ERPNext Manual in German](http://erpnext.org/docs/user/manual/de/) contributed by [CWT Connector & Wire Technology GmbH](http://www.cwt-assembly.com/)
+- [ERPNext Manual in German](http://erpnext.com/docs/user/manual/de/) contributed by [CWT Connector & Wire Technology GmbH](http://www.cwt-assembly.com/)
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index 3a8816ea498..31366b4f1b7 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -365,6 +365,36 @@ def get_data():
"is_query_report": True,
"doctype": "Sales Invoice"
},
+ {
+ "type": "report",
+ "name": "Item-wise Sales Register",
+ "is_query_report": True,
+ "doctype": "Sales Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Item-wise Purchase Register",
+ "is_query_report": True,
+ "doctype": "Purchase Invoice"
+ },
+ {
+ "type": "report",
+ "name": "Profitability Analysis",
+ "doctype": "GL Entry",
+ "is_query_report": True,
+ },
+ {
+ "type": "report",
+ "name": "Customer Ledger Summary",
+ "doctype": "Sales Invoice",
+ "is_query_report": True,
+ },
+ {
+ "type": "report",
+ "name": "Supplier Ledger Summary",
+ "doctype": "Sales Invoice",
+ "is_query_report": True,
+ }
]
},
{
@@ -377,12 +407,6 @@ def get_data():
"doctype": "GL Entry",
"is_query_report": True,
},
- {
- "type": "report",
- "name": "Profitability Analysis",
- "doctype": "GL Entry",
- "is_query_report": True,
- },
{
"type": "report",
"name": "Payment Period Based On Invoice Date",
@@ -395,18 +419,6 @@ def get_data():
"is_query_report": True,
"doctype": "Sales Invoice"
},
- {
- "type": "report",
- "name": "Item-wise Sales Register",
- "is_query_report": True,
- "doctype": "Sales Invoice"
- },
- {
- "type": "report",
- "name": "Item-wise Purchase Register",
- "is_query_report": True,
- "doctype": "Purchase Invoice"
- },
{
"type": "report",
"name": "Accounts Receivable Summary",
diff --git a/erpnext/config/crm.py b/erpnext/config/crm.py
index dd67005ecf6..5ac46bd7b80 100644
--- a/erpnext/config/crm.py
+++ b/erpnext/config/crm.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/config/maintenance.py b/erpnext/config/maintenance.py
index 7a44f556677..97be47cdd14 100644
--- a/erpnext/config/maintenance.py
+++ b/erpnext/config/maintenance.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/config/website.py b/erpnext/config/website.py
index 237c49c9afb..59e7d404d44 100644
--- a/erpnext/config/website.py
+++ b/erpnext/config/website.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 197b9554f8a..5a765aa273e 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -94,6 +94,8 @@ class AccountsController(TransactionBase):
if self.is_return:
self.validate_qty()
+ validate_regional(self)
+
def validate_invoice_documents_schedule(self):
self.validate_payment_schedule_dates()
self.set_due_date()
@@ -264,6 +266,9 @@ class AccountsController(TransactionBase):
if item_qty != len(get_serial_nos(item.get('serial_no'))):
item.set(fieldname, value)
+ if self.doctype in ["Purchase Invoice", "Sales Invoice"] and item.meta.get_field('is_fixed_asset'):
+ item.set('is_fixed_asset', ret.get('is_fixed_asset', 0))
+
if ret.get("pricing_rule"):
# if user changed the discount percentage then set user's discount percentage ?
item.set("pricing_rule", ret.get("pricing_rule"))
@@ -1129,3 +1134,15 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name):
p_doctype.update_blanket_order()
p_doctype.update_billing_percentage()
p_doctype.set_status()
+
+@erpnext.allow_regional
+def validate_regional(doc):
+ pass
+
+@erpnext.allow_regional
+def on_submit_regional(doc):
+ pass
+
+@erpnext.allow_regional
+def on_cancel_regional(doc):
+ pass
diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py
index b87fc0ea4a8..e8472aafc2e 100644
--- a/erpnext/crm/doctype/lead/lead_dashboard.py
+++ b/erpnext/crm/doctype/lead/lead_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
index bd4a6a265fb..9ed616afd23 100644
--- a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
+++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/demo/setup/education.py b/erpnext/demo/setup/education.py
index 0403c06411e..cf9451d5dae 100644
--- a/erpnext/demo/setup/education.py
+++ b/erpnext/demo/setup/education.py
@@ -1,5 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe, json
from frappe.utils.make_random import get_random
@@ -162,7 +163,7 @@ def make_assessment_groups():
def get_json_path(doctype):
return frappe.get_app_path('erpnext', 'demo', 'data', frappe.scrub(doctype) + '.json')
-
+
def weighted_choice(weights):
totals = []
running_total = 0
diff --git a/erpnext/demo/setup/healthcare.py b/erpnext/demo/setup/healthcare.py
index 3ddb2ae19de..aa389e56b41 100644
--- a/erpnext/demo/setup/healthcare.py
+++ b/erpnext/demo/setup/healthcare.py
@@ -1,5 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe, json
from frappe.utils.make_random import get_random
diff --git a/erpnext/domains/agriculture.py b/erpnext/domains/agriculture.py
index 594624778d3..8c7427ab2d1 100644
--- a/erpnext/domains/agriculture.py
+++ b/erpnext/domains/agriculture.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Agriculture Task',
diff --git a/erpnext/domains/distribution.py b/erpnext/domains/distribution.py
index 020ab3b83b1..3661260f9b4 100644
--- a/erpnext/domains/distribution.py
+++ b/erpnext/domains/distribution.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Item',
diff --git a/erpnext/domains/education.py b/erpnext/domains/education.py
index 0631f299ad2..c6405764575 100644
--- a/erpnext/domains/education.py
+++ b/erpnext/domains/education.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Student',
diff --git a/erpnext/domains/healthcare.py b/erpnext/domains/healthcare.py
index 4e783c79209..8bd4c762907 100644
--- a/erpnext/domains/healthcare.py
+++ b/erpnext/domains/healthcare.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Patient',
diff --git a/erpnext/domains/hospitality.py b/erpnext/domains/hospitality.py
index 09b98c288bf..2a2d0c60ef6 100644
--- a/erpnext/domains/hospitality.py
+++ b/erpnext/domains/hospitality.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Restaurant',
diff --git a/erpnext/domains/manufacturing.py b/erpnext/domains/manufacturing.py
index 7f328b1d95a..259ee9238e5 100644
--- a/erpnext/domains/manufacturing.py
+++ b/erpnext/domains/manufacturing.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Item',
diff --git a/erpnext/domains/non_profit.py b/erpnext/domains/non_profit.py
index 81aff02fa61..b6772c53153 100644
--- a/erpnext/domains/non_profit.py
+++ b/erpnext/domains/non_profit.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Non Profit',
diff --git a/erpnext/domains/retail.py b/erpnext/domains/retail.py
index 07b2e2781ec..73607615f33 100644
--- a/erpnext/domains/retail.py
+++ b/erpnext/domains/retail.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'POS',
diff --git a/erpnext/domains/services.py b/erpnext/domains/services.py
index 1fb0e19edd2..7a4ffc4993f 100644
--- a/erpnext/domains/services.py
+++ b/erpnext/domains/services.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
data = {
'desktop_icons': [
'Project',
diff --git a/erpnext/education/__init__.py b/erpnext/education/__init__.py
index 13bc12d6a9e..c0589bb489b 100644
--- a/erpnext/education/__init__.py
+++ b/erpnext/education/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/education/doctype/instructor/instructor.json b/erpnext/education/doctype/instructor/instructor.json
index 80d3ee29632..5367c0e66f5 100644
--- a/erpnext/education/doctype/instructor/instructor.json
+++ b/erpnext/education/doctype/instructor/instructor.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -287,7 +288,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-08-21 14:44:36.714519",
+ "modified": "2019-01-30 11:28:17.571207",
"modified_by": "Administrator",
"module": "Education",
"name": "Instructor",
diff --git a/erpnext/education/doctype/student/student_dashboard.py b/erpnext/education/doctype/student/student_dashboard.py
index b36599c2db5..d86f4f231cb 100644
--- a/erpnext/education/doctype/student/student_dashboard.py
+++ b/erpnext/education/doctype/student/student_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
index 23acd2855c8..aeb5352a220 100644
--- a/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
+++ b/erpnext/erpnext_integrations/data_migration_mapping/issue_to_task/__init__.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def pre_process(issue):
diff --git a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
index 212f81b5f9f..9d3f02eaaf6 100644
--- a/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
+++ b/erpnext/erpnext_integrations/data_migration_mapping/milestone_to_project/__init__.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def pre_process(milestone):
return {
'title': milestone.title,
diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py
index bf6d85b9116..fd364e87fb0 100755
--- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py
+++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py
@@ -4,6 +4,7 @@
# Basic interface to Amazon MWS
# Based on http://code.google.com/p/amazon-mws-python
# Extended to include finances object
+from __future__ import unicode_literals
import urllib
import hashlib
diff --git a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py
index 985ac083e53..58db669411a 100644
--- a/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py
+++ b/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py
@@ -6,6 +6,7 @@ Borrowed from https://github.com/timotheus/ebaysdk-python
@author: pierre
"""
+from __future__ import unicode_literals
import xml.etree.ElementTree as ET
import re
diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
index 02e1fc9a692..4b284b2e9d5 100644
--- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
+++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_customer.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
index ff1edea713a..5570e6903a8 100644
--- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
+++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, cint, get_request_session
diff --git a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py
index bb4f62a0993..1edc1029565 100644
--- a/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py
+++ b/erpnext/erpnext_integrations/doctype/woocommerce_settings/woocommerce_settings.py
@@ -28,7 +28,7 @@ class WoocommerceSettings(Document):
if not frappe.get_value("Custom Field",{"name":i[0]}) or not frappe.get_value("Custom Field",{"name":i[1]}):
create_custom_field_id_and_check_status = True
- break;
+ break
if create_custom_field_id_and_check_status:
diff --git a/erpnext/erpnext_integrations/utils.py b/erpnext/erpnext_integrations/utils.py
index 2c0368609d8..90657790972 100644
--- a/erpnext/erpnext_integrations/utils.py
+++ b/erpnext/erpnext_integrations/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
import base64, hashlib, hmac
diff --git a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py
index a21f5acb7e2..7c6f4d5999e 100644
--- a/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py
+++ b/erpnext/healthcare/doctype/clinical_procedure/clinical_procedure.py
@@ -43,7 +43,7 @@ class ClinicalProcedure(Document):
self.reload()
def complete(self):
- if self.consume_stock:
+ if self.consume_stock and self.items:
create_stock_entry(self)
frappe.db.set_value("Clinical Procedure", self.name, "status", 'Completed')
@@ -183,13 +183,15 @@ def create_procedure(appointment):
procedure.patient_age = appointment.patient_age
procedure.patient_sex = appointment.patient_sex
procedure.procedure_template = appointment.procedure_template
- procedure.procedure_prescription = appointment.procedure_prescription
+ procedure.prescription = appointment.procedure_prescription
+ procedure.practitioner = appointment.practitioner
procedure.invoiced = appointment.invoiced
procedure.medical_department = appointment.department
procedure.start_date = appointment.appointment_date
procedure.start_time = appointment.appointment_time
procedure.notes = appointment.notes
procedure.service_unit = appointment.service_unit
+ procedure.company = appointment.company
consume_stock = frappe.db.get_value("Clinical Procedure Template", appointment.procedure_template, "consume_stock")
if consume_stock == 1:
procedure.consume_stock = True
@@ -203,7 +205,9 @@ def create_procedure(appointment):
return procedure.as_dict()
def insert_clinical_procedure_to_medical_record(doc):
- subject = cstr(doc.procedure_template) +" "+ doc.practitioner
+ subject = cstr(doc.procedure_template)
+ if doc.practitioner:
+ subject += " "+doc.practitioner
if subject and doc.notes:
subject += "
"+doc.notes
diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
index df56918b9c7..26564a34ce4 100644
--- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
+++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -55,7 +56,7 @@
"collapsible": 0,
"columns": 0,
"fieldname": "item_code",
- "fieldtype": "Read Only",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -71,7 +72,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -707,7 +708,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-08 13:00:06.260997",
+ "modified": "2019-02-12 11:37:18.713344",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Clinical Procedure Template",
diff --git a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
index b8305d748f8..26b14504630 100644
--- a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
+++ b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
@@ -68,6 +68,7 @@ def create_appointment(patient, practitioner, appointment_date, department):
appointment.department = department
appointment.appointment_date = appointment_date
appointment.company = "_Test Company"
+ appointment.duration = 15
appointment.save(ignore_permissions=True)
return appointment
diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
index ad68924d5a1..4a848a081da 100644
--- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
@@ -1,1007 +1,1041 @@
{
- "allow_copy": 1,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "",
- "beta": 1,
- "creation": "2016-02-23 11:20:53.565119",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 0,
+ "allow_copy": 1,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "",
+ "beta": 1,
+ "creation": "2016-02-23 11:20:53.565119",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 0,
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "first_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "First Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "first_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "First Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "middle_name",
- "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": "Middle Name (Optional)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "middle_name",
+ "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": "Middle Name (Optional)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "last_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Last Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "last_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Last Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "image",
- "fieldtype": "Attach Image",
- "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": "Image",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "image",
+ "fieldtype": "Attach Image",
+ "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": "Image",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee",
- "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": "Employee",
- "length": 0,
- "no_copy": 0,
- "options": "Employee",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee",
+ "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": "Employee",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "user_id",
- "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": "User",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "user_id",
+ "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": "User",
+ "length": 0,
+ "no_copy": 0,
+ "options": "User",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "designation",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Designation",
- "length": 0,
- "no_copy": 0,
- "options": "Designation",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "designation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Designation",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Designation",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Medical Department",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 1,
+ "label": "Department",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Medical Department",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_7",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "hospital",
- "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": "Hospital",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "hospital",
+ "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": "Hospital",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "mobile_phone",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Mobile",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "mobile_phone",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Mobile",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "residence_phone",
- "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": "Phone (R)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "residence_phone",
+ "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": "Phone (R)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "office_phone",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Phone (Office)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "office_phone",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Phone (Office)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "appointments",
- "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": "Appointments",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "active",
+ "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": "Active",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "practitioner_schedules",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Practitioner Schedules",
- "length": 0,
- "no_copy": 0,
- "options": "Practitioner Service Unit Schedule",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "appointments",
+ "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": "Appointments",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "charges",
- "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": "Charges",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "practitioner_schedules",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Practitioner Schedules",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Practitioner Service Unit Schedule",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "op_consulting_charge_item",
- "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": "Out Patient Consulting Charge Item",
- "length": 0,
- "no_copy": 0,
- "options": "Item",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "charges",
+ "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": "Charges",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "op_consulting_charge",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "OP Consulting Charge",
- "length": 0,
- "no_copy": 0,
- "options": "Currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "op_consulting_charge_item",
+ "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": "Out Patient Consulting Charge Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_18",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "op_consulting_charge",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "OP Consulting Charge",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "inpatient_visit_charge_item",
- "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": "Inpatient Visit Charge Item",
- "length": 0,
- "no_copy": 0,
- "options": "Item",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_18",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "inpatient_visit_charge",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Inpatient Visit Charge",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inpatient_visit_charge_item",
+ "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": "Inpatient Visit Charge Item",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contacts_and_address",
- "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": "Contacts and Address",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inpatient_visit_charge",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Inpatient Visit Charge",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "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": "Address HTML",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contacts_and_address",
+ "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": "Contacts and Address",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_19",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "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": "Address HTML",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_html",
- "fieldtype": "HTML",
- "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": "Contact HTML",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_19",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "account_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Account Details",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "contact_html",
+ "fieldtype": "HTML",
+ "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": "Contact HTML",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "accounts",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Income Account",
- "length": 0,
- "no_copy": 0,
- "options": "Party Account",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "account_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Account Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "default_currency",
- "fieldtype": "Link",
- "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": "Default Currency",
- "length": 0,
- "no_copy": 1,
- "options": "Currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "accounts",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Party Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "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": "Default Currency",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_field": "image",
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-08-06 16:45:37.899084",
- "modified_by": "Administrator",
- "module": "Healthcare",
- "name": "Healthcare Practitioner",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_field": "image",
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-11-23 08:54:51.442105",
+ "modified_by": "Administrator",
+ "module": "Healthcare",
+ "name": "Healthcare Practitioner",
+ "name_case": "",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Laboratory User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Laboratory User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Physician",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Physician",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Nursing User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Nursing User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Healthcare",
- "search_fields": "first_name,mobile_phone,office_phone",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "first_name",
- "track_changes": 1,
- "track_seen": 0,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Healthcare",
+ "search_fields": "first_name,mobile_phone,office_phone",
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "first_name",
+ "track_changes": 1,
+ "track_seen": 0,
"track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
index 8a087dd1b2f..ed9eae3529f 100644
--- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
@@ -9,6 +9,7 @@ from frappe import throw, _
from frappe.utils import cstr
from erpnext.accounts.party import validate_party_accounts
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
+from frappe.desk.reportview import build_match_conditions, get_filters_cond
class HealthcarePractitioner(Document):
def onload(self):
@@ -65,3 +66,36 @@ class HealthcarePractitioner(Document):
def validate_service_item(item, msg):
if frappe.db.get_value("Item", item, "is_stock_item") == 1:
frappe.throw(_(msg))
+
+def get_practitioner_list(doctype, txt, searchfield, start, page_len, filters=None):
+ fields = ["name", "first_name", "mobile_phone"]
+ match_conditions = build_match_conditions("Healthcare Practitioner")
+ match_conditions = "and {}".format(match_conditions) if match_conditions else ""
+
+ if filters:
+ filter_conditions = get_filters_cond(doctype, filters, [])
+ match_conditions += "{}".format(filter_conditions)
+
+ return frappe.db.sql("""select %s from `tabHealthcare Practitioner` where docstatus < 2
+ and (%s like %s or first_name like %s)
+ and active = 1
+ {match_conditions}
+ order by
+ case when name like %s then 0 else 1 end,
+ case when first_name like %s then 0 else 1 end,
+ name, first_name limit %s, %s""".format(
+ match_conditions=match_conditions) %
+ (
+ ", ".join(fields),
+ frappe.db.escape(searchfield),
+ "%s", "%s", "%s", "%s", "%s", "%s"
+ ),
+ (
+ "%%%s%%" % frappe.db.escape(txt),
+ "%%%s%%" % frappe.db.escape(txt),
+ "%%%s%%" % frappe.db.escape(txt),
+ "%%%s%%" % frappe.db.escape(txt),
+ start,
+ page_len
+ )
+ )
diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
index 635464edd9a..70c0b3c098d 100644
--- a/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py b/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py
index 0dc89701a85..92cc6103f45 100644
--- a/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py
+++ b/erpnext/healthcare/doctype/inpatient_record/inpatient_record_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/healthcare/doctype/patient/patient.json b/erpnext/healthcare/doctype/patient/patient.json
index 28e5351e67e..c195f4ddc78 100644
--- a/erpnext/healthcare/doctype/patient/patient.json
+++ b/erpnext/healthcare/doctype/patient/patient.json
@@ -219,7 +219,7 @@
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "blood_group",
@@ -252,7 +252,7 @@
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "dob",
@@ -480,7 +480,7 @@
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "mobile",
@@ -512,7 +512,7 @@
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
- "bold": 0,
+ "bold": 1,
"collapsible": 0,
"columns": 0,
"fieldname": "email",
@@ -1391,7 +1391,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 50,
- "modified": "2018-10-14 22:09:39.849116",
+ "modified": "2018-11-23 12:11:14.336657",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient",
@@ -1456,7 +1456,7 @@
"write": 1
}
],
- "quick_entry": 0,
+ "quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Healthcare",
diff --git a/erpnext/healthcare/doctype/patient/patient.py b/erpnext/healthcare/doctype/patient/patient.py
index bff24f7ab29..bf15cad5d52 100644
--- a/erpnext/healthcare/doctype/patient/patient.py
+++ b/erpnext/healthcare/doctype/patient/patient.py
@@ -33,7 +33,6 @@ class Patient(Document):
"email": self.email,
"user_type": "Website User"
})
- user.flags.no_welcome_email = True
user.flags.ignore_permissions = True
user.add_roles("Patient")
diff --git a/erpnext/healthcare/doctype/patient/patient_dashboard.py b/erpnext/healthcare/doctype/patient/patient_dashboard.py
index 46b10136a33..e3def72334c 100644
--- a/erpnext/healthcare/doctype/patient/patient_dashboard.py
+++ b/erpnext/healthcare/doctype/patient/patient_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index 5364031fce1..7aa41c546c0 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
-from frappe.utils import getdate, add_days
+from frappe.utils import getdate, add_days, get_time
from frappe import _
import datetime
from frappe.core.doctype.sms_settings.sms_settings import send_sms
@@ -24,9 +24,33 @@ class PatientAppointment(Document):
frappe.db.set_value("Patient Appointment", self.name, "status", "Open")
self.reload()
+ def validate(self):
+ end_time = datetime.datetime.combine(getdate(self.appointment_date), get_time(self.appointment_time)) + datetime.timedelta(minutes=float(self.duration))
+ overlaps = frappe.db.sql("""
+ select
+ name, practitioner, patient, appointment_time, duration
+ from
+ `tabPatient Appointment`
+ where
+ appointment_date=%s and name!=%s and status NOT IN ("Closed", "Cancelled")
+ and (practitioner=%s or patient=%s) and
+ ((appointment_time<%s and appointment_time + INTERVAL duration MINUTE>%s) or
+ (appointment_time>%s and appointment_time<%s) or
+ (appointment_time=%s))
+ """, (self.appointment_date, self.name, self.practitioner, self.patient,
+ self.appointment_time, end_time.time(), self.appointment_time, end_time.time(), self.appointment_time))
+
+ if overlaps:
+ frappe.throw(_("""Appointment overlaps with {0}.
{1} has appointment scheduled
+ with {2} at {3} having {4} minute(s) duration.""").format(overlaps[0][0], overlaps[0][1], overlaps[0][2], overlaps[0][3], overlaps[0][4]))
+
def after_insert(self):
if self.procedure_prescription:
frappe.db.set_value("Procedure Prescription", self.procedure_prescription, "appointment_booked", True)
+ if self.procedure_template:
+ comments = frappe.db.get_value("Procedure Prescription", self.procedure_prescription, "comments")
+ if comments:
+ frappe.db.set_value("Patient Appointment", self.name, "notes", comments)
# Check fee validity exists
appointment = self
validity_exist = validity_exists(appointment.practitioner, appointment.patient)
@@ -337,11 +361,19 @@ def get_events(start, end, filters=None):
from frappe.desk.calendar import get_event_conditions
conditions = get_event_conditions("Patient Appointment", filters)
- data = frappe.db.sql("""select name, patient, practitioner, status,
- duration, timestamp(appointment_date, appointment_time) as
- 'start' from `tabPatient Appointment` where
- (appointment_date between %(start)s and %(end)s)
- and docstatus < 2 {conditions}""".format(conditions=conditions),
+ data = frappe.db.sql("""
+ select
+ `tabPatient Appointment`.name, `tabPatient Appointment`.patient,
+ `tabPatient Appointment`.practitioner, `tabPatient Appointment`.status,
+ `tabPatient Appointment`.duration,
+ timestamp(`tabPatient Appointment`.appointment_date, `tabPatient Appointment`.appointment_time) as 'start',
+ `tabAppointment Type`.color
+ from
+ `tabPatient Appointment`
+ left join `tabAppointment Type` on `tabPatient Appointment`.appointment_type=`tabAppointment Type`.name
+ where
+ (`tabPatient Appointment`.appointment_date between %(start)s and %(end)s)
+ and `tabPatient Appointment`.status != 'Cancelled' and `tabPatient Appointment`.docstatus < 2 {conditions}""".format(conditions=conditions),
{"start": start, "end": end}, as_dict=True, update={"allDay": 0})
for item in data:
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
index a030f19e95e..085c4f6cbf8 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
index ec3521175bf..b08b172bbac 100644
--- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.json b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
index 234871c75bd..1503f835a47 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.json
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
@@ -1,997 +1,998 @@
{
- "allow_copy": 1,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "beta": 1,
- "creation": "2017-02-02 11:00:24.853005",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 1,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "beta": 1,
+ "creation": "2017-02-02 11:00:24.853005",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "patient.inpatient_record",
- "fieldname": "inpatient_record",
- "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": "Inpatient Record",
- "length": 0,
- "no_copy": 0,
- "options": "Inpatient Record",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fetch_from": "patient.inpatient_record",
+ "fieldname": "inpatient_record",
+ "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": "Inpatient Record",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Inpatient Record",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "inpatient_record.patient",
- "fieldname": "patient",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Patient",
- "length": 0,
- "no_copy": 0,
- "options": "Patient",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fetch_from": "inpatient_record.patient",
+ "fieldname": "patient",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Patient",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Patient",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "patient.patient_name",
- "fieldname": "patient_name",
- "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": "Patient Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fetch_from": "patient.patient_name",
+ "fieldname": "patient_name",
+ "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": "Patient Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "appointment",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Appointment",
- "length": 0,
- "no_copy": 1,
- "options": "Patient Appointment",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "appointment",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Appointment",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Patient Appointment",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "encounter",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 1,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Patient Encounter",
- "length": 0,
- "no_copy": 1,
- "options": "Patient Encounter",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "encounter",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 1,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Patient Encounter",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Patient Encounter",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 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,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Today",
- "fieldname": "signs_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Today",
+ "fieldname": "signs_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "fieldname": "signs_time",
- "fieldtype": "Time",
- "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": "Time",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "fieldname": "signs_time",
+ "fieldtype": "Time",
+ "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": "Time",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "sb_vs",
- "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": "Vital Signs",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sb_vs",
+ "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": "Vital Signs",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Presence of a fever (temp > 38.5 \u00b0C/101.3 \u00b0F or sustained temp > 38 \u00b0C/100.4 \u00b0F)",
- "fieldname": "temperature",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Body Temperature",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Presence of a fever (temp > 38.5 \u00b0C/101.3 \u00b0F or sustained temp > 38 \u00b0C/100.4 \u00b0F)",
+ "fieldname": "temperature",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Body Temperature",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Adults' pulse rate is anywhere between 50 and 80 beats per minute.",
- "fieldname": "pulse",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Heart Rate / Pulse",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Adults' pulse rate is anywhere between 50 and 80 beats per minute.",
+ "fieldname": "pulse",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Heart Rate / Pulse",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Normal reference range for an adult is 16\u201320 breaths/minute (RCP 2012)",
- "fieldname": "respiratory_rate",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Respiratory rate",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Normal reference range for an adult is 16\u201320 breaths/minute (RCP 2012)",
+ "fieldname": "respiratory_rate",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Respiratory rate",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "tongue",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Tongue",
- "length": 0,
- "no_copy": 0,
- "options": "\nCoated\nVery Coated\nNormal\nFurry\nCuts",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "tongue",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Tongue",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nCoated\nVery Coated\nNormal\nFurry\nCuts",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "abdomen",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Abdomen",
- "length": 0,
- "no_copy": 0,
- "options": "\nBloated\nFull\nFluid\nConstipated",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "abdomen",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Abdomen",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nNormal\nBloated\nFull\nFluid\nConstipated",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_8",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_8",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "reflexes",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reflexes",
- "length": 0,
- "no_copy": 0,
- "options": "\nNormal\nHyper\nVery Hyper\nOne Sided",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reflexes",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Reflexes",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nNormal\nHyper\nVery Hyper\nOne Sided",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "bp_systolic",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Blood Pressure (systolic)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "bp_systolic",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Blood Pressure (systolic)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "bp_diastolic",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Blood Pressure (diastolic)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "bp_diastolic",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Blood Pressure (diastolic)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Normal resting blood pressure in an adult is approximately 120 mmHg systolic, and 80 mmHg diastolic, abbreviated \"120/80 mmHg\"",
- "fieldname": "bp",
- "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": "Blood Pressure",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Normal resting blood pressure in an adult is approximately 120 mmHg systolic, and 80 mmHg diastolic, abbreviated \"120/80 mmHg\"",
+ "fieldname": "bp",
+ "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": "Blood Pressure",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "vital_signs_note",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "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,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "vital_signs_note",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "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,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "sb_nutrition_values",
- "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": "Nutrition Values",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sb_nutrition_values",
+ "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": "Nutrition Values",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "height",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Height (In Meter)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "height",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Height (In Meter)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "weight",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Weight (In Kilogram)",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "weight",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Weight (In Kilogram)",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "0.00",
- "fieldname": "bmi",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "BMI",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0.00",
+ "fieldname": "bmi",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "BMI",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_14",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "nutrition_note",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 1,
- "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,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "nutrition_note",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 1,
+ "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,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "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": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "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": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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": "Vital Signs",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 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": "Vital Signs",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
- ],
- "has_web_view": 0,
- "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": "2018-08-26 10:26:20.896305",
- "modified_by": "Administrator",
- "module": "Healthcare",
- "name": "Vital Signs",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "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": "2018-11-23 14:14:05.933292",
+ "modified_by": "Administrator",
+ "module": "Healthcare",
+ "name": "Vital Signs",
+ "name_case": "",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 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": "Physician",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 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": "Physician",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 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": "Nursing User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 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": "Nursing User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Healthcare",
- "search_fields": "patient, signs_date",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "patient",
- "track_changes": 1,
- "track_seen": 1,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "restrict_to_domain": "Healthcare",
+ "search_fields": "patient, signs_date",
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "patient",
+ "track_changes": 1,
+ "track_seen": 1,
"track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 1f9ff492347..534c62442bc 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -12,12 +12,9 @@ app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop'
-staging_version = '11.0.3-beta.37'
error_report_email = "support@erpnext.com"
-docs_app = "foundation"
-
app_include_js = "assets/js/erpnext.min.js"
app_include_css = "assets/css/erpnext.css"
web_include_js = "assets/js/erpnext-web.min.js"
@@ -182,7 +179,8 @@ dump_report_map = "erpnext.startup.report_data_map.data_map"
before_tests = "erpnext.setup.utils.before_tests"
standard_queries = {
- "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list"
+ "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list",
+ "Healthcare Practitioner": "erpnext.healthcare.doctype.healthcare_practitioner.healthcare_practitioner.get_practitioner_list"
}
doc_events = {
@@ -304,5 +302,11 @@ regional_overrides = {
},
'Saudi Arabia': {
'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data'
+ },
+ 'Italy': {
+ 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.italy.utils.update_itemised_tax_data',
+ 'erpnext.controllers.accounts_controller.validate_regional': 'erpnext.regional.italy.utils.sales_invoice_validate',
+ 'erpnext.controllers.accounts_controller.on_submit_regional': 'erpnext.regional.italy.utils.sales_invoice_on_submit',
+ 'erpnext.controllers.accounts_controller.on_cancel_regional': 'erpnext.regional.italy.utils.sales_invoice_on_cancel'
}
}
diff --git a/erpnext/hr/doctype/appraisal/appraisal.json b/erpnext/hr/doctype/appraisal/appraisal.json
index d5365db5a9f..4f6da975d5f 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.json
+++ b/erpnext/hr/doctype/appraisal/appraisal.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -695,7 +696,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 14:44:41.966708",
+ "modified": "2019-01-30 11:28:08.401459",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",
diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json
index 20f44ec2fe1..97d28e7e88f 100644
--- a/erpnext/hr/doctype/attendance/attendance.json
+++ b/erpnext/hr/doctype/attendance/attendance.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -427,7 +428,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-29 06:27:04.865541",
+ "modified": "2019-01-30 11:28:13.075959",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance",
@@ -494,7 +495,7 @@
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
- "search_fields": "employee, employee_name, attendance_date, status",
+ "search_fields": "employee,employee_name,attendance_date,status",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
diff --git a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
index cc5f62930dd..cfdd6d3aefb 100644
--- a/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
+++ b/erpnext/hr/doctype/attendance_request/attendance_request_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'attendance_request',
diff --git a/erpnext/hr/doctype/employee/employee_dashboard.py b/erpnext/hr/doctype/employee/employee_dashboard.py
index e62f59f49f6..46461da1a56 100644
--- a/erpnext/hr/doctype/employee/employee_dashboard.py
+++ b/erpnext/hr/doctype/employee/employee_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/employee_advance/employee_advance.js b/erpnext/hr/doctype/employee_advance/employee_advance.js
index c73df624e29..f4285a2ca21 100644
--- a/erpnext/hr/doctype/employee_advance/employee_advance.js
+++ b/erpnext/hr/doctype/employee_advance/employee_advance.js
@@ -19,7 +19,6 @@ frappe.ui.form.on('Employee Advance', {
filters: {
"root_type": "Asset",
"is_group": 0,
- "account_type": "Payable",
"company": frm.doc.company
}
};
diff --git a/erpnext/hr/doctype/employee_advance/employee_advance.json b/erpnext/hr/doctype/employee_advance/employee_advance.json
index 33afe17d83e..3597e76f1e6 100644
--- a/erpnext/hr/doctype/employee_advance/employee_advance.json
+++ b/erpnext/hr/doctype/employee_advance/employee_advance.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -677,7 +678,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 14:44:38.800542",
+ "modified": "2019-01-30 11:28:15.529649",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Advance",
diff --git a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
index 2ac66981bf6..f2656e9a2b2 100644
--- a/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
+++ b/erpnext/hr/doctype/employee_grade/employee_grade_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'transactions': [
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.json b/erpnext/hr/doctype/expense_claim/expense_claim.json
index 124da59f896..19b990d82fd 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.json
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.json
@@ -1186,7 +1186,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-12-06 09:43:25.056554",
+ "modified": "2019-01-30 11:28:10.324137",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim",
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
index 30828a31c07..d1599a4f47f 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
+++ b/erpnext/hr/doctype/holiday_list/holiday_list_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'holiday_list',
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.json b/erpnext/hr/doctype/leave_allocation/leave_allocation.json
index 5f84b52506b..6d61fe3d5c2 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.json
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@@ -676,7 +677,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-29 23:52:52.683844",
+ "modified": "2019-01-30 11:28:09.360525",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Allocation",
diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json
index f9d83a4244a..d7b2c9f8753 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.json
+++ b/erpnext/hr/doctype/leave_application/leave_application.json
@@ -1,1104 +1,1105 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "beta": 0,
- "creation": "2013-02-20 11:18:11",
- "custom": 0,
- "description": "Apply / Approve Leaves",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Document",
- "editable_grid": 0,
+ "allow_copy": 0,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "beta": 0,
+ "creation": "2013-02-20 11:18:11",
+ "custom": 0,
+ "description": "Apply / Approve Leaves",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
+ "editable_grid": 0,
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Series",
- "length": 0,
- "no_copy": 1,
- "options": "HR-LAP-.YYYY.-",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "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": 1,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Series",
+ "length": 0,
+ "no_copy": 1,
+ "options": "HR-LAP-.YYYY.-",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "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": 1,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee",
- "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": "Employee",
- "length": 0,
- "no_copy": 0,
- "options": "Employee",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee",
+ "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": "Employee",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Employee",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Employee Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 1,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Employee Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "leave_type",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Leave Type",
- "length": 0,
- "no_copy": 0,
- "options": "Leave Type",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "leave_type",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 1,
+ "label": "Leave Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Leave Type",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "employee.department",
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fetch_from": "employee.department",
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Department",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Department",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "leave_balance",
- "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": "Leave Balance Before Application",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "leave_balance",
+ "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": "Leave Balance Before Application",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_5",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "from_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "From Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "From Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "to_date",
- "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": 1,
- "label": "To Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "to_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": 1,
+ "label": "To Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "half_day",
- "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": "Half Day",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "half_day",
+ "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": "Half Day",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.half_day && (doc.from_date != doc.to_date)",
- "fieldname": "half_day_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": "Half Day Date",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.half_day && (doc.from_date != doc.to_date)",
+ "fieldname": "half_day_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": "Half Day Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "total_leave_days",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Total Leave Days",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "precision": "1",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_leave_days",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Total Leave Days",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "1",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "50%",
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "description",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Reason",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Reason",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_7",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_7",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "leave_approver",
- "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": "Leave Approver",
- "length": 0,
- "no_copy": 0,
- "options": "User",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "leave_approver",
+ "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": "Leave Approver",
+ "length": 0,
+ "no_copy": 0,
+ "options": "User",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "leave_approver_name",
- "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": "Leave Approver Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "leave_approver_name",
+ "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": "Leave Approver Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_18",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_18",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Open",
- "fieldname": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Status",
- "length": 0,
- "no_copy": 1,
- "options": "Open\nApproved\nRejected\nCancelled",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 1,
+ "label": "Status",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Open\nApproved\nRejected\nCancelled",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "salary_slip",
- "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": "Salary Slip",
- "length": 0,
- "no_copy": 0,
- "options": "Salary Slip",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "salary_slip",
+ "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": "Salary Slip",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Salary Slip",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "sb10",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sb10",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "Today",
- "fieldname": "posting_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": "Posting Date",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Today",
+ "fieldname": "posting_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": "Posting Date",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "follow_via_email",
- "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": "Follow via Email",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "follow_via_email",
+ "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": "Follow via Email",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "color",
- "fieldtype": "Color",
- "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": "Color",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "color",
+ "fieldtype": "Color",
+ "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": "Color",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_17",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_17",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Company",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Letter Head",
- "length": 0,
- "no_copy": 0,
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Letter Head",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "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": "Leave Application",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "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": "Leave Application",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "fa fa-calendar",
- "idx": 1,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 3,
- "modified": "2018-09-21 15:53:11.935416",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Leave Application",
- "owner": "Administrator",
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "fa fa-calendar",
+ "idx": 1,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "max_attachments": 3,
+ "modified": "2019-01-30 11:28:14.745572",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Application",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Employee",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Employee",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR Manager",
- "set_user_permissions": 1,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "set_user_permissions": 1,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "All",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "All",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "set_user_permissions": 1,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "set_user_permissions": 1,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 0,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Leave Approver",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 0,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Leave Approver",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "Leave Approver",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Leave Approver",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "timeline_field": "employee",
- "title_field": "employee_name",
- "track_changes": 0,
- "track_seen": 0,
+ ],
+ "quick_entry": 0,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days",
+ "show_name_in_global_search": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "timeline_field": "employee",
+ "title_field": "employee_name",
+ "track_changes": 0,
+ "track_seen": 0,
"track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
index 37a3474dc46..2aa54984ec5 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'leave_block_list',
diff --git a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
index 5214a58fbfa..1572de3cb72 100644
--- a/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
+++ b/erpnext/hr/doctype/leave_period/leave_period_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
index a12ba7f62db..f97d2855a4f 100644
--- a/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
+++ b/erpnext/hr/doctype/leave_policy/leave_policy_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'leave_policy',
diff --git a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
index 75e0c08c821..5cae9a8809c 100644
--- a/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
+++ b/erpnext/hr/doctype/leave_type/leave_type_dashboard.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
def get_data():
return {
'fieldname': 'leave_type',
diff --git a/erpnext/hr/doctype/loan/loan_dashboard.py b/erpnext/hr/doctype/loan/loan_dashboard.py
index c621a7fc4bd..7256d9424ae 100644
--- a/erpnext/hr/doctype/loan/loan_dashboard.py
+++ b/erpnext/hr/doctype/loan/loan_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json b/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json
index fdd102e4118..0dd3403d665 100644
--- a/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json
+++ b/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -14,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,16 +43,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.employee_name",
+ "fetch_from": "employee.employee_name",
"fieldname": "employee_name",
"fieldtype": "Data",
"hidden": 0,
@@ -74,11 +77,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -104,18 +108,19 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.department",
+ "fetch_from": "employee.department",
"fieldname": "department",
- "fieldtype": "Link",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -126,7 +131,7 @@
"label": "Department",
"length": 0,
"no_copy": 0,
- "options": "Department",
+ "options": "Department",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -137,16 +142,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.designation",
+ "fetch_from": "employee.designation",
"fieldname": "designation",
"fieldtype": "Data",
"hidden": 0,
@@ -170,7 +176,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -184,7 +190,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-17 10:32:12.974763",
+ "modified": "2019-01-30 11:28:16.544471",
"modified_by": "Administrator",
"module": "HR",
"name": "Payroll Employee Detail",
@@ -198,5 +204,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.js b/erpnext/hr/doctype/payroll_entry/payroll_entry.js
index fa1b63cee8d..e4ab68068c4 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.js
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.js
@@ -95,6 +95,8 @@ frappe.ui.form.on('Payroll Entry', {
},
setup: function (frm) {
+ frm.add_fetch('company', 'cost_center', 'cost_center');
+
frm.set_query("payment_account", function () {
var account_types = ["Bank", "Cash"];
return {
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.json b/erpnext/hr/doctype/payroll_entry/payroll_entry.json
index a898f8896b9..562b999b827 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.json
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.json
@@ -1,5 +1,6 @@
{
"allow_copy": 1,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -861,7 +862,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "company.cost_center",
+ "default": ":Company",
+ "fetch_from": "",
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": 0,
@@ -1189,7 +1191,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 16:15:45.276711",
+ "modified": "2019-02-05 10:41:08.865842",
"modified_by": "Administrator",
"module": "HR",
"name": "Payroll Entry",
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
index e097cc2ed46..af5e3d0570e 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
@@ -115,7 +115,7 @@ class PayrollEntry(Document):
frappe.enqueue(create_salary_slips_for_employees, timeout=600, employees=emp_list, args=args)
else:
create_salary_slips_for_employees(emp_list, args, publish_progress=False)
-
+
def get_sal_slip_list(self, ss_status, as_dict=False):
"""
Returns list of salary slips based on selected criteria
@@ -196,7 +196,7 @@ class PayrollEntry(Document):
return account_dict
def get_default_payroll_payable_account(self):
- payroll_payable_account = frappe.get_cached_value('Company',
+ payroll_payable_account = frappe.get_cached_value('Company',
{"company_name": self.company}, "default_payroll_payable_account")
if not payroll_payable_account:
@@ -504,9 +504,9 @@ def create_salary_slips_for_employees(employees, args, publish_progress=True):
def get_existing_salary_slips(employees, args):
return frappe.db.sql_list("""
- select distinct employee from `tabSalary Slip`
+ select distinct employee from `tabSalary Slip`
where docstatus!= 2 and company = %s
- and start_date >= %s and end_date <= %s
+ and start_date >= %s and end_date <= %s
and employee in (%s)
""" % ('%s', '%s', '%s', ', '.join(['%s']*len(employees))),
[args.company, args.start_date, args.end_date] + employees)
@@ -527,7 +527,7 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr
submitted_ss.append(ss_obj)
except frappe.ValidationError:
not_submitted_ss.append(ss[0])
-
+
count += 1
if publish_progress:
frappe.publish_progress(count*100/len(salary_slips), title = _("Submitting Salary Slips..."))
@@ -538,7 +538,7 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr
.format(ss_obj.start_date, ss_obj.end_date))
payroll_entry.email_salary_slip(submitted_ss)
-
+
payroll_entry.db_set("salary_slips_submitted", 1)
payroll_entry.notify_update()
@@ -546,4 +546,16 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr
frappe.msgprint(_("No salary slip found to submit for the above selected criteria OR salary slip already submitted"))
if not_submitted_ss:
- frappe.msgprint(_("Could not submit some Salary Slips"))
\ No newline at end of file
+ frappe.msgprint(_("Could not submit some Salary Slips"))
+def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
+ return frappe.db.sql("""
+ select name from `tabPayroll Entry`
+ where `{key}` LIKE %(txt)s
+ and name not in
+ (select reference_name from `tabJournal Entry Account`
+ where reference_type="Payroll Entry")
+ order by name limit %(start)s, %(page_len)s"""
+ .format(key=searchfield), {
+ 'txt': "%%%s%%" % frappe.db.escape(txt),
+ 'start': start, 'page_len': page_len
+ })
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py
index c4fa7f6dd56..7af507d119c 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
index ada8e3d86fe..3cf13226db9 100644
--- a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
+++ b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
@@ -21,6 +21,8 @@ class TestPayrollEntry(unittest.TestCase):
make_earning_salary_component(setup=True)
make_deduction_salary_component(setup=True)
+ frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 0)
+
def test_payroll_entry(self): # pylint: disable=no-self-use
company = erpnext.get_default_company()
for data in frappe.get_all('Salary Component', fields = ["name"]):
diff --git a/erpnext/hr/doctype/salary_detail/salary_detail.json b/erpnext/hr/doctype/salary_detail/salary_detail.json
index bc9812c34f5..0ec3cd64138 100644
--- a/erpnext/hr/doctype/salary_detail/salary_detail.json
+++ b/erpnext/hr/doctype/salary_detail/salary_detail.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -348,7 +349,7 @@
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -417,7 +418,7 @@
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -692,7 +693,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-09-20 16:59:33.622652",
+ "modified": "2019-02-04 14:41:56.030991",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Detail",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index 2e2856d5346..c9a5d87281a 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -194,7 +195,7 @@
"columns": 0,
"fetch_from": "employee.branch",
"fieldname": "branch",
- "fieldtype": "Read Only",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -207,11 +208,11 @@
"no_copy": 0,
"oldfieldname": "branch",
"oldfieldtype": "Link",
- "options": "",
+ "options": "Branch",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@@ -900,7 +901,7 @@
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 1,
"read_only": 0,
@@ -1905,7 +1906,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-07-27 19:23:35.587516",
+ "modified": "2019-02-18 18:54:36.161027",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 85e372d1840..3fd266b4bba 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -406,7 +406,7 @@ class SalarySlip(TransactionBase):
if frappe.db.get_value('Timesheet', data.time_sheet, 'status') == 'Payrolled':
frappe.throw(_("Salary Slip of employee {0} already created for time sheet {1}").format(self.employee, data.time_sheet))
- def sum_components(self, component_type, total_field):
+ def sum_components(self, component_type, total_field, precision):
joining_date, relieving_date = frappe.db.get_value("Employee", self.employee,
["date_of_joining", "relieving_date"])
@@ -426,7 +426,7 @@ class SalarySlip(TransactionBase):
)):
d.amount = rounded(
- (flt(d.default_amount) * flt(self.payment_days)
+ (flt(d.default_amount, precision) * flt(self.payment_days)
/ cint(self.total_working_days)), self.precision("amount", component_type)
)
@@ -436,19 +436,19 @@ class SalarySlip(TransactionBase):
elif not d.amount:
d.amount = d.default_amount
if not d.do_not_include_in_total:
- self.set(total_field, self.get(total_field) + flt(d.amount))
+ self.set(total_field, self.get(total_field) + flt(d.amount, precision))
def calculate_net_pay(self):
if self.salary_structure:
self.calculate_component_amounts()
disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total"))
-
+ precision = frappe.defaults.get_global_default("currency_precision")
self.total_deduction = 0
self.gross_pay = 0
- self.sum_components('earnings', 'gross_pay')
- self.sum_components('deductions', 'total_deduction')
+ self.sum_components('earnings', 'gross_pay', precision)
+ self.sum_components('deductions', 'total_deduction', precision)
self.set_loan_repayment()
diff --git a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
index 7a9393c332a..797f8f7c028 100644
--- a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
+++ b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
@@ -1,5 +1,7 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -11,16 +13,21 @@
"editable_grid": 1,
"fields": [
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "time_sheet",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Time Sheet",
"length": 0,
"no_copy": 0,
@@ -30,49 +37,58 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "columns": 0,
"fieldname": "working_hours",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
+ "in_standard_filter": 0,
"label": "Working Hours",
"length": 0,
"no_copy": 1,
"permlevel": 0,
- "precision": "3",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
-
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-07-11 03:28:07.152366",
+ "modified": "2019-02-19 08:33:41.762144",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip Timesheet",
@@ -82,7 +98,10 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
+ "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "track_seen": 0
+ "track_changes": 0,
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/hr/doctype/salary_structure/salary_structure.json
index ce8b64eb4dd..0e47278a3e1 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.json
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -365,7 +366,7 @@
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -950,7 +951,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-07-24 18:36:25.169098",
+ "modified": "2019-02-18 18:51:53.932518",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Structure",
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py
index 7a29878ac3b..3803c1d3ea0 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py
+++ b/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
index cf0906687c9..668e0ec4717 100644
--- a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
+++ b/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
@@ -20,7 +20,7 @@ class SalaryStructureAssignment(Document):
if self.from_date:
if frappe.db.exists("Salary Structure Assignment", {"employee": self.employee, "from_date": self.from_date, "docstatus": 1}):
- frappe.throw("Salary Structure Assignment for Employee already exists")
+ frappe.throw(_("Salary Structure Assignment for Employee already exists"), DuplicateAssignment)
if joining_date and getdate(self.from_date) < joining_date:
frappe.throw(_("From Date {0} cannot be before employee's joining Date {1}")
diff --git a/erpnext/hr/doctype/training_event_employee/training_event_employee.json b/erpnext/hr/doctype/training_event_employee/training_event_employee.json
index d8b514830d7..e3a40649b4d 100644
--- a/erpnext/hr/doctype/training_event_employee/training_event_employee.json
+++ b/erpnext/hr/doctype/training_event_employee/training_event_employee.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -13,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,16 +42,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.employee_name",
+ "fetch_from": "employee.employee_name",
"fieldname": "employee_name",
"fieldtype": "Read Only",
"hidden": 0,
@@ -73,48 +76,50 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.department",
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "fetch_from": "employee.department",
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Department",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Department",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -136,11 +141,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -169,11 +175,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -201,7 +208,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -215,7 +222,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-17 10:19:51.899523",
+ "modified": "2019-01-30 11:28:16.170333",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Event Employee",
@@ -229,5 +236,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_feedback/training_feedback.json b/erpnext/hr/doctype/training_feedback/training_feedback.json
index 0123332de90..cd967d514f4 100644
--- a/erpnext/hr/doctype/training_feedback/training_feedback.json
+++ b/erpnext/hr/doctype/training_feedback/training_feedback.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -383,7 +384,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 16:15:34.125368",
+ "modified": "2019-01-30 11:28:13.849860",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Feedback",
diff --git a/erpnext/hr/doctype/training_program/training_program_dashboard.py b/erpnext/hr/doctype/training_program/training_program_dashboard.py
index a314081c6b9..441a71bba77 100644
--- a/erpnext/hr/doctype/training_program/training_program_dashboard.py
+++ b/erpnext/hr/doctype/training_program/training_program_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/hr/doctype/training_result_employee/training_result_employee.json b/erpnext/hr/doctype/training_result_employee/training_result_employee.json
index ca71bf1bf5c..c4747545d04 100644
--- a/erpnext/hr/doctype/training_result_employee/training_result_employee.json
+++ b/erpnext/hr/doctype/training_result_employee/training_result_employee.json
@@ -1,6 +1,7 @@
{
"allow_copy": 0,
- "allow_guest_to_view": 0,
+ "allow_events_in_timeline": 0,
+ "allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
@@ -13,7 +14,8 @@
"engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -24,7 +26,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Employee",
@@ -36,16 +38,17 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -56,7 +59,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -66,28 +69,29 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.employee_name",
+ "fetch_from": "employee.employee_name",
"fieldname": "employee_name",
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Employee Name",
@@ -99,53 +103,55 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "employee.department",
- "fieldname": "department",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Department",
- "length": 0,
- "no_copy": 0,
- "options": "Department",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "fetch_from": "employee.department",
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Department",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Department",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"depends_on": "",
"fieldname": "section_break_5",
"fieldtype": "Section Break",
@@ -153,7 +159,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -163,16 +169,17 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -183,7 +190,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Hours",
@@ -194,16 +201,17 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -214,7 +222,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Grade",
@@ -225,16 +233,17 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -245,7 +254,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
@@ -255,16 +264,17 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
- "allow_bulk_edit": 0,
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -275,7 +285,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
- "in_global_search": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Comments",
@@ -286,16 +296,16 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
- "remember_last_selected_value": 0,
+ "remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
- "has_web_view": 0,
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
@@ -305,7 +315,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-17 10:09:57.777384",
+ "modified": "2019-01-30 11:28:14.337778",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Result Employee",
@@ -315,9 +325,10 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
- "show_name_in_global_search": 0,
+ "show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0
+ "track_changes": 0,
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
index 2c1c4c31aa2..d27c7ac0096 100644
--- a/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
+++ b/erpnext/hr/doctype/vehicle/vehicle_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
data = {
diff --git a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json
index 12837111a78..4b49f1978ab 100644
--- a/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json
+++ b/erpnext/hub_node/doctype/marketplace_settings/marketplace_settings.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -351,8 +352,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-01 17:05:59.600583",
- "modified_by": "cave@aperture.com",
+ "modified": "2019-02-01 14:21:16.729848",
+ "modified_by": "Administrator",
"module": "Hub Node",
"name": "Marketplace Settings",
"name_case": "",
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 0cf7dc4f816..79c883a734f 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -642,6 +642,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "Valuation Rate",
"fieldname": "rm_cost_as_per",
"fieldtype": "Select",
"hidden": 0,
@@ -1977,7 +1978,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-12-13 17:45:44.843197",
+ "modified": "2019-01-30 16:39:34.353721",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 57a1cc25936..88d346ff0f3 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -163,6 +163,8 @@ class BOM(WebsiteGenerator):
def get_rm_rate(self, arg):
""" Get raw material rate as per selected method, if bom exists takes bom cost """
rate = 0
+ if not self.rm_cost_as_per:
+ self.rm_cost_as_per = "Valuation Rate"
if arg.get('scrap_items'):
rate = self.get_valuation_rate(arg)
@@ -181,7 +183,7 @@ class BOM(WebsiteGenerator):
args = frappe._dict({
"doctype": "BOM",
"price_list": self.buying_price_list,
- "qty": arg.get("qty"),
+ "qty": arg.get("qty") or 1,
"uom": arg.get("uom") or arg.get("stock_uom"),
"stock_uom": arg.get("stock_uom"),
"transaction_type": "buying",
@@ -189,7 +191,8 @@ class BOM(WebsiteGenerator):
"currency": self.currency,
"conversion_rate": self.conversion_rate or 1,
"conversion_factor": arg.get("conversion_factor") or 1,
- "plc_conversion_rate": 1
+ "plc_conversion_rate": 1,
+ "ignore_party": True
})
item_doc = frappe.get_doc("Item", arg.get("item_code"))
out = frappe._dict()
@@ -213,7 +216,7 @@ class BOM(WebsiteGenerator):
existing_bom_cost = self.total_cost
for d in self.get("items"):
- d.rate = self.get_rm_rate({
+ rate = self.get_rm_rate({
"item_code": d.item_code,
"bom_no": d.bom_no,
"qty": d.qty,
@@ -221,6 +224,8 @@ class BOM(WebsiteGenerator):
"stock_uom": d.stock_uom,
"conversion_factor": d.conversion_factor
})
+ if rate:
+ d.rate = rate
d.amount = flt(d.rate) * flt(d.qty)
if self.docstatus == 1:
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json
index 754540eb6bc..22583605777 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.json
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json
@@ -78,39 +78,6 @@
"translatable": 0,
"unique": 0
},
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "operation",
- "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": "Item operation",
- "length": 0,
- "no_copy": 0,
- "options": "Operation",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -926,38 +893,6 @@
"translatable": 0,
"unique": 0
},
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "allow_alternative_item",
- "fieldtype": "Check",
- "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": "Allow Alternative Item",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -1115,4 +1050,4 @@
"track_changes": 0,
"track_seen": 0,
"track_views": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py
index 5343a280ca7..ea9f714fc84 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card.py
@@ -57,7 +57,7 @@ class JobCard(Document):
.format(d.idx, d.item_code))
if self.get('operation') == d.operation:
- child = self.append('items', {
+ self.append('items', {
'item_code': d.item_code,
'source_warehouse': d.source_warehouse,
'uom': frappe.db.get_value("Item", d.item_code, 'stock_uom'),
@@ -108,6 +108,10 @@ class JobCard(Document):
if not self.items:
self.transferred_qty = self.for_quantity if self.docstatus == 1 else 0
+ doc = frappe.get_doc('Work Order', self.get('work_order'))
+ if doc.transfer_material_against == 'Work Order' or doc.skip_transfer:
+ return
+
if self.items:
self.transferred_qty = frappe.db.get_value('Stock Entry', {
'job_card': self.name,
@@ -168,9 +172,6 @@ def make_material_request(source_name, target_doc=None):
doclist = get_mapped_doc("Job Card", source_name, {
"Job Card": {
"doctype": "Material Request",
- "validation": {
- "docstatus": ["=", 1]
- },
"field_map": {
"name": "job_card",
},
@@ -202,9 +203,6 @@ def make_stock_entry(source_name, target_doc=None):
doclist = get_mapped_doc("Job Card", source_name, {
"Job Card": {
"doctype": "Stock Entry",
- "validation": {
- "docstatus": ["=", 1]
- },
"field_map": {
"name": "job_card",
"for_quantity": "fg_completed_qty"
diff --git a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
index a9811fcf95b..d48bccf9d42 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/manufacturing/doctype/operation/test_operation.py b/erpnext/manufacturing/doctype/operation/test_operation.py
index 401ac748f35..17d206a4e1f 100644
--- a/erpnext/manufacturing/doctype/operation/test_operation.py
+++ b/erpnext/manufacturing/doctype/operation/test_operation.py
@@ -1,5 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
+from __future__ import unicode_literals
import frappe
import unittest
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 6c84ef15caf..97a8ea7e3cf 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -276,8 +276,8 @@ class ProductionPlan(Document):
item_dict[(d.item_code, d.material_request_item, d.warehouse)] = item_details
else:
item_details.update({
- "qty":flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{})
- .get("qty")) + flt(d.planned_qty)
+ "qty": flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{})
+ .get("qty")) + (flt(d.planned_qty) - flt(d.ordered_qty))
})
item_dict[(d.item_code, d.sales_order, d.warehouse)] = item_details
@@ -567,7 +567,7 @@ def get_items_for_material_requests(doc, sales_order=None, company=None):
else:
item_details = get_subitems(doc, data, item_details, bom_no, company,
include_non_stock_items, include_subcontracted_items, 1, planned_qty=planned_qty)
- else:
+ elif data.get('item_code'):
item_master = frappe.get_doc('Item', data['item_code']).as_dict()
purchase_uom = item_master.purchase_uom or item_master.stock_uom
conversion_factor = 0
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
index 8611372dfc4..91c28555d61 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
index 02fbfcdeabe..3fe5282582e 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py
index 2d3d0781790..612f415beb0 100644
--- a/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py
+++ b/erpnext/manufacturing/report/bom_stock_calculated/bom_stock_calculated.py
@@ -13,16 +13,16 @@ def execute(filters=None):
data = get_bom_stock(filters)
qty_to_make = filters.get("qty_to_make")
- for rows in data:
- item_map = get_item_details(rows[0])
- reqd_qty = qty_to_make * rows[3]
- last_pur_price = frappe.db.get_value("Item", rows[0], "last_purchase_rate")
- if rows[4] > 0:
- diff_qty = rows[4] - reqd_qty
- summ_data.append([rows[0], rows[1], item_map[rows[0]]["manufacturer"], item_map[rows[0]]["manufacturer_part_no"], rows[3], rows[4], reqd_qty, diff_qty, last_pur_price])
+ for row in data:
+ item_map = get_item_details(row.item_code)
+ reqd_qty = qty_to_make * row.actual_qty
+ last_pur_price = frappe.db.get_value("Item", row.item_code, "last_purchase_rate")
+ if row.to_build > 0:
+ diff_qty = row.to_build - reqd_qty
+ summ_data.append([row.item_code, row.description, item_map[row.item_code]["manufacturer"], item_map[row.item_code]["manufacturer_part_no"], row.actual_qty, row.to_build, reqd_qty, diff_qty, last_pur_price])
else:
diff_qty = 0 - reqd_qty
- summ_data.append([rows[0], rows[1], item_map[rows[0]]["manufacturer"], item_map[rows[0]]["manufacturer_part_no"], rows[3], "0.000", reqd_qty, diff_qty, last_pur_price])
+ summ_data.append([row.item_code, row.description, item_map[row.item_code]["manufacturer"], item_map[row.item_code]["manufacturer_part_no"], row.actual_qty, "0.000", reqd_qty, diff_qty, last_pur_price])
return columns, summ_data
@@ -72,8 +72,8 @@ def get_bom_stock(filters):
bom_item.item_code,
bom_item.description,
bom_item.{qty_field},
- sum(ledger.actual_qty) as actual_qty,
- sum(FLOOR(ledger.actual_qty / bom_item.{qty_field}))as to_build
+ ifnull(sum(ledger.actual_qty), 0) as actual_qty,
+ ifnull(sum(FLOOR(ledger.actual_qty / bom_item.{qty_field})), 0) as to_build
FROM
{table} AS bom_item
LEFT JOIN `tabBin` AS ledger
@@ -83,7 +83,7 @@ def get_bom_stock(filters):
WHERE
bom_item.parent = '{bom}' and bom_item.parenttype='BOM'
- GROUP BY bom_item.item_code""".format(qty_field=qty_field, table=table, conditions=conditions, bom=bom))
+ GROUP BY bom_item.item_code""".format(qty_field=qty_field, table=table, conditions=conditions, bom=bom), as_dict=1)
def get_item_details(item_code):
items = frappe.db.sql("""select it.item_group, it.item_name, it.stock_uom, it.name, it.brand, it.description, it.manufacturer_part_no, it.manufacturer from tabItem it where it.item_code = %s""", item_code, as_dict=1)
diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.json b/erpnext/manufacturing/report/production_analytics/production_analytics.json
index 023e0a89295..946cd33a1a2 100644
--- a/erpnext/manufacturing/report/production_analytics/production_analytics.json
+++ b/erpnext/manufacturing/report/production_analytics/production_analytics.json
@@ -1,13 +1,14 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"creation": "2018-10-11 19:28:37.085066",
+ "disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"letter_head": "",
- "modified": "2018-10-11 19:28:37.085066",
+ "modified": "2019-02-12 14:32:16.392521",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Analytics",
diff --git a/erpnext/non_profit/doctype/member/member_dashboard.py b/erpnext/non_profit/doctype/member/member_dashboard.py
index c44a9a8422e..945fb7b7d31 100644
--- a/erpnext/non_profit/doctype/member/member_dashboard.py
+++ b/erpnext/non_profit/doctype/member/member_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 69ad5d1d74f..b1a393bdf3e 100755
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -488,7 +488,6 @@ erpnext.patches.v10_0.update_assessment_plan
erpnext.patches.v10_0.update_assessment_result
erpnext.patches.v10_0.set_default_payment_terms_based_on_company
erpnext.patches.v10_0.update_sales_order_link_to_purchase_order
-erpnext.patches.v10_0.item_barcode_childtable_migrate
erpnext.patches.v10_0.rename_price_to_rate_in_pricing_rule
erpnext.patches.v10_0.set_currency_in_pricing_rule
erpnext.patches.v10_0.set_b2c_limit
@@ -576,9 +575,16 @@ erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13 #2019-01-09
erpnext.patches.v11_0.drop_column_max_days_allowed
erpnext.patches.v11_0.change_healthcare_desktop_icons
erpnext.patches.v10_0.update_user_image_in_employee
-erpnext.patches.v11_0.update_delivery_trip_status
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
+erpnext.patches.v10_0.allow_operators_in_supplier_scorecard
+erpnext.patches.v11_0.update_delivery_trip_status
erpnext.patches.v11_0.set_missing_gst_hsn_code
erpnext.patches.v11_0.rename_bom_wo_fields
erpnext.patches.v11_0.rename_additional_salary_component_additional_salary
-erpnext.patches.v11_0.renamed_from_to_fields_in_project
\ No newline at end of file
+erpnext.patches.v11_0.renamed_from_to_fields_in_project
+erpnext.patches.v11_0.add_permissions_in_gst_settings
+erpnext.patches.v11_1.setup_guardian_role
+execute:frappe.delete_doc('DocType', 'Notification Control')
+erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants
+erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
+erpnext.patches.v11_0.make_italian_localization_fields
diff --git a/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py
new file mode 100644
index 00000000000..827f9bc94fa
--- /dev/null
+++ b/erpnext/patches/v10_0/allow_operators_in_supplier_scorecard.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2019, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_criteria')
+ frappe.reload_doc('buying', 'doctype', 'supplier_scorecard_scoring_criteria')
+ frappe.reload_doc('buying', 'doctype', 'supplier_scorecard')
+
+ for criteria in frappe.get_all('Supplier Scorecard Criteria', fields=['name', 'formula'], limit_page_length=None):
+ frappe.db.set_value('Supplier Scorecard Criteria', criteria.name,
+ 'formula', criteria.formula.replace('<','<').replace('>','>'))
+
+ for criteria in frappe.get_all('Supplier Scorecard Scoring Criteria', fields=['name', 'formula'], limit_page_length=None):
+ if criteria.formula: # not mandatory
+ frappe.db.set_value('Supplier Scorecard Scoring Criteria', criteria.name,
+ 'formula', criteria.formula.replace('<','<').replace('>','>'))
+
+ for sc in frappe.get_all('Supplier Scorecard', fields=['name', 'weighting_function'], limit_page_length=None):
+ frappe.db.set_value('Supplier Scorecard', sc.name, 'weighting_function',
+ sc.weighting_function.replace('<','<').replace('>','>'))
\ No newline at end of file
diff --git a/erpnext/patches/v10_0/copy_projects_renamed_fields.py b/erpnext/patches/v10_0/copy_projects_renamed_fields.py
index 58e32b0de8d..80db3bdd1ee 100644
--- a/erpnext/patches/v10_0/copy_projects_renamed_fields.py
+++ b/erpnext/patches/v10_0/copy_projects_renamed_fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v10_0/delete_hub_documents.py b/erpnext/patches/v10_0/delete_hub_documents.py
index 6dcfec7ca8e..f6a14998956 100644
--- a/erpnext/patches/v10_0/delete_hub_documents.py
+++ b/erpnext/patches/v10_0/delete_hub_documents.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
index c939dd5d33d..bc6005677db 100644
--- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
+++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py
@@ -7,20 +7,25 @@ import frappe
def execute():
- items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') })
-
- frappe.reload_doc("stock", "doctype", "item")
frappe.reload_doc("stock", "doctype", "item_barcode")
+ items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') })
+ frappe.reload_doc("stock", "doctype", "item")
+
+
+
for item in items_barcode:
barcode = item.barcode.strip()
if barcode and '<' not in barcode:
- frappe.get_doc({
- 'idx': 0,
- 'doctype': 'Item Barcode',
- 'barcode': barcode,
- 'parenttype': 'Item',
- 'parent': item.name,
- 'parentfield': 'barcodes'
- }).insert()
+ try:
+ frappe.get_doc({
+ 'idx': 0,
+ 'doctype': 'Item Barcode',
+ 'barcode': barcode,
+ 'parenttype': 'Item',
+ 'parent': item.name,
+ 'parentfield': 'barcodes'
+ }).insert()
+ except frappe.DuplicateEntryError:
+ continue
diff --git a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
index f888ef6b63e..2e3095153a5 100644
--- a/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
+++ b/erpnext/patches/v10_0/rename_offer_letter_to_job_offer.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/set_discount_amount.py b/erpnext/patches/v10_0/set_discount_amount.py
index eb8bb2d48f3..d5e2c5a84b8 100644
--- a/erpnext/patches/v10_0/set_discount_amount.py
+++ b/erpnext/patches/v10_0/set_discount_amount.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
diff --git a/erpnext/patches/v10_0/set_student_party_type.py b/erpnext/patches/v10_0/set_student_party_type.py
index 6ac1451623b..08376ae894b 100644
--- a/erpnext/patches/v10_0/set_student_party_type.py
+++ b/erpnext/patches/v10_0/set_student_party_type.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/show_leaves_of_all_department_members_in_calendar.py b/erpnext/patches/v10_0/show_leaves_of_all_department_members_in_calendar.py
index 1ae8b4a54e3..7e2ff7a8a7f 100644
--- a/erpnext/patches/v10_0/show_leaves_of_all_department_members_in_calendar.py
+++ b/erpnext/patches/v10_0/show_leaves_of_all_department_members_in_calendar.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/update_asset_calculate_depreciation.py b/erpnext/patches/v10_0/update_asset_calculate_depreciation.py
index 44b8c7f3202..b947a40b4a3 100644
--- a/erpnext/patches/v10_0/update_asset_calculate_depreciation.py
+++ b/erpnext/patches/v10_0/update_asset_calculate_depreciation.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/update_hub_connector_domain.py b/erpnext/patches/v10_0/update_hub_connector_domain.py
index 808ae77129f..baf580a3699 100644
--- a/erpnext/patches/v10_0/update_hub_connector_domain.py
+++ b/erpnext/patches/v10_0/update_hub_connector_domain.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/update_lft_rgt_for_employee.py b/erpnext/patches/v10_0/update_lft_rgt_for_employee.py
index 82fbeaaeaf7..46ca786e0d6 100644
--- a/erpnext/patches/v10_0/update_lft_rgt_for_employee.py
+++ b/erpnext/patches/v10_0/update_lft_rgt_for_employee.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import rebuild_tree
diff --git a/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py b/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py
index b0df91890bc..7b2c36698a2 100644
--- a/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py
+++ b/erpnext/patches/v10_0/update_reserved_qty_for_purchase_order.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.stock.utils import get_bin
diff --git a/erpnext/patches/v10_0/update_status_in_purchase_receipt.py b/erpnext/patches/v10_0/update_status_in_purchase_receipt.py
index 69e2bb881b3..a0bdd9e2cc1 100644
--- a/erpnext/patches/v10_0/update_status_in_purchase_receipt.py
+++ b/erpnext/patches/v10_0/update_status_in_purchase_receipt.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v10_0/update_territory_and_customer_group.py b/erpnext/patches/v10_0/update_territory_and_customer_group.py
index c02d3276aa9..8f0c230717c 100644
--- a/erpnext/patches/v10_0/update_territory_and_customer_group.py
+++ b/erpnext/patches/v10_0/update_territory_and_customer_group.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.rename_doc import get_fetch_fields
diff --git a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
index 08006ad01b1..f4c18955390 100644
--- a/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
+++ b/erpnext/patches/v11_0/add_default_dispatch_notification_template.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import os
import frappe
diff --git a/erpnext/patches/v11_0/add_default_email_template_for_leave.py b/erpnext/patches/v11_0/add_default_email_template_for_leave.py
index bd86ae29e33..f722be26b41 100644
--- a/erpnext/patches/v11_0/add_default_email_template_for_leave.py
+++ b/erpnext/patches/v11_0/add_default_email_template_for_leave.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe, os
from frappe import _
diff --git a/erpnext/patches/v11_0/add_expense_claim_default_account.py b/erpnext/patches/v11_0/add_expense_claim_default_account.py
index 685020222f2..eecf75568a4 100644
--- a/erpnext/patches/v11_0/add_expense_claim_default_account.py
+++ b/erpnext/patches/v11_0/add_expense_claim_default_account.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py b/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py
index 029ea8738b3..d956052f1a6 100644
--- a/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py
+++ b/erpnext/patches/v11_0/add_healthcare_service_unit_tree_root.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py b/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py
index 064e0367429..5a30c780f8c 100644
--- a/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py
+++ b/erpnext/patches/v11_0/add_index_on_nestedset_doctypes.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/add_market_segments.py b/erpnext/patches/v11_0/add_market_segments.py
index 0e7a23ad662..ed47d4293f7 100644
--- a/erpnext/patches/v11_0/add_market_segments.py
+++ b/erpnext/patches/v11_0/add_market_segments.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v11_0/add_permissions_in_gst_settings.py b/erpnext/patches/v11_0/add_permissions_in_gst_settings.py
new file mode 100644
index 00000000000..e8fcf33bede
--- /dev/null
+++ b/erpnext/patches/v11_0/add_permissions_in_gst_settings.py
@@ -0,0 +1,12 @@
+import frappe
+from frappe.permissions import add_permission, update_permission_property
+
+def execute():
+ company = frappe.get_all('Company', filters = {'country': 'India'})
+ if not company:
+ return
+
+ for doctype in ('GST HSN Code', 'GST Settings'):
+ add_permission(doctype, 'Accounts Manager', 0)
+ update_permission_property(doctype, 'Accounts Manager', 0, 'write', 1)
+ update_permission_property(doctype, 'Accounts Manager', 0, 'create', 1)
\ No newline at end of file
diff --git a/erpnext/patches/v11_0/add_sales_stages.py b/erpnext/patches/v11_0/add_sales_stages.py
index 69182c21791..ac2ae1511ae 100644
--- a/erpnext/patches/v11_0/add_sales_stages.py
+++ b/erpnext/patches/v11_0/add_sales_stages.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.setup.setup_wizard.operations.install_fixtures import add_sale_stages
diff --git a/erpnext/patches/v11_0/change_healthcare_desktop_icons.py b/erpnext/patches/v11_0/change_healthcare_desktop_icons.py
index ed7df503e51..0b773958651 100644
--- a/erpnext/patches/v11_0/change_healthcare_desktop_icons.py
+++ b/erpnext/patches/v11_0/change_healthcare_desktop_icons.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
index ee336be3b5c..462f830c183 100644
--- a/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
+++ b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/create_default_success_action.py b/erpnext/patches/v11_0/create_default_success_action.py
index 29687d2692d..31feff25b93 100644
--- a/erpnext/patches/v11_0/create_default_success_action.py
+++ b/erpnext/patches/v11_0/create_default_success_action.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.setup.install import create_default_success_action
diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py
index eb48eed7a67..b5a7bd91bd5 100644
--- a/erpnext/patches/v11_0/create_department_records_for_each_company.py
+++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils.nestedset import rebuild_tree
@@ -26,8 +27,10 @@ def execute():
for company in companies:
copy_doc = frappe.copy_doc(department_doc)
copy_doc.update({"company": company.name})
- copy_doc.insert()
-
+ try:
+ copy_doc.insert()
+ except frappe.DuplicateEntryError:
+ pass
# append list of new department for each company
comp_dict[company.name][department.name] = copy_doc.name
diff --git a/erpnext/patches/v11_0/create_salary_structure_assignments.py b/erpnext/patches/v11_0/create_salary_structure_assignments.py
index 2dab1940d8a..610fa85172f 100644
--- a/erpnext/patches/v11_0/create_salary_structure_assignments.py
+++ b/erpnext/patches/v11_0/create_salary_structure_assignments.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from datetime import datetime
+from frappe.utils import getdate
from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import DuplicateAssignment
def execute():
@@ -31,14 +32,22 @@ def execute():
where is_active='Yes'
AND employee in (select name from `tabEmployee` where ifNull(status, '') != 'Left')
""".format(cols), as_dict=1)
-
+
for d in ss_details:
try:
+ joining_date, relieving_date = frappe.db.get_value("Employee", d.employee,
+ ["date_of_joining", "relieving_date"])
+ from_date = d.from_date
+ if joining_date and getdate(from_date) < joining_date:
+ from_date = joining_date
+ elif relieving_date and getdate(from_date) > relieving_date:
+ continue
+
s = frappe.new_doc("Salary Structure Assignment")
s.employee = d.employee
s.employee_name = d.employee_name
s.salary_structure = d.salary_structure
- s.from_date = d.from_date
+ s.from_date = from_date
s.to_date = d.to_date if isinstance(d.to_date, datetime) else None
s.base = d.get("base")
s.variable = d.get("variable")
diff --git a/erpnext/patches/v11_0/drop_column_max_days_allowed.py b/erpnext/patches/v11_0/drop_column_max_days_allowed.py
index f663674d1ed..591c521efbe 100644
--- a/erpnext/patches/v11_0/drop_column_max_days_allowed.py
+++ b/erpnext/patches/v11_0/drop_column_max_days_allowed.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
index fc552a99e21..9925b70a963 100644
--- a/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
+++ b/erpnext/patches/v11_0/ewaybill_fields_gst_india.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v11_0/hr_ux_cleanups.py b/erpnext/patches/v11_0/hr_ux_cleanups.py
index acaf83d980a..80476c8a74c 100644
--- a/erpnext/patches/v11_0/hr_ux_cleanups.py
+++ b/erpnext/patches/v11_0/hr_ux_cleanups.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/inter_state_field_for_gst.py b/erpnext/patches/v11_0/inter_state_field_for_gst.py
index 7f5c3aa0676..232d44256f6 100644
--- a/erpnext/patches/v11_0/inter_state_field_for_gst.py
+++ b/erpnext/patches/v11_0/inter_state_field_for_gst.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v11_0/make_italian_localization_fields.py b/erpnext/patches/v11_0/make_italian_localization_fields.py
new file mode 100644
index 00000000000..b0b5ef159b6
--- /dev/null
+++ b/erpnext/patches/v11_0/make_italian_localization_fields.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+from erpnext.regional.italy.setup import make_custom_fields, setup_report
+import frappe
+
+def execute():
+ company = frappe.get_all('Company', filters = {'country': 'Italy'})
+ if not company:
+ return
+
+ make_custom_fields()
+ setup_report()
diff --git a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
index 304bf7d3bb0..edab34cc58a 100644
--- a/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
+++ b/erpnext/patches/v11_0/move_leave_approvers_from_employee.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/rebuild_tree_for_company.py b/erpnext/patches/v11_0/rebuild_tree_for_company.py
index 0fc4780a300..4cb74c7256c 100644
--- a/erpnext/patches/v11_0/rebuild_tree_for_company.py
+++ b/erpnext/patches/v11_0/rebuild_tree_for_company.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils.nestedset import rebuild_tree
diff --git a/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py b/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py
index eef6722a188..7c8a822fa22 100644
--- a/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py
+++ b/erpnext/patches/v11_0/redesign_healthcare_billing_work_flow.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from erpnext.domains.healthcare import data
diff --git a/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py b/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py
new file mode 100644
index 00000000000..97ddd41ddb6
--- /dev/null
+++ b/erpnext/patches/v11_0/remove_barcodes_field_from_copy_fields_to_variants.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ '''Remove barcodes field from "Copy Fields to Variants" table because barcodes must be unique'''
+
+ settings = frappe.get_doc('Item Variant Settings')
+ settings.remove_invalid_fields_for_copy_fields_in_variants()
diff --git a/erpnext/patches/v11_0/remove_land_unit_icon.py b/erpnext/patches/v11_0/remove_land_unit_icon.py
index 98051cc7f11..f28c16f0c7e 100644
--- a/erpnext/patches/v11_0/remove_land_unit_icon.py
+++ b/erpnext/patches/v11_0/remove_land_unit_icon.py
@@ -1,6 +1,8 @@
# Copyright (c) 2018, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
+
# imports - module imports
import frappe
diff --git a/erpnext/patches/v11_0/remove_subscriber_doctype.py b/erpnext/patches/v11_0/remove_subscriber_doctype.py
index 4e50c35cd2a..4839a20f91f 100644
--- a/erpnext/patches/v11_0/remove_subscriber_doctype.py
+++ b/erpnext/patches/v11_0/remove_subscriber_doctype.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
index 8fa876dd743..8eb70167447 100644
--- a/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
+++ b/erpnext/patches/v11_0/rename_additional_salary_component_additional_salary.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
# this patch should have been included with this PR https://github.com/frappe/erpnext/pull/14302
diff --git a/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py b/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py
index e32149ec441..c03ab0b7111 100644
--- a/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py
+++ b/erpnext/patches/v11_0/rename_asset_adjustment_doctype.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.model.rename_doc import rename_doc
diff --git a/erpnext/patches/v11_0/rename_employee_loan_to_loan.py b/erpnext/patches/v11_0/rename_employee_loan_to_loan.py
index e6741371303..b2ff6b8c5d2 100644
--- a/erpnext/patches/v11_0/rename_employee_loan_to_loan.py
+++ b/erpnext/patches/v11_0/rename_employee_loan_to_loan.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/rename_field_max_days_allowed.py b/erpnext/patches/v11_0/rename_field_max_days_allowed.py
index 730b2714208..4e99fac8224 100644
--- a/erpnext/patches/v11_0/rename_field_max_days_allowed.py
+++ b/erpnext/patches/v11_0/rename_field_max_days_allowed.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py
index ba18de8174d..8fdac07658f 100644
--- a/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py
+++ b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.rename_doc import rename_doc
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v11_0/rename_healthcare_fields.py b/erpnext/patches/v11_0/rename_healthcare_fields.py
index d47a3c38fde..9aeb433cff8 100644
--- a/erpnext/patches/v11_0/rename_healthcare_fields.py
+++ b/erpnext/patches/v11_0/rename_healthcare_fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
diff --git a/erpnext/patches/v11_0/rename_members_with_naming_series.py b/erpnext/patches/v11_0/rename_members_with_naming_series.py
index 7fa1b09e7b0..84f5518926f 100644
--- a/erpnext/patches/v11_0/rename_members_with_naming_series.py
+++ b/erpnext/patches/v11_0/rename_members_with_naming_series.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
index fac772ccdd9..56e95e03286 100644
--- a/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
+++ b/erpnext/patches/v11_0/reset_publish_in_hub_for_all_items.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/set_default_email_template_in_hr.py b/erpnext/patches/v11_0/set_default_email_template_in_hr.py
index a4bc3559f86..e895eaeb653 100644
--- a/erpnext/patches/v11_0/set_default_email_template_in_hr.py
+++ b/erpnext/patches/v11_0/set_default_email_template_in_hr.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py
index b1098abb57a..175d2a189f3 100644
--- a/erpnext/patches/v11_0/set_department_for_doctypes.py
+++ b/erpnext/patches/v11_0/set_department_for_doctypes.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
# Set department value based on employee value
diff --git a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
index 3c2cea22306..4353ef80e24 100644
--- a/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
+++ b/erpnext/patches/v11_0/set_missing_gst_hsn_code.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
diff --git a/erpnext/patches/v11_0/set_salary_component_properties.py b/erpnext/patches/v11_0/set_salary_component_properties.py
index a45c38fe091..fa3605ba5f1 100644
--- a/erpnext/patches/v11_0/set_salary_component_properties.py
+++ b/erpnext/patches/v11_0/set_salary_component_properties.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
index ca8f0dc924b..d0cabb38359 100644
--- a/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
+++ b/erpnext/patches/v11_0/set_update_field_and_value_in_workflow_state.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.workflow import get_workflow_name
diff --git a/erpnext/patches/v11_0/set_user_permissions_for_department.py b/erpnext/patches/v11_0/set_user_permissions_for_department.py
index a18f3ff1be2..7bd8577f9c5 100644
--- a/erpnext/patches/v11_0/set_user_permissions_for_department.py
+++ b/erpnext/patches/v11_0/set_user_permissions_for_department.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
index 7f7cfc1327a..0f7fad7e497 100644
--- a/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
+++ b/erpnext/patches/v11_0/skip_user_permission_check_for_department.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.desk.form.linked_with import get_linked_doctypes
diff --git a/erpnext/patches/v11_0/uom_conversion_data.py b/erpnext/patches/v11_0/uom_conversion_data.py
index 9cd574390e2..91470b3558a 100644
--- a/erpnext/patches/v11_0/uom_conversion_data.py
+++ b/erpnext/patches/v11_0/uom_conversion_data.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe, json
def execute():
diff --git a/erpnext/patches/v11_0/update_brand_in_item_price.py b/erpnext/patches/v11_0/update_brand_in_item_price.py
index a19a6c47b64..a8d3fab4812 100644
--- a/erpnext/patches/v11_0/update_brand_in_item_price.py
+++ b/erpnext/patches/v11_0/update_brand_in_item_price.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
@@ -10,5 +11,5 @@ def execute():
set
`tabItem Price`.brand = `tabItem`.brand
where
- `tabItem Price`.item_code = `tabItem`.name
+ `tabItem Price`.item_code = `tabItem`.name
and `tabItem`.brand is not null and `tabItem`.brand != ''""")
\ No newline at end of file
diff --git a/erpnext/patches/v11_0/update_hub_url.py b/erpnext/patches/v11_0/update_hub_url.py
index 40181a2e90a..6c6ca3c5c28 100644
--- a/erpnext/patches/v11_0/update_hub_url.py
+++ b/erpnext/patches/v11_0/update_hub_url.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v11_0/update_sales_partner_type.py b/erpnext/patches/v11_0/update_sales_partner_type.py
index 508c51a3768..b393926b237 100644
--- a/erpnext/patches/v11_0/update_sales_partner_type.py
+++ b/erpnext/patches/v11_0/update_sales_partner_type.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py
index 8f086992b63..992454ac7c1 100644
--- a/erpnext/patches/v11_0/update_total_qty_field.py
+++ b/erpnext/patches/v11_0/update_total_qty_field.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
@@ -18,9 +19,10 @@ def execute():
SELECT
parent, SUM(qty) as qty
FROM
- `tab%s Item`
+ `tab{0} Item`
+ where parenttype = '{0}'
GROUP BY parent
- ''' % (doctype), as_dict = True)
+ '''.format(doctype), as_dict = True)
# Query to update total_qty might become too big, Update in batches
# batch_size is chosen arbitrarily, Don't try too hard to reason about it
diff --git a/erpnext/patches/v11_1/__init__.py b/erpnext/patches/v11_1/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/patches/v11_1/setup_guardian_role.py b/erpnext/patches/v11_1/setup_guardian_role.py
new file mode 100644
index 00000000000..6ccfed9617c
--- /dev/null
+++ b/erpnext/patches/v11_1/setup_guardian_role.py
@@ -0,0 +1,12 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ if 'Education' in frappe.get_active_domains() and not frappe.db.exists("Role", "Guardian"):
+ doc = frappe.new_doc("Role")
+ doc.update({
+ "role_name": "Guardian",
+ "desk_access": 0
+ })
+
+ doc.insert(ignore_permissions=True)
diff --git a/erpnext/patches/v4_4/make_email_accounts.py b/erpnext/patches/v4_4/make_email_accounts.py
index d055fce969b..57df1ae4911 100644
--- a/erpnext/patches/v4_4/make_email_accounts.py
+++ b/erpnext/patches/v4_4/make_email_accounts.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model import default_fields
diff --git a/erpnext/patches/v5_0/convert_stock_reconciliation.py b/erpnext/patches/v5_0/convert_stock_reconciliation.py
index 8a0b93d9d8e..75d1da752f2 100644
--- a/erpnext/patches/v5_0/convert_stock_reconciliation.py
+++ b/erpnext/patches/v5_0/convert_stock_reconciliation.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe, json
def execute():
diff --git a/erpnext/patches/v5_0/execute_on_doctype_update.py b/erpnext/patches/v5_0/execute_on_doctype_update.py
index 9641320d469..70b1d8ded69 100644
--- a/erpnext/patches/v5_0/execute_on_doctype_update.py
+++ b/erpnext/patches/v5_0/execute_on_doctype_update.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/fix_taxes_and_totals_in_party_currency.py b/erpnext/patches/v5_0/fix_taxes_and_totals_in_party_currency.py
index 062159b4105..30dc0f8db4e 100644
--- a/erpnext/patches/v5_0/fix_taxes_and_totals_in_party_currency.py
+++ b/erpnext/patches/v5_0/fix_taxes_and_totals_in_party_currency.py
@@ -1,27 +1,27 @@
-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.model.meta import get_field_precision
def execute():
- if not frappe.db.sql("""select name from `tabPatch Log`
+ if not frappe.db.sql("""select name from `tabPatch Log`
where patch = 'erpnext.patches.v5_0.taxes_and_totals_in_party_currency'"""):
return
selling_doctypes = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]
buying_doctypes = ["Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"]
-
+
for dt in selling_doctypes:
update_values(dt, "Sales Taxes and Charges")
for dt in buying_doctypes:
update_values(dt, "Purchase Taxes and Charges")
-
+
def update_values(dt, tax_table):
rate_field_precision = get_field_precision(frappe.get_meta(dt + " Item").get_field("rate"))
tax_amount_precision = get_field_precision(frappe.get_meta(tax_table).get_field("tax_amount"))
-
+
# update net_total, discount_on
frappe.db.sql("""
UPDATE
@@ -33,7 +33,7 @@ def update_values(dt, tax_table):
and ifnull(base_total_taxes_and_charges, 0) != 0
and ifnull(total_taxes_and_charges, 0) = 0
""".format(dt, tax_amount_precision))
-
+
# update net_amount
frappe.db.sql("""
UPDATE
@@ -61,6 +61,6 @@ def update_values(dt, tax_table):
and par.docstatus < 2
and ((ifnull(tax.base_tax_amount, 0) != 0 and ifnull(tax.tax_amount, 0) = 0)
or (ifnull(tax.base_total, 0) != 0 and ifnull(tax.total, 0) = 0)
- or (ifnull(tax.base_tax_amount_after_discount_amount, 0) != 0 and
+ or (ifnull(tax.base_tax_amount_after_discount_amount, 0) != 0 and
ifnull(tax.tax_amount_after_discount_amount, 0) = 0))
""".format(dt, tax_table, tax_amount_precision))
\ No newline at end of file
diff --git a/erpnext/patches/v5_0/item_patches.py b/erpnext/patches/v5_0/item_patches.py
index 37992adec6f..e223e09f5b7 100644
--- a/erpnext/patches/v5_0/item_patches.py
+++ b/erpnext/patches/v5_0/item_patches.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/new_crm_module.py b/erpnext/patches/v5_0/new_crm_module.py
index f7e0793fd1a..f5dda1f2738 100644
--- a/erpnext/patches/v5_0/new_crm_module.py
+++ b/erpnext/patches/v5_0/new_crm_module.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import json
import frappe
diff --git a/erpnext/patches/v5_0/newsletter.py b/erpnext/patches/v5_0/newsletter.py
index fcf95ca4c61..63e33124139 100644
--- a/erpnext/patches/v5_0/newsletter.py
+++ b/erpnext/patches/v5_0/newsletter.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
import frappe.permissions
diff --git a/erpnext/patches/v5_0/portal_fixes.py b/erpnext/patches/v5_0/portal_fixes.py
index 260222e6cb4..1fefd991678 100644
--- a/erpnext/patches/v5_0/portal_fixes.py
+++ b/erpnext/patches/v5_0/portal_fixes.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
import erpnext.setup.install
diff --git a/erpnext/patches/v5_0/project_costing.py b/erpnext/patches/v5_0/project_costing.py
index 33bb9c16305..e2d65d05940 100644
--- a/erpnext/patches/v5_0/project_costing.py
+++ b/erpnext/patches/v5_0/project_costing.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py b/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py
index 89bd5808a84..d5af43c541e 100644
--- a/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py
+++ b/erpnext/patches/v5_0/recalculate_total_amount_in_jv.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.utils import money_in_words
diff --git a/erpnext/patches/v5_0/remove_birthday_events.py b/erpnext/patches/v5_0/remove_birthday_events.py
index 589792a04a4..3ead8669b86 100644
--- a/erpnext/patches/v5_0/remove_birthday_events.py
+++ b/erpnext/patches/v5_0/remove_birthday_events.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/rename_customer_issue.py b/erpnext/patches/v5_0/rename_customer_issue.py
index 5b16fd21452..1bd69ceec19 100644
--- a/erpnext/patches/v5_0/rename_customer_issue.py
+++ b/erpnext/patches/v5_0/rename_customer_issue.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/rename_pos_setting.py b/erpnext/patches/v5_0/rename_pos_setting.py
index ad579b61ff9..bf10333564e 100644
--- a/erpnext/patches/v5_0/rename_pos_setting.py
+++ b/erpnext/patches/v5_0/rename_pos_setting.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/rename_table_fieldnames.py b/erpnext/patches/v5_0/rename_table_fieldnames.py
index e93070f9501..59f534303f1 100644
--- a/erpnext/patches/v5_0/rename_table_fieldnames.py
+++ b/erpnext/patches/v5_0/rename_table_fieldnames.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
from frappe.modules import scrub, get_doctype_module
diff --git a/erpnext/patches/v5_0/rename_taxes_and_charges_master.py b/erpnext/patches/v5_0/rename_taxes_and_charges_master.py
index f5fcb3af318..e26f48cda18 100644
--- a/erpnext/patches/v5_0/rename_taxes_and_charges_master.py
+++ b/erpnext/patches/v5_0/rename_taxes_and_charges_master.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
diff --git a/erpnext/patches/v5_0/set_default_company_in_bom.py b/erpnext/patches/v5_0/set_default_company_in_bom.py
index 0b2c9211519..a5cd7611199 100644
--- a/erpnext/patches/v5_0/set_default_company_in_bom.py
+++ b/erpnext/patches/v5_0/set_default_company_in_bom.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/set_footer_address.py b/erpnext/patches/v5_0/set_footer_address.py
index a3324a04558..8120d834e1f 100644
--- a/erpnext/patches/v5_0/set_footer_address.py
+++ b/erpnext/patches/v5_0/set_footer_address.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/stock_entry_update_value.py b/erpnext/patches/v5_0/stock_entry_update_value.py
index 9abd315ff1b..ba1af310f55 100644
--- a/erpnext/patches/v5_0/stock_entry_update_value.py
+++ b/erpnext/patches/v5_0/stock_entry_update_value.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/taxes_and_totals_in_party_currency.py b/erpnext/patches/v5_0/taxes_and_totals_in_party_currency.py
index f4ed66bcf6d..76d10820b58 100644
--- a/erpnext/patches/v5_0/taxes_and_totals_in_party_currency.py
+++ b/erpnext/patches/v5_0/taxes_and_totals_in_party_currency.py
@@ -1,7 +1,7 @@
-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.model.meta import get_field_precision
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
@@ -20,20 +20,20 @@ def update_values(dt, tax_table):
frappe.reload_doctype(dt)
frappe.reload_doctype(dt + " Item")
frappe.reload_doctype(tax_table)
-
+
net_total_precision = get_field_precision(frappe.get_meta(dt).get_field("net_total"))
for field in ("total", "base_total", "base_net_total"):
make_property_setter(dt, field, "precision", net_total_precision, "Select")
-
+
rate_field_precision = get_field_precision(frappe.get_meta(dt + " Item").get_field("rate"))
for field in ("net_rate", "base_net_rate", "net_amount", "base_net_amount", "base_rate", "base_amount"):
make_property_setter(dt + " Item", field, "precision", rate_field_precision, "Select")
-
+
tax_amount_precision = get_field_precision(frappe.get_meta(tax_table).get_field("tax_amount"))
- for field in ("base_tax_amount", "total", "base_total", "tax_amount_after_discount_amount",
+ for field in ("base_tax_amount", "total", "base_total", "tax_amount_after_discount_amount",
"base_tax_amount_after_discount_amount"):
make_property_setter(tax_table, field, "precision", tax_amount_precision, "Select")
-
+
# update net_total, discount_on
frappe.db.sql("""
UPDATE
@@ -46,7 +46,7 @@ def update_values(dt, tax_table):
WHERE
docstatus < 2
""".format(dt, net_total_precision))
-
+
# update net_amount
frappe.db.sql("""
UPDATE
diff --git a/erpnext/patches/v5_0/update_dn_against_doc_fields.py b/erpnext/patches/v5_0/update_dn_against_doc_fields.py
index 0fb508583a3..56f4f484b13 100644
--- a/erpnext/patches/v5_0/update_dn_against_doc_fields.py
+++ b/erpnext/patches/v5_0/update_dn_against_doc_fields.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_frozen_accounts_permission_role.py b/erpnext/patches/v5_0/update_frozen_accounts_permission_role.py
index 14426f5e809..b52785ae605 100644
--- a/erpnext/patches/v5_0/update_frozen_accounts_permission_role.py
+++ b/erpnext/patches/v5_0/update_frozen_accounts_permission_role.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_item_and_description_again.py b/erpnext/patches/v5_0/update_item_and_description_again.py
index 622274807ac..35dedcc072b 100644
--- a/erpnext/patches/v5_0/update_item_and_description_again.py
+++ b/erpnext/patches/v5_0/update_item_and_description_again.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
import re
diff --git a/erpnext/patches/v5_0/update_item_desc_in_invoice.py b/erpnext/patches/v5_0/update_item_desc_in_invoice.py
index 1f74184a980..dba35d56938 100644
--- a/erpnext/patches/v5_0/update_item_desc_in_invoice.py
+++ b/erpnext/patches/v5_0/update_item_desc_in_invoice.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.website.utils import find_first_image
from frappe.utils import cstr
@@ -29,7 +30,7 @@ def execute():
image = item_details.get(d.item_code).image
else:
desc, image = extract_image_and_description(cstr(d.description))
-
+
if not image:
item_detail = item_details.get(d.item_code)
if item_detail:
diff --git a/erpnext/patches/v5_0/update_item_description_and_image.py b/erpnext/patches/v5_0/update_item_description_and_image.py
index a18df2f653c..75df39ee399 100644
--- a/erpnext/patches/v5_0/update_item_description_and_image.py
+++ b/erpnext/patches/v5_0/update_item_description_and_image.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
from frappe.website.utils import find_first_image
from frappe.utils import cstr
diff --git a/erpnext/patches/v5_0/update_item_name_in_bom.py b/erpnext/patches/v5_0/update_item_name_in_bom.py
index f4e29907f13..5781542a2a3 100644
--- a/erpnext/patches/v5_0/update_item_name_in_bom.py
+++ b/erpnext/patches/v5_0/update_item_name_in_bom.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_material_transfer_for_manufacture.py b/erpnext/patches/v5_0/update_material_transfer_for_manufacture.py
index b858bd8074f..f31c9fed4dc 100644
--- a/erpnext/patches/v5_0/update_material_transfer_for_manufacture.py
+++ b/erpnext/patches/v5_0/update_material_transfer_for_manufacture.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_material_transferred_for_manufacturing.py b/erpnext/patches/v5_0/update_material_transferred_for_manufacturing.py
index 2133d1c0504..2a09aa29afd 100644
--- a/erpnext/patches/v5_0/update_material_transferred_for_manufacturing.py
+++ b/erpnext/patches/v5_0/update_material_transferred_for_manufacturing.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_material_transferred_for_manufacturing_again.py b/erpnext/patches/v5_0/update_material_transferred_for_manufacturing_again.py
index 187f4ea0bd0..5847c83d38f 100644
--- a/erpnext/patches/v5_0/update_material_transferred_for_manufacturing_again.py
+++ b/erpnext/patches/v5_0/update_material_transferred_for_manufacturing_again.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_0/update_operation_description.py b/erpnext/patches/v5_0/update_operation_description.py
index ae7b6326cb6..4ce32f35f11 100644
--- a/erpnext/patches/v5_0/update_operation_description.py
+++ b/erpnext/patches/v5_0/update_operation_description.py
@@ -1,10 +1,11 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
import frappe.permissions
def execute():
if "opn_description" in frappe.db.get_table_columns("BOM Operation"):
- frappe.db.sql("""update `tabBOM Operation` set description = opn_description
+ frappe.db.sql("""update `tabBOM Operation` set description = opn_description
where ifnull(description, '') = ''""")
\ No newline at end of file
diff --git a/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py b/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py
index 987247c2f31..53df9422b38 100644
--- a/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py
+++ b/erpnext/patches/v5_0/update_tax_amount_after_discount_in_purchase_cycle.py
@@ -1,16 +1,17 @@
# Copyright (c) 2015, Frappe 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.sql("""
- update
+ update
`tabPurchase Taxes and Charges`
set
tax_amount_after_discount_amount = tax_amount,
base_tax_amount_after_discount_amount = base_tax_amount
where
- ifnull(tax_amount_after_discount_amount, 0) = 0
- and ifnull(base_tax_amount_after_discount_amount, 0) = 0
+ ifnull(tax_amount_after_discount_amount, 0) = 0
+ and ifnull(base_tax_amount_after_discount_amount, 0) = 0
""")
\ No newline at end of file
diff --git a/erpnext/patches/v5_1/rename_roles.py b/erpnext/patches/v5_1/rename_roles.py
index 26208aa1e57..e19c22a6142 100644
--- a/erpnext/patches/v5_1/rename_roles.py
+++ b/erpnext/patches/v5_1/rename_roles.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v5_4/cleanup_journal_entry.py b/erpnext/patches/v5_4/cleanup_journal_entry.py
index 9100b8f4a88..6860e6ad090 100644
--- a/erpnext/patches/v5_4/cleanup_journal_entry.py
+++ b/erpnext/patches/v5_4/cleanup_journal_entry.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from pymysql import InternalError
diff --git a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
index 6851e67475f..2045358ddb2 100644
--- a/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
+++ b/erpnext/patches/v5_7/update_item_description_based_on_item_master.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_0/default_activity_rate.py b/erpnext/patches/v6_0/default_activity_rate.py
index 44fda3415c0..cfbfb723bcd 100644
--- a/erpnext/patches/v6_0/default_activity_rate.py
+++ b/erpnext/patches/v6_0/default_activity_rate.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_0/set_default_title.py b/erpnext/patches/v6_0/set_default_title.py
index 83b6b59897d..cceff3f480c 100644
--- a/erpnext/patches/v6_0/set_default_title.py
+++ b/erpnext/patches/v6_0/set_default_title.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_10/email_digest_default_quote.py b/erpnext/patches/v6_10/email_digest_default_quote.py
index 003b317ad8c..6139f1a88a6 100644
--- a/erpnext/patches/v6_10/email_digest_default_quote.py
+++ b/erpnext/patches/v6_10/email_digest_default_quote.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_10/fix_jv_total_amount.py b/erpnext/patches/v6_10/fix_jv_total_amount.py
index 3797ff441da..42cb9e9e150 100644
--- a/erpnext/patches/v6_10/fix_jv_total_amount.py
+++ b/erpnext/patches/v6_10/fix_jv_total_amount.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
# patch all for-print field (total amount) in Journal Entry in 2015
diff --git a/erpnext/patches/v6_12/set_overdue_tasks.py b/erpnext/patches/v6_12/set_overdue_tasks.py
index 39d601aa004..7dbb8ba8b6b 100644
--- a/erpnext/patches/v6_12/set_overdue_tasks.py
+++ b/erpnext/patches/v6_12/set_overdue_tasks.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_2/remove_newsletter_duplicates.py b/erpnext/patches/v6_2/remove_newsletter_duplicates.py
index dc5b77851e0..f9d15475d17 100644
--- a/erpnext/patches/v6_2/remove_newsletter_duplicates.py
+++ b/erpnext/patches/v6_2/remove_newsletter_duplicates.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_24/set_recurring_id.py b/erpnext/patches/v6_24/set_recurring_id.py
index 85a39e3371f..527a2fd3d97 100644
--- a/erpnext/patches/v6_24/set_recurring_id.py
+++ b/erpnext/patches/v6_24/set_recurring_id.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py
index b1793db5cbb..231a483ea22 100644
--- a/erpnext/patches/v6_3/convert_applicable_territory.py
+++ b/erpnext/patches/v6_3/convert_applicable_territory.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_4/email_digest_update.py b/erpnext/patches/v6_4/email_digest_update.py
index a1624276fe3..8342b7fce61 100644
--- a/erpnext/patches/v6_4/email_digest_update.py
+++ b/erpnext/patches/v6_4/email_digest_update.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py b/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py
index dbd34d54d18..50aa9e542e4 100644
--- a/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py
+++ b/erpnext/patches/v6_4/fix_sales_order_maintenance_status.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_4/fix_status_in_sales_and_purchase_order.py b/erpnext/patches/v6_4/fix_status_in_sales_and_purchase_order.py
index 867a5b2182b..746a99004af 100644
--- a/erpnext/patches/v6_4/fix_status_in_sales_and_purchase_order.py
+++ b/erpnext/patches/v6_4/fix_status_in_sales_and_purchase_order.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_4/make_image_thumbnail.py b/erpnext/patches/v6_4/make_image_thumbnail.py
index 3315acc896f..2c86e8af864 100644
--- a/erpnext/patches/v6_4/make_image_thumbnail.py
+++ b/erpnext/patches/v6_4/make_image_thumbnail.py
@@ -1,4 +1,4 @@
-from __future__ import print_function
+from __future__ import print_function, unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_4/set_user_in_contact.py b/erpnext/patches/v6_4/set_user_in_contact.py
index 41f76af94d1..7e8a6eecd57 100644
--- a/erpnext/patches/v6_4/set_user_in_contact.py
+++ b/erpnext/patches/v6_4/set_user_in_contact.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_8/make_webform_standard.py b/erpnext/patches/v6_8/make_webform_standard.py
index 8633ba694e1..2cc16a286f8 100644
--- a/erpnext/patches/v6_8/make_webform_standard.py
+++ b/erpnext/patches/v6_8/make_webform_standard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v6_8/move_drop_ship_to_po_items.py b/erpnext/patches/v6_8/move_drop_ship_to_po_items.py
index 06d158e4ec3..7184deecccc 100644
--- a/erpnext/patches/v6_8/move_drop_ship_to_po_items.py
+++ b/erpnext/patches/v6_8/move_drop_ship_to_po_items.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/calculate_total_costing_amount.py b/erpnext/patches/v7_0/calculate_total_costing_amount.py
index 11fdff9abd9..8ed60a29550 100644
--- a/erpnext/patches/v7_0/calculate_total_costing_amount.py
+++ b/erpnext/patches/v7_0/calculate_total_costing_amount.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils import flt
diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
index 4177e07630e..3af6622d96e 100644
--- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
+++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
index 83c738ef07c..e78f163e077 100644
--- a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
+++ b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils import cint
diff --git a/erpnext/patches/v7_0/create_budget_record.py b/erpnext/patches/v7_0/create_budget_record.py
index 607ef690963..fd8bec9f327 100644
--- a/erpnext/patches/v7_0/create_budget_record.py
+++ b/erpnext/patches/v7_0/create_budget_record.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.accounts.doctype.budget.budget import DuplicateBudgetError
diff --git a/erpnext/patches/v7_0/fix_duplicate_icons.py b/erpnext/patches/v7_0/fix_duplicate_icons.py
index f6d227d3045..9f442029b5a 100644
--- a/erpnext/patches/v7_0/fix_duplicate_icons.py
+++ b/erpnext/patches/v7_0/fix_duplicate_icons.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.desk.doctype.desktop_icon.desktop_icon import (sync_desktop_icons,
diff --git a/erpnext/patches/v7_0/merge_account_type_stock_and_warehouse_to_stock.py b/erpnext/patches/v7_0/merge_account_type_stock_and_warehouse_to_stock.py
index 6141792b8fd..02808a742f3 100644
--- a/erpnext/patches/v7_0/merge_account_type_stock_and_warehouse_to_stock.py
+++ b/erpnext/patches/v7_0/merge_account_type_stock_and_warehouse_to_stock.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py b/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py
index 727a44ee284..998c4b674bf 100644
--- a/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py
+++ b/erpnext/patches/v7_0/move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/re_route.py b/erpnext/patches/v7_0/re_route.py
index 1db492094b9..3cec6f39b2c 100644
--- a/erpnext/patches/v7_0/re_route.py
+++ b/erpnext/patches/v7_0/re_route.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe.patches.v7_0.re_route import update_routes
def execute():
diff --git a/erpnext/patches/v7_0/remove_doctypes_and_reports.py b/erpnext/patches/v7_0/remove_doctypes_and_reports.py
index 03461dee1f6..746cae0e1ca 100644
--- a/erpnext/patches/v7_0/remove_doctypes_and_reports.py
+++ b/erpnext/patches/v7_0/remove_doctypes_and_reports.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/remove_features_setup.py b/erpnext/patches/v7_0/remove_features_setup.py
index 596f7a9dcf6..49393cc248d 100644
--- a/erpnext/patches/v7_0/remove_features_setup.py
+++ b/erpnext/patches/v7_0/remove_features_setup.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.setup.install import create_compact_item_print_custom_field
diff --git a/erpnext/patches/v7_0/rename_prevdoc_fields.py b/erpnext/patches/v7_0/rename_prevdoc_fields.py
index d189056b0c4..ded4ad4aaee 100644
--- a/erpnext/patches/v7_0/rename_prevdoc_fields.py
+++ b/erpnext/patches/v7_0/rename_prevdoc_fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
import json
from frappe.model.utils.rename_field import update_reports, rename_field, update_property_setters
diff --git a/erpnext/patches/v7_0/rename_salary_components.py b/erpnext/patches/v7_0/rename_salary_components.py
index 8409ca842d1..de92fc6083b 100644
--- a/erpnext/patches/v7_0/rename_salary_components.py
+++ b/erpnext/patches/v7_0/rename_salary_components.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import update_property_setters
diff --git a/erpnext/patches/v7_0/rename_time_sheet_doctype.py b/erpnext/patches/v7_0/rename_time_sheet_doctype.py
index a00804518b5..f80a8301d78 100644
--- a/erpnext/patches/v7_0/rename_time_sheet_doctype.py
+++ b/erpnext/patches/v7_0/rename_time_sheet_doctype.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/set_is_group_for_warehouse.py b/erpnext/patches/v7_0/set_is_group_for_warehouse.py
index d3aca216cb7..3e69616b803 100644
--- a/erpnext/patches/v7_0/set_is_group_for_warehouse.py
+++ b/erpnext/patches/v7_0/set_is_group_for_warehouse.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/update_home_page.py b/erpnext/patches/v7_0/update_home_page.py
index ed88e203e64..909825c5721 100644
--- a/erpnext/patches/v7_0/update_home_page.py
+++ b/erpnext/patches/v7_0/update_home_page.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
import erpnext
diff --git a/erpnext/patches/v7_0/update_mins_to_first_response.py b/erpnext/patches/v7_0/update_mins_to_first_response.py
index a89a9c81292..1df4b42cedb 100644
--- a/erpnext/patches/v7_0/update_mins_to_first_response.py
+++ b/erpnext/patches/v7_0/update_mins_to_first_response.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.core.doctype.communication.email import update_mins_to_first_communication
diff --git a/erpnext/patches/v7_0/update_party_status.py b/erpnext/patches/v7_0/update_party_status.py
index 9ca3d02b9d0..0c6b4ea598d 100644
--- a/erpnext/patches/v7_0/update_party_status.py
+++ b/erpnext/patches/v7_0/update_party_status.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py b/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py
index 1c41ec8e80b..e90de50c1ec 100644
--- a/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py
+++ b/erpnext/patches/v7_0/update_prevdoc_values_for_supplier_quotation_item.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_0/update_project_in_gl_entry.py b/erpnext/patches/v7_0/update_project_in_gl_entry.py
index 7f9923b3964..d99e9a41e3b 100644
--- a/erpnext/patches/v7_0/update_project_in_gl_entry.py
+++ b/erpnext/patches/v7_0/update_project_in_gl_entry.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/add_field_for_task_dependent.py b/erpnext/patches/v7_1/add_field_for_task_dependent.py
index 96daa139181..65b1c74e87d 100644
--- a/erpnext/patches/v7_1/add_field_for_task_dependent.py
+++ b/erpnext/patches/v7_1/add_field_for_task_dependent.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/fix_link_for_customer_from_lead.py b/erpnext/patches/v7_1/fix_link_for_customer_from_lead.py
index cbb3ea4092c..33f809fe37e 100644
--- a/erpnext/patches/v7_1/fix_link_for_customer_from_lead.py
+++ b/erpnext/patches/v7_1/fix_link_for_customer_from_lead.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/set_budget_against_as_cost_center.py b/erpnext/patches/v7_1/set_budget_against_as_cost_center.py
index 1d334a50121..dd9a432cf01 100644
--- a/erpnext/patches/v7_1/set_budget_against_as_cost_center.py
+++ b/erpnext/patches/v7_1/set_budget_against_as_cost_center.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/set_currency_exchange_date.py b/erpnext/patches/v7_1/set_currency_exchange_date.py
index 630b7d42293..2a2d420f21c 100644
--- a/erpnext/patches/v7_1/set_currency_exchange_date.py
+++ b/erpnext/patches/v7_1/set_currency_exchange_date.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/set_student_guardian.py b/erpnext/patches/v7_1/set_student_guardian.py
index 0942505b568..093c0bf6d94 100644
--- a/erpnext/patches/v7_1/set_student_guardian.py
+++ b/erpnext/patches/v7_1/set_student_guardian.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_1/set_total_amount_currency_in_je.py b/erpnext/patches/v7_1/set_total_amount_currency_in_je.py
index eb4a347a326..8426ddcd7d9 100644
--- a/erpnext/patches/v7_1/set_total_amount_currency_in_je.py
+++ b/erpnext/patches/v7_1/set_total_amount_currency_in_je.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext import get_default_currency
diff --git a/erpnext/patches/v7_1/update_bom_base_currency.py b/erpnext/patches/v7_1/update_bom_base_currency.py
index c8af0333cb1..9a59209ea52 100644
--- a/erpnext/patches/v7_1/update_bom_base_currency.py
+++ b/erpnext/patches/v7_1/update_bom_base_currency.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext import get_default_currency
diff --git a/erpnext/patches/v7_1/update_component_type.py b/erpnext/patches/v7_1/update_component_type.py
index aecbc9fac2e..552fc894676 100644
--- a/erpnext/patches/v7_1/update_component_type.py
+++ b/erpnext/patches/v7_1/update_component_type.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils import flt
diff --git a/erpnext/patches/v7_1/update_lead_source.py b/erpnext/patches/v7_1/update_lead_source.py
index 7fd4c14ed15..517e66c4bc1 100644
--- a/erpnext/patches/v7_1/update_lead_source.py
+++ b/erpnext/patches/v7_1/update_lead_source.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v7_1/update_portal_roles.py b/erpnext/patches/v7_1/update_portal_roles.py
index 72e9434c26f..482586b8efe 100644
--- a/erpnext/patches/v7_1/update_portal_roles.py
+++ b/erpnext/patches/v7_1/update_portal_roles.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
index 13a2bb8d5a9..3b9642dd3b8 100644
--- a/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
+++ b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/contact_address_links.py b/erpnext/patches/v7_2/contact_address_links.py
index cf23e88798c..200434c208d 100644
--- a/erpnext/patches/v7_2/contact_address_links.py
+++ b/erpnext/patches/v7_2/contact_address_links.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.core.doctype.dynamic_link.dynamic_link import deduplicate_dynamic_links
from frappe.utils import update_progress_bar
diff --git a/erpnext/patches/v7_2/mark_students_active.py b/erpnext/patches/v7_2/mark_students_active.py
index 0a2f2d3c105..7289e4a9158 100644
--- a/erpnext/patches/v7_2/mark_students_active.py
+++ b/erpnext/patches/v7_2/mark_students_active.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/rename_att_date_attendance.py b/erpnext/patches/v7_2/rename_att_date_attendance.py
index b2658ba7f12..7f06d8f1239 100644
--- a/erpnext/patches/v7_2/rename_att_date_attendance.py
+++ b/erpnext/patches/v7_2/rename_att_date_attendance.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import update_reports, update_users_report_view_settings, update_property_setters
diff --git a/erpnext/patches/v7_2/rename_evaluation_criteria.py b/erpnext/patches/v7_2/rename_evaluation_criteria.py
index d74976084be..c6520b1b725 100644
--- a/erpnext/patches/v7_2/rename_evaluation_criteria.py
+++ b/erpnext/patches/v7_2/rename_evaluation_criteria.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v7_2/stock_uom_in_selling.py b/erpnext/patches/v7_2/stock_uom_in_selling.py
index 875fc4e6b99..d0295557470 100644
--- a/erpnext/patches/v7_2/stock_uom_in_selling.py
+++ b/erpnext/patches/v7_2/stock_uom_in_selling.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/update_abbr_in_salary_slips.py b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
index aa6965f17cb..19dcb5e3b22 100644
--- a/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
+++ b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/update_assessment_modules.py b/erpnext/patches/v7_2/update_assessment_modules.py
index 37ae7c77f84..2b5e774d467 100644
--- a/erpnext/patches/v7_2/update_assessment_modules.py
+++ b/erpnext/patches/v7_2/update_assessment_modules.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v7_2/update_attendance_docstatus.py b/erpnext/patches/v7_2/update_attendance_docstatus.py
index 863c0c02bb9..a69052657dd 100644
--- a/erpnext/patches/v7_2/update_attendance_docstatus.py
+++ b/erpnext/patches/v7_2/update_attendance_docstatus.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v7_2/update_guardian_name_in_student_master.py b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
index 163e7c3d19b..9f589ef00e1 100644
--- a/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
+++ b/erpnext/patches/v7_2/update_guardian_name_in_student_master.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.model.utils.rename_field import rename_field
diff --git a/erpnext/patches/v7_2/update_salary_slips.py b/erpnext/patches/v7_2/update_salary_slips.py
index c6bca8e7b9b..11a52f95876 100644
--- a/erpnext/patches/v7_2/update_salary_slips.py
+++ b/erpnext/patches/v7_2/update_salary_slips.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.hr.doctype.payroll_entry.payroll_entry import get_month_details
from frappe.utils import cint
diff --git a/erpnext/patches/v7_2/update_website_for_variant.py b/erpnext/patches/v7_2/update_website_for_variant.py
index 639569883ec..e8eef6e7da1 100644
--- a/erpnext/patches/v7_2/update_website_for_variant.py
+++ b/erpnext/patches/v7_2/update_website_for_variant.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_0/addresses_linked_to_lead.py b/erpnext/patches/v8_0/addresses_linked_to_lead.py
index c485b5b10ab..b5f22342284 100644
--- a/erpnext/patches/v8_0/addresses_linked_to_lead.py
+++ b/erpnext/patches/v8_0/addresses_linked_to_lead.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_1/add_hsn_sac_codes.py b/erpnext/patches/v8_1/add_hsn_sac_codes.py
index 0b54f15d3b8..0fce96a8d4e 100644
--- a/erpnext/patches/v8_1/add_hsn_sac_codes.py
+++ b/erpnext/patches/v8_1/add_hsn_sac_codes.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india.setup import setup
diff --git a/erpnext/patches/v8_1/add_indexes_in_transaction_doctypes.py b/erpnext/patches/v8_1/add_indexes_in_transaction_doctypes.py
index 2fa0221ed71..46316026068 100644
--- a/erpnext/patches/v8_1/add_indexes_in_transaction_doctypes.py
+++ b/erpnext/patches/v8_1/add_indexes_in_transaction_doctypes.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py b/erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py
index 1fb297f2886..4c606af4243 100644
--- a/erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py
+++ b/erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_1/gst_fixes.py b/erpnext/patches/v8_1/gst_fixes.py
index b47879c08d8..22fa53ba373 100644
--- a/erpnext/patches/v8_1/gst_fixes.py
+++ b/erpnext/patches/v8_1/gst_fixes.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from erpnext.regional.india.setup import update_address_template
diff --git a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
index 2e815710722..af2d28b857f 100644
--- a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
+++ b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_1/setup_gst_india.py b/erpnext/patches/v8_1/setup_gst_india.py
index 5370fa2aa54..e8b017d8644 100644
--- a/erpnext/patches/v8_1/setup_gst_india.py
+++ b/erpnext/patches/v8_1/setup_gst_india.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.email import sendmail_to_system_managers
diff --git a/erpnext/patches/v8_1/update_gst_state.py b/erpnext/patches/v8_1/update_gst_state.py
index 5fb9be04456..7aaf2d5ff31 100644
--- a/erpnext/patches/v8_1/update_gst_state.py
+++ b/erpnext/patches/v8_1/update_gst_state.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india import states
diff --git a/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py b/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py
index fe9befe2651..82beba37702 100644
--- a/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py
+++ b/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india.setup import make_custom_fields
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
diff --git a/erpnext/patches/v8_5/remove_project_type_property_setter.py b/erpnext/patches/v8_5/remove_project_type_property_setter.py
index 03d128d3ec8..70a08f53776 100644
--- a/erpnext/patches/v8_5/remove_project_type_property_setter.py
+++ b/erpnext/patches/v8_5/remove_project_type_property_setter.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_5/update_customer_group_in_POS_profile.py b/erpnext/patches/v8_5/update_customer_group_in_POS_profile.py
index 9a5fef90c86..2661914401b 100644
--- a/erpnext/patches/v8_5/update_customer_group_in_POS_profile.py
+++ b/erpnext/patches/v8_5/update_customer_group_in_POS_profile.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_6/rename_bom_update_tool.py b/erpnext/patches/v8_6/rename_bom_update_tool.py
index 45a4ddc7888..ef5f335e45f 100644
--- a/erpnext/patches/v8_6/rename_bom_update_tool.py
+++ b/erpnext/patches/v8_6/rename_bom_update_tool.py
@@ -1,4 +1,6 @@
+from __future__ import unicode_literals
import frappe
+
def execute():
frappe.delete_doc_if_exists("DocType", "BOM Replace Tool")
diff --git a/erpnext/patches/v8_7/fix_purchase_receipt_status.py b/erpnext/patches/v8_7/fix_purchase_receipt_status.py
index f7037dd7dfb..99ecb442149 100644
--- a/erpnext/patches/v8_7/fix_purchase_receipt_status.py
+++ b/erpnext/patches/v8_7/fix_purchase_receipt_status.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_7/sync_india_custom_fields.py b/erpnext/patches/v8_7/sync_india_custom_fields.py
index 323b5bcd3ee..c684b24b2b7 100644
--- a/erpnext/patches/v8_7/sync_india_custom_fields.py
+++ b/erpnext/patches/v8_7/sync_india_custom_fields.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from erpnext.regional.india.setup import make_custom_fields
diff --git a/erpnext/patches/v8_9/delete_gst_doctypes_for_outside_india_accounts.py b/erpnext/patches/v8_9/delete_gst_doctypes_for_outside_india_accounts.py
index 2b4ac58a67c..f67af90555a 100644
--- a/erpnext/patches/v8_9/delete_gst_doctypes_for_outside_india_accounts.py
+++ b/erpnext/patches/v8_9/delete_gst_doctypes_for_outside_india_accounts.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_9/remove_employee_from_salary_structure_parent.py b/erpnext/patches/v8_9/remove_employee_from_salary_structure_parent.py
index 4ab9cf3ec8b..808ae6d5271 100644
--- a/erpnext/patches/v8_9/remove_employee_from_salary_structure_parent.py
+++ b/erpnext/patches/v8_9/remove_employee_from_salary_structure_parent.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_9/set_default_customer_group.py b/erpnext/patches/v8_9/set_default_customer_group.py
index e6351c41fd6..cbbe09daf5d 100644
--- a/erpnext/patches/v8_9/set_default_customer_group.py
+++ b/erpnext/patches/v8_9/set_default_customer_group.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v8_9/set_member_party_type.py b/erpnext/patches/v8_9/set_member_party_type.py
index 2934c70ad53..33bbc11a93c 100644
--- a/erpnext/patches/v8_9/set_member_party_type.py
+++ b/erpnext/patches/v8_9/set_member_party_type.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py b/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py
index 33dc5192d1b..c685bbc6818 100644
--- a/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py
+++ b/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_0/revert_manufacturing_user_role.py b/erpnext/patches/v9_0/revert_manufacturing_user_role.py
index 5bfa8c3f9af..f38b7f29cec 100644
--- a/erpnext/patches/v9_0/revert_manufacturing_user_role.py
+++ b/erpnext/patches/v9_0/revert_manufacturing_user_role.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_0/set_variant_item_description.py b/erpnext/patches/v9_0/set_variant_item_description.py
index c8445715069..82d6148508a 100644
--- a/erpnext/patches/v9_0/set_variant_item_description.py
+++ b/erpnext/patches/v9_0/set_variant_item_description.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
diff --git a/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py b/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py
index 187cbd3f9ab..54ae18b8e29 100644
--- a/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py
+++ b/erpnext/patches/v9_2/delete_healthcare_domain_default_items.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe.utils import getdate
diff --git a/erpnext/patches/v9_2/delete_process_payroll.py b/erpnext/patches/v9_2/delete_process_payroll.py
index e9e1b99c06c..91c49f577f3 100644
--- a/erpnext/patches/v9_2/delete_process_payroll.py
+++ b/erpnext/patches/v9_2/delete_process_payroll.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_2/remove_company_from_patient.py b/erpnext/patches/v9_2/remove_company_from_patient.py
index 1ce344501d5..1a50088f239 100644
--- a/erpnext/patches/v9_2/remove_company_from_patient.py
+++ b/erpnext/patches/v9_2/remove_company_from_patient.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_2/rename_translated_domains_in_en.py b/erpnext/patches/v9_2/rename_translated_domains_in_en.py
index fc3d01cc608..aec5d438ec8 100644
--- a/erpnext/patches/v9_2/rename_translated_domains_in_en.py
+++ b/erpnext/patches/v9_2/rename_translated_domains_in_en.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
from frappe import _
diff --git a/erpnext/patches/v9_2/repost_reserved_qty_for_production.py b/erpnext/patches/v9_2/repost_reserved_qty_for_production.py
index c4eab19d2ec..040e655bd82 100644
--- a/erpnext/patches/v9_2/repost_reserved_qty_for_production.py
+++ b/erpnext/patches/v9_2/repost_reserved_qty_for_production.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/patches/v9_2/set_item_name_in_production_order.py b/erpnext/patches/v9_2/set_item_name_in_production_order.py
index 18b5b8cdc6c..1f490e62c8b 100644
--- a/erpnext/patches/v9_2/set_item_name_in_production_order.py
+++ b/erpnext/patches/v9_2/set_item_name_in_production_order.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def execute():
diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py
index 93fe5da693b..2e710c75f3d 100644
--- a/erpnext/portal/utils.py
+++ b/erpnext/portal/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def set_default_role(doc, method):
diff --git a/erpnext/projects/doctype/activity_cost/activity_cost.json b/erpnext/projects/doctype/activity_cost/activity_cost.json
index 662e00c3eed..0e929d91098 100644
--- a/erpnext/projects/doctype/activity_cost/activity_cost.json
+++ b/erpnext/projects/doctype/activity_cost/activity_cost.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -350,7 +351,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 16:15:35.363505",
+ "modified": "2019-01-30 11:28:17.991944",
"modified_by": "Administrator",
"module": "Projects",
"name": "Activity Cost",
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index dcf485a8030..e3fd1a8622b 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -66,11 +66,11 @@ class Project(Document):
def validate(self):
self.validate_project_name()
- self.validate_dates()
self.validate_weights()
self.sync_tasks()
self.tasks = []
self.load_tasks()
+ self.validate_dates()
self.send_welcome_email()
self.update_percent_complete()
@@ -79,6 +79,24 @@ class Project(Document):
frappe.throw(_("Project {0} already exists").format(frappe.safe_decode(self.project_name)))
def validate_dates(self):
+ if self.tasks:
+ for d in self.tasks:
+ if self.expected_start_date:
+ if d.start_date and getdate(d.start_date) < getdate(self.expected_start_date):
+ frappe.throw(_("Start date of task {0} cannot be less than {1} expected start date {2}")
+ .format(d.title, self.name, self.expected_start_date))
+ if d.end_date and getdate(d.end_date) < getdate(self.expected_start_date):
+ frappe.throw(_("End date of task {0} cannot be less than {1} expected start date {2}")
+ .format(d.title, self.name, self.expected_start_date))
+
+ if self.expected_end_date:
+ if d.start_date and getdate(d.start_date) > getdate(self.expected_end_date):
+ frappe.throw(_("Start date of task {0} cannot be greater than {1} expected end date {2}")
+ .format(d.title, self.name, self.expected_end_date))
+ if d.end_date and getdate(d.end_date) > getdate(self.expected_end_date):
+ frappe.throw(_("End date of task {0} cannot be greater than {1} expected end date {2}")
+ .format(d.title, self.name, self.expected_end_date))
+
if self.expected_start_date and self.expected_end_date:
if getdate(self.expected_end_date) < getdate(self.expected_start_date):
frappe.throw(_("Expected End Date can not be less than Expected Start Date"))
@@ -459,7 +477,7 @@ def get_projects_for_collect_progress(frequency, fields):
fields.extend(["name"])
return frappe.get_all("Project", fields = fields,
- filters = {'collect_progress': 1, 'frequency': frequency})
+ filters = {'collect_progress': 1, 'frequency': frequency, 'status': 'Open'})
def send_project_update_email_to_users(project):
doc = frappe.get_doc('Project', project)
diff --git a/erpnext/projects/doctype/project/project_dashboard.py b/erpnext/projects/doctype/project/project_dashboard.py
index 485aae77e72..39cf016d61f 100644
--- a/erpnext/projects/doctype/project/project_dashboard.py
+++ b/erpnext/projects/doctype/project/project_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 371fc5c79b4..fffa9c1657c 100755
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -44,12 +44,6 @@ class Task(NestedSet):
if self.act_start_date and self.act_end_date and getdate(self.act_start_date) > getdate(self.act_end_date):
frappe.throw(_("'Actual Start Date' can not be greater than 'Actual End Date'"))
- if(self.project):
- if frappe.db.exists("Project", self.project):
- expected_end_date = frappe.db.get_value("Project", self.project, "expected_end_date")
- if self.exp_end_date and expected_end_date and getdate(self.exp_end_date) > getdate(expected_end_date) :
- frappe.throw(_("Expected end date cannot be after Project: '{0}' Expected end date").format(self.project), EndDateCannotBeGreaterThanProjectEndDateError)
-
def validate_status(self):
if self.status!=self.get_db_value("status") and self.status == "Closed":
for d in self.depends_on:
diff --git a/erpnext/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py
index 6fb54124732..9971946cb4f 100644
--- a/erpnext/projects/doctype/task/test_task.py
+++ b/erpnext/projects/doctype/task/test_task.py
@@ -5,7 +5,7 @@ import frappe
import unittest
from frappe.utils import getdate, nowdate, add_days
-from erpnext.projects.doctype.task.task import CircularReferenceError, EndDateCannotBeGreaterThanProjectEndDateError
+from erpnext.projects.doctype.task.task import CircularReferenceError
class TestTask(unittest.TestCase):
def test_circular_reference(self):
@@ -97,15 +97,6 @@ class TestTask(unittest.TestCase):
self.assertEqual(frappe.db.get_value("Task", task.name, "status"), "Overdue")
- def test_end_date_validation(self):
- task_end = create_task("Testing_Enddate_validation", add_days(nowdate(), 35), add_days(nowdate(), 45), save=False)
- pro = frappe.get_doc("Project", task_end.project)
- pro.expected_end_date = add_days(nowdate(), 40)
- pro.save()
- self.assertRaises(EndDateCannotBeGreaterThanProjectEndDateError, task_end.save)
-
-
-
def create_task(subject, start=None, end=None, depends_on=None, project=None, save=True):
if not frappe.db.exists("Task", subject):
task = frappe.new_doc('Task')
diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js
index e890befd1a2..8811ab95438 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.js
+++ b/erpnext/projects/doctype/timesheet/timesheet.js
@@ -18,7 +18,7 @@ frappe.ui.form.on("Timesheet", {
return{
filters: {
'project': child.project,
- 'status': ["!=", "Closed"]
+ 'status': ["!=", "Cancelled"]
}
}
}
diff --git a/erpnext/projects/doctype/timesheet/timesheet.json b/erpnext/projects/doctype/timesheet/timesheet.json
index 0be147bfb1c..5ad2ab3a379 100644
--- a/erpnext/projects/doctype/timesheet/timesheet.json
+++ b/erpnext/projects/doctype/timesheet/timesheet.json
@@ -1000,7 +1000,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-11-15 07:58:42.629845",
+ "modified": "2019-01-30 11:28:18.518590",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet",
diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
index b1f737296d9..a9b3bfb06fb 100644
--- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
+++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -13,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -44,6 +46,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -75,6 +78,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -105,6 +109,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -136,6 +141,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -166,6 +172,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -197,6 +204,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -230,6 +238,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -260,6 +269,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -278,7 +288,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -292,6 +302,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -325,6 +336,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -355,6 +367,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -388,6 +401,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -420,6 +434,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -450,6 +465,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -482,6 +498,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -512,6 +529,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -545,6 +563,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -575,6 +594,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -607,6 +627,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -637,6 +658,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -669,6 +691,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -700,6 +723,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -718,7 +742,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 1,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -732,6 +756,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -752,7 +777,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 1,
- "precision": "2",
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -766,6 +791,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -796,6 +822,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -827,6 +854,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -860,6 +888,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -891,6 +920,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -932,7 +962,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-07 15:12:31.510813",
+ "modified": "2019-02-18 18:55:53.190526",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet Detail",
@@ -944,5 +974,6 @@
"show_name_in_global_search": 0,
"sort_order": "ASC",
"track_changes": 0,
- "track_seen": 0
+ "track_seen": 0,
+ "track_views": 0
}
\ No newline at end of file
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index 32081550e69..56e6bdb8dbe 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -14,7 +14,7 @@ $(document).bind('toolbar_setup', function() {
$('.navbar-home').html('
');
- $('[data-link="docs"]').attr("href", "https://frappe.github.io/erpnext/")
+ $('[data-link="docs"]').attr("href", "https://erpnext.com/docs")
$('[data-link="issues"]').attr("href", "https://github.com/frappe/erpnext/issues")
@@ -23,7 +23,8 @@ $(document).bind('toolbar_setup', function() {
// additional help links for erpnext
var $help_menu = $('.dropdown-help ul .documentation-links');
-
+ $(''+__('Documentation')+'').insertBefore($help_menu);
$(''+__('User Forum')+'').insertBefore($help_menu);
$(' {
-
- if(r && r.message && r.message.item_code) {
- let child = "";
- let add_row_index = -1;
- let cur_grid= this.frm.fields_dict["items"].grid;
-
- this.frm.doc.items.map(d => {
- if(d.item_code==r.message.item_code){
- add_row_index = d.idx;
- return;
- } else if(!d.item_code && add_row_index==-1) {
- add_row_index = d.idx;
- }
- });
-
- if(add_row_index == -1) {
- child = frappe.model.add_child(this.frm.doc, cur_grid.doctype, "items", add_row_index);
- } else {
- child = cur_grid.get_grid_row(add_row_index-1).doc;
- }
- show_description(child.idx, r.message.item_code, child.item_code);
-
- frappe.model.set_value(child.doctype, child.name, {
- "item_code": r.message.item_code,
- "qty": (child.qty || 0) + 1
- });
+ const data = r && r.message;
+ if (!data) {
+ scan_barcode_field.set_new_description(__('Cannot find Item with this barcode'));
+ return;
}
- else{
- scan_barcode_field.set_new_description(this.frm.doc.scan_barcode +__(' does not exist!'));
+
+ let cur_grid = this.frm.fields_dict.items.grid;
+
+ let row_to_modify = null;
+ const existing_item_row = this.frm.doc.items.find(d => d.item_code === data.item_code);
+ const blank_item_row = this.frm.doc.items.find(d => !d.item_code);
+
+ if (existing_item_row) {
+ row_to_modify = existing_item_row;
+ } else if (blank_item_row) {
+ row_to_modify = blank_item_row;
}
+
+ if (!row_to_modify) {
+ // add new row
+ row_to_modify = frappe.model.add_child(this.frm.doc, cur_grid.doctype, 'items');
+ }
+
+ show_description(row_to_modify.idx, row_to_modify.item_code);
+
+ frappe.model.set_value(row_to_modify.doctype, row_to_modify.name, {
+ item_code: data.item_code,
+ qty: (row_to_modify.qty || 0) + 1
+ });
+
+ this.frm.refresh_field('items');
});
- scan_barcode_field.set_value("");
+ scan_barcode_field.set_value('');
}
return false;
},
@@ -477,7 +476,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
var me = this;
var item = frappe.get_doc(cdt, cdn);
- if (item.serial_no) {
+ if (item && item.serial_no) {
if (!item.item_code) {
this.frm.trigger("item_code", cdt, cdn);
}
diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js
index b8d0019e28d..17b726ee18f 100644
--- a/erpnext/public/js/help_links.js
+++ b/erpnext/public/js/help_links.js
@@ -1,524 +1,526 @@
frappe.provide('frappe.help.help_links');
+const docsUrl = 'https://erpnext.com/docs/';
+
frappe.help.help_links['Form/Rename Tool'] = [
- { label: 'Bulk Rename', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/data/bulk-rename' },
+ { label: 'Bulk Rename', url: docsUrl + 'user/manual/en/setting-up/data/bulk-rename' },
]
//Setup
frappe.help.help_links['List/User'] = [
- { label: 'New User', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/adding-users' },
- { label: 'Rename User', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/rename-user' },
+ { label: 'New User', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/adding-users' },
+ { label: 'Rename User', url: docsUrl + 'user/manual/en/setting-up/articles/rename-user' },
]
frappe.help.help_links['permission-manager'] = [
- { label: 'Role Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/role-based-permissions' },
- { label: 'Managing Perm Level in Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-perm-level' },
- { label: 'User Permissions', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/user-permissions' },
- { label: 'Sharing', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/sharing' },
- { label: 'Password', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/change-password' },
+ { label: 'Role Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/role-based-permissions' },
+ { label: 'Managing Perm Level in Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/articles/managing-perm-level' },
+ { label: 'User Permissions', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/user-permissions' },
+ { label: 'Sharing', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/sharing' },
+ { label: 'Password', url: docsUrl + 'user/manual/en/setting-up/articles/change-password' },
]
frappe.help.help_links['Form/System Settings'] = [
- { label: 'Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/system-settings' },
+ { label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/system-settings' },
]
frappe.help.help_links['data-import-tool'] = [
- { label: 'Importing and Exporting Data', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/data/data-import-tool' },
- { label: 'Overwriting Data from Data Import Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool' },
+ { label: 'Importing and Exporting Data', url: docsUrl + 'user/manual/en/setting-up/data/data-import-tool' },
+ { label: 'Overwriting Data from Data Import Tool', url: docsUrl + 'user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool' },
]
frappe.help.help_links['module_setup'] = [
- { label: 'Role Permissions Manager', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/role-based-permissions' },
+ { label: 'Role Permissions Manager', url: docsUrl + 'user/manual/en/setting-up/users-and-permissions/role-based-permissions' },
]
frappe.help.help_links['Form/Naming Series'] = [
- { label: 'Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/naming-series' },
- { label: 'Setting the Current Value for Naming Series', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/naming-series-current-value' },
+ { label: 'Naming Series', url: docsUrl + 'user/manual/en/setting-up/settings/naming-series' },
+ { label: 'Setting the Current Value for Naming Series', url: docsUrl + 'user/manual/en/setting-up/articles/naming-series-current-value' },
]
frappe.help.help_links['Form/Global Defaults'] = [
- { label: 'Global Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/settings/global-defaults' },
+ { label: 'Global Settings', url: docsUrl + 'user/manual/en/setting-up/settings/global-defaults' },
]
frappe.help.help_links['Form/Email Digest'] = [
- { label: 'Email Digest', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-digest' },
+ { label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' },
]
frappe.help.help_links['List/Print Heading'] = [
- { label: 'Print Heading', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-headings' },
+ { label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' },
]
frappe.help.help_links['List/Letter Head'] = [
- { label: 'Letter Head', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/letter-head' },
+ { label: 'Letter Head', url: docsUrl + 'user/manual/en/setting-up/print/letter-head' },
]
frappe.help.help_links['List/Address Template'] = [
- { label: 'Address Template', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/address-template' },
+ { label: 'Address Template', url: docsUrl + 'user/manual/en/setting-up/print/address-template' },
]
frappe.help.help_links['List/Terms and Conditions'] = [
- { label: 'Terms and Conditions', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/terms-and-conditions' },
+ { label: 'Terms and Conditions', url: docsUrl + 'user/manual/en/setting-up/print/terms-and-conditions' },
]
frappe.help.help_links['List/Cheque Print Template'] = [
- { label: 'Cheque Print Template', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/cheque-print-template' },
+ { label: 'Cheque Print Template', url: docsUrl + 'user/manual/en/setting-up/print/cheque-print-template' },
]
frappe.help.help_links['List/Email Account'] = [
- { label: 'Email Account', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-account' },
+ { label: 'Email Account', url: docsUrl + 'user/manual/en/setting-up/email/email-account' },
]
frappe.help.help_links['List/Notification'] = [
- { label: 'Notification', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/notifications' },
+ { label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' },
]
frappe.help.help_links['Form/Notification'] = [
- { label: 'Notification', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/notifications' },
+ { label: 'Notification', url: docsUrl + 'user/manual/en/setting-up/email/notifications' },
]
frappe.help.help_links['List/Email Digest'] = [
- { label: 'Email Digest', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-digest' },
+ { label: 'Email Digest', url: docsUrl + 'user/manual/en/setting-up/email/email-digest' },
]
frappe.help.help_links['List/Auto Email Report'] = [
- { label: 'Auto Email Reports', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/email/email-reports' },
+ { label: 'Auto Email Reports', url: docsUrl + 'user/manual/en/setting-up/email/email-reports' },
]
frappe.help.help_links['Form/Print Settings'] = [
- { label: 'Print Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-settings' },
+ { label: 'Print Settings', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' },
]
frappe.help.help_links['print-format-builder'] = [
- { label: 'Print Format Builder', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-settings' },
+ { label: 'Print Format Builder', url: docsUrl + 'user/manual/en/setting-up/print/print-settings' },
]
frappe.help.help_links['List/Print Heading'] = [
- { label: 'Print Heading', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/print/print-headings' },
+ { label: 'Print Heading', url: docsUrl + 'user/manual/en/setting-up/print/print-headings' },
]
//setup-integrations
frappe.help.help_links['Form/PayPal Settings'] = [
- { label: 'PayPal Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/paypal-integration' },
+ { label: 'PayPal Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/paypal-integration' },
]
frappe.help.help_links['Form/Razorpay Settings'] = [
- { label: 'Razorpay Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/razorpay-integration' },
+ { label: 'Razorpay Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/razorpay-integration' },
]
frappe.help.help_links['Form/Dropbox Settings'] = [
- { label: 'Dropbox Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/dropbox-backup' },
+ { label: 'Dropbox Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/dropbox-backup' },
]
frappe.help.help_links['Form/LDAP Settings'] = [
- { label: 'LDAP Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/ldap-integration' },
+ { label: 'LDAP Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/ldap-integration' },
]
frappe.help.help_links['Form/Stripe Settings'] = [
- { label: 'Stripe Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/integrations/stripe-integration' },
+ { label: 'Stripe Settings', url: docsUrl + 'user/manual/en/setting-up/integrations/stripe-integration' },
]
//Sales
frappe.help.help_links['Form/Quotation'] = [
- { label: 'Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/quotation' },
- { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' },
- { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
- { label: 'Applying Margin', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/adding-margin' },
+ { label: 'Quotation', url: docsUrl + 'user/manual/en/selling/quotation' },
+ { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' },
+ { label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
+ { label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' },
]
frappe.help.help_links['List/Customer'] = [
- { label: 'Customer', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/customer' },
- { label: 'Credit Limit', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/credit-limit' },
+ { label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' },
+ { label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' },
]
frappe.help.help_links['Form/Customer'] = [
- { label: 'Customer', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/customer' },
- { label: 'Credit Limit', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/credit-limit' },
+ { label: 'Customer', url: docsUrl + 'user/manual/en/CRM/customer' },
+ { label: 'Credit Limit', url: docsUrl + 'user/manual/en/accounts/credit-limit' },
]
frappe.help.help_links['List/Sales Taxes and Charges Template'] = [
- { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' },
+ { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
]
frappe.help.help_links['Form/Sales Taxes and Charges Template'] = [
- { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' },
+ { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
]
frappe.help.help_links['List/Sales Order'] = [
- { label: 'Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/sales-order' },
- { label: 'Recurring Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
- { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' },
+ { label: 'Sales Order', url: docsUrl + 'user/manual/en/selling/sales-order' },
+ { label: 'Recurring Sales Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' },
]
frappe.help.help_links['Form/Sales Order'] = [
- { label: 'Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/sales-order' },
- { label: 'Recurring Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
- { label: 'Applying Discount', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/applying-discount' },
- { label: 'Drop Shipping', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/drop-shipping' },
- { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
- { label: 'Close Sales Order', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/close-sales-order' },
- { label: 'Applying Margin', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/articles/adding-margin' },
+ { label: 'Sales Order', url: docsUrl + 'user/manual/en/selling/sales-order' },
+ { label: 'Recurring Sales Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Applying Discount', url: docsUrl + 'user/manual/en/selling/articles/applying-discount' },
+ { label: 'Drop Shipping', url: docsUrl + 'user/manual/en/selling/articles/drop-shipping' },
+ { label: 'Sales Person', url: docsUrl + 'user/manual/en/selling/articles/sales-persons-in-the-sales-transactions' },
+ { label: 'Close Sales Order', url: docsUrl + 'user/manual/en/selling/articles/close-sales-order' },
+ { label: 'Applying Margin', url: docsUrl + 'user/manual/en/selling/articles/adding-margin' },
]
frappe.help.help_links['Form/Product Bundle'] = [
- { label: 'Product Bundle', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/product-bundle' },
+ { label: 'Product Bundle', url: docsUrl + 'user/manual/en/selling/setup/product-bundle' },
]
frappe.help.help_links['Form/Selling Settings'] = [
- { label: 'Selling Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/selling-settings' },
+ { label: 'Selling Settings', url: docsUrl + 'user/manual/en/selling/setup/selling-settings' },
]
//Buying
frappe.help.help_links['List/Supplier'] = [
- { label: 'Supplier', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier' },
+ { label: 'Supplier', url: docsUrl + 'user/manual/en/buying/supplier' },
]
frappe.help.help_links['Form/Supplier'] = [
- { label: 'Supplier', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier' },
+ { label: 'Supplier', url: docsUrl + 'user/manual/en/buying/supplier' },
]
frappe.help.help_links['Form/Request for Quotation'] = [
- { label: 'Request for Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/request-for-quotation' },
- { label: 'RFQ Video', url: 'https://frappe.github.io/erpnext/user/videos/learn/request-for-quotation.html' },
+ { label: 'Request for Quotation', url: docsUrl + 'user/manual/en/buying/request-for-quotation' },
+ { label: 'RFQ Video', url: docsUrl + 'user/videos/learn/request-for-quotation.html' },
]
frappe.help.help_links['Form/Supplier Quotation'] = [
- { label: 'Supplier Quotation', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/supplier-quotation' },
+ { label: 'Supplier Quotation', url: docsUrl + 'user/manual/en/buying/supplier-quotation' },
]
frappe.help.help_links['Form/Buying Settings'] = [
- { label: 'Buying Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/setup/buying-settings' },
+ { label: 'Buying Settings', url: docsUrl + 'user/manual/en/buying/setup/buying-settings' },
]
frappe.help.help_links['List/Purchase Order'] = [
- { label: 'Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/purchase-order' },
- { label: 'Recurring Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Purchase Order', url: docsUrl + 'user/manual/en/buying/purchase-order' },
+ { label: 'Recurring Purchase Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
]
frappe.help.help_links['Form/Purchase Order'] = [
- { label: 'Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/purchase-order' },
- { label: 'Item UoM', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/articles/purchasing-in-different-unit' },
- { label: 'Supplier Item Code', url: 'https://frappe.github.io/erpnext/user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item' },
- { label: 'Recurring Purchase Order', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
- { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' },
+ { label: 'Purchase Order', url: docsUrl + 'user/manual/en/buying/purchase-order' },
+ { label: 'Item UoM', url: docsUrl + 'user/manual/en/buying/articles/purchasing-in-different-unit' },
+ { label: 'Supplier Item Code', url: docsUrl + 'user/manual/en/buying/articles/maintaining-suppliers-part-no-in-item' },
+ { label: 'Recurring Purchase Order', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
]
frappe.help.help_links['List/Purchase Taxes and Charges Template'] = [
- { label: 'Setting Up Taxes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/setting-up-taxes' },
+ { label: 'Setting Up Taxes', url: docsUrl + 'user/manual/en/setting-up/setting-up-taxes' },
]
frappe.help.help_links['List/POS Profile'] = [
- { label: 'POS Profile', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/pos-setting' },
+ { label: 'POS Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' },
]
frappe.help.help_links['List/Price List'] = [
- { label: 'Price List', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/price-lists' },
+ { label: 'Price List', url: docsUrl + 'user/manual/en/setting-up/price-lists' },
]
frappe.help.help_links['List/Authorization Rule'] = [
- { label: 'Authorization Rule', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/authorization-rule' },
+ { label: 'Authorization Rule', url: docsUrl + 'user/manual/en/setting-up/authorization-rule' },
]
frappe.help.help_links['Form/SMS Settings'] = [
- { label: 'SMS Settings', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/sms-setting' },
+ { label: 'SMS Settings', url: docsUrl + 'user/manual/en/setting-up/sms-setting' },
]
frappe.help.help_links['List/Stock Reconciliation'] = [
- { label: 'Stock Reconciliation', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item' },
+ { label: 'Stock Reconciliation', url: docsUrl + 'user/manual/en/setting-up/stock-reconciliation-for-non-serialized-item' },
]
frappe.help.help_links['Tree/Territory'] = [
- { label: 'Territory', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/territory' },
+ { label: 'Territory', url: docsUrl + 'user/manual/en/setting-up/territory' },
]
frappe.help.help_links['Form/Dropbox Backup'] = [
- { label: 'Dropbox Backup', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/third-party-backups' },
- { label: 'Setting Up Dropbox Backup', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/setting-up-dropbox-backups' },
+ { label: 'Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/third-party-backups' },
+ { label: 'Setting Up Dropbox Backup', url: docsUrl + 'user/manual/en/setting-up/articles/setting-up-dropbox-backups' },
]
frappe.help.help_links['List/Workflow'] = [
- { label: 'Workflow', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/workflows' },
+ { label: 'Workflow', url: docsUrl + 'user/manual/en/setting-up/workflows' },
]
frappe.help.help_links['List/Company'] = [
- { label: 'Company', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/company-setup' },
- { label: 'Managing Multiple Companies', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-multiple-companies' },
- { label: 'Delete All Related Transactions for a Company', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions' },
+ { label: 'Company', url: docsUrl + 'user/manual/en/setting-up/company-setup' },
+ { label: 'Managing Multiple Companies', url: docsUrl + 'user/manual/en/setting-up/articles/managing-multiple-companies' },
+ { label: 'Delete All Related Transactions for a Company', url: docsUrl + 'user/manual/en/setting-up/articles/delete-a-company-and-all-related-transactions' },
]
//Accounts
frappe.help.help_links['modules/Accounts'] = [
- { label: 'Introduction to Accounts', url: 'http://frappe.github.io/erpnext/user/manual/en/accounts/' },
- { label: 'Chart of Accounts', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/chart-of-accounts.html' },
- { label: 'Multi Currency Accounting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/multi-currency-accounting' },
+ { label: 'Introduction to Accounts', url: docsUrl + 'user/manual/en/accounts/' },
+ { label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts.html' },
+ { label: 'Multi Currency Accounting', url: docsUrl + 'user/manual/en/accounts/multi-currency-accounting' },
]
frappe.help.help_links['Tree/Account'] = [
- { label: 'Chart of Accounts', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/chart-of-accounts' },
- { label: 'Managing Tree Mastes', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-tree-structure-masters' },
+ { label: 'Chart of Accounts', url: docsUrl + 'user/manual/en/accounts/chart-of-accounts' },
+ { label: 'Managing Tree Mastes', url: docsUrl + 'user/manual/en/setting-up/articles/managing-tree-structure-masters' },
]
frappe.help.help_links['Form/Sales Invoice'] = [
- { label: 'Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/sales-invoice' },
- { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' },
- { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' },
- { label: 'Recurring Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' },
+ { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
+ { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
+ { label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
]
frappe.help.help_links['List/Sales Invoice'] = [
- { label: 'Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/sales-invoice' },
- { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' },
- { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' },
- { label: 'Recurring Sales Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Sales Invoice', url: docsUrl + 'user/manual/en/accounts/sales-invoice' },
+ { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
+ { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
+ { label: 'Recurring Sales Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
]
frappe.help.help_links['pos'] = [
- { label: 'Point of Sale Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/point-of-sale-pos-invoice' },
+ { label: 'Point of Sale Invoice', url: docsUrl + 'user/manual/en/accounts/point-of-sale-pos-invoice' },
]
frappe.help.help_links['List/POS Profile'] = [
- { label: 'Point of Sale Profile', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/pos-setting' },
+ { label: 'Point of Sale Profile', url: docsUrl + 'user/manual/en/setting-up/pos-setting' },
]
frappe.help.help_links['List/Purchase Invoice'] = [
- { label: 'Purchase Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/purchase-invoice' },
- { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' },
- { label: 'Recurring Purchase Invoice', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/recurring-orders-and-invoices' },
+ { label: 'Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/purchase-invoice' },
+ { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
+ { label: 'Recurring Purchase Invoice', url: docsUrl + 'user/manual/en/accounts/recurring-orders-and-invoices' },
]
frappe.help.help_links['List/Journal Entry'] = [
- { label: 'Journal Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/journal-entry' },
- { label: 'Advance Payment Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/advance-payment-entry' },
- { label: 'Accounts Opening Balance', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/opening-accounts' },
+ { label: 'Journal Entry', url: docsUrl + 'user/manual/en/accounts/journal-entry' },
+ { label: 'Advance Payment Entry', url: docsUrl + 'user/manual/en/accounts/advance-payment-entry' },
+ { label: 'Accounts Opening Balance', url: docsUrl + 'user/manual/en/accounts/opening-accounts' },
]
frappe.help.help_links['List/Payment Entry'] = [
- { label: 'Payment Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/payment-entry' },
+ { label: 'Payment Entry', url: docsUrl + 'user/manual/en/accounts/payment-entry' },
]
frappe.help.help_links['List/Payment Request'] = [
- { label: 'Payment Request', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/payment-request' },
+ { label: 'Payment Request', url: docsUrl + 'user/manual/en/accounts/payment-request' },
]
frappe.help.help_links['List/Asset'] = [
- { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' },
+ { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
]
frappe.help.help_links['List/Asset Category'] = [
- { label: 'Asset Category', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' },
+ { label: 'Asset Category', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
]
frappe.help.help_links['Tree/Cost Center'] = [
- { label: 'Budgeting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/budgeting' },
+ { label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' },
]
frappe.help.help_links['List/Item'] = [
- { label: 'Item', url: 'http://frappe.github.io/erpnext/user/manual/en/stock/item' },
- { label: 'Item Price', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-price' },
- { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' },
- { label: 'Item Wise Taxation', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/item-wise-taxation' },
- { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' },
- { label: 'Item Codification', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-codification' },
- { label: 'Item Variants', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-variants' },
- { label: 'Item Valuation', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-valuation-fifo-and-moving-average' },
+ { label: 'Item', url: docsUrl + 'user/manual/en/stock/item' },
+ { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' },
+ { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
+ { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' },
+ { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
+ { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' },
+ { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' },
+ { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' },
]
frappe.help.help_links['Form/Item'] = [
- { label: 'Item', url: 'http://frappe.github.io/erpnext/user/manual/en/stock/item' },
- { label: 'Item Price', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-price' },
- { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' },
- { label: 'Item Wise Taxation', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/item-wise-taxation' },
- { label: 'Managing Fixed Assets', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/managing-fixed-assets' },
- { label: 'Item Codification', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-codification' },
- { label: 'Item Variants', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-variants' },
- { label: 'Item Valuation', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/item/item-valuation-fifo-and-moving-average' },
+ { label: 'Item', url: docsUrl + 'user/manual/en/stock/item' },
+ { label: 'Item Price', url: docsUrl + 'user/manual/en/stock/item/item-price' },
+ { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
+ { label: 'Item Wise Taxation', url: docsUrl + 'user/manual/en/accounts/item-wise-taxation' },
+ { label: 'Managing Fixed Assets', url: docsUrl + 'user/manual/en/accounts/managing-fixed-assets' },
+ { label: 'Item Codification', url: docsUrl + 'user/manual/en/stock/item/item-codification' },
+ { label: 'Item Variants', url: docsUrl + 'user/manual/en/stock/item/item-variants' },
+ { label: 'Item Valuation', url: docsUrl + 'user/manual/en/stock/item/item-valuation-fifo-and-moving-average' },
]
frappe.help.help_links['List/Purchase Receipt'] = [
- { label: 'Purchase Receipt', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/purchase-receipt' },
- { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' },
+ { label: 'Purchase Receipt', url: docsUrl + 'user/manual/en/stock/purchase-receipt' },
+ { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
]
frappe.help.help_links['List/Delivery Note'] = [
- { label: 'Delivery Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/delivery-note' },
- { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' },
- { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' },
+ { label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' },
+ { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
+ { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
]
frappe.help.help_links['Form/Delivery Note'] = [
- { label: 'Delivery Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/delivery-note' },
- { label: 'Sales Return', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/sales-return' },
- { label: 'Barcode', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/track-items-using-barcode' },
- { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' },
+ { label: 'Delivery Note', url: docsUrl + 'user/manual/en/stock/delivery-note' },
+ { label: 'Sales Return', url: docsUrl + 'user/manual/en/stock/sales-return' },
+ { label: 'Barcode', url: docsUrl + 'user/manual/en/stock/articles/track-items-using-barcode' },
+ { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
]
frappe.help.help_links['List/Installation Note'] = [
- { label: 'Installation Note', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/installation-note' },
+ { label: 'Installation Note', url: docsUrl + 'user/manual/en/stock/installation-note' },
]
frappe.help.help_links['Tree'] = [
- { label: 'Managing Tree Structure Masters', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/articles/managing-tree-structure-masters' },
+ { label: 'Managing Tree Structure Masters', url: docsUrl + 'user/manual/en/setting-up/articles/managing-tree-structure-masters' },
]
frappe.help.help_links['List/Budget'] = [
- { label: 'Budgeting', url: 'https://frappe.github.io/erpnext/user/manual/en/accounts/budgeting' },
+ { label: 'Budgeting', url: docsUrl + 'user/manual/en/accounts/budgeting' },
]
//Stock
frappe.help.help_links['List/Material Request'] = [
- { label: 'Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/material-request' },
- { label: 'Auto-creation of Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/auto-creation-of-material-request' },
+ { label: 'Material Request', url: docsUrl + 'user/manual/en/stock/material-request' },
+ { label: 'Auto-creation of Material Request', url: docsUrl + 'user/manual/en/stock/articles/auto-creation-of-material-request' },
]
frappe.help.help_links['Form/Material Request'] = [
- { label: 'Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/material-request' },
- { label: 'Auto-creation of Material Request', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/auto-creation-of-material-request' },
+ { label: 'Material Request', url: docsUrl + 'user/manual/en/stock/material-request' },
+ { label: 'Auto-creation of Material Request', url: docsUrl + 'user/manual/en/stock/articles/auto-creation-of-material-request' },
]
frappe.help.help_links['Form/Stock Entry'] = [
- { label: 'Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/stock-entry' },
- { label: 'Stock Entry Types', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/stock-entry-purpose' },
- { label: 'Repack Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/repack-entry' },
- { label: 'Opening Stock', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/opening-stock' },
- { label: 'Subcontracting', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/subcontracting' },
+ { label: 'Stock Entry', url: docsUrl + 'user/manual/en/stock/stock-entry' },
+ { label: 'Stock Entry Types', url: docsUrl + 'user/manual/en/stock/articles/stock-entry-purpose' },
+ { label: 'Repack Entry', url: docsUrl + 'user/manual/en/stock/articles/repack-entry' },
+ { label: 'Opening Stock', url: docsUrl + 'user/manual/en/stock/opening-stock' },
+ { label: 'Subcontracting', url: docsUrl + 'user/manual/en/manufacturing/subcontracting' },
]
frappe.help.help_links['List/Stock Entry'] = [
- { label: 'Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/stock-entry' },
+ { label: 'Stock Entry', url: docsUrl + 'user/manual/en/stock/stock-entry' },
]
frappe.help.help_links['Tree/Warehouse'] = [
- { label: 'Warehouse', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/warehouse' },
+ { label: 'Warehouse', url: docsUrl + 'user/manual/en/stock/warehouse' },
]
frappe.help.help_links['List/Serial No'] = [
- { label: 'Serial No', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/serial-no' },
+ { label: 'Serial No', url: docsUrl + 'user/manual/en/stock/serial-no' },
]
frappe.help.help_links['Form/Serial No'] = [
- { label: 'Serial No', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/serial-no' },
+ { label: 'Serial No', url: docsUrl + 'user/manual/en/stock/serial-no' },
]
frappe.help.help_links['Form/Batch'] = [
- { label: 'Batch', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/batch' },
+ { label: 'Batch', url: docsUrl + 'user/manual/en/stock/batch' },
]
frappe.help.help_links['Form/Packing Slip'] = [
- { label: 'Packing Slip', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/packing-slip' },
+ { label: 'Packing Slip', url: docsUrl + 'user/manual/en/stock/tools/packing-slip' },
]
frappe.help.help_links['Form/Quality Inspection'] = [
- { label: 'Quality Inspection', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/quality-inspection' },
+ { label: 'Quality Inspection', url: docsUrl + 'user/manual/en/stock/tools/quality-inspection' },
]
frappe.help.help_links['Form/Landed Cost Voucher'] = [
- { label: 'Landed Cost Voucher', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/tools/landed-cost-voucher' },
+ { label: 'Landed Cost Voucher', url: docsUrl + 'user/manual/en/stock/tools/landed-cost-voucher' },
]
frappe.help.help_links['Tree/Item Group'] = [
- { label: 'Item Group', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/setup/item-group' },
+ { label: 'Item Group', url: docsUrl + 'user/manual/en/stock/setup/item-group' },
]
frappe.help.help_links['Form/Item Attribute'] = [
- { label: 'Item Attribute', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/setup/item-attribute' },
+ { label: 'Item Attribute', url: docsUrl + 'user/manual/en/stock/setup/item-attribute' },
]
frappe.help.help_links['Form/UOM'] = [
- { label: 'Fractions in UOM', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/articles/managing-fractions-in-uom' },
+ { label: 'Fractions in UOM', url: docsUrl + 'user/manual/en/stock/articles/managing-fractions-in-uom' },
]
frappe.help.help_links['Form/Stock Reconciliation'] = [
- { label: 'Opening Stock Entry', url: 'https://frappe.github.io/erpnext/user/manual/en/stock/opening-stock' },
+ { label: 'Opening Stock Entry', url: docsUrl + 'user/manual/en/stock/opening-stock' },
]
//CRM
frappe.help.help_links['Form/Lead'] = [
- { label: 'Lead', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/lead' },
+ { label: 'Lead', url: docsUrl + 'user/manual/en/CRM/lead' },
]
frappe.help.help_links['Form/Opportunity'] = [
- { label: 'Opportunity', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/opportunity' },
+ { label: 'Opportunity', url: docsUrl + 'user/manual/en/CRM/opportunity' },
]
frappe.help.help_links['Form/Address'] = [
- { label: 'Address', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/contact' },
+ { label: 'Address', url: docsUrl + 'user/manual/en/CRM/contact' },
]
frappe.help.help_links['Form/Contact'] = [
- { label: 'Contact', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/contact' },
+ { label: 'Contact', url: docsUrl + 'user/manual/en/CRM/contact' },
]
frappe.help.help_links['Form/Newsletter'] = [
- { label: 'Newsletter', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/newsletter' },
+ { label: 'Newsletter', url: docsUrl + 'user/manual/en/CRM/newsletter' },
]
frappe.help.help_links['Form/Campaign'] = [
- { label: 'Campaign', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/setup/campaign' },
+ { label: 'Campaign', url: docsUrl + 'user/manual/en/CRM/setup/campaign' },
]
frappe.help.help_links['Tree/Sales Person'] = [
- { label: 'Sales Person', url: 'https://frappe.github.io/erpnext/user/manual/en/CRM/setup/sales-person' },
+ { label: 'Sales Person', url: docsUrl + 'user/manual/en/CRM/setup/sales-person' },
]
frappe.help.help_links['Form/Sales Person'] = [
- { label: 'Sales Person Target', url: 'https://frappe.github.io/erpnext/user/manual/en/selling/setup/sales-person-target-allocation' },
+ { label: 'Sales Person Target', url: docsUrl + 'user/manual/en/selling/setup/sales-person-target-allocation' },
]
//Support
frappe.help.help_links['List/Feedback Trigger'] = [
- { label: 'Feedback Trigger', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/setting-up-feedback' },
+ { label: 'Feedback Trigger', url: docsUrl + 'user/manual/en/setting-up/feedback/setting-up-feedback' },
]
frappe.help.help_links['List/Feedback Request'] = [
- { label: 'Feedback Request', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/submit-feedback' },
+ { label: 'Feedback Request', url: docsUrl + 'user/manual/en/setting-up/feedback/submit-feedback' },
]
frappe.help.help_links['List/Feedback Request'] = [
- { label: 'Feedback Request', url: 'https://frappe.github.io/erpnext/user/manual/en/setting-up/feedback/submit-feedback' },
+ { label: 'Feedback Request', url: docsUrl + 'user/manual/en/setting-up/feedback/submit-feedback' },
]
//Manufacturing
frappe.help.help_links['Form/BOM'] = [
- { label: 'Bill of Material', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/bill-of-materials' },
- { label: 'Nested BOM Structure', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/articles/nested-bom-structure' },
+ { label: 'Bill of Material', url: docsUrl + 'user/manual/en/manufacturing/bill-of-materials' },
+ { label: 'Nested BOM Structure', url: docsUrl + 'user/manual/en/manufacturing/articles/nested-bom-structure' },
]
frappe.help.help_links['Form/Work Order'] = [
- { label: 'Work Order', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/work-order' },
+ { label: 'Work Order', url: docsUrl + 'user/manual/en/manufacturing/work-order' },
]
frappe.help.help_links['Form/Workstation'] = [
- { label: 'Workstation', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/workstation' },
+ { label: 'Workstation', url: docsUrl + 'user/manual/en/manufacturing/workstation' },
]
frappe.help.help_links['Form/Operation'] = [
- { label: 'Operation', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/operation' },
+ { label: 'Operation', url: docsUrl + 'user/manual/en/manufacturing/operation' },
]
frappe.help.help_links['Form/BOM Update Tool'] = [
- { label: 'BOM Update Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/tools/bom-update-tool' },
+ { label: 'BOM Update Tool', url: docsUrl + 'user/manual/en/manufacturing/tools/bom-update-tool' },
]
//Customize
frappe.help.help_links['Form/Customize Form'] = [
- { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' },
- { label: 'Customize Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/customize-form' },
+ { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
+ { label: 'Customize Field', url: docsUrl + 'user/manual/en/customize-erpnext/customize-form' },
]
frappe.help.help_links['Form/Custom Field'] = [
- { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' },
+ { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
]
frappe.help.help_links['Form/Custom Field'] = [
- { label: 'Custom Field', url: 'https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-field' },
-]
\ No newline at end of file
+ { label: 'Custom Field', url: docsUrl + 'user/manual/en/customize-erpnext/custom-field' },
+]
diff --git a/erpnext/public/js/hub/PageContainer.vue b/erpnext/public/js/hub/PageContainer.vue
index a101eaf4d38..f151add8d5a 100644
--- a/erpnext/public/js/hub/PageContainer.vue
+++ b/erpnext/public/js/hub/PageContainer.vue
@@ -10,14 +10,15 @@ import Home from './pages/Home.vue';
import Search from './pages/Search.vue';
import Category from './pages/Category.vue';
import SavedItems from './pages/SavedItems.vue';
+import FeaturedItems from './pages/FeaturedItems.vue';
import PublishedItems from './pages/PublishedItems.vue';
import Item from './pages/Item.vue';
import Seller from './pages/Seller.vue';
+import SellerItems from './pages/SellerItems.vue';
import Publish from './pages/Publish.vue';
import Buying from './pages/Buying.vue';
import Selling from './pages/Selling.vue';
import Messages from './pages/Messages.vue';
-import Profile from './pages/Profile.vue';
import NotFound from './pages/NotFound.vue';
function get_route_map() {
@@ -27,11 +28,13 @@ function get_route_map() {
'marketplace/category/:category': Category,
'marketplace/item/:item': Item,
'marketplace/seller/:seller': Seller,
+ 'marketplace/seller/:seller/items': SellerItems,
'marketplace/not-found': NotFound,
}
const registered_routes = {
- 'marketplace/profile': Profile,
+ 'marketplace/profile': Seller,
'marketplace/saved-items': SavedItems,
+ 'marketplace/featured-items': FeaturedItems,
'marketplace/publish': Publish,
'marketplace/published-items': PublishedItems,
'marketplace/buying': Buying,
diff --git a/erpnext/public/js/hub/Sidebar.vue b/erpnext/public/js/hub/Sidebar.vue
index ef3510d79a1..66c291ec52f 100644
--- a/erpnext/public/js/hub/Sidebar.vue
+++ b/erpnext/public/js/hub/Sidebar.vue
@@ -30,6 +30,11 @@ export default {
route: 'marketplace/saved-items',
condition: () => this.hub_registered
},
+ {
+ label: __('Your Featured Items'),
+ route: 'marketplace/featured-items',
+ condition: () => this.hub_registered
+ },
{
label: __('Your Profile'),
route: 'marketplace/profile',
diff --git a/erpnext/public/js/hub/components/DetailHeaderItem.vue b/erpnext/public/js/hub/components/DetailHeaderItem.vue
index 8ca4379701c..a6c5f066f28 100644
--- a/erpnext/public/js/hub/components/DetailHeaderItem.vue
+++ b/erpnext/public/js/hub/components/DetailHeaderItem.vue
@@ -1,5 +1,12 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/erpnext/public/js/hub/pages/Item.vue b/erpnext/public/js/hub/pages/Item.vue
index 7735aa23376..841d0046db8 100644
--- a/erpnext/public/js/hub/pages/Item.vue
+++ b/erpnext/public/js/hub/pages/Item.vue
@@ -53,12 +53,30 @@ export default {
image: null,
sections: [],
- menu_items: [
+ };
+ },
+ computed: {
+ is_own_item() {
+ let is_own_item = false;
+ if(this.item) {
+ if(this.item.hub_seller === hub.settings.hub_seller_name) {
+ is_own_item = true;
+ }
+ }
+ return is_own_item;
+ },
+ menu_items(){
+ return [
{
label: __('Save Item'),
condition: hub.is_user_registered() && !this.is_own_item,
action: this.add_to_saved_items
},
+ {
+ label: __('Add to Featured Item'),
+ condition: hub.is_user_registered() && this.is_own_item,
+ action: this.add_to_featured_items
+ },
{
label: __('Report this Item'),
condition: !this.is_own_item,
@@ -75,17 +93,6 @@ export default {
action: this.unpublish_item
}
]
- };
- },
- computed: {
- is_own_item() {
- let is_own_item = false;
- if(this.item) {
- if(this.item.hub_seller === hub.settings.hub_seller_name) {
- is_own_item = true;
- }
- }
- return is_own_item;
},
item_subtitle() {
@@ -101,7 +108,7 @@ export default {
subtitle_items.push(rating + ``)
}
- subtitle_items.push(this.item.company);
+ subtitle_items.push({value:this.item.company,on_click:this.go_to_seller_profile_page});
return subtitle_items;
},
@@ -167,7 +174,9 @@ export default {
this.make_dialogs();
});
},
-
+ go_to_seller_profile_page(seller_name) {
+ frappe.set_route(`marketplace/seller/${seller_name}`);
+ },
build_data() {
this.title = this.item.item_name || this.item.name;
this.image = this.item.image;
@@ -208,6 +217,21 @@ export default {
});
},
+ add_to_featured_items() {
+ hub.call('add_item_to_seller_featured_items', {
+ hub_item_name: this.hub_item_name,
+ hub_user: frappe.session.user
+ },)
+ .then(() => {
+ const featured_items_link = `${__('Added to Featured Items')}`
+ frappe.show_alert(featured_items_link);
+ erpnext.hub.trigger('action:item_feature');
+ })
+ .catch(e => {
+ console.error(e);
+ });
+ },
+
make_contact_seller_dialog() {
this.contact_seller_dialog = new frappe.ui.Dialog({
title: __('Send a message'),
@@ -272,11 +296,11 @@ export default {
},
edit_details() {
- //
+ frappe.msgprint(__('This feature is under development...'));
},
unpublish_item() {
- //
+ frappe.msgprint(__('This feature is under development...'));
}
}
}
diff --git a/erpnext/public/js/hub/pages/Profile.vue b/erpnext/public/js/hub/pages/Profile.vue
deleted file mode 100644
index 91ed946761f..00000000000
--- a/erpnext/public/js/hub/pages/Profile.vue
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/erpnext/public/js/hub/pages/Seller.vue b/erpnext/public/js/hub/pages/Seller.vue
index c80865bfbda..e339eaa3e5b 100644
--- a/erpnext/public/js/hub/pages/Seller.vue
+++ b/erpnext/public/js/hub/pages/Seller.vue
@@ -22,30 +22,77 @@
- {{ item_container_heading }}
-
-
+
+
+
+
Customer Reviews
+
+
+
+
+
+
+
{{ review.subject }}
+
+
+ by {{ review.username }}
+
+ –
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js
index eabb81ed02c..b94cdd8c4c3 100644
--- a/erpnext/public/js/utils/serial_no_batch_selector.js
+++ b/erpnext/public/js/utils/serial_no_batch_selector.js
@@ -208,6 +208,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
map_row_values: function(row, values, number, qty_field, warehouse) {
row.qty = values[qty_field];
+ row.transfer_qty = flt(values[qty_field]) * flt(row.conversion_factor);
row[number] = values[number];
if(this.warehouse_details.type === 'Source Warehouse') {
row.s_warehouse = values.warehouse || warehouse;
diff --git a/erpnext/regional/__init__.py b/erpnext/regional/__init__.py
index 1bd3357a81b..dc14d04960a 100644
--- a/erpnext/regional/__init__.py
+++ b/erpnext/regional/__init__.py
@@ -1,6 +1,7 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
+from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext import get_region
diff --git a/erpnext/regional/doctype/gst_settings/gst_settings.js b/erpnext/regional/doctype/gst_settings/gst_settings.js
index ab2358ff05b..808f9bc0789 100644
--- a/erpnext/regional/doctype/gst_settings/gst_settings.js
+++ b/erpnext/regional/doctype/gst_settings/gst_settings.js
@@ -21,5 +21,23 @@ frappe.ui.form.on('GST Settings', {
`
);
+ },
+
+ setup: function(frm) {
+ $.each(["cgst_account", "sgst_account", "igst_account", "cess_account"], function(i, field) {
+ frm.events.filter_accounts(frm, field);
+ });
+ },
+
+ filter_accounts: function(frm, account_field) {
+ frm.set_query(account_field, "gst_accounts", function(doc, cdt, cdn) {
+ var row = locals[cdt][cdn];
+ return {
+ filters: {
+ company: row.company,
+ is_group: 0
+ }
+ };
+ });
}
});
diff --git a/erpnext/regional/france/utils.py b/erpnext/regional/france/utils.py
index 9e9f0ad9bee..e4b72f65866 100644
--- a/erpnext/regional/france/utils.py
+++ b/erpnext/regional/france/utils.py
@@ -1,6 +1,7 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# For license information, please see license.txt
+from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext import get_region
diff --git a/erpnext/regional/india/__init__.py b/erpnext/regional/india/__init__.py
index 4a9a211b41a..46c874b2524 100644
--- a/erpnext/regional/india/__init__.py
+++ b/erpnext/regional/india/__init__.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
states = [
'',
'Andaman and Nicobar Islands',
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index ec4da0db651..c5498c77700 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe, os, json
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
-from frappe.permissions import add_permission
+from frappe.permissions import add_permission, update_permission_property
from erpnext.regional.india import states
from erpnext.accounts.utils import get_fiscal_year
from frappe.utils import today
@@ -79,6 +79,9 @@ def add_custom_roles_for_reports():
def add_permissions():
for doctype in ('GST HSN Code', 'GST Settings'):
add_permission(doctype, 'All', 0)
+ add_permission(doctype, 'Accounts Manager', 0)
+ update_permission_property(doctype, 'Accounts Manager', 0, 'write', 1)
+ update_permission_property(doctype, 'Accounts Manager', 0, 'create', 1)
def add_print_formats():
frappe.reload_doc("regional", "print_format", "gst_tax_invoice")
@@ -342,13 +345,14 @@ def set_tax_withholding_category(company):
if company and tds_account:
accounts = [dict(company=company, account=tds_account)]
- fiscal_year = get_fiscal_year(today(), company=accounts[0].get('company'))[0]
+ fiscal_year = get_fiscal_year(today(), company=company)[0]
docs = get_tds_details(accounts, fiscal_year)
for d in docs:
try:
doc = frappe.get_doc(d)
doc.flags.ignore_permissions = True
+ doc.flags.ignore_mandatory = True
doc.insert()
except frappe.DuplicateEntryError:
doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 43ed8688647..e7d0d5052ec 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe, re
from frappe import _
from frappe.utils import cstr, flt, date_diff, getdate
diff --git a/erpnext/regional/italy/__init__.py b/erpnext/regional/italy/__init__.py
new file mode 100644
index 00000000000..22bf84e4d07
--- /dev/null
+++ b/erpnext/regional/italy/__init__.py
@@ -0,0 +1,63 @@
+# coding=utf-8
+
+fiscal_regimes = [
+ "RF01-Ordinario",
+ "RF02-Contribuenti minimi (art.1, c.96-117, L. 244/07)",
+ "RF04-Agricoltura e attività connesse e pesca (artt.34 e 34-bis, DPR 633/72)",
+ "RF05-Vendita sali e tabacchi (art.74, c.1, DPR. 633/72)",
+ "RF06-Commercio fiammiferi (art.74, c.1, DPR 633/72)",
+ "RF07-Editoria (art.74, c.1, DPR 633/72)",
+ "RF08-Gestione servizi telefonia pubblica (art.74, c.1, DPR 633/72)",
+ "RF09-Rivendita documenti di trasporto pubblico e di sosta (art.74, c.1, DPR 633/72)",
+ "RF10-Intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72 (art.74, c.6, DPR 633/72)",
+ "RF11-Agenzie viaggi e turismo (art.74-ter, DPR 633/72)",
+ "RF12-Agriturismo (art.5, c.2, L. 413/91)",
+ "RF13-Vendite a domicilio (art.25-bis, c.6, DPR 600/73)",
+ "RF14-Rivendita beni usati, oggetti d’arte, d’antiquariato o da collezione (art.36, DL 41/95)",
+ "RF15-Agenzie di vendite all’asta di oggetti d’arte, antiquariato o da collezione (art.40-bis, DL 41/95)",
+ "RF16-IVA per cassa P.A. (art.6, c.5, DPR 633/72)",
+ "RF17-IVA per cassa (art. 32-bis, DL 83/2012)",
+ "RF18-Altro",
+ "RF19-Regime forfettario (art.1, c.54-89, L. 190/2014)"
+]
+
+tax_exemption_reasons = [
+ "N1-Escluse ex art. 15",
+ "N2-Non Soggette",
+ "N3-Non Imponibili",
+ "N4-Esenti",
+ "N5-Regime del margine / IVA non esposta in fattura",
+ "N6-Inversione Contabile",
+ "N7-IVA assolta in altro stato UE"
+]
+
+mode_of_payment_codes = [
+ "MP01-Contanti",
+ "MP02-Assegno",
+ "MP03-Assegno circolare",
+ "MP04-Contanti presso Tesoreria",
+ "MP05-Bonifico",
+ "MP06-Vaglia cambiario",
+ "MP07-Bollettino bancario",
+ "MP08-Carta di pagamento",
+ "MP09-RID",
+ "MP10-RID utenze",
+ "MP11-RID veloce",
+ "MP12-RIBA",
+ "MP13-MAV",
+ "MP14-Quietanza erario",
+ "MP15-Giroconto su conti di contabilità speciale",
+ "MP16-Domiciliazione bancaria",
+ "MP17-Domiciliazione postale",
+ "MP18-Bollettino di c/c postale",
+ "MP19-SEPA Direct Debit",
+ "MP20-SEPA Direct Debit CORE",
+ "MP21-SEPA Direct Debit B2B",
+ "MP22-Trattenuta su somme già riscosse"
+]
+
+vat_collectability_options = [
+ "I-Immediata",
+ "D-Differita",
+ "S-Scissione dei Pagamenti"
+]
diff --git a/erpnext/regional/italy/e-invoice.xml b/erpnext/regional/italy/e-invoice.xml
new file mode 100644
index 00000000000..1c416eeec63
--- /dev/null
+++ b/erpnext/regional/italy/e-invoice.xml
@@ -0,0 +1,208 @@
+{%- macro format_float(value) -%}
+{{ "%.2f" % value|abs }}
+{%- endmacro -%}
+
+{%- macro render_address(address) %}
+{{ address.address_line1 }}
+{{ address.pincode }}
+{{ address.city }}
+{%- if address.state %}
+{{ address.state }}
+{%- endif %}
+{{ address.country_code|upper }}
+{%- endmacro %}
+
+{%- macro render_discount_or_margin(item) -%}
+{%- if item.discount_percentage > 0.0 or item.margin_type %}
+
+ {%- if item.discount_percentage > 0.0 %}
+ SC
+ {{ format_float(item.discount_percentage) }}
+ {%- endif %}
+ {%- if item.margin_rate_or_amount > 0.0 -%}
+ MG
+ {%- if item.margin_type == "Percentage" -%}
+ {{ format_float(item.margin_rate_or_amount) }}
+ {%- elif item.margin_type == "Amount" -%}
+ {{ format_float(item.margin_rate_or_amount) }}
+ {%- endif -%}
+ {%- endif %}
+
+{%- endif -%}
+{%- endmacro -%}
+
+
+
+
+
+
+ {{ doc.company_address_data.country_code|upper or "IT" }}
+ {{ doc.company_fiscal_code or doc.company_tax_id | replace("IT","") }}
+
+ {{ doc.progressive_number }}
+ {{ doc.transmission_format_code }}
+ {{ doc.customer_data.recipient_code }}
+ {% if doc.company_data.phone or doc.company_data.email -%}
+
+ {% if doc.company_data.phone -%}{{ doc.company_data.phone }}{%- endif %}
+ {% if doc.company_data.email -%}{{ doc.company_data.email }}{%- endif %}
+
+ {% endif -%}
+
+
+
+
+ {{ doc.company_address_data.country_code|upper or "IT"}}
+ {{ doc.company_tax_id | replace("IT","") }}
+
+ {%- if doc.company_fiscal_code %}
+ {{ doc.company_fiscal_code }}
+ {%- endif %}
+
+ {{ doc.company }}
+
+ {{ doc.company_fiscal_regime.split("-")[0] }}
+
+
+ {{ render_address(doc.company_address_data) }}
+
+ {%- if doc.company_data.registration_number %}
+
+ {{ doc.company_data.registrar_office_province }}
+ {{ doc.company_data.registration_number }}
+ {%- if doc.company_data.share_capital_amount %}
+ {{ format_float(doc.company_data.share_capital_amount) }}
+ {%- endif %}
+ {%- if doc.company_data.no_of_members %}
+ {{ doc.company_data.no_of_members.split("-")[0] }}
+ {%- endif %}
+ {%- if doc.company_data.liquidation_state %}
+ {{ doc.company_data.liquidation_state.split("-")[0] }}
+ {%- endif %}
+
+ {%- endif %}
+
+
+
+ {%- if doc.customer_data.customer_type == "Individual" %}
+ {{ doc.customer_data.fiscal_code }}
+
+ {{ doc.customer_data.first_name }}
+ {{ doc.customer_data.last_name }}
+
+ {%- else %}
+ {%- if doc.customer_data.is_public_administration %}
+ {{ doc.customer_data.fiscal_code }}
+ {%- else %}
+
+ {{ doc.customer_address_data.country_code|upper or "IT" }}
+ {{ doc.tax_id | replace("IT","") }}
+
+ {%- endif %}
+
+ {{ doc.customer_name }}
+
+ {%- endif %}
+
+ {%- if doc.customer_address_data %}
+
+ {{ render_address(doc.customer_address_data) }}
+
+ {%- endif %}
+
+
+
+
+
+ {{ doc.type_of_document }}
+ EUR
+ {{ doc.posting_date }}
+ {{ doc.unamended_name }}
+ {%- if doc.stamp_duty %}
+
+ SI
+ {{ format_float(doc.stamp_duty) }}
+
+ {%- endif %}
+ {{ format_float(doc.grand_total) }}
+ VENDITA
+
+ {%- if doc.po_no %}
+
+ {{ doc.po_no }}
+ {%- if doc.po_date %}
+ {{ doc.po_date }}
+ {%- endif %}
+
+ {%- endif %}
+ {%- if doc.is_return and doc.return_against_unamended %}
+
+ {{ doc.return_against_unamended }}
+
+ {%- endif %}
+ {%- if doc.shipping_address_data %}
+
+
+ {{ render_address(doc.shipping_address_data) }}
+
+
+ {%- endif %}
+
+
+ {%- for item in doc.e_invoice_items %}
+
+ {{ item.idx }}
+
+ CODICE
+ {{ item.item_code }}
+
+ {{ item.description or item.item_name }}
+ {{ format_float(item.qty) }}
+ {{ item.stock_uom }}
+ {{ format_float(item.price_list_rate or item.rate) }}
+ {{ render_discount_or_margin(item) }}
+ {{ format_float(item.amount) }}
+ {{ format_float(item.tax_rate) }}
+ {%- if item.tax_exemption_reason %}
+ {{ item.tax_exemption_reason.split("-")[0] }}
+ {%- endif %}
+
+ {%- endfor %}
+ {%- for tax, data in doc.tax_data.items() %}
+
+ {{ format_float(tax|flt) }}
+ {%- if data.tax_exemption_reason %}
+ {{ data.tax_exemption_reason.split("-")[0] }}
+ {%- endif %}
+ {{ format_float(data.taxable_amount) }}
+ {{ format_float(data.tax_amount) }}
+ {{ doc.vat_collectability.split("-")[0] }}
+ {%- if data.tax_exemption_law %}
+ {{ data.tax_exemption_law }}
+ {%- endif %}
+
+ {%- endfor %}
+
+ {%- if doc.payment_schedule %}
+
+ {%- if payment_schedule|length > 1 %}
+ TP01
+ {%- else %}
+ TP02
+ {%- endif %}
+ {%- for payment_term in doc.payment_schedule %}
+
+ {{ payment_term.mode_of_payment_code.split("-")[0] }}
+ {{ payment_term.due_date }}
+ {{ format_float(payment_term.payment_amount) }}
+ {%- if payment_term.bank_account_iban %}{{ payment_term.bank_account_iban }}{%- endif %}
+
+ {%- endfor %}
+
+ {%- endif %}
+
+
diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py
new file mode 100644
index 00000000000..b4ab26f9c73
--- /dev/null
+++ b/erpnext/regional/italy/setup.py
@@ -0,0 +1,156 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+# coding=utf-8
+
+from __future__ import unicode_literals
+
+import frappe
+from frappe import _
+from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
+from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons, mode_of_payment_codes, vat_collectability_options
+
+def setup(company=None, patch=True):
+ make_custom_fields()
+ setup_report()
+
+def make_custom_fields(update=True):
+ invoice_item_fields = [
+ dict(fieldname='tax_rate', label='Tax Rate',
+ fieldtype='Float', insert_after='description',
+ print_hide=1, hidden=1, read_only=1),
+ dict(fieldname='tax_amount', label='Tax Amount',
+ fieldtype='Currency', insert_after='tax_rate',
+ print_hide=1, hidden=1, read_only=1, options="currency"),
+ dict(fieldname='total_amount', label='Total Amount',
+ fieldtype='Currency', insert_after='tax_amount',
+ print_hide=1, hidden=1, read_only=1, options="currency")
+ ]
+
+ custom_fields = {
+ 'Company': [
+ dict(fieldname='sb_e_invoicing', label='E-Invoicing',
+ fieldtype='Section Break', insert_after='date_of_establishment', print_hide=1),
+ dict(fieldname='fiscal_regime', label='Fiscal Regime',
+ fieldtype='Select', insert_after='sb_e_invoicing', print_hide=1,
+ options="\n".join(map(lambda x: x.decode('utf-8'), fiscal_regimes))),
+ dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='fiscal_regime', print_hide=1,
+ description=_("Applicable if the company is an Individual or a Proprietorship")),
+ dict(fieldname='vat_collectability', label='VAT Collectability',
+ fieldtype='Select', insert_after='fiscal_code', print_hide=1,
+ options="\n".join(map(lambda x: x.decode('utf-8'), vat_collectability_options))),
+ dict(fieldname='cb_e_invoicing1', fieldtype='Column Break', insert_after='vat_collectability', print_hide=1),
+ dict(fieldname='registrar_office_province', label='Province of the Registrar Office',
+ fieldtype='Data', insert_after='cb_e_invoicing1', print_hide=1, length=2),
+ dict(fieldname='registration_number', label='Registration Number',
+ fieldtype='Data', insert_after='registrar_office_province', print_hide=1, length=20),
+ dict(fieldname='share_capital_amount', label='Share Capital',
+ fieldtype='Currency', insert_after='registration_number', print_hide=1,
+ description=_('Applicable if the company is SpA, SApA or SRL')),
+ dict(fieldname='no_of_members', label='No of Members',
+ fieldtype='Select', insert_after='share_capital_amount', print_hide=1,
+ options="\nSU-Socio Unico\nSM-Piu Soci", description=_("Applicable if the company is a limited liability company")),
+ dict(fieldname='liquidation_state', label='Liquidation State',
+ fieldtype='Select', insert_after='no_of_members', print_hide=1,
+ options="\nLS-In Liquidazione\nLN-Non in Liquidazione")
+ ],
+ 'Sales Taxes and Charges': [
+ dict(fieldname='tax_exemption_reason', label='Tax Exemption Reason',
+ fieldtype='Select', insert_after='included_in_print_rate', print_hide=1,
+ depends_on='eval:doc.charge_type!="Actual" && doc.rate==0.0',
+ options="\n" + "\n".join(map(lambda x: x.decode('utf-8'), tax_exemption_reasons))),
+ dict(fieldname='tax_exemption_law', label='Tax Exempt Under',
+ fieldtype='Text', insert_after='tax_exemption_reason', print_hide=1,
+ depends_on='eval:doc.charge_type!="Actual" && doc.rate==0.0')
+ ],
+ 'Customer': [
+ dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='tax_id', print_hide=1),
+ dict(fieldname='recipient_code', label='Recipient Code',
+ fieldtype='Data', insert_after='fiscal_code', print_hide=1, default="0000000"),
+ dict(fieldname='pec', label='Recipient PEC',
+ fieldtype='Data', insert_after='fiscal_code', print_hide=1),
+ dict(fieldname='is_public_administration', label='Is Public Administration',
+ fieldtype='Check', insert_after='is_internal_customer', print_hide=1,
+ description=_("Set this if the customer is a Public Administration company."),
+ depends_on='eval:doc.customer_type=="Company"'),
+ dict(fieldname='first_name', label='First Name', fieldtype='Data',
+ insert_after='salutation', print_hide=1, depends_on='eval:doc.customer_type!="Company"'),
+ dict(fieldname='last_name', label='Last Name', fieldtype='Data',
+ insert_after='first_name', print_hide=1, depends_on='eval:doc.customer_type!="Company"')
+ ],
+ 'Mode of Payment': [
+ dict(fieldname='mode_of_payment_code', label='Code',
+ fieldtype='Select', insert_after='included_in_print_rate', print_hide=1,
+ options="\n".join(map(lambda x: x.decode('utf-8'), mode_of_payment_codes)))
+ ],
+ 'Payment Schedule': [
+ dict(fieldname='mode_of_payment_code', label='Code',
+ fieldtype='Select', insert_after='mode_of_payment', print_hide=1,
+ options="\n".join(map(lambda x: x.decode('utf-8'), mode_of_payment_codes)),
+ fetch_from="mode_of_payment.mode_of_payment_code", read_only=1),
+ dict(fieldname='bank_account', label='Bank Account',
+ fieldtype='Link', insert_after='mode_of_payment_code', print_hide=1,
+ options="Bank Account"),
+ dict(fieldname='bank_account_name', label='Bank Account Name',
+ fieldtype='Data', insert_after='bank_account', print_hide=1,
+ fetch_from="bank_account.account_name", read_only=1),
+ dict(fieldname='bank_account_no', label='Bank Account No',
+ fieldtype='Data', insert_after='bank_account_name', print_hide=1,
+ fetch_from="bank_account.bank_account_no", read_only=1),
+ dict(fieldname='bank_account_iban', label='IBAN',
+ fieldtype='Data', insert_after='bank_account_name', print_hide=1,
+ fetch_from="bank_account.iban", read_only=1),
+ ],
+ "Sales Invoice": [
+ dict(fieldname='vat_collectability', label='VAT Collectability',
+ fieldtype='Select', insert_after='taxes_and_charges', print_hide=1,
+ options="\n".join(map(lambda x: x.decode('utf-8'), vat_collectability_options)),
+ fetch_from="company.vat_collectability"),
+ dict(fieldname='sb_e_invoicing_reference', label='E-Invoicing',
+ fieldtype='Section Break', insert_after='pos_total_qty', print_hide=1),
+ dict(fieldname='company_tax_id', label='Company Tax ID',
+ fieldtype='Data', insert_after='sb_e_invoicing_reference', print_hide=1, read_only=1,
+ fetch_from="company.tax_id"),
+ dict(fieldname='company_fiscal_code', label='Company Fiscal Code',
+ fieldtype='Data', insert_after='company_tax_id', print_hide=1, read_only=1,
+ fetch_from="company.fiscal_code"),
+ dict(fieldname='company_fiscal_regime', label='Company Fiscal Regime',
+ fieldtype='Data', insert_after='company_fiscal_code', print_hide=1, read_only=1,
+ fetch_from="company.fiscal_regime"),
+ dict(fieldname='cb_e_invoicing_reference', fieldtype='Column Break',
+ insert_after='company_fiscal_regime', print_hide=1),
+ dict(fieldname='customer_fiscal_code', label='Customer Fiscal Code',
+ fieldtype='Data', insert_after='cb_e_invoicing_reference', read_only=1,
+ fetch_from="customer.fiscal_code"),
+ ],
+ 'Purchase Invoice Item': invoice_item_fields,
+ 'Sales Order Item': invoice_item_fields,
+ 'Delivery Note Item': invoice_item_fields,
+ 'Sales Invoice Item': invoice_item_fields,
+ 'Quotation Item': invoice_item_fields,
+ 'Purchase Order Item': invoice_item_fields,
+ 'Purchase Receipt Item': invoice_item_fields,
+ 'Supplier Quotation Item': invoice_item_fields,
+ 'Address': [
+ dict(fieldname='country_code', label='Country Code',
+ fieldtype='Data', insert_after='country', print_hide=1, read_only=1,
+ fetch_from="country.code")
+ ]
+ }
+
+ create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update)
+
+def setup_report():
+ report_name = 'Electronic Invoice Register'
+
+ frappe.db.sql(""" update `tabReport` set disabled = 0 where
+ name = %s """, report_name)
+
+ if not frappe.db.get_value('Custom Role', dict(report=report_name)):
+ frappe.get_doc(dict(
+ doctype='Custom Role',
+ report=report_name,
+ roles= [
+ dict(role='Accounts User'),
+ dict(role='Accounts Manager')
+ ]
+ )).insert()
diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py
new file mode 100644
index 00000000000..85f744774f6
--- /dev/null
+++ b/erpnext/regional/italy/utils.py
@@ -0,0 +1,285 @@
+from __future__ import unicode_literals
+
+import frappe, json, os
+from frappe.utils import flt, cstr
+from erpnext.controllers.taxes_and_totals import get_itemised_tax
+from frappe import _
+from frappe.utils.file_manager import save_file, remove_file
+from frappe.desk.form.load import get_attachments
+
+
+def update_itemised_tax_data(doc):
+ if not doc.taxes: return
+
+ itemised_tax = get_itemised_tax(doc.taxes)
+
+ for row in doc.items:
+ tax_rate = 0.0
+ if itemised_tax.get(row.item_code):
+ tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
+
+ row.tax_rate = flt(tax_rate, row.precision("tax_rate"))
+ row.tax_amount = flt((row.net_amount * tax_rate) / 100, row.precision("net_amount"))
+ row.total_amount = flt((row.net_amount + row.tax_amount), row.precision("total_amount"))
+
+@frappe.whitelist()
+def export_invoices(filters=None):
+ saved_xmls = []
+
+ invoices = frappe.get_all("Sales Invoice", filters=get_conditions(filters), fields=["*"])
+
+ for invoice in invoices:
+ attachments = get_e_invoice_attachments(invoice)
+ saved_xmls += [attachment.file_name for attachment in attachments]
+
+ zip_filename = "{0}-einvoices.zip".format(frappe.utils.get_datetime().strftime("%Y%m%d_%H%M%S"))
+
+ download_zip(saved_xmls, zip_filename)
+
+
+@frappe.whitelist()
+def prepare_invoice(invoice, progressive_number):
+ #set company information
+ company = frappe.get_doc("Company", invoice.company)
+
+ invoice.progressive_number = progressive_number
+ invoice.unamended_name = get_unamended_name(invoice)
+ invoice.company_data = company
+ company_address = frappe.get_doc("Address", invoice.company_address)
+ invoice.company_address_data = company_address
+
+ #Set invoice type
+ if invoice.is_return and invoice.return_against:
+ invoice.type_of_document = "TD04" #Credit Note (Nota di Credito)
+ invoice.return_against_unamended = get_unamended_name(frappe.get_doc("Sales Invoice", invoice.return_against))
+ else:
+ invoice.type_of_document = "TD01" #Sales Invoice (Fattura)
+
+ #set customer information
+ invoice.customer_data = frappe.get_doc("Customer", invoice.customer)
+ customer_address = frappe.get_doc("Address", invoice.customer_address)
+ invoice.customer_address_data = customer_address
+
+ if invoice.shipping_address_name:
+ invoice.shipping_address_data = frappe.get_doc("Address", invoice.shipping_address_name)
+
+ if invoice.customer_data.is_public_administration:
+ invoice.transmission_format_code = "FPA12"
+ else:
+ invoice.transmission_format_code = "FPR12"
+
+ invoice.e_invoice_items = [item for item in invoice.items]
+ tax_data = get_invoice_summary(invoice.e_invoice_items, invoice.taxes)
+ invoice.tax_data = tax_data
+
+ #Check if stamp duty (Bollo) of 2 EUR exists.
+ stamp_duty_charge_row = next((tax for tax in invoice.taxes if tax.charge_type == _("Actual") and tax.tax_amount == 2.0 ), None)
+ if stamp_duty_charge_row:
+ invoice.stamp_duty = stamp_duty_charge_row.tax_amount
+
+ for item in invoice.e_invoice_items:
+ if item.tax_rate == 0.0 and item.tax_amount == 0.0:
+ item.tax_exemption_reason = tax_data["0.0"]["tax_exemption_reason"]
+
+ return invoice
+
+def get_conditions(filters):
+ filters = json.loads(filters)
+
+ conditions = {"docstatus": 1}
+
+ if filters.get("company"): conditions["company"] = filters["company"]
+ if filters.get("customer"): conditions["customer"] = filters["customer"]
+
+ if filters.get("from_date"): conditions["posting_date"] = (">=", filters["from_date"])
+ if filters.get("to_date"): conditions["posting_date"] = ("<=", filters["to_date"])
+
+ if filters.get("from_date") and filters.get("to_date"):
+ conditions["posting_date"] = ("between", [filters.get("from_date"), filters.get("to_date")])
+
+ return conditions
+
+#TODO: Use function from frappe once PR #6853 is merged.
+def download_zip(files, output_filename):
+ from zipfile import ZipFile
+
+ input_files = [frappe.get_site_path('private', 'files', filename) for filename in files]
+ output_path = frappe.get_site_path('private', 'files', output_filename)
+
+ with ZipFile(output_path, 'w') as output_zip:
+ for input_file in input_files:
+ output_zip.write(input_file, arcname=os.path.basename(input_file))
+
+ with open(output_path, 'rb') as fileobj:
+ filedata = fileobj.read()
+
+ frappe.local.response.filename = output_filename
+ frappe.local.response.filecontent = filedata
+ frappe.local.response.type = "download"
+
+def get_invoice_summary(items, taxes):
+ summary_data = frappe._dict()
+ for tax in taxes:
+ #Include only VAT charges.
+ if tax.charge_type == "Actual":
+ continue
+
+ #Charges to appear as items in the e-invoice.
+ if tax.charge_type in ["On Previous Row Total", "On Previous Row Amount"]:
+ reference_row = next((row for row in taxes if row.idx == int(tax.row_id or 0)), None)
+ if reference_row:
+ items.append(
+ frappe._dict(
+ idx=len(items)+1,
+ item_code=reference_row.description,
+ item_name=reference_row.description,
+ rate=reference_row.tax_amount,
+ qty=1.0,
+ amount=reference_row.tax_amount,
+ stock_uom=frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos"),
+ tax_rate=tax.rate,
+ tax_amount=(reference_row.tax_amount * tax.rate) / 100,
+ net_amount=reference_row.tax_amount,
+ taxable_amount=reference_row.tax_amount,
+ item_tax_rate="{}",
+ charges=True
+ )
+ )
+
+ #Check item tax rates if tax rate is zero.
+ if tax.rate == 0:
+ for item in items:
+ item_tax_rate = json.loads(item.item_tax_rate)
+ if tax.account_head in item_tax_rate:
+ key = cstr(item_tax_rate[tax.account_head])
+ summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0, "tax_exemption_reason": "", "tax_exemption_law": ""})
+ summary_data[key]["tax_amount"] += item.tax_amount
+ summary_data[key]["taxable_amount"] += item.net_amount
+ if key == "0.0":
+ summary_data[key]["tax_exemption_reason"] = tax.tax_exemption_reason
+ summary_data[key]["tax_exemption_law"] = tax.tax_exemption_law
+
+ if summary_data == {}: #Implies that Zero VAT has not been set on any item.
+ summary_data.setdefault("0.0", {"tax_amount": 0.0, "taxable_amount": tax.total,
+ "tax_exemption_reason": tax.tax_exemption_reason, "tax_exemption_law": tax.tax_exemption_law})
+
+ else:
+ item_wise_tax_detail = json.loads(tax.item_wise_tax_detail)
+ for rate_item in [tax_item for tax_item in item_wise_tax_detail.items() if tax_item[1][0] == tax.rate]:
+ key = cstr(tax.rate)
+ if not summary_data.get(key): summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0})
+ summary_data[key]["tax_amount"] += rate_item[1][1]
+ summary_data[key]["taxable_amount"] += sum([item.net_amount for item in items if item.item_code == rate_item[0]])
+
+ for item in items:
+ key = cstr(tax.rate)
+ if item.get("charges"):
+ if not summary_data.get(key): summary_data.setdefault(key, {"taxable_amount": 0.0})
+ summary_data[key]["taxable_amount"] += item.taxable_amount
+
+ return summary_data
+
+#Preflight for successful e-invoice export.
+def sales_invoice_validate(doc):
+ #Validate company
+ if not doc.company_address:
+ frappe.throw(_("Please set an Address on the Company '%s'" % doc.company), title=_("E-Invoicing Information Missing"))
+ else:
+ validate_address(doc.company_address, "Company")
+
+ if not doc.company_tax_id and not doc.company_fiscal_code:
+ frappe.throw(_("Please set either the Tax ID or Fiscal Code on Company '%s'" % doc.company), title=_("E-Invoicing Information Missing"))
+
+ #Validate customer details
+ customer_type, is_public_administration = frappe.db.get_value("Customer", doc.customer, ["customer_type", "is_public_administration"])
+ if customer_type == _("Individual"):
+ if not doc.customer_fiscal_code:
+ frappe.throw(_("Please set Fiscal Code for the customer '%s'" % doc.customer), title=_("E-Invoicing Information Missing"))
+ else:
+ if is_public_administration:
+ if not doc.customer_fiscal_code:
+ frappe.throw(_("Please set Fiscal Code for the public administration '%s'" % doc.customer), title=_("E-Invoicing Information Missing"))
+ else:
+ if not doc.tax_id:
+ frappe.throw(_("Please set Tax ID for the customer '%s'" % doc.customer), title=_("E-Invoicing Information Missing"))
+
+ if not doc.customer_address:
+ frappe.throw(_("Please set the Customer Address"), title=_("E-Invoicing Information Missing"))
+ else:
+ validate_address(doc.customer_address, "Customer")
+
+ if not len(doc.taxes):
+ frappe.throw(_("Please set at least one row in the Taxes and Charges Table"), title=_("E-Invoicing Information Missing"))
+ else:
+ for row in doc.taxes:
+ if row.rate == 0 and row.tax_amount == 0 and not row.tax_exemption_reason:
+ frappe.throw(_("Row {0}: Please set at Tax Exemption Reason in Sales Taxes and Charges".format(row.idx)),
+ title=_("E-Invoicing Information Missing"))
+
+
+#Ensure payment details are valid for e-invoice.
+def sales_invoice_on_submit(doc):
+ #Validate payment details
+ if not len(doc.payment_schedule):
+ frappe.throw(_("Please set the Payment Schedule"), title=_("E-Invoicing Information Missing"))
+ else:
+ for schedule in doc.payment_schedule:
+ if not schedule.mode_of_payment:
+ frappe.throw(_("Row {0}: Please set the Mode of Payment in Payment Schedule".format(schedule.idx)),
+ title=_("E-Invoicing Information Missing"))
+ elif not frappe.db.get_value("Mode of Payment", schedule.mode_of_payment, "mode_of_payment_code"):
+ frappe.throw(_("Row {0}: Please set the correct code on Mode of Payment {1}".format(schedule.idx, schedule.mode_of_payment)),
+ title=_("E-Invoicing Information Missing"))
+
+ prepare_and_attach_invoice(doc)
+
+def prepare_and_attach_invoice(doc):
+ progressive_name, progressive_number = get_progressive_name_and_number(doc)
+
+ invoice = prepare_invoice(doc, progressive_number)
+ invoice_xml = frappe.render_template('erpnext/regional/italy/e-invoice.xml', context={"doc": invoice}, is_path=True)
+
+ xml_filename = progressive_name + ".xml"
+ save_file(xml_filename, invoice_xml, dt=doc.doctype, dn=doc.name, is_private=True)
+
+#Delete e-invoice attachment on cancel.
+def sales_invoice_on_cancel(doc):
+ for attachment in get_e_invoice_attachments(doc):
+ remove_file(attachment.name, attached_to_doctype=doc.doctype, attached_to_name=doc.name)
+
+def get_e_invoice_attachments(invoice):
+ out = []
+ attachments = get_attachments(invoice.doctype, invoice.name)
+ company_tax_id = invoice.company_tax_id if invoice.company_tax_id.startswith("IT") else "IT" + invoice.company_tax_id
+
+ for attachment in attachments:
+ if attachment.file_name.startswith(company_tax_id) and attachment.file_name.endswith(".xml"):
+ out.append(attachment)
+
+ return out
+
+def validate_address(address_name, address_context):
+ pincode, city = frappe.db.get_value("Address", address_name, ["pincode", "city"])
+ if not pincode:
+ frappe.throw(_("Please set pin code on %s Address" % address_context), title=_("E-Invoicing Information Missing"))
+ if not city:
+ frappe.throw(_("Please set city on %s Address" % address_context), title=_("E-Invoicing Information Missing"))
+
+
+def get_unamended_name(doc):
+ attributes = ["naming_series", "amended_from"]
+ for attribute in attributes:
+ if not hasattr(doc, attribute):
+ return doc.name
+
+ if doc.amended_from:
+ return "-".join(doc.name.split("-")[:-1])
+ else:
+ return doc.name
+
+def get_progressive_name_and_number(doc):
+ company_tax_id = doc.company_tax_id if doc.company_tax_id.startswith("IT") else "IT" + doc.company_tax_id
+ progressive_name = frappe.model.naming.make_autoname(company_tax_id + "_.#####")
+ progressive_number = progressive_name.split("_")[1]
+
+ return progressive_name, progressive_number
\ No newline at end of file
diff --git a/erpnext/regional/report/electronic_invoice_register/__init__.py b/erpnext/regional/report/electronic_invoice_register/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js
new file mode 100644
index 00000000000..67297f757ca
--- /dev/null
+++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js
@@ -0,0 +1,53 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["Electronic Invoice Register"] = {
+ "filters": [
+ {
+ "fieldname":"from_date",
+ "label": __("From Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
+ "width": "80"
+ },
+ {
+ "fieldname":"to_date",
+ "label": __("To Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today()
+ },
+ {
+ "fieldname":"customer",
+ "label": __("Customer"),
+ "fieldtype": "Link",
+ "options": "Customer"
+ },
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "default": frappe.defaults.get_user_default("Company")
+ },
+ ],
+ "onload": function(reportview) {
+ reportview.page.add_inner_button(__("Export E-Invoices"), function() {
+ //TODO: refactor condition to disallow export if report has no data.
+ if (!reportview.data.length) {
+ frappe.msgprint(__("No data to export"));
+ return
+ }
+
+ var w = window.open(
+ frappe.urllib.get_full_url(
+ "/api/method/erpnext.regional.italy.utils.export_invoices?"
+ + "filters=" + JSON.stringify(reportview.get_filter_values())
+ )
+ );
+ if (!w) {
+ frappe.msgprint(__("Please enable pop-ups")); return;
+ }
+ })
+ }
+}
diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json
new file mode 100644
index 00000000000..5470c49c574
--- /dev/null
+++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json
@@ -0,0 +1,21 @@
+{
+ "add_total_row": 0,
+ "color": "green",
+ "creation": "2019-01-13 17:43:21.903589",
+ "disabled": 1,
+ "docstatus": 0,
+ "doctype": "Report",
+ "icon": "fa fa-file-code-o",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2019-01-13 19:03:56.187748",
+ "modified_by": "Administrator",
+ "module": "Regional",
+ "name": "Electronic Invoice Register",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Electronic Invoice Register",
+ "report_type": "Script Report",
+ "roles": []
+}
\ No newline at end of file
diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py
new file mode 100644
index 00000000000..376ba3ee471
--- /dev/null
+++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py
@@ -0,0 +1,8 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from erpnext.accounts.report.sales_register.sales_register import _execute
+
+def execute(filters=None):
+ return _execute(filters)
diff --git a/erpnext/regional/report/eway_bill/eway_bill.py b/erpnext/regional/report/eway_bill/eway_bill.py
index 1b5de274c58..5b9896be2a1 100644
--- a/erpnext/regional/report/eway_bill/eway_bill.py
+++ b/erpnext/regional/report/eway_bill/eway_bill.py
@@ -16,7 +16,7 @@ def execute(filters=None):
return columns, data
def get_data(filters):
-
+
conditions = get_conditions(filters)
data = frappe.db.sql("""
@@ -25,7 +25,7 @@ def get_data(filters):
FROM
`tabDelivery Note` AS dn join `tabDelivery Note Item` AS dni on (dni.parent = dn.name)
WHERE
- dn.docstatus < 2
+ dn.docstatus < 2
%s """ % conditions, as_dict=1)
unit = {
@@ -40,14 +40,14 @@ def get_data(filters):
'Set': "SETS"
}
- # Regular expression set to remove all the special characters
+ # Regular expression set to remove all the special characters
special_characters = "[$%^*()+\\[\]{};':\"\\|<>.?]"
for row in data:
set_defaults(row)
set_taxes(row, filters)
set_address_details(row, special_characters)
-
+
# Eway Bill accepts date as dd/mm/yyyy and not dd-mm-yyyy
row.posting_date = '/'.join(str(row.posting_date).replace("-", "/").split('/')[::-1])
row.lr_date = '/'.join(str(row.lr_date).replace("-", "/").split('/')[::-1])
@@ -66,7 +66,7 @@ def get_data(filters):
return data
def get_conditions(filters):
-
+
conditions = ""
conditions += filters.get('company') and " AND dn.company = '%s' " % filters.get('company') or ""
@@ -92,7 +92,7 @@ def set_address_details(row, special_characters):
row.update({'from_pin_code': pincode and pincode.replace(" ", "") or ''})
row.update({'from_state': state and state.upper() or ''})
row.update({'dispatch_state': row.from_state})
-
+
if row.get('shipping_address_name'):
address_line1, address_line2, city, pincode, state = frappe.db.get_value("Address", row.get('shipping_address_name'), ['address_line1', 'address_line2', 'city', 'pincode', 'state'])
@@ -104,20 +104,23 @@ def set_address_details(row, special_characters):
row.update({'ship_to_state': row.to_state})
def set_taxes(row, filters):
- taxes = frappe.get_list("Sales Taxes and Charges",
+ taxes = frappe.get_list("Sales Taxes and Charges",
filters={
'parent': row.dn_id
- },
+ },
fields=('item_wise_tax_detail', 'account_head'))
account_list = ["cgst_account", "sgst_account", "igst_account", "cess_account"]
taxes_list = frappe.get_list("GST Account",
filters={
- "parent": "GST Settings",
+ "parent": "GST Settings",
"company": filters.company
},
fields=account_list)
+ if not taxes_list:
+ frappe.throw(_("Please set GST Accounts in GST Settings"))
+
item_tax_rate = {}
for tax in taxes:
diff --git a/erpnext/regional/united_arab_emirates/utils.py b/erpnext/regional/united_arab_emirates/utils.py
index 61ffadb443b..a01c6ceec36 100644
--- a/erpnext/regional/united_arab_emirates/utils.py
+++ b/erpnext/regional/united_arab_emirates/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe.utils import flt
from erpnext.controllers.taxes_and_totals import get_itemised_tax
diff --git a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
index 1f84ccf1d8d..ec62ba22b4d 100644
--- a/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
+++ b/erpnext/restaurant/doctype/restaurant/restaurant_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/selling/doctype/customer/customer_dashboard.py b/erpnext/selling/doctype/customer/customer_dashboard.py
index bf01363bd65..f2f430a61e2 100644
--- a/erpnext/selling/doctype/customer/customer_dashboard.py
+++ b/erpnext/selling/doctype/customer/customer_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.js b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.js
index 67ff8cb649c..f24caf767fe 100644
--- a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.js
+++ b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.js
@@ -20,6 +20,16 @@ frappe.ui.form.on('POS Closing Voucher', {
};
});
},
+
+ total_amount: function(frm) {
+ get_difference_amount(frm);
+ },
+ custody_amount: function(frm){
+ get_difference_amount(frm);
+ },
+ expense_amount: function(frm){
+ get_difference_amount(frm);
+ },
refresh: function(frm) {
get_closing_voucher_details(frm);
},
@@ -47,6 +57,10 @@ frappe.ui.form.on('POS Closing Voucher Details', {
}
});
+var get_difference_amount = function(frm){
+ frm.doc.difference = frm.doc.total_amount - frm.doc.custody_amount - frm.doc.expense_amount;
+ refresh_field("difference");
+};
var get_closing_voucher_details = function(frm) {
if (frm.doc.period_end_date && frm.doc.period_start_date && frm.doc.company && frm.doc.pos_profile && frm.doc.user) {
@@ -62,6 +76,7 @@ var get_closing_voucher_details = function(frm) {
refresh_field("grand_total");
refresh_field("net_total");
refresh_field("total_quantity");
+ refresh_field("total_amount");
frm.get_field("payment_reconciliation_details").$wrapper.html(r.message);
}
diff --git a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.json b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.json
index e24239526ac..2ac57794b4f 100644
--- a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.json
+++ b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@@ -38,7 +39,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
@@ -71,7 +72,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 0,
+ "read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
@@ -307,6 +308,197 @@
"translatable": 0,
"unique": 0
},
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "expense_details_section",
+ "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": "Expense Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "expense_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Expense Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "custody_amount",
+ "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": "Amount in Custody",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Total Collected Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "difference",
+ "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": "Difference",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -766,7 +958,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-08-21 16:15:54.363636",
+ "modified": "2019-01-28 12:33:45.217813",
"modified_by": "Administrator",
"module": "Selling",
"name": "POS Closing Voucher",
diff --git a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.py b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.py
index e7fc85e05ac..c45571f57ca 100644
--- a/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.py
+++ b/erpnext/selling/doctype/pos_closing_voucher/pos_closing_voucher.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
+from frappe import _
from frappe.model.document import Document
from collections import defaultdict
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data
@@ -26,6 +27,7 @@ class POSClosingVoucher(Document):
sales_summary = get_sales_summary(invoice_list)
self.set_sales_summary_values(sales_summary)
+ self.total_amount = sales_summary['grand_total']
if not self.get('payment_reconciliation'):
mop = get_mode_of_payment_details(invoice_list)
@@ -36,6 +38,21 @@ class POSClosingVoucher(Document):
return self.get_payment_reconciliation_details()
+ def validate(self):
+ user = frappe.get_all('POS Closing Voucher',
+ filters = {
+ 'user': self.user,
+ 'docstatus': 1
+ },
+ or_filters = {
+ 'period_start_date': ('between', [self.period_start_date, self.period_end_date]),
+ 'period_end_date': ('between', [self.period_start_date, self.period_end_date])
+ })
+
+ if user:
+ frappe.throw(_("POS Closing Voucher alreday exists for {0} between date {1} and {2}"
+ .format(self.user, self.period_start_date, self.period_end_date)))
+
def set_invoice_list(self, invoice_list):
self.sales_invoices_summary = []
for invoice in invoice_list:
diff --git a/erpnext/selling/doctype/quotation/quotation_dashboard.py b/erpnext/selling/doctype/quotation/quotation_dashboard.py
index d32fd0cfede..f1ac951ef94 100644
--- a/erpnext/selling/doctype/quotation/quotation_dashboard.py
+++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json
index 3a8b0df5c59..24cb405657e 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.json
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.json
@@ -762,7 +762,7 @@
"no_copy": 0,
"options": "currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -1914,7 +1914,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2019-01-07 16:51:56.248107",
+ "modified": "2019-02-18 18:57:25.277633",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation Item",
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index 35c643de6c8..aab6db2584f 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
+++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 19065dfa375..5ca2f818642 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -961,7 +961,7 @@
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -2477,7 +2477,7 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2019-01-07 16:51:51.852343",
+ "modified": "2019-02-18 18:53:23.425126",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js
index 1ee59712716..c54430fd560 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -164,6 +164,12 @@ erpnext.pos.PointOfSale = class PointOfSale {
}
}
});
+
+ frappe.ui.form.on('Sales Invoice', 'selling_price_list', (frm) => {
+ if(this.items && frm.doc.pos_profile) {
+ this.items.reset_items();
+ }
+ })
}
toggle_editing(flag) {
@@ -1384,6 +1390,7 @@ class POSItems {
}
get_items({start = 0, page_length = 40, search_value='', item_group=this.parent_item_group}={}) {
+ const price_list = this.frm.doc.selling_price_list;
return new Promise(res => {
frappe.call({
method: "erpnext.selling.page.point_of_sale.point_of_sale.get_items",
@@ -1391,10 +1398,10 @@ class POSItems {
args: {
start,
page_length,
- 'price_list': this.frm.doc.selling_price_list,
+ price_list,
item_group,
search_value,
- 'pos_profile': this.frm.doc.pos_profile
+ pos_profile: this.frm.doc.pos_profile
}
}).then(r => {
// const { items, serial_no, batch_no } = r.message;
diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.py b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
index a9e43034b48..eb242d0a737 100644
--- a/erpnext/selling/report/address_and_contacts/address_and_contacts.py
+++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.py
@@ -102,7 +102,8 @@ def get_party_details(party_type, party_list, doctype, party_details):
records = frappe.get_list(doctype, filters=filters, fields=fields, as_list=True)
for d in records:
details = party_details.get(d[0])
- details.setdefault(frappe.scrub(doctype), []).append(d[1:])
+ if details:
+ details.setdefault(frappe.scrub(doctype), []).append(d[1:])
return party_details
diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py b/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py
index f2b7701b103..f2518f09f8e 100644
--- a/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py
+++ b/erpnext/selling/report/pending_so_items_for_purchase_request/test_pending_so_items_for_purchase_request.py
@@ -1,6 +1,7 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
+from __future__ import unicode_literals
import unittest
from frappe.utils import nowdate, add_months
from erpnext.selling.report.pending_so_items_for_purchase_request.pending_so_items_for_purchase_request\
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.json b/erpnext/selling/report/sales_analytics/sales_analytics.json
index 5c95f284101..bd8230230ba 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.json
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.json
@@ -1,12 +1,13 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"creation": "2018-09-21 12:46:29.451048",
+ "disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
- "modified": "2018-09-21 12:46:29.451048",
+ "modified": "2019-02-12 14:30:40.043652",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Analytics",
diff --git a/erpnext/selling/report/sales_analytics/test_analytics.py b/erpnext/selling/report/sales_analytics/test_analytics.py
index 5d68b06b6d3..4d81a1e4dda 100644
--- a/erpnext/selling/report/sales_analytics/test_analytics.py
+++ b/erpnext/selling/report/sales_analytics/test_analytics.py
@@ -1,6 +1,7 @@
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
+from __future__ import unicode_literals
import frappe
import frappe.defaults
import unittest
diff --git a/erpnext/setup/doctype/company/company.js b/erpnext/setup/doctype/company/company.js
index 16676ac78af..70e047a4e80 100644
--- a/erpnext/setup/doctype/company/company.js
+++ b/erpnext/setup/doctype/company/company.js
@@ -206,6 +206,8 @@ erpnext.company.setup_queries = function(frm) {
["default_payroll_payable_account", {"root_type": "Liability"}],
["round_off_account", {"root_type": "Expense"}],
["write_off_account", {"root_type": "Expense"}],
+ ["discount_allowed_account", {"root_type": "Expense"}],
+ ["discount_received_account", {"root_type": "Income"}],
["exchange_gain_loss_account", {"root_type": "Expense"}],
["unrealized_exchange_gain_loss_account", {"root_type": "Expense"}],
["accumulated_depreciation_account",
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 01f8956a826..77c371e0cdd 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -1250,6 +1250,72 @@
"translatable": 0,
"unique": 0
},
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "discount_allowed_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": "Discount Allowed Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "discount_received_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": "Discount Received Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -2903,7 +2969,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-10-24 12:57:46.776452",
+ "modified": "2019-01-15 13:29:54.510379",
"modified_by": "Administrator",
"module": "Setup",
"name": "Company",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 09ff5a83fd6..c49c2642511 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -94,6 +94,9 @@ class Company(NestedSet):
if frappe.flags.country_change:
install_country_fixtures(self.name)
+ self.create_default_tax_template()
+
+
if not frappe.db.get_value("Department", {"company": self.name}):
from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures
@@ -336,6 +339,9 @@ class Company(NestedSet):
frappe.db.sql("delete from tabDepartment where company=%s", self.name)
frappe.db.sql("delete from `tabTax Withholding Account` where company=%s", self.name)
+ frappe.db.sql("delete from `tabSales Taxes and Charges Template` where company=%s", self.name)
+ frappe.db.sql("delete from `tabPurchase Taxes and Charges Template` where company=%s", self.name)
+
@frappe.whitelist()
def enqueue_replace_abbr(company, old, new):
kwargs = dict(company=company, old=old, new=new)
diff --git a/erpnext/setup/doctype/company/company_dashboard.py b/erpnext/setup/doctype/company/company_dashboard.py
index 5efcf3839f6..9b483dd55e5 100644
--- a/erpnext/setup/doctype/company/company_dashboard.py
+++ b/erpnext/setup/doctype/company/company_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py
index c3260ab9060..1b08a228b6c 100644
--- a/erpnext/setup/doctype/company/test_company.py
+++ b/erpnext/setup/doctype/company/test_company.py
@@ -46,7 +46,7 @@ class TestCompany(unittest.TestCase):
def test_coa_based_on_country_template(self):
countries = ["India", "Brazil", "United Arab Emirates", "Canada", "Germany", "France",
- "Guatemala", "Indonesia", "Mexico", "Nicaragua", "Netherlands", "Singapore",
+ "Guatemala", "Indonesia", "Italy", "Mexico", "Nicaragua", "Netherlands", "Singapore",
"Brazil", "Argentina", "Hungary", "Taiwan"]
for country in countries:
diff --git a/erpnext/setup/doctype/sales_person/sales_person.json b/erpnext/setup/doctype/sales_person/sales_person.json
index 7eeb500f2a9..73f7623ba04 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.json
+++ b/erpnext/setup/doctype/sales_person/sales_person.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -523,7 +524,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-12 16:41:06.378899",
+ "modified": "2019-01-30 11:28:16.966735",
"modified_by": "Administrator",
"module": "Setup",
"name": "Sales Person",
diff --git a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
index 42528d8832f..3d0b2ff7f8d 100644
--- a/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
+++ b/erpnext/setup/doctype/sales_person/sales_person_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html
index 57fce28eeb7..5808ce73ee9 100644
--- a/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html
+++ b/erpnext/setup/page/welcome_to_erpnext/welcome_to_erpnext.html
@@ -22,7 +22,7 @@
diff --git a/erpnext/setup/setup_wizard/data/industry_type.py b/erpnext/setup/setup_wizard/data/industry_type.py
index 74a10ff56a3..4fa9f8abb16 100644
--- a/erpnext/setup/setup_wizard/data/industry_type.py
+++ b/erpnext/setup/setup_wizard/data/industry_type.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_industry_types():
diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py
index c732c4b4799..6009bccb4dc 100644
--- a/erpnext/setup/setup_wizard/operations/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py
@@ -263,10 +263,13 @@ def install(country=None):
def set_more_defaults():
# Do more setup stuff that can be done here with no dependencies
-
- # set default customer group and territory
selling_settings = frappe.get_doc("Selling Settings")
selling_settings.set_default_customer_group_and_territory()
+ selling_settings.cust_master_name = "Customer Name"
+ selling_settings.so_required = "No"
+ selling_settings.dn_required = "No"
+ selling_settings.allow_multiple_items = 1
+ selling_settings.sales_update_frequency = "Each Transaction"
selling_settings.save()
add_uom_data()
@@ -276,14 +279,6 @@ def set_more_defaults():
doc.set_default_fields()
doc.save()
- selling_settings = frappe.get_doc("Selling Settings")
- selling_settings.cust_master_name = "Customer Name"
- selling_settings.so_required = "No"
- selling_settings.dn_required = "No"
- selling_settings.allow_multiple_items = 1
- selling_settings.sales_update_frequency = "Each Transaction"
- selling_settings.save()
-
buying_settings = frappe.get_doc("Buying Settings")
buying_settings.supp_master_name = "Supplier Name"
buying_settings.po_required = "No"
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index e062e280b9d..b293f5d9201 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -6,7 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
-from .operations import install_fixtures as fixtures, company_setup, taxes_setup, sample_data
+from .operations import install_fixtures as fixtures, company_setup, sample_data
def get_setup_stages(args=None):
if frappe.db.sql("select name from tabCompany"):
@@ -37,18 +37,13 @@ def get_setup_stages(args=None):
]
},
{
- 'status': _('Setting up company and taxes'),
+ 'status': _('Setting up company'),
'fail_msg': _('Failed to setup company'),
'tasks': [
{
'fn': setup_company,
'args': args,
'fail_msg': _("Failed to setup company")
- },
- {
- 'fn': setup_taxes,
- 'args': args,
- 'fail_msg': _("Failed to setup taxes")
}
]
},
@@ -94,9 +89,6 @@ def stage_fixtures(args):
def setup_company(args):
fixtures.install_company(args)
-def setup_taxes(args):
- taxes_setup.create_sales_tax(args)
-
def setup_post_company_fixtures(args):
fixtures.install_post_company_fixtures(args)
@@ -132,7 +124,6 @@ def login_as_first_user(args):
def setup_complete(args=None):
stage_fixtures(args)
setup_company(args)
- setup_taxes(args)
setup_post_company_fixtures(args)
setup_defaults(args)
stage_four(args)
diff --git a/erpnext/setup/setup_wizard/utils.py b/erpnext/setup/setup_wizard/utils.py
index d821a129899..e82bc96d937 100644
--- a/erpnext/setup/setup_wizard/utils.py
+++ b/erpnext/setup/setup_wizard/utils.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import json, os
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 0216c3ba69a..01e0b7d441a 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -109,6 +109,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
cache.setex(key, value, 6 * 60 * 60)
return flt(value)
except:
+ frappe.log_error(title="Get Exchange Rate")
frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date))
return 0.0
diff --git a/erpnext/stock/dashboard/item_dashboard.py b/erpnext/stock/dashboard/item_dashboard.py
index f95daafd384..6242fa767ef 100644
--- a/erpnext/stock/dashboard/item_dashboard.py
+++ b/erpnext/stock/dashboard/item_dashboard.py
@@ -1,43 +1,43 @@
from __future__ import unicode_literals
import frappe
+from frappe.model.db_query import DatabaseQuery
@frappe.whitelist()
def get_data(item_code=None, warehouse=None, item_group=None,
start=0, sort_by='actual_qty', sort_order='desc'):
'''Return data to render the item dashboard'''
- conditions = []
- values = []
+ filters = []
if item_code:
- conditions.append('b.item_code=%s')
- values.append(item_code)
+ filters.append(['item_code', '=', item_code])
if warehouse:
- conditions.append('b.warehouse=%s')
- values.append(warehouse)
+ filters.append(['warehouse', '=', warehouse])
if item_group:
- conditions.append('i.item_group=%s')
- values.append(item_group)
+ lft, rgt = frappe.db.get_value("Item Group", item_group, ["lft", "rgt"])
+ items = frappe.db.sql_list("""
+ select i.name from `tabItem` i
+ where exists(select name from `tabItem Group`
+ where name=i.item_group and lft >=%s and rgt<=%s)
+ """, (lft, rgt))
+ filters.append(['item_code', 'in', items])
+ try:
+ # check if user has any restrictions based on user permissions on warehouse
+ if DatabaseQuery('Warehouse', user=frappe.session.user).build_match_conditions():
+ filters.append(['warehouse', 'in', [w.name for w in frappe.get_list('Warehouse')]])
+ except frappe.PermissionError:
+ # user does not have access on warehouse
+ return []
- if conditions:
- conditions = ' and ' + ' and '.join(conditions)
- else:
- conditions = ''
-
- return frappe.db.sql('''
- select
- b.item_code, b.warehouse, b.projected_qty, b.reserved_qty,
- b.reserved_qty_for_production, b.reserved_qty_for_sub_contract, b.actual_qty, b.valuation_rate, i.item_name
- from
- tabBin b, tabItem i
- where
- b.item_code = i.name
- and
- (b.projected_qty != 0 or b.reserved_qty != 0 or b.reserved_qty_for_production != 0
- or b.reserved_qty_for_sub_contract != 0 or b.actual_qty != 0)
- {conditions}
- order by
- {sort_by} {sort_order}
- limit
- {start}, 21
- '''.format(conditions=conditions, sort_by=sort_by, sort_order=sort_order,
- start=start), values, as_dict=True)
+ return frappe.db.get_all('Bin', fields=['item_code', 'warehouse', 'projected_qty',
+ 'reserved_qty', 'reserved_qty_for_production', 'reserved_qty_for_sub_contract', 'actual_qty', 'valuation_rate'],
+ or_filters={
+ 'projected_qty': ['!=', 0],
+ 'reserved_qty': ['!=', 0],
+ 'reserved_qty_for_production': ['!=', 0],
+ 'reserved_qty_for_sub_contract': ['!=', 0],
+ 'actual_qty': ['!=', 0],
+ },
+ filters=filters,
+ order_by=sort_by + ' ' + sort_order,
+ limit_start=start,
+ limit_page_length='21')
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
index 63c32a4b93a..beeb9ebb05d 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index 9fe741a11e2..1e73d68fef7 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -793,7 +793,7 @@
"no_copy": 0,
"options": "currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -928,7 +928,7 @@
"no_copy": 0,
"options": "Company:company:default_currency",
"permlevel": 0,
- "precision": "2",
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -2310,7 +2310,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2019-01-07 16:51:53.322875",
+ "modified": "2019-02-18 18:58:51.342901",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 81997edfb4e..58c907793a7 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -38,6 +38,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-flag",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -70,6 +71,7 @@
"no_copy": 0,
"options": "STO-ITEM-.YYYY.-",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -104,6 +106,7 @@
"oldfieldname": "item_code",
"oldfieldtype": "Data",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -172,6 +175,7 @@
"oldfieldname": "item_name",
"oldfieldtype": "Data",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -183,37 +187,6 @@
"translatable": 0,
"unique": 0
},
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "barcode",
- "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": "Barcode",
- "length": 0,
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@@ -238,6 +211,7 @@
"oldfieldtype": "Link",
"options": "Item Group",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -305,6 +279,7 @@
"oldfieldtype": "Link",
"options": "UOM",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -335,6 +310,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -435,6 +411,7 @@
"oldfieldtype": "Select",
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -701,6 +678,7 @@
"oldfieldname": "tolerance",
"oldfieldtype": "Currency",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -800,6 +778,7 @@
"oldfieldtype": "Link",
"options": "Brand",
"permlevel": 0,
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -833,6 +812,7 @@
"oldfieldname": "description",
"oldfieldtype": "Text",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -933,6 +913,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-truck",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1000,6 +981,7 @@
"oldfieldname": "end_of_life",
"oldfieldtype": "Date",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1067,6 +1049,7 @@
"no_copy": 0,
"options": "\nFIFO\nMoving Average",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1099,6 +1082,7 @@
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1134,6 +1118,7 @@
"oldfieldname": "warranty_period",
"oldfieldtype": "Data",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1167,6 +1152,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1200,6 +1186,7 @@
"no_copy": 0,
"options": "UOM",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1234,6 +1221,7 @@
"no_copy": 0,
"options": "fa fa-rss",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1268,6 +1256,7 @@
"no_copy": 0,
"options": "Item Reorder",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1337,6 +1326,7 @@
"oldfieldtype": "Table",
"options": "UOM Conversion Detail",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1407,6 +1397,7 @@
"oldfieldtype": "Select",
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1643,6 +1634,7 @@
"oldfieldtype": "Select",
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1676,6 +1668,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -1913,6 +1906,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-shopping-cart",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2015,6 +2009,7 @@
"oldfieldname": "min_order_qty",
"oldfieldtype": "Currency",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2114,6 +2109,7 @@
"oldfieldname": "lead_time_days",
"oldfieldtype": "Int",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2148,6 +2144,7 @@
"oldfieldname": "last_purchase_rate",
"oldfieldtype": "Currency",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -2246,6 +2243,7 @@
"no_copy": 0,
"options": "Manufacturer",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2278,6 +2276,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2311,6 +2310,7 @@
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2345,6 +2345,7 @@
"no_copy": 0,
"options": "Item Supplier",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2507,6 +2508,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-tag",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2606,6 +2608,7 @@
"no_copy": 0,
"oldfieldtype": "Column Break",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -2641,6 +2644,7 @@
"oldfieldname": "max_discount",
"oldfieldtype": "Currency",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3031,6 +3035,7 @@
"no_copy": 0,
"options": "Item Customer Detail",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3064,6 +3069,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-money",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3099,6 +3105,7 @@
"oldfieldtype": "Table",
"options": "Item Tax",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3132,6 +3139,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-search",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3167,6 +3175,7 @@
"oldfieldtype": "Select",
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3267,6 +3276,7 @@
"oldfieldtype": "Section Break",
"options": "fa fa-cogs",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3302,6 +3312,7 @@
"oldfieldtype": "Link",
"options": "BOM",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
@@ -3338,6 +3349,7 @@
"oldfieldtype": "Select",
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3400,6 +3412,7 @@
"length": 0,
"no_copy": 1,
"permlevel": 0,
+ "precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3432,6 +3445,7 @@
"no_copy": 0,
"options": "fa fa-globe",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3464,6 +3478,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3563,6 +3578,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3597,6 +3613,7 @@
"no_copy": 0,
"options": "Website Slideshow",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3631,6 +3648,7 @@
"no_copy": 0,
"options": "",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3693,6 +3711,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3727,6 +3746,7 @@
"no_copy": 0,
"options": "Warehouse",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3761,6 +3781,7 @@
"no_copy": 0,
"options": "Website Item Group",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3794,6 +3815,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3826,6 +3848,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3859,6 +3882,7 @@
"no_copy": 0,
"options": "Item Website Specification",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -3891,6 +3915,7 @@
"length": 0,
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -4114,10 +4139,11 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2019-01-07 16:52:05.096907",
+ "modified": "2019-02-16 17:43:56.039611",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
+ "name_case": "",
"owner": "Administrator",
"permissions": [
{
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 566b6386fec..bd06688caa2 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -700,15 +700,14 @@ class Item(WebsiteGenerator):
frappe.db.get_single_value('Item Variant Settings', 'do_not_update_variants'):
return
if self.has_variants:
- updated = []
variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name})
- for d in variants:
- variant = frappe.get_doc("Item", d)
- copy_attributes_to_variant(self, variant)
- variant.save()
- updated.append(d.item_code)
- if updated:
- frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
+ if variants:
+ if len(variants) <= 30:
+ update_variants(variants, self, publish_progress=False)
+ frappe.msgprint(_("Item Variants updated"))
+ else:
+ frappe.enqueue("erpnext.stock.doctype.item.item.update_variants",
+ variants=variants, template=self, now=frappe.flags.in_test, timeout=600)
def validate_has_variants(self):
if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"):
@@ -997,3 +996,13 @@ def get_item_attribute(parent, attribute_value=''):
return frappe.get_all("Item Attribute Value", fields = ["attribute_value"],
filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)})
+
+def update_variants(variants, template, publish_progress=True):
+ count=0
+ for d in variants:
+ variant = frappe.get_doc("Item", d)
+ copy_attributes_to_variant(template, variant)
+ variant.save()
+ count+=1
+ if publish_progress:
+ frappe.publish_progress(count*100/len(variants), title = _("Updating Variants..."))
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item_dashboard.py b/erpnext/stock/doctype/item/item_dashboard.py
index c571355cad7..8e4f74ddbb9 100644
--- a/erpnext/stock/doctype/item/item_dashboard.py
+++ b/erpnext/stock/doctype/item/item_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/stock/doctype/item_attribute/test_item_attribute.py b/erpnext/stock/doctype/item_attribute/test_item_attribute.py
index 6357b525697..61e53d24a46 100644
--- a/erpnext/stock/doctype/item_attribute/test_item_attribute.py
+++ b/erpnext/stock/doctype/item_attribute/test_item_attribute.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
+from __future__ import unicode_literals
import frappe
import unittest
diff --git a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py
index 678de1a9ba7..04224424a5e 100644
--- a/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py
+++ b/erpnext/stock/doctype/item_variant_settings/item_variant_settings.py
@@ -5,14 +5,17 @@
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
+from frappe import _
class ItemVariantSettings(Document):
+ invalid_fields_for_copy_fields_in_variants = ['barcodes']
+
def set_default_fields(self):
self.fields = []
fields = frappe.get_meta('Item').fields
exclude_fields = ["naming_series", "item_code", "item_name", "show_in_website",
"show_variant_in_website", "standard_rate", "opening_stock", "image", "description",
- "variant_of", "valuation_rate", "description",
+ "variant_of", "valuation_rate", "description", "barcodes",
"website_image", "thumbnail", "website_specifiations", "web_long_description"]
for d in fields:
@@ -20,4 +23,14 @@ class ItemVariantSettings(Document):
d.fieldtype not in ['HTML', 'Section Break', 'Column Break', 'Button', 'Read Only']:
self.append('fields', {
'field_name': d.fieldname
- })
\ No newline at end of file
+ })
+
+ def remove_invalid_fields_for_copy_fields_in_variants(self):
+ fields = [row for row in self.fields if row.field_name not in self.invalid_fields_for_copy_fields_in_variants]
+ self.fields = fields
+ self.save()
+
+ def validate(self):
+ for d in self.fields:
+ if d.field_name in self.invalid_fields_for_copy_fields_in_variants:
+ frappe.throw(_('Cannot set the field {0} for copying in variants').format(d.field_name))
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index f3e3abfde20..47d61f847f1 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -81,9 +81,9 @@ class MaterialRequest(BuyingController):
def set_title(self):
'''Set title as comma separated list of items'''
- items = ', '.join([d.item_name for d in self.items][:4])
-
- self.title = _('{0} for {1}'.format(self.material_request_type, items))[:100]
+ if not self.title:
+ items = ', '.join([d.item_name for d in self.items][:3])
+ self.title = _('{0} Request for {1}').format(self.material_request_type, items)[:100]
def on_submit(self):
# frappe.db.set(self, 'status', 'Submitted')
diff --git a/erpnext/stock/doctype/material_request/material_request_dashboard.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py
index 6cfb8af0a29..adfab86cc4c 100644
--- a/erpnext/stock/doctype/material_request/material_request_dashboard.py
+++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
index a517703c9ad..3832c827e27 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
from frappe import _
def get_data():
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index a4eb2bb15dd..472083b5a11 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -1,8 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
-
-
+from __future__ import unicode_literals
import unittest
import frappe, erpnext
import frappe.defaults
@@ -352,7 +351,7 @@ class TestPurchaseReceipt(unittest.TestCase):
set_perpetual_inventory(1, "_Test Company")
pr = make_purchase_receipt(cost_center=cost_center)
-
+
stock_in_hand_account = get_inventory_account(pr.company, pr.get("items")[0].warehouse)
gl_entries = get_gl_entries("Purchase Receipt", pr.name)
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index 3746dfb2235..528f799aa70 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -417,7 +417,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Recd Quantity",
+ "label": "Received Quantity",
"length": 0,
"no_copy": 0,
"oldfieldname": "received_qty",
@@ -2608,7 +2608,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2019-01-07 16:51:59.002215",
+ "modified": "2019-02-18 16:04:36.138776",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",
diff --git a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
index 0f0b4016e26..bb535c1f6a0 100644
--- a/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
+++ b/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
+from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 5d3c6c4adcc..3a5253019af 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -293,8 +293,9 @@ class StockEntry(StockController):
total_completed_qty = flt(self.fg_completed_qty) + flt(prod_order.produced_qty)
completed_qty = d.completed_qty + (allowance_percentage/100 * d.completed_qty)
if total_completed_qty > flt(completed_qty):
- frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Work Order # {3}. Please update operation status via Time Logs")
- .format(d.idx, d.operation, total_completed_qty, self.work_order), OperationsNotCompleteError)
+ job_card = frappe.db.get_value('Job Card', {'operation_id': d.name}, 'name')
+ frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Work Order # {3}. Please update operation status via Job Card # {4}")
+ .format(d.idx, d.operation, total_completed_qty, self.work_order, job_card), OperationsNotCompleteError)
def check_duplicate_entry_for_work_order(self):
other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", {
@@ -914,6 +915,11 @@ class StockEntry(StockController):
filters={'parent': self.work_order, 'item_code': item_code},
fields=["required_qty", "consumed_qty"]
)
+ if not req_items:
+ frappe.msgprint(_("Did not found transfered item {0} in Work Order {1}, the item not added in Stock Entry")
+ .format(item_code, self.work_order))
+ continue
+
req_qty = flt(req_items[0].required_qty)
req_qty_each = flt(req_qty / manufacturing_qty)
consumed_qty = flt(req_items[0].consumed_qty)
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
index 6b4ca18191f..7a3433819d2 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_utils.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
+from __future__ import unicode_literals
import frappe, erpnext
from frappe.utils import cint, flt
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index eb60ce56e91..a00d279f973 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -259,6 +259,7 @@ class StockReconciliation(StockController):
def submit(self):
if len(self.items) > 100:
+ msgprint(_("The task has been enqueued as a background job. In case there is any issue on processing in background, the system will add a comment about the error on this Stock Reconciliation and revert to the Draft stage"))
self.queue_action('submit')
else:
self._submit()
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index ef63740650f..da97bc61a90 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -157,6 +157,8 @@ def get_children(doctype, parent=None, company=None, is_root=False):
# return warehouses
for wh in warehouses:
wh["balance"] = get_stock_value_from_bin(warehouse=wh.value)
+ if company:
+ wh["company_currency"] = frappe.db.get_value('Company', company, 'default_currency')
return warehouses
@frappe.whitelist()
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 9db04cd0ab4..74f35953e2a 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -16,6 +16,9 @@ from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
from six import string_types, iteritems
+sales_doctypes = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']
+purchase_doctypes = ['Material Request', 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice']
+
@frappe.whitelist()
def get_item_details(args):
"""
@@ -228,7 +231,7 @@ def get_basic_details(args, item):
#Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master
if not args.uom:
- if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']:
+ if args.get('doctype') in sales_doctypes:
args.uom = item.sales_uom if item.sales_uom else item.stock_uom
elif (args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']) or \
(args.get('doctype') == 'Material Request' and args.get('material_request_type') == 'Purchase'):
@@ -281,14 +284,15 @@ def get_basic_details(args, item):
out.conversion_factor = 1.0
else:
out.conversion_factor = args.conversion_factor or \
- get_conversion_factor(item.item_code, args.uom).get("conversion_factor")
+ get_conversion_factor(item.name, args.uom).get("conversion_factor")
args.conversion_factor = out.conversion_factor
out.stock_qty = out.qty * out.conversion_factor
# calculate last purchase rate
- from erpnext.buying.doctype.purchase_order.purchase_order import item_last_purchase_rate
- out.last_purchase_rate = item_last_purchase_rate(args.name, args.conversion_rate, item.item_code, out.conversion_factor)
+ if args.get('doctype') in purchase_doctypes:
+ from erpnext.buying.doctype.purchase_order.purchase_order import item_last_purchase_rate
+ out.last_purchase_rate = item_last_purchase_rate(args.name, args.conversion_rate, item.name, out.conversion_factor)
# if default specified in item is for another company, fetch from company
for d in [
@@ -424,7 +428,7 @@ def insert_item_price(args):
frappe.msgprint(_("Item Price added for {0} in Price List {1}").format(args.item_code,
args.price_list), alert=True)
-def get_item_price(args, item_code):
+def get_item_price(args, item_code, ignore_party=False):
"""
Get name, price_list_rate from Item Price based on conditions
Check if the Derised qty is within the increment of the packing list.
@@ -434,17 +438,19 @@ def get_item_price(args, item_code):
"""
args['item_code'] = item_code
- conditions = "where (customer is null or customer = '') and (supplier is null or supplier = '')"
- if args.get("customer"):
- conditions = "where customer=%(customer)s"
- if args.get("supplier"):
- conditions = "where supplier=%(supplier)s"
-
- conditions += """ and item_code=%(item_code)s
+ conditions = """where item_code=%(item_code)s
and price_list=%(price_list)s
and ifnull(uom, '') in ('', %(uom)s)"""
+ if not ignore_party:
+ if args.get("customer"):
+ conditions += " and customer=%(customer)s"
+ elif args.get("supplier"):
+ conditions += " and supplier=%(supplier)s"
+ else:
+ conditions += " and (customer is null or customer = '') and (supplier is null or supplier = '')"
+
if args.get('min_qty'):
conditions += " and ifnull(min_qty, 0) <= %(min_qty)s"
@@ -490,10 +496,10 @@ def get_price_list_rate_for(args, item_code):
for field in ["customer", "supplier", "min_qty"]:
del item_price_args[field]
- general_price_list_rate = get_item_price(item_price_args, item_code)
+ general_price_list_rate = get_item_price(item_price_args, item_code, ignore_party=args.get("ignore_party"))
if not general_price_list_rate and args.get("uom") != args.get("stock_uom"):
item_price_args["args"] = args.get("stock_uom")
- general_price_list_rate = get_item_price(item_price_args, item_code)
+ general_price_list_rate = get_item_price(item_price_args, item_code, ignore_party=args.get("ignore_party"))
if general_price_list_rate:
item_price_data = general_price_list_rate
diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py
index 1578bb68ce7..39fb0240236 100644
--- a/erpnext/stock/reorder_item.py
+++ b/erpnext/stock/reorder_item.py
@@ -1,6 +1,7 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
+from __future__ import unicode_literals
import frappe
import erpnext
from frappe.utils import flt, nowdate, add_days, cint
@@ -138,7 +139,7 @@ def create_material_request(material_requests):
if request_type == 'Purchase':
uom = item.purchase_uom or item.stock_uom
if uom != item.stock_uom:
- conversion_factor = frappe.db.get_value("UOM Conversion Detail",
+ conversion_factor = frappe.db.get_value("UOM Conversion Detail",
{'parent': item.name, 'uom': uom}, 'conversion_factor') or 1.0
mr.append("items", {
diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.json b/erpnext/stock/report/stock_analytics/stock_analytics.json
index efd5e99cbcc..7a2ed2bfc20 100644
--- a/erpnext/stock/report/stock_analytics/stock_analytics.json
+++ b/erpnext/stock/report/stock_analytics/stock_analytics.json
@@ -1,12 +1,13 @@
{
- "add_total_row": 0,
+ "add_total_row": 1,
"creation": "2018-10-08 12:11:32.133020",
+ "disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
- "modified": "2018-10-08 12:18:42.834270",
+ "modified": "2019-02-12 14:32:22.874082",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Analytics",
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index e72e94b12de..0ece78f2567 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -173,15 +173,15 @@ def get_item_warehouse_map(filters, sle):
qty_dict.val_rate = d.valuation_rate
qty_dict.bal_qty += qty_diff
qty_dict.bal_val += value_diff
-
+
iwb_map = filter_items_with_no_transactions(iwb_map)
return iwb_map
-
+
def filter_items_with_no_transactions(iwb_map):
for (company, item, warehouse) in sorted(iwb_map):
qty_dict = iwb_map[(company, item, warehouse)]
-
+
no_transactions = True
float_precision = cint(frappe.db.get_default("float_precision")) or 3
for key, val in iteritems(qty_dict):
@@ -189,7 +189,7 @@ def filter_items_with_no_transactions(iwb_map):
qty_dict[key] = val
if key != "val_rate" and val:
no_transactions = False
-
+
if no_transactions:
iwb_map.pop((company, item, warehouse))
@@ -216,20 +216,28 @@ def get_item_details(items, sle, filters):
if not items:
items = list(set([d.item_code for d in sle]))
- if items:
- cf_field = cf_join = ""
- if filters.get("include_uom"):
- cf_field = ", ucd.conversion_factor"
- cf_join = "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom=%(include_uom)s"
+ if not items:
+ return item_details
- for item in frappe.db.sql("""
- select item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom{cf_field}
- from `tabItem` item
+ cf_field = cf_join = ""
+ if filters.get("include_uom"):
+ cf_field = ", ucd.conversion_factor"
+ cf_join = "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom='%s'" \
+ % frappe.db.escape(filters.get("include_uom"))
+
+ item_codes = ', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])
+ res = frappe.db.sql("""
+ select
+ item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom {cf_field}
+ from
+ `tabItem` item
{cf_join}
- where item.name in ({names}) and ifnull(item.disabled, 0) = 0
- """.format(cf_field=cf_field, cf_join=cf_join, names=', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])),
- {"include_uom": filters.get("include_uom")}, as_dict=1):
- item_details.setdefault(item.name, item)
+ where
+ item.name in ({item_codes}) and ifnull(item.disabled, 0) = 0
+ """.format(cf_field=cf_field, cf_join=cf_join, item_codes=item_codes), as_dict=1)
+
+ for item in res:
+ item_details.setdefault(item.name, item)
if filters.get('show_variant_attributes', 0) == 1:
variant_values = get_variant_values_for(list(item_details))
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index 578000bfa1f..ef9fbe41c02 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -110,16 +110,22 @@ def get_item_details(items, sl_entries, include_uom):
cf_field = cf_join = ""
if include_uom:
cf_field = ", ucd.conversion_factor"
- cf_join = "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom=%(include_uom)s"
+ cf_join = "left join `tabUOM Conversion Detail` ucd on ucd.parent=item.name and ucd.uom='%s'" \
+ % frappe.db.escape(include_uom)
- for item in frappe.db.sql("""
- select item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom{cf_field}
- from `tabItem` item
- {cf_join}
- where item.name in ({names})
- """.format(cf_field=cf_field, cf_join=cf_join, names=', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])),
- {"include_uom": include_uom}, as_dict=1):
- item_details.setdefault(item.name, item)
+ item_codes = ', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in items])
+ res = frappe.db.sql("""
+ select
+ item.name, item.item_name, item.description, item.item_group, item.brand, item.stock_uom {cf_field}
+ from
+ `tabItem` item
+ {cf_join}
+ where
+ item.name in ({item_codes})
+ """.format(cf_field=cf_field, cf_join=cf_join, item_codes=item_codes), as_dict=1)
+
+ for item in res:
+ item_details.setdefault(item.name, item)
return item_details
diff --git a/erpnext/templates/includes/cart/cart_items.html b/erpnext/templates/includes/cart/cart_items.html
index b2e68585a70..65b81d93209 100644
--- a/erpnext/templates/includes/cart/cart_items.html
+++ b/erpnext/templates/includes/cart/cart_items.html
@@ -21,12 +21,11 @@
+
-
+
{{ d.get_formatted("amount") }}
-
{{
- _("Rate: {0}").format(d.get_formatted("rate")) }}
+
{{ _("Rate") }} {{ d.get_formatted("rate") }}
{% endfor %}
\ No newline at end of file
diff --git a/erpnext/templates/pages/non_profit/join-chapter.html b/erpnext/templates/pages/non_profit/join-chapter.html
index 029cd770081..89a7d2aace8 100644
--- a/erpnext/templates/pages/non_profit/join-chapter.html
+++ b/erpnext/templates/pages/non_profit/join-chapter.html
@@ -15,7 +15,7 @@
{{ chapter_button() }}
Leave Chapter
{% else %}
- {% if frappe.local.request.method=='POST' %}
+ {% if request.method=='POST' %}
Welcome to chapter {{ chapter.name }}!
{{ chapter_button() }}
{% else %}
diff --git a/erpnext/templates/pages/non_profit/join_chapter.py b/erpnext/templates/pages/non_profit/join_chapter.py
index 121f4440ebd..aa54a58eeb1 100644
--- a/erpnext/templates/pages/non_profit/join_chapter.py
+++ b/erpnext/templates/pages/non_profit/join_chapter.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def get_context(context):
diff --git a/erpnext/templates/pages/non_profit/leave_chapter.py b/erpnext/templates/pages/non_profit/leave_chapter.py
index da2d819eb70..21cb722b884 100644
--- a/erpnext/templates/pages/non_profit/leave_chapter.py
+++ b/erpnext/templates/pages/non_profit/leave_chapter.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
import frappe
def get_context(context):
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index 74c9da0012c..64fd32a992a 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -73,14 +73,12 @@
{{ d.qty }}
{% if d.delivered_qty is defined and d.delivered_qty != None %}
-
{{
- _("Delivered: {0}").format(d.delivered_qty) }}
+
{{ _("Delivered") }} {{ d.delivered_qty }}
{% endif %}
{{ d.get_formatted("amount") }}
-
{{
- _("@ {0}").format(d.get_formatted("rate")) }}
+
{{ _("Rate:") }} {{ d.get_formatted("rate") }}
{% endfor %}
diff --git a/erpnext/templates/pages/product_search.html b/erpnext/templates/pages/product_search.html
index d5a56b2cac8..f9efd485d32 100644
--- a/erpnext/templates/pages/product_search.html
+++ b/erpnext/templates/pages/product_search.html
@@ -10,7 +10,7 @@