Resolve merge conflicts from enterprise_sprint branch
diff --git a/.travis.yml b/.travis.yml
index b74289f..70df757 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,7 @@
- pip install flake8==3.3.0
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
- sudo rm /etc/apt/sources.list.d/docker.list
+ - sudo apt-get install hhvm && rm -rf /home/travis/.kiex/
- sudo apt-get purge -y mysql-common mysql-server mysql-client
- nvm install v7.10.0
- wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
@@ -34,6 +35,7 @@
- bench reinstall --yes
- bench build
- bench scheduler disable
+ - sed -i 's/9000/9001/g' sites/common_site_config.json
- bench start &
- sleep 10
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 8a247cc..a20b21a 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
-__version__ = '10.1.27'
+__version__ = '10.1.31'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
index 6e16371..161e52a 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts.py
@@ -24,7 +24,8 @@
"account_type": "Cash"
},
_("Loans and Advances (Assets)"): {
- "is_group": 1
+ _("Employee Advances"): {
+ },
},
_("Securities and Deposits"): {
_("Earnest Money"): {}
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py
index 5ed3e45..6c83e3b 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/verified/standard_chart_of_accounts_with_account_number.py
@@ -29,7 +29,9 @@
"account_number": "1100"
},
_("Loans and Advances (Assets)"): {
- "is_group": 1,
+ _("Employee Advances"): {
+ "account_number": "1610"
+ },
"account_number": "1600"
},
_("Securities and Deposits"): {
diff --git a/erpnext/accounts/doctype/bank/__init__.py b/erpnext/accounts/doctype/bank/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/__init__.py
diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js
new file mode 100644
index 0000000..1063a07
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/bank.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Bank', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/accounts/doctype/bank/bank.json b/erpnext/accounts/doctype/bank/bank.json
new file mode 100644
index 0000000..0a24726
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/bank.json
@@ -0,0 +1,94 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:bank_name",
+ "beta": 0,
+ "creation": "2018-04-07 16:59:59.496668",
+ "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": "bank_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": "Bank 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
+ }
+ ],
+ "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": "2018-04-07 17:00:21.246202",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank",
+ "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,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/bank/bank.py b/erpnext/accounts/doctype/bank/bank.py
new file mode 100644
index 0000000..b205d56
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/bank.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class Bank(Document):
+ pass
diff --git a/erpnext/accounts/doctype/bank/test_bank.js b/erpnext/accounts/doctype/bank/test_bank.js
new file mode 100644
index 0000000..9ec2644
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/test_bank.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Bank", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Bank
+ () => frappe.tests.make('Bank', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/bank/test_bank.py b/erpnext/accounts/doctype/bank/test_bank.py
new file mode 100644
index 0000000..d8741f2
--- /dev/null
+++ b/erpnext/accounts/doctype/bank/test_bank.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestBank(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
index 0439b73..f7ffc6c 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.js
@@ -2,7 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on('Bank Guarantee', {
- refresh: function(frm) {
+ setup: function(frm) {
cur_frm.set_query("account", function() {
return {
"filters": {
@@ -19,6 +19,39 @@
};
});
},
+
+ bg_type: function(frm) {
+ if (frm.doc.bg_type == "Receiving") {
+ frm.set_value("reference_doctype", "Sales Order");
+ } else if (frm.doc.bg_type == "Providing") {
+ frm.set_value("reference_doctype", "Purchase Order");
+ }
+ },
+
+ reference_docname: function(frm) {
+ if (frm.doc.reference_docname && frm.doc.reference_doctype) {
+ let fields_to_fetch = ["project", "grand_total"];
+ let party_field = frm.doc.reference_doctype == "Sales Order" ? "customer" : "supplier";
+ fields_to_fetch.push(party_field);
+ frappe.call({
+ method: "erpnext.accounts.doctype.bank_guarantee.bank_guarantee.get_vouchar_detials",
+ args: {
+ "column_list": fields_to_fetch,
+ "doctype": frm.doc.reference_doctype,
+ "docname": frm.doc.reference_docname
+ },
+ callback: function(r) {
+ if (r.message) {
+ if (r.message[party_field]) frm.set_value(party_field, r.message[party_field]);
+ if (r.message.project) frm.set_value("project", r.message.project);
+ if (r.message.grand_total) frm.set_value("amount", r.message.grand_total);
+ }
+ }
+ });
+
+ }
+ },
+
start_date: function(frm) {
var end_date = frappe.datetime.add_days(cur_frm.doc.start_date, cur_frm.doc.validity - 1);
cur_frm.set_value("end_date", end_date);
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
index 807c544..b3cd157 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.json
@@ -19,6 +19,103 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "bg_type",
+ "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": "Bank Guarantee Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nReceiving\nProviding",
+ "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": "reference_doctype",
+ "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": "Reference Document Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "DocType",
+ "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,
+ "fieldname": "reference_docname",
+ "fieldtype": "Dynamic 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": "Reference Document Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "reference_doctype",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.bg_type == \"Receiving\"",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -39,9 +136,43 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "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,
+ "depends_on": "eval: doc.bg_type == \"Providing\"",
+ "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,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +204,37 @@
"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,
+ "fieldname": "column_break_6",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -101,9 +263,10 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,35 +297,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_6",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -193,6 +328,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -221,9 +357,10 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -251,9 +388,103 @@
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "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,
+ "fieldname": "section_break_14",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "more_information",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Clauses and Conditions",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "margin_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": "Other Details",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -281,19 +512,20 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 1
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 1,
+ "collapsible": 0,
"columns": 0,
- "fieldname": "section_break_10",
- "fieldtype": "Section Break",
+ "fieldname": "name_of_beneficiary",
+ "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -301,7 +533,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "More Information",
+ "label": "Name of Beneficiary",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -314,6 +546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -322,8 +555,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "more_information",
- "fieldtype": "Text Editor",
+ "fieldname": "name_of_bank",
+ "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -331,7 +564,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Notes",
+ "label": "Name of Bank",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -344,6 +577,133 @@
"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,
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "margin_money",
+ "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": "Margin Money",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "",
+ "fieldname": "charges",
+ "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": "Charges Incurred",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "fixed_deposit_number",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Fixed Deposit Number",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -374,6 +734,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -387,7 +748,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-04-25 13:31:49.627831",
+ "modified": "2018-05-08 06:27:08.959864",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Bank Guarantee",
@@ -396,7 +757,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
@@ -416,7 +776,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
diff --git a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
index 71647b9..1a62c42 100644
--- a/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
+++ b/erpnext/accounts/doctype/bank_guarantee/bank_guarantee.py
@@ -3,8 +3,26 @@
# For license information, please see license.txt
from __future__ import unicode_literals
-import frappe
+import frappe, json
from frappe.model.document import Document
+from frappe import _
class BankGuarantee(Document):
- pass
+ def validate(self):
+ if not (self.customer or self.supplier):
+ frappe.throw(_("Select the customer or supplier."))
+
+ def on_submit(self):
+ if not self.bank_guarantee_number:
+ frappe.throw(_("Enter the Bank Guarantee Number before submittting."))
+ if not self.name_of_beneficiary:
+ frappe.throw(_("Enter the name of the Beneficiary before submittting."))
+ if not self.name_of_bank:
+ frappe.throw(_("Enter the name of the bank or lending institution before submittting."))
+
+@frappe.whitelist()
+def get_vouchar_detials(column_list, doctype, docname):
+ print (column_list, doctype, docname)
+ return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
+ .format(columns=", ".join(json.loads(column_list)), doctype=doctype), docname, as_dict=1)[0]
+
diff --git a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py b/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py
deleted file mode 100644
index 0e56991..0000000
--- a/erpnext/accounts/doctype/bank_guarantee/test_bank_guarantee.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-
-# test_records = frappe.get_test_records('Bank Guarantee')
-
-class TestBankGuarantee(unittest.TestCase):
- pass
diff --git a/erpnext/accounts/doctype/bank_statement_settings/__init__.py b/erpnext/accounts/doctype/bank_statement_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.js b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.js
new file mode 100644
index 0000000..46aa4f2
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, sathishpy@gmail.com and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Bank Statement Settings', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json
new file mode 100644
index 0000000..53fbf7d
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.json
@@ -0,0 +1,272 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "beta": 0,
+ "creation": "2017-11-13 13:38:10.863592",
+ "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": "bank",
+ "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": "Bank Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "'%d/%m/%Y'",
+ "fieldname": "date_format",
+ "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": "Date Format",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "statement_header_mapping",
+ "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": "Statement Header Mapping",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "header_items",
+ "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": "Statement Headers",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Settings Item",
+ "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,
+ "fieldname": "transaction_data_mapping",
+ "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": "Transaction Data Mapping",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "mapped_items",
+ "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": "Mapped Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Transaction Settings 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
+ }
+ ],
+ "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": "2018-04-07 18:57:04.048423",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Settings",
+ "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,
+ "write": 1
+ },
+ {
+ "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": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/bank_statement_settings/bank_statement_settings.py b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.py
new file mode 100644
index 0000000..6c4dd1b
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/bank_statement_settings.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementSettings(Document):
+ def autoname(self):
+ self.name = self.bank + "-Statement-Settings"
diff --git a/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.js b/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.js
new file mode 100644
index 0000000..f2381c0
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Bank Statement Settings", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Bank Statement Settings
+ () => frappe.tests.make('Bank Statement Settings', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.py b/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.py
new file mode 100644
index 0000000..aa7fe83
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings/test_bank_statement_settings.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestBankStatementSettings(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_settings_item/__init__.py b/erpnext/accounts/doctype/bank_statement_settings_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings_item/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.json b/erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.json
new file mode 100644
index 0000000..7c93f26
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.json
@@ -0,0 +1,101 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-01-08 00:16:42.762980",
+ "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": "mapped_header",
+ "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": "Mapped Header",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "stmt_header",
+ "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": "Bank Header",
+ "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
+ }
+ ],
+ "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": "2018-01-08 00:19:14.841134",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Settings Item",
+ "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/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.py b/erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.py
new file mode 100644
index 0000000..9438e9a
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementSettingsItem(Document):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/__init__.py b/erpnext/accounts/doctype/bank_statement_transaction_entry/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.js b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.js
new file mode 100644
index 0000000..d852935
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.js
@@ -0,0 +1,75 @@
+// Copyright (c) 2017, sathishpy@gmail.com and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Bank Statement Transaction Entry', {
+ setup: function(frm) {
+ frm.events.account_filters(frm)
+ frm.events.invoice_filter(frm)
+ },
+ refresh: function(frm) {
+ frm.set_df_property("bank_account", "read_only", frm.doc.__islocal ? 0 : 1);
+ frm.set_df_property("from_date", "read_only", frm.doc.__islocal ? 0 : 1);
+ frm.set_df_property("to_date", "read_only", frm.doc.__islocal ? 0 : 1);
+ },
+ invoke_doc_function(frm, method) {
+ frappe.call({
+ doc: frm.doc,
+ method: method,
+ callback: function(r) {
+ if(!r.exe) {
+ frm.refresh_fields();
+ }
+ }
+ });
+ },
+ account_filters: function(frm) {
+ frm.fields_dict['bank_account'].get_query = function(doc, dt, dn) {
+ return {
+ filters:[
+ ["Account", "account_type", "in", ["Bank"]]
+ ]
+ }
+ };
+ frm.fields_dict['receivable_account'].get_query = function(doc, dt, dn) {
+ return {
+ filters: {"account_type": "Receivable"}
+ }
+ };
+ frm.fields_dict['payable_account'].get_query = function(doc, dt, dn) {
+ return {
+ filters: {"account_type": "Payable"}
+ }
+ };
+ },
+
+ invoice_filter: function(frm) {
+ frm.set_query("invoice", "payment_invoice_items", function(doc, cdt, cdn) {
+ row = locals[cdt][cdn]
+ if (row.party_type == "Customer") {
+ return {
+ filters:[[row.invoice_type, "customer", "in", [row.party]],
+ [row.invoice_type, "status", "!=", "Cancelled" ],
+ [row.invoice_type, "posting_date", "<", row.transaction_date ],
+ [row.invoice_type, "outstanding_amount", ">", 0 ]]
+ }
+ } else if (row.party_type == "Supplier") {
+ return {
+ filters:[[row.invoice_type, "supplier", "in", [row.party]],
+ [row.invoice_type, "status", "!=", "Cancelled" ],
+ [row.invoice_type, "posting_date", "<", row.transaction_date ],
+ [row.invoice_type, "outstanding_amount", ">", 0 ]]
+ }
+ }
+ });
+ },
+
+ match_invoices: function(frm) {
+ frm.events.invoke_doc_function(frm, "populate_matching_invoices");
+ },
+ create_payments: function(frm) {
+ frm.events.invoke_doc_function(frm, "create_payment_entries");
+ },
+ submit_payments: function(frm) {
+ frm.events.invoke_doc_function(frm, "submit_payment_entries");
+ },
+});
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json
new file mode 100644
index 0000000..a7c56a1
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json
@@ -0,0 +1,768 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "beta": 0,
+ "creation": "2017-11-07 13:48:13.123185",
+ "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": "bank_account",
+ "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": "Bank Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 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": 0,
+ "label": "From 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_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": 1,
+ "in_standard_filter": 0,
+ "label": "To Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 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": "bank_settings",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Bank Statement Settings",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Settings",
+ "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,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "bank",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Bank",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "receivable_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Receivable Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "payable_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": "Payable Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "bank_statement",
+ "fieldtype": "Attach",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Bank Statement",
+ "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_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,
+ "label": "Bank Transaction Entries",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "new_transaction_items",
+ "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": "New Transactions",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Transaction Payment Item",
+ "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,
+ "fieldname": "section_break_9",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "match_invoices",
+ "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": "Match Transaction to Invoices",
+ "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_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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "create_payments",
+ "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": "Create New Payment/Journal Entry",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "submit_payments",
+ "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": "Submit/Reconcile Payments",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_18",
+ "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": "Matching Invoices",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "payment_invoice_items",
+ "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": "Payment Invoice Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Transaction Invoice 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reconciled_transactions",
+ "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": "Reconciled Transactions",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reconciled_transaction_items",
+ "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": "Reconciled Transactions",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Transaction Payment Item",
+ "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,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Amended From",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Bank Statement Transaction Entry",
+ "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-04-07 17:01:47.480572",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Transaction Entry",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "quick_entry": 0,
+ "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/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.py b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.py
new file mode 100644
index 0000000..45663df
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.py
@@ -0,0 +1,431 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from frappe.model.document import Document
+from erpnext.accounts.utils import get_outstanding_invoices
+from frappe.utils import nowdate
+from datetime import datetime
+import csv, os, re, io
+import difflib
+import copy
+
+class BankStatementTransactionEntry(Document):
+ def autoname(self):
+ self.name = self.bank_account + "-" + self.from_date + "-" + self.to_date
+ mapper_name = self.bank + "-Statement-Settings"
+ if not frappe.db.exists("Bank Statement Settings", mapper_name):
+ self.create_settings(self.bank)
+ self.bank_settings = mapper_name
+
+ def create_settings(self, bank):
+ mapper = frappe.new_doc("Bank Statement Settings")
+ mapper.bank = bank
+ mapper.date_format = "%Y-%m-%d"
+ for header in ["Date", "Particulars", "Withdrawals", "Deposits", "Balance"]:
+ header_item = mapper.append("header_items", {})
+ header_item.mapped_header = header_item.stmt_header = header
+ mapper.save()
+
+ def on_update(self):
+ if (not self.bank_statement):
+ self.reconciled_transaction_items = self.new_transaction_items = []
+ return
+
+ if len(self.new_transaction_items + self.reconciled_transaction_items) == 0:
+ self.populate_payment_entries()
+ else:
+ self.match_invoice_to_payment()
+
+ def get_statement_headers(self):
+ if not self.bank_settings:
+ frappe.throw("Bank Data mapper doesn't exist")
+ mapper_doc = frappe.get_doc("Bank Statement Settings", self.bank_settings)
+ headers = [entry.stmt_header for entry in mapper_doc.header_items]
+ return headers
+
+ def populate_payment_entries(self):
+ if self.bank_statement is None: return
+ filename = self.bank_statement.split("/")[-1]
+ if (len(self.new_transaction_items + self.reconciled_transaction_items) > 0):
+ frappe.throw("Transactions already retreived from the statement")
+
+ date_format = frappe.get_value("Bank Statement Settings", self.bank_settings, "date_format")
+ if (date_format is None):
+ date_format = '%Y-%m-%d'
+ if self.bank_settings:
+ mapped_items = frappe.get_doc("Bank Statement Settings", self.bank_settings).mapped_items
+ transactions = get_transaction_entries(filename, self.get_statement_headers())
+ for entry in transactions:
+ date = entry["Date"].strip()
+ #print("Processing entry DESC:{0}-W:{1}-D:{2}-DT:{3}".format(entry["Particulars"], entry["Withdrawals"], entry["Deposits"], entry["Date"]))
+ if (not date): continue
+ transaction_date = datetime.strptime(date, date_format).date()
+ if (self.from_date and transaction_date < datetime.strptime(self.from_date, '%Y-%m-%d').date()): continue
+ if (self.to_date and transaction_date > datetime.strptime(self.to_date, '%Y-%m-%d').date()): continue
+ bank_entry = self.append('new_transaction_items', {})
+ bank_entry.transaction_date = transaction_date
+ bank_entry.description = entry["Particulars"]
+
+ mapped_item = next((entry for entry in mapped_items if entry.mapping_type == "Transaction" and entry.bank_data.lower() in bank_entry.description.lower()), None)
+ if (mapped_item is not None):
+ bank_entry.party_type = mapped_item.mapped_data_type
+ bank_entry.party = mapped_item.mapped_data
+ else:
+ bank_entry.party_type = "Supplier" if not entry["Deposits"].strip() else "Customer"
+ party_list = frappe.get_all(bank_entry.party_type, fields=["name"])
+ parties = [party.name for party in party_list]
+ matches = difflib.get_close_matches(bank_entry.description.lower(), parties, 1, 0.4)
+ if len(matches) > 0: bank_entry.party = matches[0]
+ bank_entry.amount = -float(entry["Withdrawals"]) if not entry["Deposits"].strip() else float(entry["Deposits"])
+ self.map_unknown_transactions()
+ self.map_transactions_on_journal_entry()
+
+ def map_transactions_on_journal_entry(self):
+ for entry in self.new_transaction_items:
+ vouchers = frappe.db.sql("""select name, posting_date from `tabJournal Entry`
+ where posting_date='{0}' and total_credit={1} and cheque_no='{2}' and docstatus != 2
+ """.format(entry.transaction_date, abs(entry.amount), entry.description), as_dict=True)
+ if (len(vouchers) == 1):
+ entry.reference_name = vouchers[0].name
+
+ def populate_matching_invoices(self):
+ self.payment_invoice_items = []
+ self.map_unknown_transactions()
+ added_invoices = []
+ for entry in self.new_transaction_items:
+ if (not entry.party or entry.party_type == "Account"): continue
+ account = self.receivable_account if entry.party_type == "Customer" else self.payable_account
+ invoices = get_outstanding_invoices(entry.party_type, entry.party, account)
+ transaction_date = datetime.strptime(entry.transaction_date, "%Y-%m-%d").date()
+ outstanding_invoices = [invoice for invoice in invoices if invoice.posting_date <= transaction_date]
+ amount = abs(entry.amount)
+ matching_invoices = [invoice for invoice in outstanding_invoices if invoice.outstanding_amount == amount]
+ sorted(outstanding_invoices, key=lambda k: k['posting_date'])
+ for e in (matching_invoices + outstanding_invoices):
+ added = next((inv for inv in added_invoices if inv == e.get('voucher_no')), None)
+ if (added is not None): continue
+ ent = self.append('payment_invoice_items', {})
+ ent.transaction_date = entry.transaction_date
+ ent.payment_description = entry.description
+ ent.party_type = entry.party_type
+ ent.party = entry.party
+ ent.invoice = e.get('voucher_no')
+ added_invoices += [ent.invoice]
+ ent.invoice_type = "Sales Invoice" if entry.party_type == "Customer" else "Purchase Invoice"
+ ent.invoice_date = e.get('posting_date')
+ ent.outstanding_amount = e.get('outstanding_amount')
+ ent.allocated_amount = min(float(e.get('outstanding_amount')), amount)
+ amount -= float(e.get('outstanding_amount'))
+ if (amount <= 5): break
+ self.match_invoice_to_payment()
+ self.populate_matching_vouchers()
+ self.map_transactions_on_journal_entry()
+
+ def match_invoice_to_payment(self):
+ added_payments = []
+ for entry in self.new_transaction_items:
+ if (not entry.party or entry.party_type == "Account"): continue
+ entry.account = self.receivable_account if entry.party_type == "Customer" else self.payable_account
+ amount = abs(entry.amount)
+ payment, matching_invoices = None, []
+ for inv_entry in self.payment_invoice_items:
+ if (inv_entry.payment_description != entry.description or inv_entry.transaction_date != entry.transaction_date): continue
+ if (inv_entry.party != entry.party): continue
+ matching_invoices += [inv_entry.invoice_type + "|" + inv_entry.invoice]
+ payment = get_payments_matching_invoice(inv_entry.invoice, entry.amount, entry.transaction_date)
+ doc = frappe.get_doc(inv_entry.invoice_type, inv_entry.invoice)
+ inv_entry.invoice_date = doc.posting_date
+ inv_entry.outstanding_amount = doc.outstanding_amount
+ inv_entry.allocated_amount = min(float(doc.outstanding_amount), amount)
+ amount -= inv_entry.allocated_amount
+ if (amount < 0): break
+
+ amount = abs(entry.amount)
+ if (payment is None):
+ order_doctype = "Sales Order" if entry.party_type=="Customer" else "Purchase Order"
+ from erpnext.controllers.accounts_controller import get_advance_payment_entries
+ payment_entries = get_advance_payment_entries(entry.party_type, entry.party, entry.account, order_doctype, against_all_orders=True)
+ payment_entries += self.get_matching_payments(entry.party, amount, entry.transaction_date)
+ payment = next((payment for payment in payment_entries if payment.amount == amount and payment not in added_payments), None)
+ if (payment is None):
+ print("Failed to find payments for {0}:{1}".format(entry.party, amount))
+ continue
+ added_payments += [payment]
+ entry.reference_type = payment.reference_type
+ entry.reference_name = payment.reference_name
+ entry.mode_of_payment = "Wire Transfer"
+ entry.outstanding_amount = min(amount, 0)
+ if (entry.payment_reference is None):
+ entry.payment_reference = entry.description
+ entry.invoices = ",".join(matching_invoices)
+ #print("Matching payment is {0}:{1}".format(entry.reference_type, entry.reference_name))
+
+ def get_matching_payments(self, party, amount, pay_date):
+ query = """select 'Payment Entry' as reference_type, name as reference_name, paid_amount as amount
+ from `tabPayment Entry` where party='{0}' and paid_amount={1} and posting_date='{2}' and docstatus != 2
+ """.format(party, amount, pay_date)
+ matching_payments = frappe.db.sql(query, as_dict=True)
+ return matching_payments
+
+ def map_unknown_transactions(self):
+ for entry in self.new_transaction_items:
+ if (entry.party): continue
+ inv_type = "Sales Invoice" if (entry.amount > 0) else "Purchase Invoice"
+ party_type = "customer" if (entry.amount > 0) else "supplier"
+
+ query = """select posting_date, name, {0}, outstanding_amount
+ from `tab{1}` where ROUND(outstanding_amount)={2} and posting_date < '{3}'
+ """.format(party_type, inv_type, round(abs(entry.amount)), entry.transaction_date)
+ invoices = frappe.db.sql(query, as_dict = True)
+ if(len(invoices) > 0):
+ entry.party = invoices[0].get(party_type)
+
+ def populate_matching_vouchers(self):
+ for entry in self.new_transaction_items:
+ if (not entry.party or entry.reference_name): continue
+ print("Finding matching voucher for {0}".format(entry.description))
+ amount = abs(entry.amount)
+ invoices = []
+ vouchers = get_matching_journal_entries(self.from_date, self.to_date, entry.party, self.bank_account, amount)
+ if len(vouchers) == 0: continue
+ for voucher in vouchers:
+ added = next((entry.invoice for entry in self.payment_invoice_items if entry.invoice == voucher.voucher_no), None)
+ if (added):
+ print("Found voucher {0}".format(added))
+ continue
+ print("Adding voucher {0} {1} {2}".format(voucher.voucher_no, voucher.posting_date, voucher.debit))
+ ent = self.append('payment_invoice_items', {})
+ ent.invoice_date = voucher.posting_date
+ ent.invoice_type = "Journal Entry"
+ ent.invoice = voucher.voucher_no
+ ent.payment_description = entry.description
+ ent.allocated_amount = max(voucher.debit, voucher.credit)
+
+ invoices += [ent.invoice_type + "|" + ent.invoice]
+ entry.reference_type = "Journal Entry"
+ entry.mode_of_payment = "Wire Transfer"
+ entry.reference_name = ent.invoice
+ #entry.account = entry.party
+ entry.invoices = ",".join(invoices)
+ break
+
+
+ def create_payment_entries(self):
+ for payment_entry in self.new_transaction_items:
+ if (not payment_entry.party): continue
+ if (payment_entry.reference_name): continue
+ print("Creating payment entry for {0}".format(payment_entry.description))
+ if (payment_entry.party_type == "Account"):
+ payment = self.create_journal_entry(payment_entry)
+ invoices = [payment.doctype + "|" + payment.name]
+ payment_entry.invoices = ",".join(invoices)
+ else:
+ payment = self.create_payment_entry(payment_entry)
+ invoices = [entry.reference_doctype + "|" + entry.reference_name for entry in payment.references if entry is not None]
+ payment_entry.invoices = ",".join(invoices)
+ payment_entry.mode_of_payment = payment.mode_of_payment
+ payment_entry.account = self.receivable_account if payment_entry.party_type == "Customer" else self.payable_account
+ payment_entry.reference_name = payment.name
+ payment_entry.reference_type = payment.doctype
+ frappe.msgprint(_("Successfully created payment entries"))
+
+ def create_payment_entry(self, pe):
+ payment = frappe.new_doc("Payment Entry")
+ payment.posting_date = pe.transaction_date
+ payment.payment_type = "Receive" if pe.party_type == "Customer" else "Pay"
+ payment.mode_of_payment = "Wire Transfer"
+ payment.party_type = pe.party_type
+ payment.party = pe.party
+ payment.paid_to = self.bank_account if pe.party_type == "Customer" else self.payable_account
+ payment.paid_from = self.receivable_account if pe.party_type == "Customer" else self.bank_account
+ payment.paid_amount = payment.received_amount = abs(pe.amount)
+ payment.reference_no = pe.description
+ payment.reference_date = pe.transaction_date
+ payment.save()
+ for inv_entry in self.payment_invoice_items:
+ if (pe.description != inv_entry.payment_description or pe.transaction_date != inv_entry.transaction_date): continue
+ if (pe.party != inv_entry.party): continue
+ reference = payment.append("references", {})
+ reference.reference_doctype = inv_entry.invoice_type
+ reference.reference_name = inv_entry.invoice
+ reference.allocated_amount = inv_entry.allocated_amount
+ print ("Adding invoice {0} {1}".format(reference.reference_name, reference.allocated_amount))
+ payment.setup_party_account_field()
+ payment.set_missing_values()
+ #payment.set_exchange_rate()
+ #payment.set_amounts()
+ #print("Created payment entry {0}".format(payment.as_dict()))
+ payment.save()
+ return payment
+
+ def create_journal_entry(self, pe):
+ je = frappe.new_doc("Journal Entry")
+ je.is_opening = "No"
+ je.voucher_type = "Bank Entry"
+ je.cheque_no = pe.description
+ je.cheque_date = pe.transaction_date
+ je.remark = pe.description
+ je.posting_date = pe.transaction_date
+ if (pe.amount < 0):
+ je.append("accounts", {"account": pe.party, "debit_in_account_currency": abs(pe.amount)})
+ je.append("accounts", {"account": self.bank_account, "credit_in_account_currency": abs(pe.amount)})
+ else:
+ je.append("accounts", {"account": pe.party, "credit_in_account_currency": pe.amount})
+ je.append("accounts", {"account": self.bank_account, "debit_in_account_currency": pe.amount})
+ je.save()
+ return je
+
+ def update_payment_entry(self, payment):
+ lst = []
+ invoices = payment.invoices.strip().split(',')
+ if (len(invoices) == 0): return
+ amount = float(abs(payment.amount))
+ for invoice_entry in invoices:
+ if (not invoice_entry.strip()): continue
+ invs = invoice_entry.split('|')
+ invoice_type, invoice = invs[0], invs[1]
+ outstanding_amount = frappe.get_value(invoice_type, invoice, 'outstanding_amount')
+
+ lst.append(frappe._dict({
+ 'voucher_type': payment.reference_type,
+ 'voucher_no' : payment.reference_name,
+ 'against_voucher_type' : invoice_type,
+ 'against_voucher' : invoice,
+ 'account' : payment.account,
+ 'party_type': payment.party_type,
+ 'party': frappe.get_value("Payment Entry", payment.reference_name, "party"),
+ 'unadjusted_amount' : float(amount),
+ 'allocated_amount' : min(outstanding_amount, amount)
+ }))
+ amount -= outstanding_amount
+ if lst:
+ from erpnext.accounts.utils import reconcile_against_document
+ try:
+ reconcile_against_document(lst)
+ except:
+ frappe.throw("Exception occurred while reconciling {0}".format(payment.reference_name))
+
+ def submit_payment_entries(self):
+ for payment in self.new_transaction_items:
+ if payment.reference_name is None: continue
+ doc = frappe.get_doc(payment.reference_type, payment.reference_name)
+ if doc.docstatus == 1:
+ if (payment.reference_type == "Journal Entry"): continue
+ if doc.unallocated_amount == 0: continue
+ print("Reconciling payment {0}".format(payment.reference_name))
+ self.update_payment_entry(payment)
+ else:
+ print("Submitting payment {0}".format(payment.reference_name))
+ if (payment.reference_type == "Payment Entry"):
+ if (payment.payment_reference):
+ doc.reference_no = payment.payment_reference
+ doc.mode_of_payment = payment.mode_of_payment
+ doc.save()
+ doc.submit()
+ self.move_reconciled_entries()
+ self.populate_matching_invoices()
+
+ def move_reconciled_entries(self):
+ idx = 0
+ while idx < len(self.new_transaction_items):
+ entry = self.new_transaction_items[idx]
+ print("Checking transaction {0}: {2} in {1} entries".format(idx, len(self.new_transaction_items), entry.description))
+ idx += 1
+ if entry.reference_name is None: continue
+ doc = frappe.get_doc(entry.reference_type, entry.reference_name)
+ if doc.docstatus == 1 and (entry.reference_type == "Journal Entry" or doc.unallocated_amount == 0):
+ self.remove(entry)
+ rc_entry = self.append('reconciled_transaction_items', {})
+ dentry = entry.as_dict()
+ dentry.pop('idx', None)
+ rc_entry.update(dentry)
+ idx -= 1
+
+
+def get_matching_journal_entries(from_date, to_date, account, against, amount):
+ query = """select voucher_no, posting_date, account, against, debit_in_account_currency as debit, credit_in_account_currency as credit
+ from `tabGL Entry`
+ where posting_date between '{0}' and '{1}' and account = '{2}' and against = '{3}' and debit = '{4}'
+ """.format(from_date, to_date, account, against, amount)
+ jv_entries = frappe.db.sql(query, as_dict=True)
+ #print("voucher query:{0}\n Returned {1} entries".format(query, len(jv_entries)))
+ return jv_entries
+
+def get_payments_matching_invoice(invoice, amount, pay_date):
+ query = """select pe.name as reference_name, per.reference_doctype as reference_type, per.outstanding_amount, per.allocated_amount
+ from `tabPayment Entry Reference` as per JOIN `tabPayment Entry` as pe on pe.name = per.parent
+ where per.reference_name='{0}' and (posting_date='{1}' or reference_date='{1}') and pe.docstatus != 2
+ """.format(invoice, pay_date)
+ payments = frappe.db.sql(query, as_dict=True)
+ if (len(payments) == 0): return
+ payment = next((payment for payment in payments if payment.allocated_amount == amount), payments[0])
+ #Hack: Update the reference type which is set to invoice type
+ payment.reference_type = "Payment Entry"
+ return payment
+
+def is_headers_present(headers, row):
+ for header in headers:
+ if header not in row:
+ return False
+ return True
+
+def get_header_index(headers, row):
+ header_index = {}
+ for header in headers:
+ if header in row:
+ header_index[header] = row.index(header)
+ return header_index
+
+def get_transaction_info(headers, header_index, row):
+ transaction = {}
+ for header in headers:
+ transaction[header] = row[header_index[header]]
+ if (transaction[header] == None):
+ transaction[header] = ""
+ return transaction
+
+def get_transaction_entries(filename, headers):
+ header_index = {}
+ rows, transactions = [], []
+
+ if (filename.lower().endswith("xlsx")):
+ from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file
+ rows = read_xlsx_file_from_attached_file(file_id=filename)
+ elif (filename.lower().endswith("csv")):
+ from frappe.utils.file_manager import get_file_path
+ from frappe.utils.csvutils import read_csv_content
+ filepath = get_file_path(filename)
+ with open(filepath,'rb') as csvfile:
+ rows = read_csv_content(csvfile.read())
+ elif (filename.lower().endswith("xls")):
+ rows = get_rows_from_xls_file(filename)
+ else:
+ frappe.throw("Only .csv and .xlsx files are supported currently")
+
+ for row in rows:
+ if len(row) == 0 or row[0] == None or not row[0]: continue
+ #print("Processing row {0}".format(row))
+ if header_index:
+ transaction = get_transaction_info(headers, header_index, row)
+ transactions.append(transaction)
+ elif is_headers_present(headers, row):
+ header_index = get_header_index(headers, row)
+ return transactions
+
+def get_rows_from_xls_file(filename):
+ from frappe.utils.file_manager import get_file_path
+ filepath = get_file_path(filename)
+ import xlrd
+ book = xlrd.open_workbook(filepath)
+ sheets = book.sheets()
+ rows = []
+ for row in range(1, sheets[0].nrows):
+ row_values = []
+ for col in range(1, sheets[0].ncols):
+ row_values.append(sheets[0].cell_value(row, col))
+ rows.append(row_values)
+ return rows
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.js b/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.js
new file mode 100644
index 0000000..46d570f
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Bank Statement Transaction Entry", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Bank Statement Transaction Entry
+ () => frappe.tests.make('Bank Statement Transaction Entry', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.py b/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.py
new file mode 100644
index 0000000..4589483
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/test_bank_statement_transaction_entry.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestBankStatementTransactionEntry(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/__init__.py b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.json b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.json
new file mode 100644
index 0000000..bcffff0
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.json
@@ -0,0 +1,344 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-11-07 13:58:53.827058",
+ "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": "transaction_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": "Transaction 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,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 4,
+ "fieldname": "payment_description",
+ "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": "Payment Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "party_type",
+ "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": "Party Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer\nSupplier\nAccount",
+ "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": "party",
+ "fieldtype": "Dynamic 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": "Party",
+ "length": 0,
+ "no_copy": 0,
+ "options": "party_type",
+ "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_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": 2,
+ "fieldname": "invoice_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": "Invoice Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "invoice_type",
+ "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": "Invoice Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Purchase Invoice\nSales Invoice\nJournal Entry",
+ "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": 2,
+ "fieldname": "invoice",
+ "fieldtype": "Dynamic 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": "invoice",
+ "length": 0,
+ "no_copy": 0,
+ "options": "invoice_type",
+ "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": 1,
+ "fieldname": "outstanding_amount",
+ "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": "Outstanding 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,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 1,
+ "fieldname": "allocated_amount",
+ "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": "Allocated 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,
+ "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-11-15 09:41:45.840947",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Transaction Invoice Item",
+ "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/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.py b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.py
new file mode 100644
index 0000000..cb1b158
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_invoice_item/bank_statement_transaction_invoice_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementTransactionInvoiceItem(Document):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_payment_item/__init__.py b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.json b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.json
new file mode 100644
index 0000000..177dccd
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.json
@@ -0,0 +1,494 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-11-07 14:03:05.651413",
+ "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": 1,
+ "fieldname": "transaction_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": "Transaction Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 4,
+ "fieldname": "description",
+ "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": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 1,
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Amount",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 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_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 1,
+ "fieldname": "party_type",
+ "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": "Party Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer\nSupplier\nAccount",
+ "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": 2,
+ "fieldname": "party",
+ "fieldtype": "Dynamic 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": "Party",
+ "length": 0,
+ "no_copy": 0,
+ "options": "party_type",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "section_break_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": "reference_type",
+ "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": "Reference Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Payment Entry\nJournal Entry",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "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,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "mode_of_payment",
+ "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": "Mode of Payment",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Mode of Payment",
+ "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": "outstanding_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": "outstanding_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,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 2,
+ "fieldname": "reference_name",
+ "fieldtype": "Dynamic 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": "Reference Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "reference_type",
+ "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": "payment_reference",
+ "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": "Payment 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,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "invoices",
+ "fieldtype": "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": "Invoices",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "max_attachments": 0,
+ "modified": "2017-11-15 19:18:52.876221",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Transaction Payment Item",
+ "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
+}
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.py b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.py
new file mode 100644
index 0000000..9840c0d
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_payment_item/bank_statement_transaction_payment_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementTransactionPaymentItem(Document):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings/__init__.py b/erpnext/accounts/doctype/bank_statement_transaction_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.js b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.js
new file mode 100644
index 0000000..46aa4f2
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.js
@@ -0,0 +1,8 @@
+// Copyright (c) 2017, sathishpy@gmail.com and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Bank Statement Settings', {
+ refresh: function(frm) {
+
+ }
+});
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.json b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.json
new file mode 100644
index 0000000..474bb90
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.json
@@ -0,0 +1,266 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "beta": 0,
+ "creation": "2017-11-13 13:38:10.863592",
+ "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": "bank_account",
+ "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": "Bank Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "'%d/%m/%Y'",
+ "fieldname": "date_format",
+ "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": "Date Format",
+ "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": "statement_header_mapping",
+ "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": "Statement Header Mapping",
+ "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": "header_items",
+ "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": "Statement Headers",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Settings Item",
+ "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": "transaction_data_mapping",
+ "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": "Transaction Data Mapping",
+ "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": "mapped_items",
+ "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": "Mapped Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Bank Statement Transaction Settings 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,
+ "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": "2018-01-12 10:34:32.840487",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Settings",
+ "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,
+ "write": 1
+ },
+ {
+ "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": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.py b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.py
new file mode 100644
index 0000000..de9a85f
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/bank_statement_transaction_settings.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementSettings(Document):
+ def autoname(self):
+ self.name = self.bank_account + "-Mappings"
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.js b/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.js
new file mode 100644
index 0000000..f2381c0
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Bank Statement Settings", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Bank Statement Settings
+ () => frappe.tests.make('Bank Statement Settings', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.py b/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.py
new file mode 100644
index 0000000..aa7fe83
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings/test_bank_statement_transaction_settings.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+class TestBankStatementSettings(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings_item/__init__.py b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/__init__.py
diff --git a/erpnext/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.json b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.json
new file mode 100644
index 0000000..47c3209
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.json
@@ -0,0 +1,166 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2017-11-13 13:42:00.335432",
+ "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,
+ "default": "Transaction",
+ "fieldname": "mapping_type",
+ "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": "Mapping Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Transaction",
+ "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": "bank_data",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Bank Data",
+ "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,
+ "default": "Account",
+ "fieldname": "mapped_data_type",
+ "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": "Mapped Data Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account\nCustomer\nSupplier\nAccount",
+ "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": "mapped_data",
+ "fieldtype": "Dynamic 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": "Mapped Data",
+ "length": 0,
+ "no_copy": 0,
+ "options": "mapped_data_type",
+ "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
+ }
+ ],
+ "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": "2018-01-08 00:13:49.973501",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Statement Transaction Settings Item",
+ "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/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.py b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.py
new file mode 100644
index 0000000..bf0a590
--- /dev/null
+++ b/erpnext/accounts/doctype/bank_statement_transaction_settings_item/bank_statement_transaction_settings_item.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2017, sathishpy@gmail.com and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class BankStatementTransactionSettingsItem(Document):
+ pass
diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py
index 0556e9b..24cd3dd 100644
--- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py
+++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py
@@ -27,10 +27,20 @@
doc = frappe.get_doc("Cheque Print Template", template_name)
cheque_print.html = """
+<style>
+ .print-format {
+ padding: 0px;
+ }
+ @media screen {
+ .print-format {
+ padding: 0in;
+ }
+ }
+</style>
<div style="position: relative; top:%(starting_position_from_top_edge)scm">
<div style="width:%(cheque_width)scm;height:%(cheque_height)scm;">
<span style="top:%(acc_pay_dist_from_top_edge)scm; left:%(acc_pay_dist_from_left_edge)scm;
- border-bottom: solid 1px;border-top:solid 1px; position: absolute;">
+ border-bottom: solid 1px;border-top:solid 1px; width:2cm;text-align: center; position: absolute;">
%(message_to_show)s
</span>
<span style="top:%(date_dist_from_top_edge)scm; left:%(date_dist_from_left_edge)scm;
@@ -38,11 +48,11 @@
{{ frappe.utils.formatdate(doc.reference_date) or '' }}
</span>
<span style="top:%(acc_no_dist_from_top_edge)scm;left:%(acc_no_dist_from_left_edge)scm;
- position: absolute;">
+ position: absolute; min-width: 6cm;">
{{ doc.account_no or '' }}
</span>
<span style="top:%(payer_name_from_top_edge)scm;left: %(payer_name_from_left_edge)scm;
- position: absolute;">
+ position: absolute; min-width: 6cm;">
{{doc.party_name}}
</span>
<span style="top:%(amt_in_words_from_top_edge)scm; left:%(amt_in_words_from_left_edge)scm;
@@ -51,11 +61,11 @@
{{frappe.utils.money_in_words(doc.base_paid_amount or doc.base_received_amount)}}
</span>
<span style="top:%(amt_in_figures_from_top_edge)scm;left: %(amt_in_figures_from_left_edge)scm;
- position: absolute;">
+ position: absolute; min-width: 4cm;">
{{doc.get_formatted("base_paid_amount") or doc.get_formatted("base_received_amount")}}
</span>
<span style="top:%(signatory_from_top_edge)scm;left: %(signatory_from_left_edge)scm;
- position: absolute;">
+ position: absolute; min-width: 6cm;">
{{doc.company}}
</span>
</div>
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.json b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
index f12de79..4ca9f6b 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "field:year",
@@ -13,6 +14,7 @@
"editable_grid": 0,
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,9 +43,11 @@
"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,
@@ -70,9 +74,11 @@
"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,
@@ -100,9 +106,11 @@
"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,
@@ -128,9 +136,11 @@
"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,
@@ -158,21 +168,54 @@
"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,
+ "default": "0",
+ "fieldname": "auto_created",
+ "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": "Auto Created",
+ "length": 0,
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-calendar",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-02-17 16:22:08.431278",
+ "modified": "2018-04-25 14:21:41.273354",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Fiscal Year",
@@ -180,7 +223,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -200,7 +242,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -220,7 +261,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -240,7 +280,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -260,7 +299,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -280,7 +318,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index 517a2a3..92da787 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -104,6 +104,7 @@
start_year = cstr(new_fy.year_start_date.year)
end_year = cstr(new_fy.year_end_date.year)
new_fy.year = start_year if start_year==end_year else (start_year + "-" + end_year)
+ new_fy.auto_created = 1
new_fy.insert(ignore_permissions=True)
except frappe.NameError:
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index a975aa0..ffccf8e 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -1513,7 +1513,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1522,10 +1522,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 9bbd137..a69ffcf 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -102,7 +102,7 @@
d.reference_type = ''
d.reference_name = ''
d.db_update()
-
+
def unlink_asset_reference(self):
for d in self.get("accounts"):
if d.reference_type=="Asset" and d.reference_name:
diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
index 5712bf8..679750d 100644
--- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
+++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py
@@ -161,7 +161,8 @@
income_expense_account_field = "expense_account"
item = get_item_dict()
- return frappe._dict({
+
+ args = frappe._dict({
"items": [item],
"is_opening": "Yes",
"set_posting_time": 1,
@@ -173,6 +174,11 @@
"currency": frappe.db.get_value("Company", self.company, "default_currency")
})
+ if self.invoice_type == "Sales":
+ args["is_pos"] = 0
+
+ return args
+
@frappe.whitelist()
def get_temporary_opening_account(company=None):
if not company:
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json
index 60a54c2..564a93c 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.json
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json
@@ -1749,7 +1749,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -1758,10 +1758,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -1848,7 +1848,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-02-19 16:58:23.899015",
+ "modified": "2018-03-10 07:31:49.264576",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Entry",
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 0a22ae0..9b50252 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -508,7 +508,7 @@
doc = frappe.get_doc("Expense Claim", d.reference_name)
update_reimbursed_amount(doc)
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.reference_no = reference_doc.name
self.reference_date = nowdate()
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index e136a1d..8acdf5c 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -4033,7 +4033,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -4042,10 +4042,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index c9cf47d..f6103cc 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -727,7 +727,7 @@
if account_type != 'Fixed Asset':
frappe.throw(_("Row {0}# Account must be of type 'Fixed Asset'").format(d.idx))
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.due_date = None
def set_tax_withholding(self):
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
index 062a2d2..f101b6a 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py
@@ -9,7 +9,7 @@
'Payment Request': 'reference_name',
'Landed Cost Voucher': 'receipt_document',
'Purchase Invoice': 'return_against',
- 'Subscription': 'reference_document'
+ 'Auto Repeat': 'reference_document'
},
'internal_links': {
'Purchase Order': ['items', 'purchase_order'],
@@ -30,7 +30,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 77babf4..4e33cb8 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -126,18 +126,6 @@
$.each(doc["items"], function(i, row) {
if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note)
})
-
- if(this.frm.doc.is_pos) {
- this.frm.msgbox = frappe.msgprint(
- `<a class="btn btn-primary" onclick="cur_frm.print_preview.printit(true)" style="margin-right: 5px;">
- ${__('Print')}</a>
- <a class="btn btn-default" href="javascript:frappe.new_doc(cur_frm.doctype);">
- ${__('New')}</a>`
- );
-
- } else if(cint(frappe.boot.notification_settings.sales_invoice)) {
- this.frm.email_doc(frappe.boot.notification_settings.sales_invoice_message);
- }
},
set_default_print_format: function() {
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 8fe63b4..11edefc 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -4795,7 +4795,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -4804,10 +4804,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -4897,8 +4897,8 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-04-19 15:46:45.766533",
- "modified_by": "Administrator",
+ "modified": "2018-04-30 16:19:54.711885",
+ "modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
"name_case": "Title Case",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index f27d377..9220cc8 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -111,7 +111,7 @@
def on_submit(self):
self.validate_pos_paid_amount()
- if not self.subscription:
+ if not self.auto_repeat:
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
self.company, self.base_grand_total, self)
@@ -832,7 +832,7 @@
for dn in set(updated_delivery_notes):
frappe.get_doc("Delivery Note", dn).update_billing_percentage(update_modified=update_modified)
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
for fieldname in ("c_form_applicable", "c_form_no", "write_off_amount"):
self.set(fieldname, reference_doc.get(fieldname))
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
index efd18b5..71fce77 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py
@@ -9,7 +9,7 @@
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
'Sales Invoice': 'return_against',
- 'Subscription': 'reference_document',
+ 'Auto Repeat': 'reference_document',
},
'internal_links': {
'Sales Order': ['items', 'sales_order']
@@ -29,7 +29,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscriber/__init__.py b/erpnext/accounts/doctype/subscriber/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/__init__.py
diff --git a/erpnext/accounts/doctype/subscriber/subscriber.js b/erpnext/accounts/doctype/subscriber/subscriber.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscriber/subscriber.json b/erpnext/accounts/doctype/subscriber/subscriber.json
new file mode 100644
index 0000000..28a57d8
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.json
@@ -0,0 +1,126 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:subscriber_name",
+ "beta": 0,
+ "creation": "2018-02-24 11:17:46.809140",
+ "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": "subscriber_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": "Subscriber 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Customer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "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": 0,
+ "max_attachments": 0,
+ "modified": "2018-02-26 04:40:16.510290",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscriber",
+ "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,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/subscriber/subscriber.py b/erpnext/accounts/doctype/subscriber/subscriber.py
new file mode 100644
index 0000000..03eb0f5
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/subscriber.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class Subscriber(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscriber/test_subscriber.js b/erpnext/accounts/doctype/subscriber/test_subscriber.js
new file mode 100644
index 0000000..1fd4a1e
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/test_subscriber.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscriber", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscriber
+ () => frappe.tests.make('Subscriber', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscriber/test_subscriber.py b/erpnext/accounts/doctype/subscriber/test_subscriber.py
new file mode 100644
index 0000000..3e2fc07
--- /dev/null
+++ b/erpnext/accounts/doctype/subscriber/test_subscriber.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriber(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription/subscription.js b/erpnext/accounts/doctype/subscription/subscription.js
index 8db5be8..dcbec12 100644
--- a/erpnext/accounts/doctype/subscription/subscription.js
+++ b/erpnext/accounts/doctype/subscription/subscription.js
@@ -1,75 +1,78 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Subscription', {
- setup: function(frm) {
- frm.fields_dict['reference_doctype'].get_query = function(doc) {
- return {
- query: "erpnext.accounts.doctype.subscription.subscription.subscription_doctype_query"
- };
- };
-
- frm.fields_dict['reference_document'].get_query = function() {
- return {
- filters: {
- "docstatus": 1,
- "subscription": ''
- }
- };
- };
-
- frm.fields_dict['print_format'].get_query = function() {
- return {
- filters: {
- "doc_type": frm.doc.reference_doctype
- }
- };
- };
- },
-
refresh: function(frm) {
- if(frm.doc.docstatus == 1) {
- let label = __('View {0}', [frm.doc.reference_doctype]);
- frm.add_custom_button(__(label),
- function() {
- frappe.route_options = {
- "subscription": frm.doc.name,
- };
- frappe.set_route("List", frm.doc.reference_doctype);
- }
- );
-
- if(frm.doc.status != 'Stopped') {
- frm.add_custom_button(__("Stop"),
- function() {
- frm.events.stop_resume_subscription(frm, "Stopped");
- }
+ if(!frm.is_new()){
+ if(frm.doc.status !== 'Cancelled'){
+ frm.add_custom_button(
+ __('Cancel Subscription'),
+ () => frm.events.cancel_this_subscription(frm)
+ );
+ frm.add_custom_button(
+ __('Fetch Subscription Updates'),
+ () => frm.events.get_subscription_updates(frm)
);
}
-
- if(frm.doc.status == 'Stopped') {
- frm.add_custom_button(__("Resume"),
- function() {
- frm.events.stop_resume_subscription(frm, "Resumed");
- }
+ else if(frm.doc.status === 'Cancelled'){
+ frm.add_custom_button(
+ __('Restart Subscription'),
+ () => frm.events.renew_this_subscription(frm)
);
}
}
},
- stop_resume_subscription: function(frm, status) {
+ cancel_this_subscription: function(frm) {
+ const doc = frm.doc;
+ frappe.confirm(
+ __('This action will stop future billing. Are you sure you want to cancel this subscription?'),
+ function() {
+ frappe.call({
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.cancel_subscription",
+ args: {name: doc.name},
+ callback: function(data){
+ if(!data.exc){
+ frm.reload_doc();
+ }
+ }
+ });
+ }
+ );
+ },
+
+ renew_this_subscription: function(frm) {
+ const doc = frm.doc;
+ frappe.confirm(
+ __('You will lose records of previously generated invoices. Are you sure you want to restart this subscription?'),
+ function() {
+ frappe.call({
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.restart_subscription",
+ args: {name: doc.name},
+ callback: function(data){
+ if(!data.exc){
+ frm.reload_doc();
+ }
+ }
+ });
+ }
+ );
+ },
+
+ get_subscription_updates: function(frm) {
+ const doc = frm.doc;
frappe.call({
- method: "erpnext.accounts.doctype.subscription.subscription.stop_resume_subscription",
- args: {
- subscription: frm.doc.name,
- status: status
- },
- callback: function(r) {
- if(r.message) {
- frm.set_value("status", r.message);
+ method:
+ "erpnext.accounts.doctype.subscription.subscription.get_subscription_updates",
+ args: {name: doc.name},
+ freeze: true,
+ callback: function(data){
+ if(!data.exc){
frm.reload_doc();
}
}
});
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/accounts/doctype/subscription/subscription.json b/erpnext/accounts/doctype/subscription/subscription.json
index 7ff2e4b..1165bed 100644
--- a/erpnext/accounts/doctype/subscription/subscription.json
+++ b/erpnext/accounts/doctype/subscription/subscription.json
@@ -1,9 +1,9 @@
{
"allow_copy": 0,
"allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "naming_series:",
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "SUBC.####",
"beta": 0,
"creation": "2017-07-18 17:50:43.967266",
"custom": 0,
@@ -19,67 +19,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "section_break_1",
- "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": "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": 0,
- "options": "SUB-",
- "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": "reference_doctype",
+ "fieldname": "subscriber",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -88,10 +28,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Reference Doctype",
+ "label": "Subscriber",
"length": 0,
"no_copy": 0,
- "options": "DocType",
+ "options": "Subscriber",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -101,7 +41,8 @@
"report_hide": 0,
"reqd": 1,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -110,127 +51,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "reference_document",
- "fieldtype": "Dynamic 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": "Reference Document",
- "length": 0,
- "no_copy": 1,
- "options": "reference_doctype",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_5",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "start_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "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": 1,
- "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": 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": "submit_on_creation",
+ "fieldname": "cancel_at_period_end",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -239,9 +60,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Submit on Creation",
+ "label": "Cancel At End Of Period",
"length": 0,
"no_copy": 0,
+ "options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -252,36 +74,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "disabled",
- "fieldtype": "Check",
- "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": "Disabled",
- "length": 0,
- "no_copy": 1,
- "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
},
{
@@ -290,127 +83,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "section_break_10",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "frequency",
- "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": "Frequency",
- "length": 0,
- "no_copy": 0,
- "options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval: in_list([\"Monthly\", \"Quarterly\", \"Yearly\"], doc.frequency)",
- "fieldname": "repeat_on_day",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Repeat on Day",
- "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": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "next_schedule_date",
+ "fieldname": "start",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -419,12 +92,45 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Next Schedule Date",
+ "label": "Subscription Start Date",
"length": 0,
- "no_copy": 1,
+ "no_copy": 0,
+ "options": "",
"permlevel": 0,
"precision": "",
- "print_hide": 1,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cancelation_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": "Cancelation Date",
+ "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,
@@ -432,16 +138,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 1,
+ "collapsible": 0,
"columns": 0,
- "fieldname": "notification",
- "fieldtype": "Section Break",
+ "fieldname": "current_invoice_start",
+ "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -449,7 +156,69 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Notification",
+ "label": "Current Invoice Start Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 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,
+ "fieldname": "current_invoice_end",
+ "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": "Current Invoice End Date",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "trial_period_start",
+ "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": "Trial Period Start Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -461,7 +230,8 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -470,8 +240,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "notify_by_email",
- "fieldtype": "Check",
+ "depends_on": "eval:doc.trial_period_start",
+ "fieldname": "trial_period_end",
+ "fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
@@ -479,7 +250,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Notify by Email",
+ "label": "Trial Period End Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -491,48 +262,17 @@
"report_hide": 0,
"reqd": 0,
"search_index": 0,
- "set_only_once": 0,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval: doc.notify_by_email",
- "description": "To add dynamic subject, use jinja tags like\n\n<div><pre><code>New {{ doc.doctype }} #{{ doc.name }}</code></pre></div>",
- "fieldname": "subject",
- "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": "Subject",
- "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_17",
+ "fieldname": "cb_1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -541,161 +281,6 @@
"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,
- "depends_on": "notify_by_email",
- "fieldname": "recipients",
- "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": "Recipients",
- "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,
- "depends_on": "notify_by_email",
- "fieldname": "print_format",
- "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": "Print Format",
- "length": 0,
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "columns": 0,
- "depends_on": "eval:doc.notify_by_email",
- "fieldname": "section_break_20",
- "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": "Message",
- "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": "Please find attached {{ doc.doctype }} #{{ doc.name }}",
- "fieldname": "message",
- "fieldtype": "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": "Message",
- "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": 1,
- "columns": 0,
- "depends_on": "eval: !doc.__islocal",
- "fieldname": "section_break_16",
- "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,
@@ -709,15 +294,15 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 1,
+ "allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "default": "Draft",
"fieldname": "status",
"fieldtype": "Select",
"hidden": 0,
@@ -725,12 +310,12 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"in_standard_filter": 0,
"label": "Status",
"length": 0,
"no_copy": 0,
- "options": "\nDraft\nStopped\nSubmitted\nCancelled\nCompleted",
+ "options": "\nTrialling\nActive\nPast Due Date\nCancelled\nUnpaid",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -741,6 +326,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -749,7 +335,168 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "amended_from",
+ "default": "0",
+ "description": "Number of days that the subscriber has to pay invoices generated by this subscription",
+ "fieldname": "days_until_due",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Days Until Due",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "quantity",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Quantity",
+ "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_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "sb_4",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Plans",
+ "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_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "plans",
+ "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": "Plans",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Plan Detail",
+ "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": "sb_1",
+ "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": "Taxes",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "tax_template",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -758,19 +505,249 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Amended From",
+ "label": "Sales Taxes and Charges Template",
"length": 0,
- "no_copy": 1,
- "options": "Subscription",
+ "no_copy": 0,
+ "options": "Sales Taxes and Charges Template",
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "sb_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,
+ "label": "Discounts",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "apply_additional_discount",
+ "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": "Apply Additional Discount On",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nGrand Total\nNet total",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "cb_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,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "additional_discount_percentage",
+ "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": "Additional DIscount Percentage",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "additional_discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Additional DIscount 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.invoices",
+ "fieldname": "sb_3",
+ "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": "Invoices",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "invoices",
+ "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": "Invoices",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Invoice",
+ "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
}
],
@@ -780,11 +757,11 @@
"idx": 0,
"image_view": 0,
"in_create": 0,
- "is_submittable": 1,
+ "is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-23 18:28:08.966403",
+ "modified": "2018-03-12 00:34:52.243133",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription",
@@ -794,7 +771,7 @@
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -808,13 +785,13 @@
"role": "System Manager",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -828,13 +805,13 @@
"role": "Accounts User",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
- "cancel": 1,
+ "cancel": 0,
"create": 1,
"delete": 1,
"email": 1,
@@ -848,18 +825,18 @@
"role": "Accounts Manager",
"set_user_permissions": 0,
"share": 1,
- "submit": 1,
+ "submit": 0,
"write": 1
}
],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
- "search_fields": "reference_document",
+ "search_fields": "",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "reference_document",
+ "title_field": "",
"track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py
index 480abd4..1edc138 100644
--- a/erpnext/accounts/doctype/subscription/subscription.py
+++ b/erpnext/accounts/doctype/subscription/subscription.py
@@ -1,315 +1,500 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
+
import frappe
-import calendar
from frappe import _
-from frappe.desk.form import assign_to
-from frappe.utils.jinja import validate_template
-from dateutil.relativedelta import relativedelta
-from frappe.utils.user import get_system_managers
-from frappe.utils import cstr, getdate, split_emails, add_days, today, get_last_day, get_first_day
from frappe.model.document import Document
+from frappe.utils.data import nowdate, getdate, cint, add_days, date_diff, get_last_day, add_to_date, flt
-month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12}
+
class Subscription(Document):
- def validate(self):
- self.update_status()
- self.validate_reference_doctype()
- self.validate_dates()
- self.validate_next_schedule_date()
- self.validate_email_id()
+ def before_insert(self):
+ # update start just before the subscription doc is created
+ self.update_subscription_period(self.start)
- validate_template(self.subject or "")
- validate_template(self.message or "")
+ def update_subscription_period(self, date=None):
+ """
+ Subscription period is the period to be billed. This method updates the
+ beginning of the billing period and end of the billing period.
- def before_submit(self):
- if not self.next_schedule_date:
- self.next_schedule_date = get_next_schedule_date(self.start_date,
- self.frequency, self.repeat_on_day)
+ The beginning of the billing period is represented in the doctype as
+ `current_invoice_start` and the end of the billing period is represented
+ as `current_invoice_end`.
+ """
+ self.set_current_invoice_start(date)
+ self.set_current_invoice_end()
- def on_submit(self):
- self.update_subscription_id()
+ def set_current_invoice_start(self, date=None):
+ """
+ This sets the date of the beginning of the current billing period.
+ If the `date` parameter is not given , it will be automatically set as today's
+ date.
+ """
+ if self.trial_period_start and self.is_trialling():
+ self.current_invoice_start = self.trial_period_start
+ elif not date:
+ self.current_invoice_start = nowdate()
+ elif date:
+ self.current_invoice_start = date
- def on_update_after_submit(self):
- self.validate_dates()
- self.set_next_schedule_date()
+ def set_current_invoice_end(self):
+ """
+ This sets the date of the end of the current billing period.
- def before_cancel(self):
- self.unlink_subscription_id()
- self.next_schedule_date = None
+ If the subscription is in trial period, it will be set as the end of the
+ trial period.
- def unlink_subscription_id(self):
- frappe.db.sql("update `tab{0}` set subscription = null where subscription=%s"
- .format(self.reference_doctype), self.name)
-
- def validate_reference_doctype(self):
- if not frappe.get_meta(self.reference_doctype).has_field('subscription'):
- frappe.throw(_("Add custom field Subscription in the doctype {0}").format(self.reference_doctype))
-
- def validate_dates(self):
- if self.end_date and getdate(self.start_date) > getdate(self.end_date):
- frappe.throw(_("End date must be greater than start date"))
-
- def validate_next_schedule_date(self):
- if self.repeat_on_day and self.next_schedule_date:
- next_date = getdate(self.next_schedule_date)
- if next_date.day != self.repeat_on_day:
- # if the repeat day is the last day of the month (31)
- # and the current month does not have as many days,
- # then the last day of the current month is a valid date
- lastday = calendar.monthrange(next_date.year, next_date.month)[1]
- if self.repeat_on_day < lastday:
-
- # the specified day of the month is not same as the day specified
- # or the last day of the month
- frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal"))
-
- def validate_email_id(self):
- if self.notify_by_email:
- if self.recipients:
- email_list = split_emails(self.recipients.replace("\n", ""))
-
- from frappe.utils import validate_email_add
- for email in email_list:
- if not validate_email_add(email):
- frappe.throw(_("{0} is an invalid email address in 'Recipients'").format(email))
- else:
- frappe.throw(_("'Recipients' not specified"))
-
- def set_next_schedule_date(self):
- if self.repeat_on_day:
- self.next_schedule_date = get_next_date(self.next_schedule_date, 0, self.repeat_on_day)
-
- def update_subscription_id(self):
- frappe.db.set_value(self.reference_doctype, self.reference_document, "subscription", self.name)
-
- def update_status(self, status=None):
- self.status = {
- '0': 'Draft',
- '1': 'Submitted',
- '2': 'Cancelled'
- }[cstr(self.docstatus or 0)]
-
- if status and status != 'Resumed':
- self.status = status
-
-def get_next_schedule_date(start_date, frequency, repeat_on_day):
- mcount = month_map.get(frequency)
- if mcount:
- next_date = get_next_date(start_date, mcount, repeat_on_day)
- else:
- days = 7 if frequency == 'Weekly' else 1
- next_date = add_days(start_date, days)
- return next_date
-
-def make_subscription_entry(date=None):
- date = date or today()
- for data in get_subscription_entries(date):
- schedule_date = getdate(data.next_schedule_date)
- while schedule_date <= getdate(today()):
- create_documents(data, schedule_date)
- schedule_date = get_next_schedule_date(schedule_date,
- data.frequency, data.repeat_on_day)
-
- if schedule_date and not frappe.db.get_value('Subscription', data.name, 'disabled'):
- frappe.db.set_value('Subscription', data.name, 'next_schedule_date', schedule_date)
-
-def get_subscription_entries(date):
- return frappe.db.sql(""" select * from `tabSubscription`
- where docstatus = 1 and next_schedule_date <=%s
- and reference_document is not null and reference_document != ''
- and next_schedule_date <= ifnull(end_date, '2199-12-31')
- and ifnull(disabled, 0) = 0 and status != 'Stopped' """, (date), as_dict=1)
-
-def create_documents(data, schedule_date):
- try:
- doc = make_new_document(data, schedule_date)
- if data.notify_by_email and data.recipients:
- print_format = data.print_format or "Standard"
- send_notification(doc, data, print_format=print_format)
-
- frappe.db.commit()
- except Exception:
- frappe.db.rollback()
- frappe.db.begin()
- frappe.log_error(frappe.get_traceback())
- disable_subscription(data)
- frappe.db.commit()
- if data.reference_document and not frappe.flags.in_test:
- notify_error_to_user(data)
-
-def disable_subscription(data):
- subscription = frappe.get_doc('Subscription', data.name)
- subscription.db_set('disabled', 1)
-
-def notify_error_to_user(data):
- party = ''
- party_type = ''
-
- if data.reference_doctype in ['Sales Order', 'Sales Invoice', 'Delivery Note']:
- party_type = 'customer'
- elif data.reference_doctype in ['Purchase Order', 'Purchase Invoice', 'Purchase Receipt']:
- party_type = 'supplier'
-
- if party_type:
- party = frappe.db.get_value(data.reference_doctype, data.reference_document, party_type)
-
- notify_errors(data.reference_document, data.reference_doctype, party, data.owner, data.name)
-
-def make_new_document(args, schedule_date):
- doc = frappe.get_doc(args.reference_doctype, args.reference_document)
- new_doc = frappe.copy_doc(doc, ignore_no_copy=False)
- update_doc(new_doc, doc , args, schedule_date)
- new_doc.insert(ignore_permissions=True)
-
- if args.submit_on_creation:
- new_doc.submit()
-
- return new_doc
-
-def update_doc(new_document, reference_doc, args, schedule_date):
- new_document.docstatus = 0
- if new_document.meta.get_field('set_posting_time'):
- new_document.set('set_posting_time', 1)
-
- mcount = month_map.get(args.frequency)
-
- if new_document.meta.get_field('subscription'):
- new_document.set('subscription', args.name)
-
- for fieldname in ['naming_series', 'ignore_pricing_rule', 'posting_time'
- 'select_print_heading', 'remarks', 'owner']:
- if new_document.meta.get_field(fieldname):
- new_document.set(fieldname, reference_doc.get(fieldname))
-
- # copy item fields
- if new_document.meta.get_field('items'):
- for i, item in enumerate(new_document.items):
- for fieldname in ("page_break",):
- item.set(fieldname, reference_doc.items[i].get(fieldname))
-
- for data in new_document.meta.fields:
- if data.fieldtype == 'Date' and data.reqd:
- new_document.set(data.fieldname, schedule_date)
-
- set_subscription_period(args, mcount, new_document)
-
- new_document.run_method("on_recurring", reference_doc=reference_doc, subscription_doc=args)
-
-def set_subscription_period(args, mcount, new_document):
- if mcount and new_document.meta.get_field('from_date') and new_document.meta.get_field('to_date'):
- last_ref_doc = frappe.db.sql("""
- select name, from_date, to_date
- from `tab{0}`
- where subscription=%s and docstatus < 2
- order by creation desc
- limit 1
- """.format(args.reference_doctype), args.name, as_dict=1)
-
- if not last_ref_doc:
- return
-
- from_date = get_next_date(last_ref_doc[0].from_date, mcount)
-
- if (cstr(get_first_day(last_ref_doc[0].from_date)) == cstr(last_ref_doc[0].from_date)) and \
- (cstr(get_last_day(last_ref_doc[0].to_date)) == cstr(last_ref_doc[0].to_date)):
- to_date = get_last_day(get_next_date(last_ref_doc[0].to_date, mcount))
+ If is not in a trial period, it will be `x` days from the beginning of the
+ current billing period where `x` is the billing interval from the
+ `Subscription Plan` in the `Subscription`.
+ """
+ if self.is_trialling():
+ self.current_invoice_end = self.trial_period_end
else:
- to_date = get_next_date(last_ref_doc[0].to_date, mcount)
+ billing_cycle_info = self.get_billing_cycle()
+ if billing_cycle_info:
+ self.current_invoice_end = add_to_date(self.current_invoice_start, **billing_cycle_info)
+ else:
+ self.current_invoice_end = get_last_day(self.current_invoice_start)
- new_document.set('from_date', from_date)
- new_document.set('to_date', to_date)
+ def get_billing_cycle(self):
+ """
+ Returns a dict containing billing cycle information deduced from the
+ `Subscription Plan` in the `Subscription`.
+ """
+ return self.get_billing_cycle_data()
-def get_next_date(dt, mcount, day=None):
- dt = getdate(dt)
- dt += relativedelta(months=mcount, day=day)
+ @staticmethod
+ def validate_plans_billing_cycle(billing_cycle_data):
+ """
+ Makes sure that all `Subscription Plan` in the `Subscription` have the
+ same billing interval
+ """
+ if billing_cycle_data and len(billing_cycle_data) != 1:
+ frappe.throw(_('You can only have Plans with the same billing cycle in a Subscription'))
- return dt
+ def get_billing_cycle_and_interval(self):
+ """
+ Returns a dict representing the billing interval and cycle for this `Subscription`.
-def send_notification(new_rv, subscription_doc, print_format='Standard'):
- """Notify concerned persons about recurring document generation"""
- print_format = print_format
- subject = subscription_doc.subject or ''
- message = subscription_doc.message or ''
+ You shouldn't need to call this directly. Use `get_billing_cycle` instead.
+ """
+ plan_names = [plan.plan for plan in self.plans]
+ billing_info = frappe.db.sql(
+ 'select distinct `billing_interval`, `billing_interval_count` '
+ 'from `tabSubscription Plan` '
+ 'where name in %s',
+ (plan_names,), as_dict=1
+ )
- if not subscription_doc.subject:
- subject = _("New {0}: #{1}").format(new_rv.doctype, new_rv.name)
- elif "{" in subscription_doc.subject:
- subject = frappe.render_template(subscription_doc.subject, {'doc': new_rv})
+ return billing_info
- if not subscription_doc.message:
- message = _("Please find attached {0} #{1}").format(new_rv.doctype, new_rv.name)
- elif "{" in subscription_doc.message:
- message = frappe.render_template(subscription_doc.message, {'doc': new_rv})
+ def get_billing_cycle_data(self):
+ """
+ Returns dict contain the billing cycle data.
- attachments = [frappe.attach_print(new_rv.doctype, new_rv.name,
- file_name=new_rv.name, print_format=print_format)]
+ You shouldn't need to call this directly. Use `get_billing_cycle` instead.
+ """
+ billing_info = self.get_billing_cycle_and_interval()
- frappe.sendmail(subscription_doc.recipients,
- subject=subject, message=message, attachments=attachments)
+ self.validate_plans_billing_cycle(billing_info)
-def notify_errors(doc, doctype, party, owner, name):
- recipients = get_system_managers(only_name=True)
- frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")],
- subject=_("[Urgent] Error while creating recurring %s for %s" % (doctype, doc)),
- message = frappe.get_template("templates/emails/recurring_document_failed.html").render({
- "type": _(doctype),
- "name": doc,
- "party": party or "",
- "subscription": name
- }))
+ if billing_info:
+ data = dict()
+ interval = billing_info[0]['billing_interval']
+ interval_count = billing_info[0]['billing_interval_count']
+ if interval not in ['Day', 'Week']:
+ data['days'] = -1
+ if interval == 'Day':
+ data['days'] = interval_count - 1
+ elif interval == 'Month':
+ data['months'] = interval_count
+ elif interval == 'Year':
+ data['years'] = interval_count
+ # todo: test week
+ elif interval == 'Week':
+ data['days'] = interval_count * 7 - 1
- assign_task_to_owner(name, "Recurring Documents Failed", recipients)
+ return data
-def assign_task_to_owner(name, msg, users):
- for d in users:
- args = {
- 'doctype' : 'Subscription',
- 'assign_to' : d,
- 'name' : name,
- 'description' : msg,
- 'priority' : 'High'
- }
- assign_to.add(args)
+ def set_status_grace_period(self):
+ """
+ Sets the `Subscription` `status` based on the preference set in `Subscription Settings`.
+
+ Used when the `Subscription` needs to decide what to do after the current generated
+ invoice is past it's due date and grace period.
+ """
+ subscription_settings = frappe.get_single('Subscription Settings')
+ if self.status == 'Past Due Date' and self.is_past_grace_period():
+ self.status = 'Cancelled' if cint(subscription_settings.cancel_after_grace) else 'Unpaid'
+
+ def set_subscription_status(self):
+ """
+ Sets the status of the `Subscription`
+ """
+ if self.is_trialling():
+ self.status = 'Trialling'
+ elif self.status == 'Past Due Date' and self.is_past_grace_period():
+ subscription_settings = frappe.get_single('Subscription Settings')
+ self.status = 'Cancelled' if cint(subscription_settings.cancel_after_grace) else 'Unpaid'
+ elif self.status == 'Past Due Date' and not self.has_outstanding_invoice():
+ self.status = 'Active'
+ elif self.current_invoice_is_past_due():
+ self.status = 'Past Due Date'
+ elif self.is_new_subscription():
+ self.status = 'Active'
+ # todo: then generate new invoice
+ self.save()
+
+ def is_trialling(self):
+ """
+ Returns `True` if the `Subscription` is trial period.
+ """
+ return not self.period_has_passed(self.trial_period_end) and self.is_new_subscription()
+
+ @staticmethod
+ def period_has_passed(end_date):
+ """
+ Returns true if the given `end_date` has passed
+ """
+ # todo: test for illegal time
+ if not end_date:
+ return True
+
+ end_date = getdate(end_date)
+ return getdate(nowdate()) > getdate(end_date)
+
+ def is_past_grace_period(self):
+ """
+ Returns `True` if the grace period for the `Subscription` has passed
+ """
+ current_invoice = self.get_current_invoice()
+ if self.current_invoice_is_past_due(current_invoice):
+ subscription_settings = frappe.get_single('Subscription Settings')
+ grace_period = cint(subscription_settings.grace_period)
+
+ return getdate(nowdate()) > add_days(current_invoice.due_date, grace_period)
+
+ def current_invoice_is_past_due(self, current_invoice=None):
+ """
+ Returns `True` if the current generated invoice is overdue
+ """
+ if not current_invoice:
+ current_invoice = self.get_current_invoice()
+
+ if not current_invoice:
+ return False
+ else:
+ return getdate(nowdate()) > getdate(current_invoice.due_date)
+
+ def get_current_invoice(self):
+ """
+ Returns the most recent generated invoice.
+ """
+ if len(self.invoices):
+ current = self.invoices[-1]
+ if frappe.db.exists('Sales Invoice', current.invoice):
+ doc = frappe.get_doc('Sales Invoice', current.invoice)
+ return doc
+ else:
+ frappe.throw(_('Invoice {0} no longer exists'.format(current.invoice)))
+
+ def is_new_subscription(self):
+ """
+ Returns `True` if `Subscription` has never generated an invoice
+ """
+ return len(self.invoices) == 0
+
+ def validate(self):
+ self.validate_trial_period()
+ self.validate_plans_billing_cycle(self.get_billing_cycle_and_interval())
+
+ def validate_trial_period(self):
+ """
+ Runs sanity checks on trial period dates for the `Subscription`
+ """
+ if self.trial_period_start and self.trial_period_end:
+ if getdate(self.trial_period_end) < getdate(self.trial_period_start):
+ frappe.throw(_('Trial Period End Date Cannot be before Trial Period Start Date'))
+
+ elif self.trial_period_start or self.trial_period_end:
+ frappe.throw(_('Both Trial Period Start Date and Trial Period End Date must be set'))
+
+ def after_insert(self):
+ # todo: deal with users who collect prepayments. Maybe a new Subscription Invoice doctype?
+ self.set_subscription_status()
+
+ def generate_invoice(self, prorate=0):
+ """
+ Creates a `Sales Invoice` for the `Subscription`, updates `self.invoices` and
+ saves the `Subscription`.
+ """
+ invoice = self.create_invoice(prorate)
+ self.append('invoices', {'invoice': invoice.name})
+ self.save()
+
+ return invoice
+
+ def create_invoice(self, prorate):
+ """
+ Creates a `Sales Invoice`, submits it and returns it
+ """
+ invoice = frappe.new_doc('Sales Invoice')
+ invoice.set_posting_time = 1
+ invoice.posting_date = self.current_invoice_start
+ invoice.customer = self.get_customer(self.subscriber)
+
+ # Subscription is better suited for service items. I won't update `update_stock`
+ # for that reason
+ items_list = self.get_items_from_plans(self.plans, prorate)
+ for item in items_list:
+ item['qty'] = self.quantity
+ invoice.append('items', item)
+
+ # Taxes
+ if self.tax_template:
+ invoice.taxes_and_charges = self.tax_template
+ invoice.set_taxes()
+
+ # Due date
+ invoice.append(
+ 'payment_schedule',
+ {
+ 'due_date': add_days(self.current_invoice_end, cint(self.days_until_due)),
+ 'invoice_portion': 100
+ }
+ )
+
+ # Discounts
+ if self.additional_discount_percentage:
+ invoice.additional_discount_percentage = self.additional_discount_percentage
+
+ if self.additional_discount_amount:
+ invoice.discount_amount = self.additional_discount_amount
+
+ if self.additional_discount_percentage or self.additional_discount_amount:
+ discount_on = self.apply_additional_discount
+ invoice.apply_additional_discount = discount_on if discount_on else 'Grand Total'
+
+ invoice.flags.ignore_mandatory = True
+ invoice.save()
+ invoice.submit()
+
+ return invoice
+
+ @staticmethod
+ def get_customer(subscriber_name):
+ """
+ Returns the `Customer` linked to the `Subscriber`
+ """
+ return frappe.get_value('Subscriber', subscriber_name)
+
+ def get_items_from_plans(self, plans, prorate=0):
+ """
+ Returns the `Item`s linked to `Subscription Plan`
+ """
+ plan_items = [plan.plan for plan in plans]
+ item_names = None
+
+ if plan_items and not prorate:
+ item_names = frappe.db.sql(
+ 'select item as item_code, cost as rate from `tabSubscription Plan` where name in %s',
+ (plan_items,), as_dict=1
+ )
+
+ elif plan_items:
+ prorate_factor = get_prorata_factor(self.current_invoice_end, self.current_invoice_start)
+
+ item_names = frappe.db.sql(
+ 'select item as item_code, cost * %s as rate from `tabSubscription Plan` where name in %s',
+ (prorate_factor, plan_items,), as_dict=1
+ )
+
+ return item_names
+
+ def process(self):
+ """
+ To be called by task periodically. It checks the subscription and takes appropriate action
+ as need be. It calls either of these methods depending the `Subscription` status:
+ 1. `process_for_active`
+ 2. `process_for_past_due`
+ """
+ if self.status == 'Active':
+ self.process_for_active()
+ elif self.status in ['Past Due Date', 'Unpaid']:
+ self.process_for_past_due_date()
+
+ self.save()
+
+ def process_for_active(self):
+ """
+ Called by `process` if the status of the `Subscription` is 'Active'.
+
+ The possible outcomes of this method are:
+ 1. Generate a new invoice
+ 2. Change the `Subscription` status to 'Past Due Date'
+ 3. Change the `Subscription` status to 'Cancelled'
+ """
+ if getdate(nowdate()) > getdate(self.current_invoice_end) and not self.has_outstanding_invoice():
+ self.generate_invoice()
+ if self.current_invoice_is_past_due():
+ self.status = 'Past Due Date'
+
+ if self.current_invoice_is_past_due() and getdate(nowdate()) > getdate(self.current_invoice_end):
+ self.status = 'Past Due Date'
+
+ if self.cancel_at_period_end and getdate(nowdate()) > self.current_invoice_end:
+ self.cancel_subscription_at_period_end()
+
+ def cancel_subscription_at_period_end(self):
+ """
+ Called when `Subscription.cancel_at_period_end` is truthy
+ """
+ self.status = 'Cancelled'
+ if not self.cancelation_date:
+ self.cancelation_date = nowdate()
+
+ def process_for_past_due_date(self):
+ """
+ Called by `process` if the status of the `Subscription` is 'Past Due Date'.
+
+ The possible outcomes of this method are:
+ 1. Change the `Subscription` status to 'Active'
+ 2. Change the `Subscription` status to 'Cancelled'
+ 3. Change the `Subscription` status to 'Unpaid'
+ """
+ current_invoice = self.get_current_invoice()
+ if not current_invoice:
+ frappe.throw(_('Current invoice {0} is missing'.format(current_invoice.invoice)))
+ else:
+ if self.is_not_outstanding(current_invoice):
+ self.status = 'Active'
+ self.update_subscription_period(nowdate())
+ else:
+ self.set_status_grace_period()
+
+ @staticmethod
+ def is_not_outstanding(invoice):
+ """
+ Return `True` if the given invoice is paid
+ """
+ return invoice.status == 'Paid'
+
+ def has_outstanding_invoice(self):
+ """
+ Returns `True` if the most recent invoice for the `Subscription` is not paid
+ """
+ current_invoice = self.get_current_invoice()
+ if not current_invoice:
+ return False
+ else:
+ return not self.is_not_outstanding(current_invoice)
+
+ def cancel_subscription(self):
+ """
+ This sets the subscription as cancelled. It will stop invoices from being generated
+ but it will not affect already created invoices.
+ """
+ if self.status != 'Cancelled':
+ to_generate_invoice = True if self.status == 'Active' else False
+ to_prorate = frappe.db.get_single_value('Subscription Settings', 'prorate')
+ self.status = 'Cancelled'
+ self.cancelation_date = nowdate()
+ if to_generate_invoice:
+ self.generate_invoice(prorate=to_prorate)
+ self.save()
+
+ def restart_subscription(self):
+ """
+ This sets the subscription as active. The subscription will be made to be like a new
+ subscription and the `Subscription` will lose all the history of generated invoices
+ it has.
+ """
+ if self.status == 'Cancelled':
+ self.status = 'Active'
+ self.db_set('start', nowdate())
+ self.update_subscription_period(nowdate())
+ self.invoices = []
+ self.save()
+ else:
+ frappe.throw(_('You cannot restart a Subscription that is not cancelled.'))
+
+ def get_precision(self):
+ invoice = self.get_current_invoice()
+ if invoice:
+ return invoice.precision('grand_total')
+
+
+def get_prorata_factor(period_end, period_start):
+ diff = flt(date_diff(nowdate(), period_start) + 1)
+ plan_days = flt(date_diff(period_end, period_start) + 1)
+ prorate_factor = diff / plan_days
+
+ return prorate_factor
+
+
+def process_all():
+ """
+ Task to updates the status of all `Subscription` apart from those that are cancelled
+ """
+ subscriptions = get_all_subscriptions()
+ for subscription in subscriptions:
+ process(subscription)
+
+
+def get_all_subscriptions():
+ """
+ Returns all `Subscription` documents
+ """
+ return frappe.db.sql(
+ 'select name from `tabSubscription` where status != "Cancelled"',
+ as_dict=1
+ )
+
+
+def process(data):
+ """
+ Checks a `Subscription` and updates it status as necessary
+ """
+ if data:
+ try:
+ subscription = frappe.get_doc('Subscription', data['name'])
+ subscription.process()
+ frappe.db.commit()
+ except frappe.ValidationError:
+ frappe.db.rollback()
+ frappe.db.begin()
+ frappe.log_error(frappe.get_traceback())
+ frappe.db.commit()
+
@frappe.whitelist()
-def make_subscription(doctype, docname):
- doc = frappe.new_doc('Subscription')
+def cancel_subscription(name):
+ """
+ Cancels a `Subscription`. This will stop the `Subscription` from further invoicing the
+ `Subscriber` but all already outstanding invoices will not be affected.
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.cancel_subscription()
- reference_doc = frappe.get_doc(doctype, docname)
- doc.reference_doctype = doctype
- doc.reference_document = docname
- doc.start_date = reference_doc.get('posting_date') or reference_doc.get('transaction_date')
- return doc
@frappe.whitelist()
-def stop_resume_subscription(subscription, status):
- doc = frappe.get_doc('Subscription', subscription)
- frappe.msgprint(_("Subscription has been {0}").format(status))
- if status == 'Resumed':
- doc.next_schedule_date = get_next_schedule_date(today(),
- doc.frequency, doc.repeat_on_day)
+def restart_subscription(name):
+ """
+ Restarts a cancelled `Subscription`. The `Subscription` will 'forget' the history of
+ all invoices it has generated
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.restart_subscription()
- doc.update_status(status)
- doc.save()
- return doc.status
-
-def subscription_doctype_query(doctype, txt, searchfield, start, page_len, filters):
- return frappe.db.sql("""select parent from `tabDocField`
- where fieldname = 'subscription'
- and parent like %(txt)s
- order by
- if(locate(%(_txt)s, parent), locate(%(_txt)s, parent), 99999),
- parent
- limit %(start)s, %(page_len)s""".format(**{
- 'key': searchfield,
- }), {
- 'txt': "%%%s%%" % txt,
- '_txt': txt.replace("%", ""),
- 'start': start,
- 'page_len': page_len
- })
\ No newline at end of file
+@frappe.whitelist()
+def get_subscription_updates(name):
+ """
+ Use this to get the latest state of the given `Subscription`
+ """
+ subscription = frappe.get_doc('Subscription', name)
+ subscription.process()
diff --git a/erpnext/accounts/doctype/subscription/subscription_list.js b/erpnext/accounts/doctype/subscription/subscription_list.js
index 71e3cce..abcfc5e 100644
--- a/erpnext/accounts/doctype/subscription/subscription_list.js
+++ b/erpnext/accounts/doctype/subscription/subscription_list.js
@@ -1,16 +1,15 @@
frappe.listview_settings['Subscription'] = {
- add_fields: ["next_schedule_date"],
get_indicator: function(doc) {
- if(doc.disabled) {
- return [__("Disabled"), "red"];
- } else if(doc.next_schedule_date >= frappe.datetime.get_today() && doc.status != 'Stopped') {
+ if(doc.status === 'Trialling') {
+ return [__("Trialling"), "green"];
+ } else if(doc.status === 'Active') {
return [__("Active"), "green"];
- } else if(doc.docstatus === 0) {
- return [__("Draft"), "red", "docstatus,=,0"];
- } else if(doc.status === 'Stopped') {
- return [__("Stopped"), "red"];
- } else {
- return [__("Expired"), "darkgrey"];
+ } else if(doc.status === 'Past Due Date') {
+ return [__("Past Due Date"), "orange"];
+ } else if(doc.status === 'Unpaid') {
+ return [__("Unpaid"), "red"];
+ } else if(doc.status === 'Cancelled') {
+ return [__("Cancelled"), "darkgrey"];
}
}
};
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/subscription/test_subscription.py b/erpnext/accounts/doctype/subscription/test_subscription.py
index 118188c..47efa45 100644
--- a/erpnext/accounts/doctype/subscription/test_subscription.py
+++ b/erpnext/accounts/doctype/subscription/test_subscription.py
@@ -1,93 +1,498 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
-import frappe
import unittest
-from frappe.utils import today, add_days, getdate
-from erpnext.accounts.utils import get_fiscal_year
-from erpnext.accounts.report.financial_statements import get_months
-from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
-from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order
-from erpnext.accounts.doctype.subscription.subscription import make_subscription_entry
+
+import frappe
+from erpnext.accounts.doctype.subscription.subscription import get_prorata_factor
+from frappe.utils.data import nowdate, add_days, add_to_date, add_months, date_diff, flt
+
+
+def create_plan():
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 900
+ plan.billing_interval = 'Month'
+ plan.billing_interval_count = 1
+ plan.insert()
+
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name 2'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name 2'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 1999
+ plan.billing_interval = 'Month'
+ plan.billing_interval_count = 1
+ plan.insert()
+
+ if not frappe.db.exists('Subscription Plan', '_Test Plan Name 3'):
+ plan = frappe.new_doc('Subscription Plan')
+ plan.plan_name = '_Test Plan Name 3'
+ plan.item = '_Test Non Stock Item'
+ plan.cost = 1999
+ plan.billing_interval = 'Day'
+ plan.billing_interval_count = 14
+ plan.insert()
+
+
+def create_subscriber():
+ if not frappe.db.exists('Subscriber', '_Test Customer'):
+ subscriber = frappe.new_doc('Subscriber')
+ subscriber.subscriber_name = '_Test Customer'
+ subscriber.customer = '_Test Customer'
+ subscriber.insert()
+
class TestSubscription(unittest.TestCase):
- def test_daily_subscription(self):
- qo = frappe.copy_doc(quotation_records[0])
- qo.submit()
- doc = make_subscription(reference_document=qo.name)
- self.assertEqual(doc.next_schedule_date, today())
- make_subscription_entry()
- frappe.db.commit()
+ def setUp(self):
+ create_plan()
+ create_subscriber()
- quotation = frappe.get_doc(doc.reference_doctype, doc.reference_document)
- self.assertEqual(quotation.subscription, doc.name)
+ def test_create_subscription_with_trial_with_correct_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_start = nowdate()
+ subscription.trial_period_end = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
- new_quotation = frappe.db.get_value('Quotation',
- {'subscription': doc.name, 'name': ('!=', quotation.name)}, 'name')
+ self.assertEqual(subscription.trial_period_start, nowdate())
+ self.assertEqual(subscription.trial_period_end, add_days(nowdate(), 30))
+ self.assertEqual(subscription.trial_period_start, subscription.current_invoice_start)
+ self.assertEqual(subscription.trial_period_end, subscription.current_invoice_end)
+ self.assertEqual(subscription.invoices, [])
+ self.assertEqual(subscription.status, 'Trialling')
- new_quotation = frappe.get_doc('Quotation', new_quotation)
+ subscription.delete()
- for fieldname in ['customer', 'company', 'order_type', 'total', 'net_total']:
- self.assertEqual(quotation.get(fieldname), new_quotation.get(fieldname))
+ def test_create_subscription_without_trial_with_correct_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
- for fieldname in ['item_code', 'qty', 'rate', 'amount']:
- self.assertEqual(quotation.items[0].get(fieldname),
- new_quotation.items[0].get(fieldname))
+ self.assertEqual(subscription.trial_period_start, None)
+ self.assertEqual(subscription.trial_period_end, None)
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ # No invoice is created
+ self.assertEqual(len(subscription.invoices), 0)
+ self.assertEqual(subscription.status, 'Active')
- def test_monthly_subscription_for_so(self):
- current_fiscal_year = get_fiscal_year(today(), as_dict=True)
- start_date = current_fiscal_year.year_start_date
- end_date = current_fiscal_year.year_end_date
+ subscription.delete()
- for doctype in ['Sales Order', 'Sales Invoice']:
- if doctype == 'Sales Invoice':
- docname = create_sales_invoice(posting_date=start_date)
- else:
- docname = make_sales_order()
+ def test_create_subscription_trial_with_wrong_dates(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_end = nowdate()
+ subscription.trial_period_start = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
- self.monthly_subscription(doctype, docname.name, start_date, end_date)
+ self.assertRaises(frappe.ValidationError, subscription.save)
+ subscription.delete()
- def monthly_subscription(self, doctype, docname, start_date, end_date):
- doc = make_subscription(reference_doctype=doctype, frequency = 'Monthly',
- reference_document = docname, start_date=start_date, end_date=end_date)
+ def test_create_subscription_multi_with_different_billing_fails(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.trial_period_end = nowdate()
+ subscription.trial_period_start = add_days(nowdate(), 30)
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.append('plans', {'plan': '_Test Plan Name 3'})
- doc.disabled = 1
- doc.save()
- frappe.db.commit()
+ self.assertRaises(frappe.ValidationError, subscription.save)
+ subscription.delete()
- make_subscription_entry()
- docnames = frappe.get_all(doc.reference_doctype, {'subscription': doc.name})
- self.assertEqual(len(docnames), 1)
+ def test_invoice_is_generated_at_end_of_billing_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.start = '2018-01-01'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.insert()
- doc = frappe.get_doc('Subscription', doc.name)
- doc.disabled = 0
- doc.save()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, '2018-01-01')
+ self.assertEqual(subscription.current_invoice_end, '2018-01-31')
+ subscription.process()
- months = get_months(getdate(start_date), getdate(today()))
- make_subscription_entry()
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.current_invoice_start, '2018-01-01')
+ self.assertEqual(subscription.status, 'Past Due Date')
+ subscription.delete()
- docnames = frappe.get_all(doc.reference_doctype, {'subscription': doc.name})
- self.assertEqual(len(docnames), months)
+ def test_status_goes_back_to_active_after_invoice_is_paid(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.status, 'Past Due Date')
-quotation_records = frappe.get_test_records('Quotation')
+ subscription.get_current_invoice()
+ current_invoice = subscription.get_current_invoice()
-def make_subscription(**args):
- args = frappe._dict(args)
- doc = frappe.get_doc({
- 'doctype': 'Subscription',
- 'reference_doctype': args.reference_doctype or 'Quotation',
- 'reference_document': args.reference_document or \
- frappe.db.get_value('Quotation', {'docstatus': 1}, 'name'),
- 'frequency': args.frequency or 'Daily',
- 'start_date': args.start_date or add_days(today(), -1),
- 'end_date': args.end_date or add_days(today(), 1),
- 'submit_on_creation': args.submit_on_creation or 0
- }).insert(ignore_permissions=True)
+ self.assertIsNotNone(current_invoice)
- if not args.do_not_submit:
- doc.submit()
+ current_invoice.db_set('outstanding_amount', 0)
+ current_invoice.db_set('status', 'Paid')
+ subscription.process()
- return doc
\ No newline at end of file
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(len(subscription.invoices), 1)
+
+ subscription.delete()
+
+ def test_subscription_cancel_after_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_unpaid_after_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_invoice_days_until_due(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.days_until_due = 10
+ subscription.start = add_months(nowdate(), -1)
+ subscription.insert()
+ subscription.process() # generate first invoice
+ self.assertEqual(len(subscription.invoices), 1)
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.delete()
+
+ def test_subscription_is_past_due_doesnt_change_within_grace_period(self):
+ settings = frappe.get_single('Subscription Settings')
+ grace_period = settings.grace_period
+ settings.grace_period = 1000
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # Grace period is 1000 days so status should remain as Past Due Date
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ settings.grace_period = grace_period
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_remains_active_during_invoice_period(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.process() # no changes expected
+
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process() # no changes expected still
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process() # no changes expected yet still
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(subscription.current_invoice_start, nowdate())
+ self.assertEqual(subscription.current_invoice_end, add_to_date(nowdate(), months=1, days=-1))
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.delete()
+
+ def test_subscription_cancelation(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.delete()
+
+ def test_subscription_cancellation_invoices(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.cancel_subscription()
+ # Invoice must have been generated
+ self.assertEqual(len(subscription.invoices), 1)
+
+ invoice = subscription.get_current_invoice()
+ diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
+ plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
+ prorate_factor = flt(diff/plan_days)
+
+ self.assertEqual(
+ flt(
+ get_prorata_factor(subscription.current_invoice_end, subscription.current_invoice_start),
+ 2),
+ flt(prorate_factor, 2)
+ )
+ self.assertEqual(flt(invoice.grand_total, 2), flt(prorate_factor * 900, 2))
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.delete()
+ settings.prorate = to_prorate
+ settings.save()
+
+ def test_subscription_cancellation_invoices_with_prorata_false(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.grand_total, 900)
+
+ settings.prorate = to_prorate
+ settings.save()
+
+ subscription.delete()
+
+ def test_subscription_cancellation_invoices_with_prorata_true(self):
+ settings = frappe.get_single('Subscription Settings')
+ to_prorate = settings.prorate
+ settings.prorate = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+ diff = flt(date_diff(nowdate(), subscription.current_invoice_start) + 1)
+ plan_days = flt(date_diff(subscription.current_invoice_end, subscription.current_invoice_start) + 1)
+ prorate_factor = flt(diff / plan_days)
+
+ self.assertEqual(flt(invoice.grand_total, 2), flt(prorate_factor * 900, 2))
+
+ settings.prorate = to_prorate
+ settings.save()
+
+ subscription.delete()
+
+ def test_subcription_cancellation_and_process(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 1
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+ invoices = len(subscription.invoices)
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.cancel_subscription()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Cancelled')
+ self.assertEqual(len(subscription.invoices), invoices)
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_restart_and_process(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.grace_period = 0
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ subscription.cancel_subscription()
+ self.assertEqual(subscription.status, 'Cancelled')
+
+ subscription.restart_subscription()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+ self.assertEqual(len(subscription.invoices), 0)
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_subscription_unpaid_back_to_active(self):
+ settings = frappe.get_single('Subscription Settings')
+ default_grace_period_action = settings.cancel_after_grace
+ settings.cancel_after_grace = 0
+ settings.save()
+
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.start = '2018-01-01'
+ subscription.insert()
+ subscription.process() # generate first invoice
+
+ self.assertEqual(subscription.status, 'Past Due Date')
+
+ subscription.process()
+ # This should change status to Cancelled since grace period is 0
+ self.assertEqual(subscription.status, 'Unpaid')
+
+ invoice = subscription.get_current_invoice()
+ invoice.db_set('outstanding_amount', 0)
+ invoice.db_set('status', 'Paid')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+
+ subscription.process()
+ self.assertEqual(subscription.status, 'Active')
+
+ settings.cancel_after_grace = default_grace_period_action
+ settings.save()
+ subscription.delete()
+
+ def test_restart_active_subscription(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+
+ self.assertRaises(frappe.ValidationError, subscription.restart_subscription)
+
+ subscription.delete()
+
+ def test_subscription_invoice_discount_percentage(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.additional_discount_percentage = 10
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.additional_discount_percentage, 10)
+ self.assertEqual(invoice.apply_discount_on, 'Grand Total')
+
+ subscription.delete()
+
+ def test_subscription_invoice_discount_amount(self):
+ subscription = frappe.new_doc('Subscription')
+ subscription.subscriber = '_Test Customer'
+ subscription.additional_discount_amount = 11
+ subscription.append('plans', {'plan': '_Test Plan Name'})
+ subscription.save()
+ subscription.cancel_subscription()
+
+ invoice = subscription.get_current_invoice()
+
+ self.assertEqual(invoice.discount_amount, 11)
+ self.assertEqual(invoice.apply_discount_on, 'Grand Total')
+
+ subscription.delete()
diff --git a/erpnext/accounts/doctype/subscription_invoice/__init__.py b/erpnext/accounts/doctype/subscription_invoice/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json
new file mode 100644
index 0000000..c4bae1d
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.json
@@ -0,0 +1,73 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-26 04:21:41.265055",
+ "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": "invoice",
+ "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": "Invoice",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Sales Invoice",
+ "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
+ }
+ ],
+ "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": "2018-02-26 10:48:07.033422",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Invoice",
+ "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/accounts/doctype/subscription_invoice/subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py
new file mode 100644
index 0000000..6f459b4
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/subscription_invoice.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionInvoice(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js
new file mode 100644
index 0000000..15d3df2
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Invoice", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Invoice
+ () => frappe.tests.make('Subscription Invoice', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py
new file mode 100644
index 0000000..e60a4ee
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_invoice/test_subscription_invoice.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionInvoice(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_plan/__init__.py b/erpnext/accounts/doctype/subscription_plan/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.js b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_plan/subscription_plan.json b/erpnext/accounts/doctype/subscription_plan/subscription_plan.json
new file mode 100644
index 0000000..ab58e7c
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.json
@@ -0,0 +1,255 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 1,
+ "autoname": "field:plan_name",
+ "beta": 0,
+ "creation": "2018-02-24 11:31:23.066506",
+ "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": "plan_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": "Plan 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item",
+ "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": "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": 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": "currency",
+ "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": "Currency",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cost",
+ "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": "Cost",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Day",
+ "fieldname": "billing_interval",
+ "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": "Billing Interval",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Day\nWeek\nMonth\nYear",
+ "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,
+ "default": "1",
+ "description": "Number of intervals for the interval field e.g if Interval is 'Days' and Billing Interval Count is 3, invoices will be generated every 3 days",
+ "fieldname": "billing_interval_count",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Billing Interval Count",
+ "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
+ }
+ ],
+ "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": "2018-02-27 09:12:58.330140",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Plan",
+ "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,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/subscription_plan/subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
new file mode 100644
index 0000000..4b8c8fc
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/subscription_plan.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class SubscriptionPlan(Document):
+ def validate(self):
+ self.validate_interval_count()
+
+ def validate_interval_count(self):
+ if self.billing_interval_count < 1:
+ frappe.throw('Billing Interval Count cannot be less than 1')
diff --git a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js
new file mode 100644
index 0000000..3ceb9a6
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Plan", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Plan
+ () => frappe.tests.make('Subscription Plan', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py
new file mode 100644
index 0000000..73afbf6
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan/test_subscription_plan.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionPlan(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_plan_detail/__init__.py b/erpnext/accounts/doctype/subscription_plan_detail/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json
new file mode 100644
index 0000000..c112923
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.json
@@ -0,0 +1,73 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-25 07:35:07.736146",
+ "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": "plan",
+ "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": "Plan",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Subscription Plan",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "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": "2018-02-25 07:35:07.736146",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Plan Detail",
+ "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/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py
new file mode 100644
index 0000000..1d9606f
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_plan_detail/subscription_plan_detail.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionPlanDetail(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_settings/__init__.py b/erpnext/accounts/doctype/subscription_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/__init__.py
diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.js b/erpnext/accounts/doctype/subscription_settings/subscription_settings.js
new file mode 100644
index 0000000..f5ea804
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.js
@@ -0,0 +1,2 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
diff --git a/erpnext/accounts/doctype/subscription_settings/subscription_settings.json b/erpnext/accounts/doctype/subscription_settings/subscription_settings.json
new file mode 100644
index 0000000..8c7c6f3
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.json
@@ -0,0 +1,179 @@
+{
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2018-02-26 06:13:37.910139",
+ "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,
+ "default": "1",
+ "description": "Number of days after invoice date has elapsed before canceling subscription or marking subscription as unpaid",
+ "fieldname": "grace_period",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Grace Period",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "fieldname": "cancel_after_grace",
+ "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": "Cancel Invoice After Grace Period",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "prorate",
+ "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": "Prorate",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ }
+ ],
+ "has_web_view": 0,
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 0,
+ "image_view": 0,
+ "in_create": 0,
+ "is_submittable": 0,
+ "issingle": 1,
+ "istable": 0,
+ "max_attachments": 0,
+ "modified": "2018-02-26 13:58:09.455832",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Subscription Settings",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Administrator",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "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/accounts/doctype/subscription_settings/subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py
new file mode 100644
index 0000000..cc378e4
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/subscription_settings.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+
+class SubscriptionSettings(Document):
+ pass
diff --git a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js
new file mode 100644
index 0000000..5a751ea
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.js
@@ -0,0 +1,23 @@
+/* eslint-disable */
+// rename this file from _test_[name] to test_[name] to activate
+// and remove above this line
+
+QUnit.test("test: Subscription Settings", function (assert) {
+ let done = assert.async();
+
+ // number of asserts
+ assert.expect(1);
+
+ frappe.run_serially([
+ // insert a new Subscription Settings
+ () => frappe.tests.make('Subscription Settings', [
+ // values to be set
+ {key: 'value'}
+ ]),
+ () => {
+ assert.equal(cur_frm.doc.key, 'value');
+ },
+ () => done()
+ ]);
+
+});
diff --git a/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py
new file mode 100644
index 0000000..82c7e1d
--- /dev/null
+++ b/erpnext/accounts/doctype/subscription_settings/test_subscription_settings.py
@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import unittest
+
+class TestSubscriptionSettings(unittest.TestCase):
+ pass
diff --git a/erpnext/accounts/email_alert/__init__.py b/erpnext/accounts/email_alert/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/email_alert/__init__.py
diff --git a/erpnext/accounts/email_alert/notification_for_new_fiscal_year/__init__.py b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/__init__.py
diff --git a/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.json b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.json
new file mode 100644
index 0000000..2e524d6
--- /dev/null
+++ b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.json
@@ -0,0 +1,28 @@
+{
+ "attach_print": 0,
+ "condition": "doc.auto_created",
+ "creation": "2018-04-25 14:19:05.440361",
+ "days_in_advance": 0,
+ "docstatus": 0,
+ "doctype": "Email Alert",
+ "document_type": "Fiscal Year",
+ "enabled": 1,
+ "event": "New",
+ "idx": 0,
+ "is_standard": 1,
+ "message": "<h3>{{_(\"Fiscal Year\")}}</h3>\n\n<p>{{ _(\"New fiscal year created :- \") }} {{ doc.name }}</p>",
+ "modified": "2018-04-25 14:30:38.588534",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Notification for new fiscal year",
+ "owner": "Administrator",
+ "recipients": [
+ {
+ "email_by_role": "Accounts User"
+ },
+ {
+ "email_by_role": "Accounts Manager"
+ }
+ ],
+ "subject": "Notification for new fiscal year {{ doc.name }}"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.md b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.md
new file mode 100644
index 0000000..c674ab6
--- /dev/null
+++ b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.md
@@ -0,0 +1,3 @@
+<h3>{{_("Fiscal Year")}}</h3>
+
+<p>{{ _("New fiscal year created :- ") }} {{ doc.name }}</p>
\ No newline at end of file
diff --git a/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py
new file mode 100644
index 0000000..1bc4d18
--- /dev/null
+++ b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py
@@ -0,0 +1,5 @@
+from __future__ import unicode_literals
+
+def get_context(context):
+ # do your magic here
+ pass
diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index a32e182..c07b851 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -405,7 +405,7 @@
make_search: function () {
var me = this;
- this.serach_item = frappe.ui.form.make_control({
+ this.search_item = frappe.ui.form.make_control({
df: {
"fieldtype": "Data",
"label": "Item",
@@ -416,13 +416,13 @@
only_input: true,
});
- this.serach_item.make_input();
+ this.search_item.make_input();
- this.serach_item.$input.on("keypress", function (event) {
+ this.search_item.$input.on("keypress", function (event) {
clearTimeout(me.last_search_timeout);
me.last_search_timeout = setTimeout(() => {
- if((me.serach_item.$input.val() != "") || (event.which == 13)) {
+ if((me.search_item.$input.val() != "") || (event.which == 13)) {
me.items = me.get_items();
me.make_item_list();
}
@@ -679,7 +679,7 @@
set_focus: function () {
if (this.default_customer || this.frm.doc.customer) {
this.set_customer_value_in_party_field();
- this.serach_item.$input.focus();
+ this.search_item.$input.focus();
} else {
this.party_field.$input.focus();
}
@@ -1073,8 +1073,8 @@
}
if (this.items.length == 1
- && this.serach_item.$input.val()) {
- this.serach_item.$input.val("");
+ && this.search_item.$input.val()) {
+ this.search_item.$input.val("");
this.add_to_cart();
}
},
@@ -1096,7 +1096,7 @@
this.items_list = this.apply_category();
- key = this.serach_item.$input.val().toLowerCase().replace(/[&\/\\#,+()\[\]$~.'":*?<>{}]/g, '\\$&');
+ key = this.search_item.$input.val().toLowerCase().replace(/[&\/\\#,+()\[\]$~.'":*?<>{}]/g, '\\$&');
var re = new RegExp('%', 'g');
var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*'))
search_status = true
@@ -1104,15 +1104,15 @@
if (key) {
return $.grep(this.items_list, function (item) {
if (search_status) {
- if (in_list(me.batch_no_data[item.item_code], me.serach_item.$input.val())) {
+ if (in_list(me.batch_no_data[item.item_code], me.search_item.$input.val())) {
search_status = false;
- return me.item_batch_no[item.item_code] = me.serach_item.$input.val()
+ return me.item_batch_no[item.item_code] = me.search_item.$input.val()
} else if (me.serial_no_data[item.item_code]
- && in_list(Object.keys(me.serial_no_data[item.item_code]), me.serach_item.$input.val())) {
+ && in_list(Object.keys(me.serial_no_data[item.item_code]), me.search_item.$input.val())) {
search_status = false;
- me.item_serial_no[item.item_code] = [me.serach_item.$input.val(), me.serial_no_data[item.item_code][me.serach_item.$input.val()]]
+ me.item_serial_no[item.item_code] = [me.search_item.$input.val(), me.serial_no_data[item.item_code][me.search_item.$input.val()]]
return true
- } else if (in_list(me.barcode_data[item.item_code], me.serach_item.$input.val())) {
+ } else if (in_list(me.barcode_data[item.item_code], me.search_item.$input.val())) {
search_status = false;
return true;
} else if (reg.test(item.item_code.toLowerCase()) || (item.description && reg.test(item.description.toLowerCase())) ||
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 75089b2..69b369f 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -130,15 +130,15 @@
def set_price_list(out, party, party_type, given_price_list):
# price list
- price_list = filter(None, get_user_permissions().get("Price List", []))
- if isinstance(price_list, list):
- price_list = price_list[0] if len(price_list)==1 else None
+ price_list = filter(None, get_user_permissions()
+ .get("Price List", {})
+ .get("docs", []))
+ price_list = list(price_list)
- if not price_list:
- price_list = get_default_price_list(party)
-
- if not price_list:
- price_list = given_price_list
+ if price_list:
+ price_list = price_list[0]
+ else:
+ price_list = get_default_price_list(party) or given_price_list
if price_list:
out.price_list_currency = frappe.db.get_value("Price List", price_list, "currency")
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index f39df3d..1066a3e 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -38,7 +38,7 @@
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
"fieldtype": "Select",
- "options": 'Posting Date\nDue Date',
+ "options": 'Posting Date\nDue Date\nSupplier Invoice Date',
"default": "Posting Date"
},
{
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index 5b68f1d..9fefc037 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -19,7 +19,13 @@
<h2 class="text-center">{%= __(report.report_name) %}</h2>
-<h4 class="text-center">{%= filters.customer || filters.supplier %} </h4>
+<h4 class="text-center">
+ {% if (filters.customer_name) { %}
+ {%= filters.customer_name %}
+ {% } else { %}
+ {%= filters.customer || filters.supplier %}
+ {% } %}
+</h4>
<h6 class="text-center">
{% if (filters.tax_id) { %}
{%= __("Tax Id: ")%} {%= filters.tax_id %}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 2caf359..d421b6e 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -23,8 +23,9 @@
"options": "Customer",
on_change: () => {
var customer = frappe.query_report_filters_by_name.customer.get_value();
- frappe.db.get_value('Customer', customer, "tax_id", function(value) {
+ frappe.db.get_value('Customer', customer, ["tax_id", "customer_name"], function(value) {
frappe.query_report_filters_by_name.tax_id.set_value(value["tax_id"]);
+ frappe.query_report_filters_by_name.customer_name.set_value(value["customer_name"]);
});
}
},
@@ -105,6 +106,12 @@
"label": __("Tax Id"),
"fieldtype": "Data",
"hidden": 1
+ },
+ {
+ "fieldname":"customer_name",
+ "label": __("Customer Name"),
+ "fieldtype": "Data",
+ "hidden": 1
}
],
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index ca806bf..8581a25 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -151,6 +151,7 @@
# get due date
due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "")
+ bill_date = voucher_details.get(gle.voucher_no, {}).get("bill_date", "")
row += [gle.voucher_type, gle.voucher_no, due_date]
@@ -167,15 +168,25 @@
row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount]
# ageing data
- entry_date = due_date if self.filters.ageing_based_on == "Due Date" else gle.posting_date
+ if self.filters.ageing_based_on == "Due Date":
+ entry_date = due_date
+ elif self.filters.ageing_based_on == "Supplier Invoice Date":
+ entry_date = bill_date
+ else:
+ entry_date = gle.posting_date
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
+
# issue 6371-Ageing buckets should not have amounts if due date is not reached
if self.filters.ageing_based_on == "Due Date" \
and getdate(due_date) > getdate(self.filters.report_date):
row[-1]=row[-2]=row[-3]=row[-4]=0
+ if self.filters.ageing_based_on == "Supplier Invoice Date" \
+ and getdate(bill_date) > getdate(self.filters.report_date):
+ row[-1]=row[-2]=row[-3]=row[-4]=0
+
if self.filters.get(scrub(args.get("party_type"))):
row.append(gle.account_currency)
else:
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index c97db6d..671408f 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -409,12 +409,6 @@
}
}
-cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
- if(cint(frappe.boot.notification_settings.purchase_order)) {
- cur_frm.email_doc(frappe.boot.notification_settings.purchase_order_message);
- }
-}
-
function set_schedule_date(frm) {
if(frm.doc.schedule_date){
erpnext.utils.copy_value_in_all_row(frm.doc, frm.doc.doctype, frm.doc.name, "items", "schedule_date");
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index fc1779a..35d2cf0 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -3522,7 +3522,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3531,10 +3531,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -3560,8 +3560,8 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-03-28 14:09:02.393746",
- "modified_by": "Administrator",
+ "modified": "2018-03-30 14:09:02.393746",
+ "modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
"owner": "Administrator",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
index d57b0e2..cce4b27 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py
@@ -6,7 +6,7 @@
'non_standard_fieldnames': {
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
- 'Subscription': 'reference_document'
+ 'Auto Repeat': 'reference_document'
},
'internal_links': {
'Material Request': ['items', 'material_request'],
@@ -24,7 +24,7 @@
},
{
'label': _('Reference'),
- 'items': ['Material Request', 'Supplier Quotation', 'Project', 'Subscription']
+ 'items': ['Material Request', 'Supplier Quotation', 'Project', 'Auto Repeat']
},
{
'label': _('Sub-contracting'),
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index b94710f..722c2d2 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -71,6 +72,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -103,6 +105,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -136,6 +139,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -229,6 +235,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -261,6 +268,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -294,6 +302,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -324,6 +333,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -354,6 +364,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -384,6 +395,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -413,6 +425,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -442,6 +455,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -471,6 +485,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -501,6 +516,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -531,6 +547,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -563,6 +580,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -596,6 +614,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -625,6 +644,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -656,6 +676,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -687,6 +708,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -718,6 +740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -747,6 +770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -778,6 +802,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -810,6 +835,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -841,6 +867,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -869,6 +896,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -900,6 +928,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -932,6 +961,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -960,6 +990,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -991,6 +1022,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1023,6 +1055,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1053,6 +1086,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1084,6 +1118,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1117,6 +1152,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1146,6 +1182,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1177,6 +1214,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1206,6 +1244,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1238,6 +1277,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1268,6 +1308,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1298,6 +1339,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1329,6 +1371,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1361,6 +1404,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1393,6 +1437,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1425,6 +1470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1454,6 +1500,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1486,6 +1533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1518,6 +1566,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1549,6 +1598,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1580,6 +1630,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1612,6 +1663,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1643,6 +1695,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1672,6 +1725,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1702,6 +1756,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1733,6 +1788,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1762,6 +1818,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1794,6 +1851,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1825,6 +1883,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1857,6 +1916,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1889,6 +1949,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1918,6 +1979,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1950,6 +2012,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1981,6 +2044,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2012,6 +2076,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2044,6 +2109,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2076,6 +2142,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2107,6 +2174,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2137,6 +2205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2169,6 +2238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2201,6 +2271,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2231,6 +2302,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2248,7 +2320,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2261,6 +2333,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2269,7 +2342,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2278,10 +2351,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2292,6 +2365,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2323,6 +2397,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2355,6 +2430,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2383,6 +2459,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2414,6 +2491,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2444,6 +2522,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2475,6 +2554,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2490,7 +2570,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-11-29 14:07:56.698355",
+ "modified": "2018-03-10 07:37:33.662363",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
index 4321f27..0387437 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py
@@ -4,7 +4,7 @@
return {
'fieldname': 'supplier_quotation',
'non_standard_fieldnames': {
- 'Subscription': 'reference_document'
+ 'Auto Repeat': 'reference_document'
},
'internal_links': {
'Material Request': ['items', 'material_request'],
@@ -22,7 +22,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index 6c7c298..636c160 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -34,8 +34,8 @@
},
{
"type": "doctype",
- "name": "Subscription",
- "label": _("Subscription"),
+ "name": "Auto Repeat",
+ "label": _("Auto Repeat"),
"description": _("To make recurring documents")
},
{
diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py
index 878b2f2..e38b30d 100644
--- a/erpnext/config/setup.py
+++ b/erpnext/config/setup.py
@@ -81,12 +81,6 @@
"type": "doctype",
"name": "Authorization Rule",
"description": _("Create rules to restrict transactions based on values.")
- },
- {
- "type": "doctype",
- "name": "Notification Control",
- "label": _("Email Notifications"),
- "description": _("Automatically compose message on submission of transactions.")
}
]
},
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 186aad3..050a143 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -198,7 +198,6 @@
if self.get("is_subcontracted"):
args["is_subcontracted"] = self.is_subcontracted
-
ret = get_item_details(args)
for fieldname, value in ret.items():
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 3bf720f..8b6dd17 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -168,6 +168,7 @@
and tabItem.disabled=0
and (tabItem.end_of_life > %(today)s or ifnull(tabItem.end_of_life, '0000-00-00')='0000-00-00')
and (tabItem.`{key}` LIKE %(txt)s
+ or tabItem.item_code LIKE %(txt)s
or tabItem.item_group LIKE %(txt)s
or tabItem.item_name LIKE %(txt)s
or tabItem.item_code IN (select parent from `tabItem Barcode` where barcode LIKE %(txt)s
diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py
index ab189cf..62295d4 100644
--- a/erpnext/controllers/sales_and_purchase_return.py
+++ b/erpnext/controllers/sales_and_purchase_return.py
@@ -83,15 +83,15 @@
else:
ref = valid_items.get(d.item_code, frappe._dict())
validate_quantity(doc, d, ref, valid_items, already_returned_items)
-
+
if ref.rate and doc.doctype in ("Delivery Note", "Sales Invoice") and flt(d.rate) > ref.rate:
frappe.throw(_("Row # {0}: Rate cannot be greater than the rate used in {1} {2}")
.format(d.idx, doc.doctype, doc.return_against))
-
+
elif ref.batch_no and d.batch_no not in ref.batch_no:
frappe.throw(_("Row # {0}: Batch No must be same as {1} {2}")
.format(d.idx, doc.doctype, doc.return_against))
-
+
elif ref.serial_no:
if not d.serial_no:
frappe.throw(_("Row # {0}: Serial No is mandatory").format(d.idx))
@@ -120,25 +120,30 @@
for column in fields:
returned_qty = flt(already_returned_data.get(column, 0)) if len(already_returned_data) > 0 else 0
- reference_qty = (ref.get(column) if column == 'stock_qty'
- else ref.get(column) * ref.get("conversion_factor", 1.0))
+
+ if column == 'stock_qty':
+ reference_qty = ref.get(column)
+ current_stock_qty = args.get(column)
+ else:
+ reference_qty = ref.get(column) * ref.get("conversion_factor", 1.0)
+ current_stock_qty = args.get(column) * args.get("conversion_factor", 1.0)
max_returnable_qty = flt(reference_qty) - returned_qty
label = column.replace('_', ' ').title()
- if reference_qty:
+ if reference_qty:
if flt(args.get(column)) > 0:
frappe.throw(_("{0} must be negative in return document").format(label))
elif returned_qty >= reference_qty and args.get(column):
frappe.throw(_("Item {0} has already been returned")
.format(args.item_code), StockOverReturnError)
- elif (abs(args.get(column)) * args.get("conversion_factor", 1.0)) > max_returnable_qty:
+ elif abs(current_stock_qty) > max_returnable_qty:
frappe.throw(_("Row # {0}: Cannot return more than {1} for Item {2}")
.format(args.idx, reference_qty, args.item_code), StockOverReturnError)
def get_ref_item_dict(valid_items, ref_item_row):
from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos
-
+
valid_items.setdefault(ref_item_row.item_code, frappe._dict({
"qty": 0,
"rate": 0,
@@ -160,10 +165,10 @@
if ref_item_row.get("serial_no"):
item_dict["serial_no"] += get_serial_nos(ref_item_row.serial_no)
-
+
if ref_item_row.get("batch_no"):
item_dict["batch_no"].append(ref_item_row.batch_no)
-
+
return valid_items
def get_already_returned_items(doc):
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 047ef4a..5ecff3f 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -29,6 +29,7 @@
self.set_item_wise_tax_breakup()
def _calculate(self):
+ self.validate_conversion_rate()
self.calculate_item_values()
self.initialize_taxes()
self.determine_exclusive_rate()
diff --git a/erpnext/docs/assets/img/accounts/bulk-payment.gif b/erpnext/docs/assets/img/accounts/bulk-payment.gif
new file mode 100644
index 0000000..e91a2d0
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/bulk-payment.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/company-round-off-account.png b/erpnext/docs/assets/img/accounts/company-round-off-account.png
new file mode 100644
index 0000000..a02a222
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/company-round-off-account.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/exchange-rate-frozen.png b/erpnext/docs/assets/img/accounts/exchange-rate-frozen.png
new file mode 100644
index 0000000..912f966
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/exchange-rate-frozen.png
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/invoice.jpg b/erpnext/docs/assets/img/accounts/invoice.jpg
new file mode 100644
index 0000000..0768830
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/invoice.jpg
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/retail-hero.jpg b/erpnext/docs/assets/img/accounts/retail-hero.jpg
new file mode 100644
index 0000000..3eeb9c8
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/retail-hero.jpg
Binary files differ
diff --git a/erpnext/docs/assets/img/accounts/round-off-account.png b/erpnext/docs/assets/img/accounts/round-off-account.png
new file mode 100644
index 0000000..2810026
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/round-off-account.png
Binary files differ
diff --git a/erpnext/docs/assets/img/agriculture/land-unit.png b/erpnext/docs/assets/img/agriculture/land-unit.png
new file mode 100644
index 0000000..215e71f
--- /dev/null
+++ b/erpnext/docs/assets/img/agriculture/land-unit.png
Binary files differ
diff --git a/erpnext/docs/assets/img/agriculture/soil-texture.png b/erpnext/docs/assets/img/agriculture/soil-texture.png
new file mode 100644
index 0000000..9b2233c
--- /dev/null
+++ b/erpnext/docs/assets/img/agriculture/soil-texture.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscriber.png b/erpnext/docs/assets/img/articles/subscriber.png
new file mode 100644
index 0000000..e4ce64d
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscriber.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-1.png b/erpnext/docs/assets/img/articles/subscription-1.png
new file mode 100644
index 0000000..cbff30f9
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-plan.png b/erpnext/docs/assets/img/articles/subscription-plan.png
new file mode 100644
index 0000000..b60f796
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-plan.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/subscription-settings.png b/erpnext/docs/assets/img/articles/subscription-settings.png
new file mode 100644
index 0000000..405f0bf
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/subscription-settings.png
Binary files differ
diff --git a/erpnext/docs/assets/img/education/assessment.png b/erpnext/docs/assets/img/education/assessment.png
new file mode 100644
index 0000000..b5581a8
--- /dev/null
+++ b/erpnext/docs/assets/img/education/assessment.png
Binary files differ
diff --git a/erpnext/docs/assets/img/education/school-hero.png b/erpnext/docs/assets/img/education/school-hero.png
new file mode 100644
index 0000000..4f53a1f
--- /dev/null
+++ b/erpnext/docs/assets/img/education/school-hero.png
Binary files differ
diff --git a/erpnext/docs/assets/img/healthcare/appointment-analytics.png b/erpnext/docs/assets/img/healthcare/appointment-analytics.png
new file mode 100644
index 0000000..b431db1
--- /dev/null
+++ b/erpnext/docs/assets/img/healthcare/appointment-analytics.png
Binary files differ
diff --git a/erpnext/docs/assets/img/healthcare/patient-appointment.png b/erpnext/docs/assets/img/healthcare/patient-appointment.png
new file mode 100644
index 0000000..9c0970cc
--- /dev/null
+++ b/erpnext/docs/assets/img/healthcare/patient-appointment.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee-loan-application.png b/erpnext/docs/assets/img/human-resources/employee-loan-application.png
deleted file mode 100644
index 317de4f..0000000
--- a/erpnext/docs/assets/img/human-resources/employee-loan-application.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/employee-loan.png b/erpnext/docs/assets/img/human-resources/employee-loan.png
deleted file mode 100644
index 19f3181..0000000
--- a/erpnext/docs/assets/img/human-resources/employee-loan.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/loan-application.png b/erpnext/docs/assets/img/human-resources/loan-application.png
new file mode 100644
index 0000000..3c6cfd2
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/loan-application.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/loan.png b/erpnext/docs/assets/img/human-resources/loan.png
new file mode 100644
index 0000000..f2f71d4
--- /dev/null
+++ b/erpnext/docs/assets/img/human-resources/loan.png
Binary files differ
diff --git a/erpnext/docs/assets/img/human-resources/repayment-schedule.png b/erpnext/docs/assets/img/human-resources/repayment-schedule.png
index f2ddf02..31085c1 100644
--- a/erpnext/docs/assets/img/human-resources/repayment-schedule.png
+++ b/erpnext/docs/assets/img/human-resources/repayment-schedule.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/BOM-hero.png b/erpnext/docs/assets/img/manufacturing/BOM-hero.png
new file mode 100644
index 0000000..6f64dd8
--- /dev/null
+++ b/erpnext/docs/assets/img/manufacturing/BOM-hero.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/manufacturing-hero.png b/erpnext/docs/assets/img/manufacturing/manufacturing-hero.png
new file mode 100644
index 0000000..a74a63d
--- /dev/null
+++ b/erpnext/docs/assets/img/manufacturing/manufacturing-hero.png
Binary files differ
diff --git a/erpnext/docs/assets/img/manufacturing/purchase-order.png b/erpnext/docs/assets/img/manufacturing/purchase-order.png
new file mode 100644
index 0000000..c1f1a27
--- /dev/null
+++ b/erpnext/docs/assets/img/manufacturing/purchase-order.png
Binary files differ
diff --git a/erpnext/docs/assets/img/non_profit/chapter.png b/erpnext/docs/assets/img/non_profit/chapter.png
new file mode 100644
index 0000000..d7dfc6b
--- /dev/null
+++ b/erpnext/docs/assets/img/non_profit/chapter.png
Binary files differ
diff --git a/erpnext/docs/assets/img/non_profit/non-profit-hero-linus.png b/erpnext/docs/assets/img/non_profit/non-profit-hero-linus.png
new file mode 100644
index 0000000..176389f
--- /dev/null
+++ b/erpnext/docs/assets/img/non_profit/non-profit-hero-linus.png
Binary files differ
diff --git a/erpnext/docs/assets/img/project/projects.png b/erpnext/docs/assets/img/project/projects.png
new file mode 100644
index 0000000..8768b29
--- /dev/null
+++ b/erpnext/docs/assets/img/project/projects.png
Binary files differ
diff --git a/erpnext/docs/assets/img/project/services-hero.png b/erpnext/docs/assets/img/project/services-hero.png
new file mode 100644
index 0000000..70e0c4e
--- /dev/null
+++ b/erpnext/docs/assets/img/project/services-hero.png
Binary files differ
diff --git a/erpnext/docs/assets/img/project/support.png b/erpnext/docs/assets/img/project/support.png
new file mode 100644
index 0000000..4026e7c
--- /dev/null
+++ b/erpnext/docs/assets/img/project/support.png
Binary files differ
diff --git a/erpnext/docs/assets/img/stock/purchase-order-hero.png b/erpnext/docs/assets/img/stock/purchase-order-hero.png
new file mode 100644
index 0000000..c1f1a27
--- /dev/null
+++ b/erpnext/docs/assets/img/stock/purchase-order-hero.png
Binary files differ
diff --git a/erpnext/docs/assets/img/stock/stock-hero.jpg b/erpnext/docs/assets/img/stock/stock-hero.jpg
new file mode 100644
index 0000000..fa222cd
--- /dev/null
+++ b/erpnext/docs/assets/img/stock/stock-hero.jpg
Binary files differ
diff --git a/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png b/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png
index d2762dd..d9e1a6a 100644
--- a/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png
+++ b/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png
Binary files differ
diff --git a/erpnext/docs/user/manual/de/human-resources/offer-letter.md b/erpnext/docs/user/manual/de/human-resources/job-offer.md
similarity index 100%
rename from erpnext/docs/user/manual/de/human-resources/offer-letter.md
rename to erpnext/docs/user/manual/de/human-resources/job-offer.md
diff --git a/erpnext/docs/user/manual/de/manufacturing/tools/index.txt b/erpnext/docs/user/manual/de/manufacturing/tools/index.txt
index 1f798d0..bdd357c 100644
--- a/erpnext/docs/user/manual/de/manufacturing/tools/index.txt
+++ b/erpnext/docs/user/manual/de/manufacturing/tools/index.txt
@@ -1,2 +1 @@
-production-planning-tool
-bom-replace-tool
+bom-update-tool
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/de/manufacturing/tools/production-planning-tool.md b/erpnext/docs/user/manual/de/manufacturing/tools/production-planning-tool.md
deleted file mode 100644
index 63e51f8..0000000
--- a/erpnext/docs/user/manual/de/manufacturing/tools/production-planning-tool.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Werkzeug zur Fertigungsplanung
-<span class="text-muted contributed-by">Beigetragen von CWT Connector & Wire Technology GmbH</span>
-
-Das Werkzeug zur Fertigungsplanung unterstützt Sie dabei die Fertigung zu planen und Artikel für eine Periode einzukaufen (normalerweise eine Woche oder ein Monat).
-
-Die Liste der Artikel kann über die offenen Kundenaufträge im System erstellt werden. Folgendes wird angelegt:
-
-* Fertigungsaufträge für jeden Artikel.
-* Materialanforderung für Artikel deren vorhergesagte Menge wahrscheinlich unter 0 fällt.
-
-Um das Werkzeug zur Fertigungsplanung zu nutzen, gehen Sie zu:
-
-> Fertigung > Werkzeuge > Werkzeug zur Fertigungsplanung
-
-<img class="screenshot" alt="Werkzeug zur Fertigungsplanung" src="{{docs_base_url}}/assets/img/manufacturing/ppt.png">
-
-### Schritt 1: Auswahl und Kundenauftrag
-
-* Wählen Sie einen Kundenauftrag für die Materialanforderung über die Filterfunktion (Zeit, Artikel und Kunde) aus.
-* Klicken Sie auf "Kundenaufträge aufrufen" um eine Übersicht zu erhalten.
-
-<img class="screenshot" alt="Werkzeug zur Fertigungsplanung" src="{{docs_base_url}}/assets/img/manufacturing/ppt-get-sales-orders.png">
-
-### Schritt 2: Artikel aus Kundenaufträgen abrufen
-
-Sie können Artikel hinzufügen, entfernen oder die Menge dieser Artikel verändern.
-
-<img class="screenshot" alt="Werkzeug zur Fertigungsplanung" src="{{docs_base_url}}/assets/img/manufacturing/ppt-get-item.png">
-
-### Schritt 3: Fertigungsaufträge erstellen
-
-<img class="screenshot" alt="Werkzeug zur Fertigungsplanung" src="{{docs_base_url}}/assets/img/manufacturing/ppt-create-production-order.png">
-
-### Schritt 4: Materialanfragen erstellen
-
-Erstellen Sie für Artikel mit prognostiziertem Engpass Materialanfragen.
-
-<img class="screenshot" alt="Werkzeug zur Fertigungsplanung" src="{{docs_base_url}}/assets/img/manufacturing/ppt-create-material-request.png">
-
-Das Werkzeug zur Fertigungsplanung wird auf zwei Ebenend verwendet:
-
-* Auswahl von offenen Kundenaufträge einer Periode auf Basis des erwarteten Lieferdatums.
-* Auswahl von Artikeln aus diesen Kundenaufträgen.
-
-Das Werkzeug erstellt eine Aktualisierung, wenn Sie bereits einen Kundenauftrag für einen bestimmten Artikel zu einem Kundenauftrag erstellt haben ("geplante Menge").
-
-Sie könnenjederzeit die Artikelliste bearbeiten und die zur Fertigung geplante Menge erhöhen bzw. vermindern.
-
-> Anmerkung: Wie ändern Sie einen Fertigungsplan? Des Ergebnis des Werkzeuges zur Produktionsplanung ist der Fertigungsauftrag. Sobald Ihre Aufträge erstellt wurden, können Sie sie ändern, indem Sie die Fertigungsaufträge ändern.
-
-{next}
diff --git a/erpnext/docs/user/manual/en/accounts/articles/bulk-payment-entry.md b/erpnext/docs/user/manual/en/accounts/articles/bulk-payment-entry.md
new file mode 100644
index 0000000..5b94f2c
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/articles/bulk-payment-entry.md
@@ -0,0 +1,13 @@
+# Bulk Payment Entry
+
+If you want to create a single payment entry adjusting against multiple invoices, follow the steps given below.
+
+* Make a "New Payment Entry".
+* Select a Party Type and Party. On selection of a Party, all the outstanding invoices will be fetched for that Customer/Supplier.
+* Enter the Payment Amount.
+* Allocate the amount against invoices/orders as needed.
+* Save and Submit Payment Entry.
+
+### Demo of Bulk Payment Entry
+
+<img class="screenshot" alt="Bulk Payment" src="{{docs_base_url}}/assets/img/accounts/bulk-payment.gif">
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/articles/exchange-rate-field-frozen.md b/erpnext/docs/user/manual/en/accounts/articles/exchange-rate-field-frozen.md
new file mode 100644
index 0000000..8e93c78
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/articles/exchange-rate-field-frozen.md
@@ -0,0 +1,14 @@
+# Exchange Rate Field Frozen
+
+In ERPNext, you can fetch Exchange Rates between currencies in real-time, or save specific exchange rates as well. In ERPNext, saved exchange rates are also referred as Stale Exchange Rate.
+
+In your sales and purchase transactions, if the field of Currency Exchange Rate is frozen, that is because the feature of allowing stale exchange rates in transactions is enabled. To you wish to make Currency Exchange Rate field editable again, then disable the feature of Stale Exchange Rate from:
+
+* Accounts > Setup > Accounts Settings
+* Uncheck field "Allow Stale Exchange Rates".
+ <img class="screenshot" alt="Exchange Rate Frozen" src="{{docs_base_url}}/assets/img/accounts/exchange-rate-frozen.png">
+* Save Account Settings
+* Refresh your ERPNext account
+* Check Sales / Purchase transaction once again
+
+After this setting, the Exchange Rate field in the transactions should become editable once again.
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md b/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md
new file mode 100644
index 0000000..97e6638
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/articles/how-to-manage-subscriptions-with-erpnext.md
@@ -0,0 +1,104 @@
+# How To Manage Subscriptions With ERPNext
+
+ERPNext now allows you to manage your subscriptions easily. A single subscription can contain multiple plans. At
+the same time, A single subscriber can also have multiple subscriptions. ERPNext also automatically manages your
+subscriptions for you by generating new invoices when due and changing the subscription status for you.
+
+## Related Doctypes
+### Subscriber
+Like its name suggests, the Subscriber Doctype represents your subscribers and each record is linked to a single
+Customer.
+
+<img alt="Subscriber form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscriber.png">
+
+### Subscription Plan
+Each Subscription Plan is linked to a single Item and contains billing and pricing information on the Item. You can have
+multiple Subscription Plans for a single Item. An example of a situation where you would want this is where you have
+different prices for the same Item like when you have a basic option and premium option for a service.
+
+<img alt="Subscription Plan Form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-plan.png">
+
+### Subscription Settings
+Subscription Settings is where you tweak the behaviour of the Subscription Doctype. For example, you can set a grace
+period for overdue invoices from it. You can also elect to have a subscription cancelled if an overdue invoice is not
+paid after the grace period.
+
+<img alt="Subscription Settings Form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-settings.png">
+
+## Creating A Subscription
+To create a Subscription, go to the Subscription creation form
+`Explore > Accounts > Subscriptions`
+
+<img alt="Subscription form" class="screenshot" src="{{docs_base_url}}/assets/img/articles/subscription-1.png">
+
+Select a Subscriber.
+
+If you want to cancel a subscription at the end of the present billing cycle, check the 'Cancel At End Of Period'
+check box.
+
+Select the start date for the subscription. By default, the start date is today's date. (Optional).
+
+If you are giving the subscriber a trial, enter the Trial Period Start Date and Trial Period End Date.
+
+If your invoice is not payable immediately, you can set the number of days before the invoice will be due in the
+'Days Until Due' field.
+
+If you require more than one unit of a plan, set it in the 'Quantity' field. For instance, a web developer is subscribed
+to your web hosting service. The developer buys a plan for each customer. Instead of having multiple subscriptions for
+the same plan, you can simply increase the quantity as needed.
+
+In the 'Plan' table, add Subscription Plans as required. You may have multiple Subscription Plans in a single
+Subscription as long as they all have the same billing period cycle. If the same Subscriber needs to subscribe to
+plans with different billing cycles, you will have to use a separate subscription.
+
+Select a Sales Taxes and Charges Template if you need to charge tax in your invoices.
+
+Fill the relevant fields in the 'Discounts' section if you need to add discounts to your invoices.
+
+Click Save.
+
+### Subscription Status
+ERPNext Subscription has five status values:
+- **Trialling** - A subscription that is in trial period
+- **Active** - A subscription that does not have any unpaid invoice
+- **Past Due** - A subscription whose most recent invoice is unpaid but is still within the grace period
+- **Unpaid** - A subscription whose most recent invoice is unpaid and past the grace period
+- **Canceled** - A subscription whose most recent invoice is unpaid and past the grace period. In this state, ERPNext no longer monitors the subscription.
+
+### Subscription Processing In The Background
+Every one hour interval, ERPNext processes all Subscriptions and updates each for any change in status. It will
+create new invoices if need be. When an outstanding invoice is paid, ERPNext updates the subscription accordingly.
+
+### Manually Updating Subscriptions
+Once you have saved a subscription, you can change the 'Days Until Due', 'Quantity', 'Plans', 'Sales Taxes and Charges
+Template', 'Apply Additional Discount On', 'Additional Discount Percentage' and 'Additional Discount Amount' fields.
+
+Note that changing any of the values will reflect in newly generated invoices only. Previously generated invoices will
+not be changed.
+
+### Cancelling Subscriptions
+To cancel a Subscription, simply click the 'Cancel Subscription' button. The subscription will update its 'Cancellation
+Date' field and the subscription will no longer be monitored.
+
+If you are cancelling an active subscription, an invoice will immediately be generated. The generated invoice will be on
+pro-rata basis by default. If you want ERPNext always create an invoice for the full amount, uncheck the 'Prorate' field
+in Subsciption Settings.
+
+### Restarting Subscriptions
+To restart a canceled subscription, simply click the 'Restart Subscription' button. Note the Subscription will empty
+its invoices table. Note that the invoices will still exist but the Subscription will no longer track them. The start
+date of the subscription will also be changed to the date the Subscription is restarted. The start of the billing
+cycle will also be set to the date the Subscription is restarted.
+
+### Recalculating Subscriptions
+Some times, a Subscription's status might have changed but might not yet be reflected in the Subscription. You can force
+ERPNext to update the subscription by clicking 'Fetch Subscription Updates'.
+
+### Subscription Settings
+**Grace Period** represents the number of days after a subscriber's invoice becomes overdue that ERPNext should delay
+before changing the Subscription status to 'Canceled' or 'Unpaid'.
+
+**Cancel Invoice After Grace Period** would cause ERPNext to automatically cancel a subscription if it is not paid before the grace period elapses. This setting is off by default.
+
+**Prorate** would cause ERPNext to generate a prorated invoice when an active subscription is canceled by default.
+If you would prefer a full invoice, uncheck the setting.
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/articles/index.txt b/erpnext/docs/user/manual/en/accounts/articles/index.txt
index af8572c..419196a 100644
--- a/erpnext/docs/user/manual/en/accounts/articles/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/articles/index.txt
@@ -14,4 +14,7 @@
adjust-withhold-amount-payment-entry
common-receivable-account.md
types-in-tax-template
-freeze-account
\ No newline at end of file
+freeze-account
+round-off-account-validation
+exchange-rate-field-frozen
+bulk-payment-entry
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/accounts/articles/round-off-account-validation.md b/erpnext/docs/user/manual/en/accounts/articles/round-off-account-validation.md
new file mode 100644
index 0000000..c50159a
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/articles/round-off-account-validation.md
@@ -0,0 +1,30 @@
+# Round of Account Validation Message
+
+**Question**
+
+When submitting an invoice, why does it ask for a Round Off Account? How to update it?
+
+<img class="screenshot" alt="Fees Section" src="{{docs_base_url}}/assets/img/accounts/round-off-account.png">
+
+**Answer**
+
+In the Purchase Invoice, Grand Total is calculated based on various calculations like:
+
+- Qty * Rate = Amount
+- Tax and other charges applied to each item
+- Discount applied to some or all the items
+- Multiplication with exchange rate, in case of multiple currencies
+
+As a result of multiple calculations, there could be some rounding loss in the final amount. This rounding loss is generally very marginal like 0.034. But for the accounting accuracy, has to be posted in the accounts. Hence, you need to define a default Round-Off account in the Company master in which such amount availed as a result of rounding loss can be booked.
+
+You need to create Round-off Account in the Chart of Accounts and update in the Company master. Steps here.
+
+* Accounts > Chart of Accounts
+* In the Chart of Account, check or create new Account under Expense > Direct Expense. Ignore if account for this purpose already existing
+* Come to Company master
+ Account > Company
+* Open Company in which Round-Off account has to be updated.
+* In the Company master, scroll to Accounts Settings and select Round-Off account and Cost Center.
+ <img class="screenshot" alt="Fees Section" src="{{docs_base_url}}/assets/img/accounts/company-round-off-account.png">
+
+Once Round-Off account this updated in the Company master, then try to submit Purchase Invoice once again.
diff --git a/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md b/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md
index 3f1d6eb..8fd348a 100644
--- a/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md
+++ b/erpnext/docs/user/manual/en/accounts/articles/tracking-project-profitability-using-cost-center.md
@@ -1,4 +1,4 @@
-#Tracking Project Profibitability using Cost Center
+#Tracking Project Profitability using Cost Center
To track expenses and profibility for a project, you can use Cost Centers. You should create separate Cost Center for each Project. This will allow you to.
@@ -77,4 +77,4 @@
[Click here to learn how to do budgeting from Cost Center](/docs/user/manual/en/accounts/budgeting.html).
-<!-- markdown -->
\ No newline at end of file
+<!-- markdown -->
diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt
index a7e27cd..61e0db4 100644
--- a/erpnext/docs/user/manual/en/accounts/index.txt
+++ b/erpnext/docs/user/manual/en/accounts/index.txt
@@ -2,6 +2,7 @@
opening-accounts
sales-invoice
point-of-sale-pos-invoice
+point-of-sales
purchase-invoice
payments
journal-entry
diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
index 166f2c5..c04c082 100644
--- a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
+++ b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
@@ -1,118 +1,22 @@
# Point of Sale Invoice
-For retail operations, the delivery of goods, accrual of sale and payment all happens in one event, that is usually called the “Point of Sale” (POS).
+The one-screen point-of-sale software, for the one-stop-shop retail business. It does everything your store needs, right from POS billing,
+to purchasing, to customer relationship management.
-<iframe width="660" height="371" src="https://www.youtube.com/embed/4WkelWkbP_c" frameborder="0" allowfullscreen></iframe>
+<img class="screenshot" alt="POS Invoice" src="{{docs_base_url}}/assets/img/accounts/retail-hero.jpg">
-###Offline POS
+### Offline POS
In the retails business, invoicing needs to done very quickly, hence should less dependency. In the ERPNext, you can create POS Invoices, even when not connected to the internet.
-POS Invoices created in the offline mode will be saved locally in the browser. If internet connection is lost which creating POS Invoice, you will still be able can proceed forward. Once internet connection is available again, offline invoices will be synced, and pushed onto your ERPNext account. To learn more on how POS Invoices can be created when offline, [check here.](https://frappe.io/blog/blog/erpnext-features/offline-pos-in-erpnext-7)
+<img class="screenshot" alt="POS Invoice" src="{{docs_base_url}}/assets/img/accounts/invoice.jpg">
-#### POS Profile
+### POS Demo
-In ERPNext all Sales and Purchase transactions, like Sales Invoice, Quotation, Sales Order, Purchase Order etc. can be edited via the POS. There two steps to Setup POS:
+Here is the quick demonstration on the Point of Sale feature of ERPNext.
-1. Enable POS View via (Setup > Customize > Feature Setup)
-2. Create a [POS Profile](/docs/user/manual/en/setting-up/pos-setting.html) record
-
-#### Different sections of the POS
-
- * Update Stock: If this is checked, Stock Ledger Entries will be made when you “Submit” this Sales Invoice thereby eliminating the need for a separate Delivery Note.
- * In your Items table, update inventory information like Warehouse (saved as default), Serial Number, or Batch Number if applicable.
- * Update Payment Details like your Bank / Cash Account, Paid amount etc.
- * If you are writing off certain amount. For example when you receive extra cash as a result of not having exact denomination of change, check on ‘Write off Outstanding Amount’ and set the Account.
-
-
-### Customer
-
-In POS, user can select the existing customer during making an order or create the new customer. This features works in the offline mode also. User can also add the customer details like contact number, address details etc on the form. The customer which has been created from the POS will be synced when the internet connection is active.
-
-<img class="screenshot" alt="POS Customer" src="{{docs_base_url}}/assets/img/accounts/pos-customer.png">
-
-### Adding an Item
-
-At the billing counter, the retailer needs to select Items which the consumer buys. In the POS interface you can select an Item by two methods. One, is by clicking on the Item image and the other, is through the Barcode / Serial No.
-
-**Select Item** \- To select a product click on the Item image and add it into the cart. A cart is an area that prepares a customer for checkout by allowing to edit product information, adjust taxes and add discounts.
-
-**Barcode / Serial No** \- A Barcode / Serial No is an optical machine-readable representation of data relating to the object to which it is attached. Enter Barcode / Serial No in the box as shown in the image below and pause for a second, the item will be automatically added to the cart.
-
-<img class="screenshot" alt="POS Item" src="{{docs_base_url}}/assets/img/accounts/pos-item.png">
-
-> Tip: To change the quantity of an Item, enter your desired quantity in the
-quantity box. These are mostly used if the same Item is purchased in bulk.
-
-If your product list is very long use the Search field, type the product name
-in Search box.
-
-### Removing an Item from the Cart
-
-1. Select row in the cart and clik on delete button in the numeric keypad
-
-<img class="screenshot" alt="POS Item" src="{{docs_base_url}}/assets/img/accounts/pos_deleted_item.gif">
-
-
-2. Set Qty as zero to remove Item from the POS invoice. There are two ways to remove an Item.
-
- * If Item's Qty is 1, click on a minus sign to make it zero.
-
- * Manually enter 0(zero) quantity.
-
-### Make Payment
-
-After all the Items and their quantities are added into the cart, you are
-ready to make the Payment. Payment process is divided into 3 steps -
-
- 1. Click on “Make Payment” to get the Payment window.
- 2. Select your “Mode of Payment”.
- 3. Click on “Pay” button to Save the document.
-
-<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/pos-payment.png">
-
-Submit the document to finalise the record. After the document is submitted,
-you can either print or email it directly to the customer.
-
-### Write off Amount
-
-Outstanding amount can be write off from the POS, user has to enter the amount under write off field on the payment screen.
-
-<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/write-off.png">
-
-System books the write off amount into the ledger which has selected on the POS Profile.
-
-### Change Amount
-
-POS calculate the extra amount paid by the customer, which user can return from the cash account. User has to set the account for the change amount on the POS profile.
-
-<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/change-amount.png">
-
-### Offline Records
-All the records from the POS stores into the browser's local storegae and sync submitted records after every minute of the interval if system is connected to internet. User can view the offline records by clicking on Menu > View Offline Records
-
-<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/offline-records.png">
-
-#### Accounting entries (GL Entry) for a Point of Sale:
-
-Debits:
-
- * Customer (grand total)
- * Bank / Cash (payment)
-
-Credits:
-
- * Income (net total, minus taxes for each Item)
- * Taxes (liabilities to be paid to the government)
- * Customer (payment)
- * Write Off (optional)
- * Account for Change Amount (optional)
-
-To see entries after “Submit”, click on “View Ledger”.
-
-### Email
-User can send email from the POS, after submission of an order, user has to click on menu > email
-<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/pos-email.png">
-After sync of an order, email sent to the customer with the print of the bill in the attachment
+<div class="embed-container">
+ <iframe src="https://www.youtube.com/embed/4WkelWkbP_c" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
+</div>
{next}
diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sales.md b/erpnext/docs/user/manual/en/accounts/point-of-sales.md
new file mode 100644
index 0000000..fe7484f
--- /dev/null
+++ b/erpnext/docs/user/manual/en/accounts/point-of-sales.md
@@ -0,0 +1,117 @@
+# Point of Sale Invoice
+
+For retail operations, the delivery of goods, accrual of sale and payment all happens in one event, that is usually called the “Point of Sale” (POS).
+
+<iframe width="660" height="371" src="https://www.youtube.com/embed/4WkelWkbP_c" frameborder="0" allowfullscreen></iframe>
+
+###Offline POS
+
+In the retails business, invoicing needs to done very quickly, hence should less dependency. In the ERPNext, you can create POS Invoices, even when not connected to the internet.
+
+POS Invoices created in the offline mode will be saved locally in the browser. If internet connection is lost which creating POS Invoice, you will still be able can proceed forward. Once internet connection is available again, offline invoices will be synced, and pushed onto your ERPNext account. To learn more on how POS Invoices can be created when offline, [check here.](https://frappe.io/blog/blog/erpnext-features/offline-pos-in-erpnext-7)
+
+#### POS Profile
+
+In ERPNext all Sales and Purchase transactions, like Sales Invoice, Quotation, Sales Order, Purchase Order etc. can be edited via the POS. There two steps to Setup POS:
+
+1. Enable POS View via (Setup > Customize > Feature Setup)
+2. Create a [POS Profile](/docs/user/manual/en/setting-up/pos-setting.html) record
+
+#### Different sections of the POS
+
+ * Update Stock: If this is checked, Stock Ledger Entries will be made when you “Submit” this Sales Invoice thereby eliminating the need for a separate Delivery Note.
+ * In your Items table, update inventory information like Warehouse (saved as default), Serial Number, or Batch Number if applicable.
+ * Update Payment Details like your Bank / Cash Account, Paid amount etc.
+ * If you are writing off certain amount. For example when you receive extra cash as a result of not having exact denomination of change, check on ‘Write off Outstanding Amount’ and set the Account.
+
+### Customer
+
+In POS, user can select the existing customer during making an order or create the new customer. This features works in the offline mode also. User can also add the customer details like contact number, address details etc on the form. The customer which has been created from the POS will be synced when the internet connection is active.
+
+<img class="screenshot" alt="POS Customer" src="{{docs_base_url}}/assets/img/accounts/pos-customer.png">
+
+### Adding an Item
+
+At the billing counter, the retailer needs to select Items which the consumer buys. In the POS interface you can select an Item by two methods. One, is by clicking on the Item image and the other, is through the Barcode / Serial No.
+
+**Select Item** \- To select a product click on the Item image and add it into the cart. A cart is an area that prepares a customer for checkout by allowing to edit product information, adjust taxes and add discounts.
+
+**Barcode / Serial No** \- A Barcode / Serial No is an optical machine-readable representation of data relating to the object to which it is attached. Enter Barcode / Serial No in the box as shown in the image below and pause for a second, the item will be automatically added to the cart.
+
+<img class="screenshot" alt="POS Item" src="{{docs_base_url}}/assets/img/accounts/pos-item.png">
+
+> Tip: To change the quantity of an Item, enter your desired quantity in the
+quantity box. These are mostly used if the same Item is purchased in bulk.
+
+If your product list is very long use the Search field, type the product name
+in Search box.
+
+### Removing an Item from the Cart
+
+1. Select row in the cart and clik on delete button in the numeric keypad
+
+<img class="screenshot" alt="POS Item" src="{{docs_base_url}}/assets/img/accounts/pos_deleted_item.gif">
+
+
+2. Set Qty as zero to remove Item from the POS invoice. There are two ways to remove an Item.
+
+ * If Item's Qty is 1, click on a minus sign to make it zero.
+
+ * Manually enter 0(zero) quantity.
+
+### Make Payment
+
+After all the Items and their quantities are added into the cart, you are
+ready to make the Payment. Payment process is divided into 3 steps -
+
+ 1. Click on “Make Payment” to get the Payment window.
+ 2. Select your “Mode of Payment”.
+ 3. Click on “Pay” button to Save the document.
+
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/pos-payment.png">
+
+Submit the document to finalise the record. After the document is submitted,
+you can either print or email it directly to the customer.
+
+### Write off Amount
+
+Outstanding amount can be write off from the POS, user has to enter the amount under write off field on the payment screen.
+
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/write-off.png">
+
+System books the write off amount into the ledger which has selected on the POS Profile.
+
+### Change Amount
+
+POS calculate the extra amount paid by the customer, which user can return from the cash account. User has to set the account for the change amount on the POS profile.
+
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/change-amount.png">
+
+### Offline Records
+All the records from the POS stores into the browser's local storegae and sync submitted records after every minute of the interval if system is connected to internet. User can view the offline records by clicking on Menu > View Offline Records
+
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/offline-records.png">
+
+#### Accounting entries (GL Entry) for a Point of Sale:
+
+Debits:
+
+ * Customer (grand total)
+ * Bank / Cash (payment)
+
+Credits:
+
+ * Income (net total, minus taxes for each Item)
+ * Taxes (liabilities to be paid to the government)
+ * Customer (payment)
+ * Write Off (optional)
+ * Account for Change Amount (optional)
+
+To see entries after “Submit”, click on “View Ledger”.
+
+### Email
+User can send email from the POS, after submission of an order, user has to click on menu > email
+<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/pos-email.png">
+After sync of an order, email sent to the customer with the print of the bill in the attachment
+
+{next}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/agriculture/index.md b/erpnext/docs/user/manual/en/agriculture/index.md
index 932bb95..7723823 100644
--- a/erpnext/docs/user/manual/en/agriculture/index.md
+++ b/erpnext/docs/user/manual/en/agriculture/index.md
@@ -1,10 +1,16 @@
-# Agriculture
+# ERPNext for Agriculture
Farmers know that even a small operation requires intensive recordkeeping. A well-run farm requires proper management of accounting, payroll, suppliers, customers and logistics to name a few areas. ERPNext already helps organize these activities.
+<img class="screenshot" alt="Land Unit" src="{{docs_base_url}}/assets/img/agriculture/land-unit.png">
+
+### Capture Land Units and Manage Crops
+
A farm requires additional attention to manage its productive units (plots of land), time sensitive crop activities (such as planting, irrigating, fertilizing, etc.), recording environmental and crop data for analysis, and reports to help make effective decisions.
-<img class="screenshot" alt="Task" src="{{docs_base_url}}/assets/img/agriculture/agri_desk.png">
+<img class="screenshot" alt="Soil Texture" src="{{docs_base_url}}/assets/img/agriculture/soil-texture.png">
+
+### ERPNext Agriculture Demo
The Agriculture module in ERPNext helps you keep track of your farming operations. It allows you keep records for each field where you farm, such as geospatial and soil texture characteristics. It allows you to:
@@ -15,12 +21,12 @@
* Record sale of the harvest or transfer to warehouse for further processing
* View reports
-<img class="screenshot" alt="Task" src="{{docs_base_url}}/assets/img/agriculture/agri_doctypes.png">
+To see feature of ERPNext Agriculture in action, check the following demo video.
<div class="embed-container">
<iframe src="https://www.youtube.com/embed/A14cnWwE0vQ?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
-### Topics
+### Agriculture User Manual
{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/education/index.md b/erpnext/docs/user/manual/en/education/index.md
index 49dfd64..ff505f0 100644
--- a/erpnext/docs/user/manual/en/education/index.md
+++ b/erpnext/docs/user/manual/en/education/index.md
@@ -1,8 +1,47 @@
-# Education
+<!-- add-breadcrumbs -->
+# ERPNext for Education
+The Education domain in ERPNext is designed to meet requirements of any organization which imparts knowledge and believe in doing it in an organized fashion. It has already been used at the schools, colleges and even at the private firms.
-The Education Domain in ERPNext is designed to meet requirements of any educational Institute whether that is a school, college or any other private firm. ERPNext provides a centralized system, which can be used to maintain and update all the activities related to an Institution. It will provide a complete package for every funcationality required in any institute like Online Admission, Fees, Attendance, Examination.
+It helps you effectively manage administrative side and allows you to focus on what is most important for your institute, **to educate!**
-<img class="screenshot" alt="Fees Section" src="{{docs_base_url}}/assets/img/education/module.png">
+<img class="screenshot" alt="School Hero" src="{{docs_base_url}}/assets/img/education/school-hero.png">
+
+### Contents of ERPNext Education Domain
+
+Using Education module of ERPNext, you can effectively manage operations like:
+
+- Managing Student
+- Program and Courses
+- Online Admissions
+- Student Attendance
+- Course Scheduling
+- Assessment Planning and Assessment Result
+- Fee Structure and Fee Receipt
+
+For an online demonstration on each functionality of ERPNext Education module, [click here.](https://www.youtube.com/watch?v=f6foQOyGzdA&list=PL3lFfCEoMxvxyjnARY_C1zLoOE55LcMKB)
+
+<img class="screenshot" alt="Fees Section" src="{{docs_base_url}}/assets/img/education/assessment.png">
+
+### Who Uses ERPNext
+
+The very first implementation of ERPNext was driven by a school teacher herself. She explains what it takes to get implementation right at your education institute.
+
+<div>
+ <div class='embed-container'>
+ <iframe src='https://www.youtube.com/embed/t8ZDDq4qtIk?end=52' frameborder='0' allowfullscreen>
+ </iframe>
+ </div>
+<div>
+
+### User Manual
+
+Education Institute needs lots more than Education module, and ERPNext has all of it available built-in.
+
+- You track your books of accounts using [Accounts module](/docs/user/manual/en/accounts.html).
+- Manage payroll, leaves and claims of your admin and teaching staff in the [HR module](/docs/user/manual/en/human-resources.html).
+- Organize your [purchases](/docs/user/manual/en/buying.html) and place an approval system.
+
+Here is the stepwise guide on each functionality of ERPNext Education module.
{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/healthcare/index.md b/erpnext/docs/user/manual/en/healthcare/index.md
index f13205f..62e537d 100755
--- a/erpnext/docs/user/manual/en/healthcare/index.md
+++ b/erpnext/docs/user/manual/en/healthcare/index.md
@@ -1,13 +1,34 @@
-# Healthcare
+# ERPNext for Healthcare
-ERPNext Healthcare helps you manage your Clinic or Practice efficiently by scheduling **Appointments** and recording **Patient Encounters** (Consultations). You can easily pull out a **Patient's Health Record** anytime to review all the history of treatments assisting you in providing effective, high quality care.
+Life is priceless, and you as a medical practioner needs a best tools to honour it. ERPNext Healthcare domain is a humble initiative to help you serve your patients better.
-<img class="screenshot" alt="ERPNext Healthcare" src="{{docs_base_url}}/assets/img/healthcare/module.png">
+<img class="screenshot" alt="ERPNext Healthcare" src="{{docs_base_url}}/assets/img/healthcare/patient-appointment.png">
-Patients can view various documents relevant to them and book Appointments via the **ERPNext Portal**. The healthcare module is integrated with **Accounts** and **Human Resources** modules, helping you in **Billing**, **Payroll Management** etc. and benefit from other rich features of ERPNext. You can configure the **Selling** and **Stock** modules manage your Pharmacy.
+### What Healthcare Module Covers
-ERPNext Healthcare also includes features for effectively managing the functions of an associated **Laboratory** by helping you record **Sample Collection**, emailing and printing **Lab Test** results etc. ERPNext Healthcare allows you to upload **Medical Code Standards** like **ICD10** and attach to Consultations.
+ERPNext Healthcare helps you manage your clinic or practice efficiently by scheduling **Appointments** and recording **Patient Encounters** (Consultations). You can easily pull out a **Patient's Health Record** anytime to review all the history of treatments assisting you in providing effective, high quality care.
-### Topics
+<img class="screenshot" alt="ERPNext Healthcare" src="{{docs_base_url}}/assets/img/healthcare/appointment-analytics.png">
-{index}
+### Contributors of ERPNext Healthcare module
+
+The healthcare domain of ERPNext is a first domain to be competely contributed by a ERPNext community member, Earthians. Listen to Anoop, founder of Earthian on what motivated him to venture into Healthcare domain and how it benefit all the stack-holders of the community.
+
+<div>
+ <div class='embed-container'>
+ <iframe src='https://www.youtube.com/embed/1n4_YqX8ArA' frameborder='0' allowfullscreen>
+ </iframe>
+ </div>
+<div>
+
+### User Manual
+
+A clinic needs lots more than Healthcare module to operate efficiently. ERPNext has all of it available built-in.
+
+- You track your books of accounts using [Accounts module](/docs/user/manual/en/accounts.html).
+- Manage payroll, leaves and claims of your support staff in the [HR module](/docs/user/manual/en/human-resources.html).
+- Organize your [purchases](/docs/user/manual/en/buying.html) and place an approval system.
+
+Here is the stepwise guide on each functionality of ERPNext Healthcare module.
+
+{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/human-resources/loan-management.md b/erpnext/docs/user/manual/en/human-resources/loan-management.md
index d8a548b..9457e1a 100644
--- a/erpnext/docs/user/manual/en/human-resources/loan-management.md
+++ b/erpnext/docs/user/manual/en/human-resources/loan-management.md
@@ -18,7 +18,7 @@
> Human Resources > Loan Management > Loan Application > New Loan Application
-<img class="screenshot" alt="Loan Application" src="{{docs_base_url}}/assets/img/human-resources/employee-loan-application.png">
+<img class="screenshot" alt="Loan Application" src="{{docs_base_url}}/assets/img/human-resources/loan-application.png">
#### In the Loan Application,
@@ -35,7 +35,7 @@
> Human Resources > Loan Management > Loan > New Loan
-<img class="screenshot" alt="Loan Application" src="{{docs_base_url}}/assets/img/human-resources/employee-loan.png">
+<img class="screenshot" alt="Loan Application" src="{{docs_base_url}}/assets/img/human-resources/loan.png">
#### In the Loan,
diff --git a/erpnext/docs/user/manual/en/manufacturing/index.md b/erpnext/docs/user/manual/en/manufacturing/index.md
index cd397e8..13ef6f8 100644
--- a/erpnext/docs/user/manual/en/manufacturing/index.md
+++ b/erpnext/docs/user/manual/en/manufacturing/index.md
@@ -1,10 +1,32 @@
-# Manufacturing
+# ERPNext for Manufacturers
-The Manufacturing module in ERPNext helps you to maintain multi-level Bill of
-Materials (BOMs) for your Items.
-It helps in product costing, production planning, creating work orders for your manufacturing shop floors and
-planning inventory by getting your material requirement via BOMs (also called Material Requirements Planning MRP).
+ERPNext comes batteries included for all requirements of a manufacturing business like Bill of Materials tracking, Production Order planning and execution, procurement and lot more.
-### Topics
+<img class="screenshot" alt="BOM" src="{{docs_base_url}}/assets/img/manufacturing/BOM-hero.png">
+
+### Bill of Material, Production Order and More
+
+The Manufacturing module in ERPNext helps you to maintain multi-level Bill of Materials (BOMs) for your Items. It helps in product costing, production planning, creating work orders for your manufacturing shop floors and planning inventory by getting your material requirement via BOMs (also called Material Requirements Planning MRP).
+
+<img class="screenshot" alt="BOM" src="{{docs_base_url}}/assets/img/manufacturing/manufacturing-hero.png">
+
+You can also effectively track operations like:
+
+* Production Orders against customer's Sales Order
+* Material Planning
+* Purchasing based on Material Planning an reorder level.
+* Track actual material transfer against a Production Order
+* Despatched manufactured items to the Customers.
+* View reports
+
+### ERPNext Manufacturing Demo
+
+Check the following video to educate yourself on each feature in the manufacturing module.
+
+<div class="embed-container">
+ <iframe src="https://www.youtube.com/embed/xE74wdQU5cc" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
+</div>
+
+### User Manual
{index}
diff --git a/erpnext/docs/user/manual/en/manufacturing/tools/index.txt b/erpnext/docs/user/manual/en/manufacturing/tools/index.txt
index a385154..bdd357c 100644
--- a/erpnext/docs/user/manual/en/manufacturing/tools/index.txt
+++ b/erpnext/docs/user/manual/en/manufacturing/tools/index.txt
@@ -1,2 +1 @@
-production-planning-tool
bom-update-tool
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/manufacturing/tools/production-planning-tool.md b/erpnext/docs/user/manual/en/manufacturing/tools/production-planning-tool.md
deleted file mode 100644
index 4b7ee7a..0000000
--- a/erpnext/docs/user/manual/en/manufacturing/tools/production-planning-tool.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Production Planning Tool
-
-Production Planning Tool helps you plan production and purchase of Items for a
-period (usually a week or a month).
-
-<div class-"embed-container">
- <iframe src="https://www.youtube.com/embed/i0E_RcngliQ?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>
- </iframe>
-</div>
-
-This list of Items can be generated from the open Sales Orders or pending Material Requests that can be Manufactured in the system
-and will generate:
-
- * Work Orders for each Item.
- * Purchase Requests for Items whose Projected Quantity is likely to fall below zero.
-
-To use the Production Planning Tool, go to:
-
-> Manufacturing > Tools > Production Planning Tool
-
-<img class="screenshot" alt="Production Planing Tool" src="{{docs_base_url}}/assets/img/manufacturing/ppt.png">
-
-#### Step 1: Specify source to get Production Items
-
-* You can select Sales Order or Material Request according to where you want to source the items from
-* If you plan to add items manually, keep the "Get items from" field empty
-
-
-
-#### Step 2: Select and get Sales Order / Material Request
-
-* Use filters to get the Sales Order / Material Request
-* Click on Get Sales Order / Get Material Requests to generate a list.
-
-<img class="screenshot" alt="Production Planing Tool" src="{{docs_base_url}}/assets/img/manufacturing/ppt-get-sales-orders.png">
-
-
-
-#### Step 3: Get Items
-
-* Get the items for the Sales Order / Material request list
-* You can add/remove or change quantity of these Items.
-
-<img class="screenshot" alt="Production Planing Tool" src="{{docs_base_url}}/assets/img/manufacturing/ppt-get-item.png">
-
-#### Step 4: Create Work Orders
-
-<img class="screenshot" alt="Production Planing Tool" src="{{docs_base_url}}/assets/img/manufacturing/ppt-create-production-order.png">
-
-
-
-#### Step 5: Create Material Request
-
-Create Material Request for Items with projected shortfall.
-
-<img class="screenshot" alt="Production Planing Tool" src="{{docs_base_url}}/assets/img/manufacturing/ppt-create-material-request.png">
-
-
-
-The Production Planning Tool is used in two stages:
-
- * Selection of open Sales Orders / pending Material Request for the period based on “Expected Delivery Date”.
- * Selection of Items from those Sales Orders / Material Requests
-
-The tool will update if you have already created Production Orde rs for a
-particular Item against its Sales Order (“Planned Quantity”) or Material Request.
-
-You can always edit the Item list and increase / reduce quantities to plan
-your production.
-
-> Note: How do you change a Production Plan? The output of the Production
-Planning Tool is the Work Order. Once your orders are created, you can
-change them by amending the Work Orders.
-
-{next}
diff --git a/erpnext/docs/user/manual/en/non_profit/index.md b/erpnext/docs/user/manual/en/non_profit/index.md
index 7d56f4d..819cf79 100644
--- a/erpnext/docs/user/manual/en/non_profit/index.md
+++ b/erpnext/docs/user/manual/en/non_profit/index.md
@@ -1,23 +1,28 @@
-# Non Profit
+# ERPNext for Non-Profit Organizations
+People who change the world need the tools to do it! The Non Profit Modules of ERPNext is designed for an non-profit organization, so that they can deliver well on their noble cause of a better world.
-The Non Profit Modules in ERPNext is designed to meet requirements of NGO and Non Profit Organization. This is a centralized system, which maintains and updates all the activities related to an Organization.
+<img class="screenshot" alt="Non Profit" src="{{docs_base_url}}/assets/img/non_profit/non-profit-hero-linus.png">
-This will track all activity related to Memberships, Chapters, Volunteer Management,
-Donor Management, Event and Grant etc
+### Manager Members, Donors, Voluteers and More
+This is a centralized system, which maintains and updates all the activities related to an Organization.
-### Desk Page
-<img class="screenshot" >
+This will track all activity related to Memberships, Chapters, Volunteer Management, Donor Management, Event and Grant etc.
-<div class="section" style="padding-top: 0px; margin-top: -30px;">
- <div class="fake-browser-frame">
- <img class="img-responsive browser-image feature-image" alt="Non Profit Domain"
- src="{{docs_base_url}}/assets/img/non_profit/non_profit_domain.png">
- </div>
-</div>
+<img class="screenshot" alt="Non Profit" src="{{docs_base_url}}/assets/img/non_profit/chapter.png">
-### Non Profit Domain
-<img class="screenshot" alt="Non Profit" src="{{docs_base_url}}/assets/img/non_profit/module.png">
+### Demonstration of ERPNext Non-Profit Domain
+
+Check the following video to educate yourself on each feature in the non-profit module.
+
+<div>
+ <div class='embed-container'>
+ <iframe src='https://www.youtube.com/embed/p3l0Kq-TU5Y' frameborder='0' allowfullscreen>
+ </iframe>
+ </div>
+<div>
+
+### User Manual
{index}
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/projects/index.md b/erpnext/docs/user/manual/en/projects/index.md
index 95af437..e658eb8 100644
--- a/erpnext/docs/user/manual/en/projects/index.md
+++ b/erpnext/docs/user/manual/en/projects/index.md
@@ -1,15 +1,42 @@
-# Projects
+# ERPNext for Services
+
+For a services business, which doesn't have a tangible product to showcase their value, needs to get many things right to stay afloat and grow in the industry. ERPNext helps services company effectively manage business aspects like Projects Management, Customer Support, Sales and Purchase Management to list a few.
+
+<img class="screenshot" alt="Gannt" src="{{docs_base_url}}/assets/img/project/services-hero.png">
+
+### Project Management in ERPNext
ERPNext helps you manage your Projects by breaking them into Tasks and
allocating them to different people.
-Purchasing and selling can also be tracked against Projects and this can help
-the company keep tabs on its budget, delivery and profitability for a Project.
+<img class="screenshot" alt="Project" src="{{docs_base_url}}/assets/img/project/project.png">
Projects can be used to manage internal projects, manufacturing jobs or
-service jobs. For service jobs, Time Sheets can also be created that can be
-used to bill Customers if billing is done on a Time & Money basis.
+service jobs. For service jobs, Time Sheets can also be created that can be used to bill Customers if billing is done on a Time & Money basis.
-### Topics
+### Sales, Purchase Management, Customer Support
+
+Purchasing and selling can also be tracked against Projects and this can help the company keep tabs on its budget, delivery and profitability for a Project.
+
+<img class="screenshot" alt="Non Profit" src="{{docs_base_url}}/assets/img/project/support.png">
+
+### Demo on ERPNext for the Service Business
+
+Check the following video to educate yourself on the ERPNext features for services business.
+
+<div>
+ <div class='embed-container'>
+ <iframe src='https://www.youtube.com/embed/mI8IkiGhaPA' frameborder='0' allowfullscreen>
+ </iframe>
+ </div>
+<div>
+
+### User Manual
+
+A services company needs lots more than projects module to operate efficiently. ERPNext has all of it available built-in.
+
+- You track your books of accounts using [Accounts module](/docs/user/manual/en/accounts.html).
+- Manage payroll, leaves and claims of your support staff in the [HR module](/docs/user/manual/en/human-resources.html).
+- Attend customer's support queries better with [Support](/docs/user/manual/en/support.html) module of ERPNext.
{index}
diff --git a/erpnext/docs/user/manual/en/setting-up/authorization-rule.md b/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
index 8b99894..138a62e 100644
--- a/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
+++ b/erpnext/docs/user/manual/en/setting-up/authorization-rule.md
@@ -10,7 +10,7 @@
Let's consider an example of Authorization Rule to learn better.
-Assume that Sales Manager needs to authorize Sales Orders, only if its Grand Total value exceeds 10000. If Sales Orer values is less than 10000, then even Sales User will be able to submit it. It means Submit permision of Sales User will be restricted only upto Sales Order of Grand Total less than 10000.
+Assume that Sales Manager needs to authorize Sales Orders, only if its Grand Total value exceeds 10000. If Sales Order values is less than 10000, then even Sales User will be able to submit it. It means Submit permision of Sales User will be restricted only upto Sales Order of Grand Total less than 10000.
**Step 1:**
diff --git a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/user-permissions.md b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/user-permissions.md
index db444d1..4ff84df 100644
--- a/erpnext/docs/user/manual/en/setting-up/users-and-permissions/user-permissions.md
+++ b/erpnext/docs/user/manual/en/setting-up/users-and-permissions/user-permissions.md
@@ -1,6 +1,6 @@
# User Permissions
-Along with Role based permissions, you can also set user level permissions that are based on rules that are evaluated against the data containted in the document being accessed. This is particularly useful when you want to restrict based on:
+Along with Role based permissions, you can also set user level permissions that are based on rules that are evaluated against the data contained in the document being accessed. This is particularly useful when you want to restrict based on:
1. Allow user to access data belonging to one Company
1. Allow user to access data related to a specific Customer or Territory
@@ -17,28 +17,14 @@
<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-perms/new-user-permission.png" class="screenshot" alt="Creating a new user permission">
-If you want to apply the permissions to all Roles for that user, keep the "Apply Permissions for all Roles of this User" checked. If you check this, it will automatically setup the rules for Roles to check for User Permissions.
-
-### Choosing Which Roles to Apply
-
-You can also manually edit the the roles for which you want the user permissions to apply. To do that go the the **Role Permission Manager** and select the role for which you want to Edit the User Permissions.
-
-Note that the "Apply User Permissions" is already checked for this role. Then click on "Select Document Types"
-
-<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-perms/select-document-types.png" class="screenshot" alt="Select Document Types to Edit the Setting">
-
-Here you will see that Company has already been checked. If you want user permissions not be applied for that particular rule, you can un check it.
-
-<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-perms/view-selected-documents.png" class="screenshot" alt="Select Document Types to Edit the Setting">
-
### Ignoring User Permissions on Certain Fields
-Another way of allowing documents to be seen that have been restricited by User Permissions is to check "Ignore User Permissions" on a particular field by going to **Customize Form**
+Another way of allowing documents to be seen that have been restricted by User Permissions is to check "Ignore User Permissions" on a particular field by going to **Customize Form**
-For example you don't want Assets to be restricited for any user, then select **Asset** in **Customize Form** and in the Company field, check on "Ignore User Permissions"
+For example you don't want Assets to be restricted for any user, then select **Asset** in **Customize Form** and in the Company field, check on "Ignore User Permissions"
-<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-perms/ignore-user-user-permissions.png" class="screenshot" alt="Ignore User Permissions on specific properties">
+<img src="{{docs_base_url}}/assets/img/users-and-permissions/user-perms/ignore-user-permissions.png" class="screenshot" alt="Ignore User Permissions on specific properties">
### Strict Permissions
diff --git a/erpnext/docs/user/manual/en/stock/index.md b/erpnext/docs/user/manual/en/stock/index.md
index 75872ee..ebf7716 100644
--- a/erpnext/docs/user/manual/en/stock/index.md
+++ b/erpnext/docs/user/manual/en/stock/index.md
@@ -1,29 +1,40 @@
-# Stock
+# ERPNext for Distributors
-For most small business that deal in physical goods, a large part of their net
-worth is invested in the stock in hand.
+Distrobutors have large part of their net worth is invested in the stock in hand. With ERPNext, you can always keep a birds eye view on your stock availability, replineshment, procurement and sales.
+
+<img class="screenshot" alt="ERPNext Stock" src="{{docs_base_url}}/assets/img/stock/stock-hero.jpg">
+
+Distributors need to be on the top of their game always. From procuring the products to providing after-sales support for the same, they are an important part of the supply-chain.
### Material Flow
-There are three main types of entries:
+There are three main types of entries
* Purchase Receipt: Items received from Suppliers against Purchase Orders.
* Stock Entry: Items transferred from one Warehouse to another.
* Delivery Note: Items shipped to Customers.
-#### How does ERPNext track stock movement / levels?
+<img class="screenshot" alt="ERPNext Healthcare" src="{{docs_base_url}}/assets/img/stock/purchase-order-hero.png">
-Tracking stock is not just about adding and subtracting quantities. Some
-complications arise when:
+### A Distributor on ERPNext Implementation
- * Back-dated (past) entries are made / edited: This affects future stock levels and may lead to negative stock.
- * Stock has to be valued based on First-in-First-out: ERPNext needs to maintain a sequence of all transactions to know the exact value of your Items.
- * Stock reports are required at any point in time in the past: You have to lookup what was the quantity / value your stock of Item X on date Y.
+When Tarun Gupta's security services startup Neural Integrated Services started growing, his ERP could not keep pace and was full of bugs in spite of spending a lot of money. Thats when Tarun decided he wanted to move to something better and discovered ERPNext.
-To manage this, ERPNext collects all inventory transactions in a table called
-the Stock Ledger Entry. All Purchase Receipts, Stock Entries and Delivery
-Notes update this table.
+<div>
+ <div class='embed-container'>
+ <iframe src='https://www.youtube.com/embed/7tPifRTfbGo' frameborder='0' allowfullscreen>
+ </iframe>
+ </div>
+<div>
-### Topics
+### User Manual
+
+A distributor needs lots more than sales and purchase module to operate efficiently. ERPNext has all of it available built-in.
+
+- You track your books of accounts using [Accounts module](/docs/user/manual/en/accounts.html).
+- Manage payroll, leaves and claims of your support staff in the [HR module](/docs/user/manual/en/human-resources.html).
+- Attend customer's support queries better with [Support](/docs/user/manual/en/support.html) module of ERPNext.
+
+Here is the stepwise guide on the functionalities of ERPNext Stock / inventory module.
{index}
diff --git a/erpnext/docs/user/videos/learn/index.md b/erpnext/docs/user/videos/learn/index.md
index 4457de0..f10061c 100644
--- a/erpnext/docs/user/videos/learn/index.md
+++ b/erpnext/docs/user/videos/learn/index.md
@@ -215,10 +215,6 @@
Bill of Materials</a>
<span class="text-muted pull-right">3:27</span>
</li>
- <li><a href="/docs/user/videos/learn/production-planning.html">
- Production Planning Tool</a>
- <span class="text-muted pull-right">1:41</span>
- </li>
<li><a href="/docs/user/videos/learn/work-order.html">
Work Order</a>
<span class="text-muted pull-right">2:24</span>
diff --git a/erpnext/docs/user/videos/learn/production-planning.md b/erpnext/docs/user/videos/learn/production-planning.md
deleted file mode 100644
index 2af4c91..0000000
--- a/erpnext/docs/user/videos/learn/production-planning.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Production Planning Tool
-
-<iframe width="660" height="371" src="https://www.youtube.com/embed/CzatSl4zJ2Y" frameborder="0" allowfullscreen></iframe>
-
-**Duration: 1:41**
-
-Production Planning Tool helps you plan production and purchase of Items for a period.
-
-This video walks you through production planning for Sales Order item. Material Planning allows you to check required quantity of raw materials for manufacturing. You can create Material Request for the raw-material items for which sufficient stock is not available. From Production Planning Tool, you can also create Work Order for the finished items.
diff --git a/erpnext/education/api.py b/erpnext/education/api.py
index 5edc037..8571bf9 100644
--- a/erpnext/education/api.py
+++ b/erpnext/education/api.py
@@ -189,7 +189,7 @@
from frappe.desk.calendar import get_event_conditions
conditions = get_event_conditions("Course Schedule", filters)
- data = frappe.db.sql("""select name, course,
+ data = frappe.db.sql("""select name, course, color,
timestamp(schedule_date, from_time) as from_datetime,
timestamp(schedule_date, to_time) as to_datetime,
room, student_group, 0 as 'allDay'
diff --git a/erpnext/education/doctype/course_schedule/course_schedule.json b/erpnext/education/doctype/course_schedule/course_schedule.json
index 9049a80..9b7d897 100644
--- a/erpnext/education/doctype/course_schedule/course_schedule.json
+++ b/erpnext/education/doctype/course_schedule/course_schedule.json
@@ -42,6 +42,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -104,6 +106,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -133,6 +136,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -165,6 +169,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,38 @@
"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": "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
},
{
@@ -225,6 +262,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -256,6 +294,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -287,6 +326,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -316,6 +356,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -346,6 +387,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -376,6 +418,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -406,6 +449,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -420,7 +464,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2017-11-10 19:10:28.797143",
+ "modified": "2018-04-30 12:49:51.094872",
"modified_by": "Administrator",
"module": "Education",
"name": "Course Schedule",
@@ -429,7 +473,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/education/doctype/fees/fees.js b/erpnext/education/doctype/fees/fees.js
index 2a7218a..7346a8d 100644
--- a/erpnext/education/doctype/fees/fees.js
+++ b/erpnext/education/doctype/fees/fees.js
@@ -66,6 +66,9 @@
};
frappe.set_route("query-report", "General Ledger");
}, __("View"));
+ frm.add_custom_button(__("Payments"), function() {
+ frappe.set_route("List", "Payment Entry", {"Payment Entry Reference.reference_name": frm.doc.name});
+ }, __("View"));
}
if(frm.doc.docstatus===1 && frm.doc.outstanding_amount>0) {
frm.add_custom_button(__("Payment Request"), function() {
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js
index d5103ca..565074d 100644
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js
+++ b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js
@@ -24,7 +24,7 @@
frm.page.clear_indicator();
frm.page.set_primary_action(__('Print Report Card'), () => {
let url = "/api/method/erpnext.education.doctype.student_report_generation_tool.student_report_generation_tool.preview_report_card";
- open_url_post(url, frm.doc, true);
+ open_url_post(url, {"doc": frm.doc}, true);
});
},
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py
index 7b2e007..f997975 100644
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py
+++ b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py
@@ -3,7 +3,7 @@
# For license information, please see license.txt
from __future__ import unicode_literals
-import frappe
+import frappe, json
from frappe.model.document import Document
from erpnext.education.api import get_grade
from frappe.utils.pdf import get_pdf
@@ -16,8 +16,8 @@
@frappe.whitelist()
-def preview_report_card(**kwargs):
- doc = frappe._dict(**kwargs)
+def preview_report_card(doc):
+ doc = frappe._dict(json.loads(doc))
doc.students = [doc.student]
if not (doc.student_name and doc.student_batch):
program_enrollment = frappe.get_all("Program Enrollment", fields=["student_batch_name", "student_name"],
@@ -33,7 +33,7 @@
course_criteria = get_courses_criteria(courses)
# get the assessment group as per the user selection
- if int(doc.include_all_assessment):
+ if doc.include_all_assessment:
assessment_groups = get_child_assessment_groups(doc.assessment_group)
else:
assessment_groups = [doc.assessment_group]
@@ -55,7 +55,7 @@
"assessment_groups": assessment_groups,
"course_criteria": course_criteria,
"letterhead": letterhead.content,
- "add_letterhead": int(doc.add_letterhead) if int(doc.add_letterhead) else 0
+ "add_letterhead": doc.add_letterhead if doc.add_letterhead else 0
})
final_template = frappe.render_template(base_template_path, {"body": html, "title": "Report Card"})
diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py
index 451c491..472a2f2 100755
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/consultation/consultation.py
@@ -108,9 +108,11 @@
def update_consultation_to_medical_record(consultation):
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s", (consultation.name))
- if(medical_record_id[0][0]):
+ if medical_record_id and medical_record_id[0][0]:
subject = set_subject_field(consultation)
frappe.db.set_value("Patient Medical Record", medical_record_id[0][0], "subject", subject)
+ else:
+ insert_consultation_to_medical_record(consultation)
def delete_medical_record(consultation):
frappe.db.sql("""delete from `tabPatient Medical Record` where reference_name = %s""", (consultation.name))
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py
index 766491d..c910d7c 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.py
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.py
@@ -244,7 +244,7 @@
def delete_lab_test_from_medical_record(self):
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s",(self.name))
- if(medical_record_id[0][0]):
+ if medical_record_id and medical_record_id[0][0]:
frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
def create_item_line(test_code, sales_invoice):
diff --git a/erpnext/healthcare/doctype/patient/patient.js b/erpnext/healthcare/doctype/patient/patient.js
index b1150ab..b40f78d 100644
--- a/erpnext/healthcare/doctype/patient/patient.js
+++ b/erpnext/healthcare/doctype/patient/patient.js
@@ -40,7 +40,7 @@
},
onload: function (frm) {
if(!frm.doc.dob){
- $(frm.fields_dict['age_html'].wrapper).html("Age not specified");
+ $(frm.fields_dict['age_html'].wrapper).html("");
}
if(frm.doc.dob){
$(frm.fields_dict['age_html'].wrapper).html("AGE : " + get_age(frm.doc.dob));
@@ -49,7 +49,7 @@
});
frappe.ui.form.on("Patient", "dob", function(frm) {
- if(frm.doc.dob){
+ if(frm.doc.dob) {
var today = new Date();
var birthDate = new Date(frm.doc.dob);
if(today < birthDate){
@@ -61,6 +61,9 @@
$(frm.fields_dict['age_html'].wrapper).html("AGE : " + age_str);
}
}
+ else {
+ $(frm.fields_dict['age_html'].wrapper).html("");
+ }
});
var create_medical_record = function (frm) {
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
index c35e397..dfff5a4 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
@@ -1,8 +1,8 @@
frappe.views.calendar["Patient Appointment"] = {
field_map: {
- "start": "appointment_date",
- "end": "appointment_datetime",
+ "start": "start",
+ "end": "end",
"id": "name",
"title": "patient",
"allDay": "allDay",
@@ -43,4 +43,4 @@
'label': __('Status')
}
]
-};
+};
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
index a42ff02..41d9258 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
@@ -27,7 +27,7 @@
def delete_vital_signs_from_medical_record(doc):
medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s",(doc.name))
- if(medical_record_id[0][0]):
+ if medical_record_id and medical_record_id[0][0]:
frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
def set_subject_field(doc):
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 627455b..aa161c5 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -216,8 +216,8 @@
scheduler_events = {
"hourly": [
- "erpnext.accounts.doctype.subscription.subscription.make_subscription_entry",
- 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails'
+ 'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
+ "erpnext.accounts.doctype.subscription.subscription.process_all"
],
"daily": [
"erpnext.stock.reorder_item.reorder_item",
diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py
index 7b04f7d..7a4cb64 100644
--- a/erpnext/hr/doctype/attendance/attendance.py
+++ b/erpnext/hr/doctype/attendance/attendance.py
@@ -8,6 +8,7 @@
from frappe import _
from frappe.model.document import Document
from erpnext.hr.utils import set_employee_name
+from frappe.utils import cstr
class Attendance(Document):
def validate_duplicate_record(self):
@@ -54,3 +55,36 @@
self.validate_attendance_date()
self.validate_duplicate_record()
self.check_leave_record()
+
+@frappe.whitelist()
+def get_events(start, end, filters=None):
+ events = []
+
+ employee = frappe.db.get_value("Employee", {"user_id": frappe.session.user})
+
+ if not employee:
+ return events
+
+ from frappe.desk.reportview import get_filters_cond
+ conditions = get_filters_cond("Attendance", filters, [])
+ add_attendance(events, start, end, conditions=conditions)
+ return events
+
+def add_attendance(events, start, end, conditions=None):
+ query = """select name, attendance_date, status
+ from `tabAttendance` where
+ attendance_date between %(from_date)s and %(to_date)s
+ and docstatus < 2"""
+ if conditions:
+ query += conditions
+
+ for d in frappe.db.sql(query, {"from_date":start, "to_date":end}, as_dict=True):
+ e = {
+ "name": d.name,
+ "doctype": "Attendance",
+ "date": d.attendance_date,
+ "title": cstr(d.status),
+ "docstatus": d.docstatus
+ }
+ if e not in events:
+ events.append(e)
\ No newline at end of file
diff --git a/erpnext/hr/doctype/attendance/attendance_calendar.js b/erpnext/hr/doctype/attendance/attendance_calendar.js
new file mode 100644
index 0000000..b21afe5
--- /dev/null
+++ b/erpnext/hr/doctype/attendance/attendance_calendar.js
@@ -0,0 +1,18 @@
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+frappe.views.calendar["Attendance"] = {
+ field_map: {
+ "start": "date",
+ "end": "date",
+ "id": "name",
+ "docstatus": 1
+ },
+ options: {
+ header: {
+ left: 'prev,next today',
+ center: 'title',
+ right: 'month'
+ }
+ },
+ get_events_method: "erpnext.hr.doctype.attendance.attendance.get_events"
+};
\ No newline at end of file
diff --git a/erpnext/hr/doctype/department/department.js b/erpnext/hr/doctype/department/department.js
index 8f83db0..71cf2d2 100644
--- a/erpnext/hr/doctype/department/department.js
+++ b/erpnext/hr/doctype/department/department.js
@@ -3,21 +3,6 @@
frappe.ui.form.on('Department', {
onload: function(frm) {
- frm.set_query("leave_approver", "leave_approvers", function(doc) {
- return {
- query:"erpnext.hr.doctype.department_approver.department_approver.get_department_approvers",
- filters:{
- user: doc.user_id
- }
- };
- });
- frm.set_query("expense_approver", "expense_approvers", function(doc) {
- return {
- query:"erpnext.hr.doctype.department_approver.department_approver.get_department_approvers",
- filters:{
- user: doc.user_id
- }
- };
- });
+
}
});
diff --git a/erpnext/hr/doctype/department_approver/department_approver.py b/erpnext/hr/doctype/department_approver/department_approver.py
index b65e8ff..d30d801 100644
--- a/erpnext/hr/doctype/department_approver/department_approver.py
+++ b/erpnext/hr/doctype/department_approver/department_approver.py
@@ -10,16 +10,6 @@
class DepartmentApprover(Document):
pass
-def get_department_approvers(doctype, txt, searchfield, start, page_len, filters):
- return get_approver_list(filters.get("user"))
-
-def get_approver_list(name):
- return frappe.db.sql("""select user.name, user.first_name, user.last_name from
- tabUser user where
- user.enabled and
- user.name != %s
- """, name or "")
-
@frappe.whitelist()
def get_approvers(doctype, txt, searchfield, start, page_len, filters):
@@ -27,6 +17,8 @@
frappe.throw(_("Please select Employee Record first."))
approvers = []
+ department_details = {}
+ department_list = []
employee_department = filters.get("department") or frappe.get_value("Employee", filters.get("employee"), "department")
if employee_department:
department_details = frappe.db.get_value("Department", {"name": employee_department}, ["lft", "rgt"], as_dict=True)
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index 5e06488..f9d1c43 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -120,12 +120,6 @@
cur_frm.cscript.calculate_total(doc,cdt,cdn);
};
-cur_frm.cscript.on_submit = function() {
- if(cint(frappe.boot.notification_settings && frappe.boot.notification_settings.expense_claim)) {
- cur_frm.email_doc(frappe.boot.notification_settings.expense_claim_message);
- }
-};
-
erpnext.expense_claim = {
set_title :function(frm) {
if (!frm.doc.task) {
@@ -156,6 +150,19 @@
},
onload: function(frm) {
+ if (frm.doc.docstatus == 0) {
+ return frappe.call({
+ method: "erpnext.hr.doctype.leave_application.leave_application.get_mandatory_approval",
+ args: {
+ doctype: frm.doc.doctype,
+ },
+ callback: function(r) {
+ if (!r.exc && r.message) {
+ frm.toggle_reqd("expense_approver", true);
+ }
+ }
+ });
+ }
frm.set_query("expense_approver", function() {
return {
query: "erpnext.hr.doctype.department_approver.department_approver.get_approvers",
@@ -187,11 +194,6 @@
frm.add_custom_button(__('Payment'),
function() { frm.events.make_payment_entry(frm); }, __("Make"));
}
- frappe.db.get_value('HR Settings', {name: 'HR Settings'}, 'expense_approver_mandatory_in_expense_claim', (r) => {
- if (frm.doc.docstatus < 1 && (r.expense_approver_mandatory_in_expense_claim == 1)) {
- frm.toggle_reqd("expense_approver", true);
- }
- });
},
make_payment_entry: function(frm) {
@@ -211,7 +213,7 @@
}
});
},
-
+
set_query_for_cost_center: function(frm) {
frm.fields_dict["cost_center"].get_query = function() {
return {
@@ -262,7 +264,7 @@
employee: frm.doc.employee
},
callback: function(r, rt) {
-
+
if(r.message) {
$.each(r.message, function(i, d) {
var row = frappe.model.add_child(frm.doc, "Expense Claim Advance", "advances");
diff --git a/erpnext/hr/doctype/expense_claim/test_expense_claim.py b/erpnext/hr/doctype/expense_claim/test_expense_claim.py
index f89beba..3e031c9 100644
--- a/erpnext/hr/doctype/expense_claim/test_expense_claim.py
+++ b/erpnext/hr/doctype/expense_claim/test_expense_claim.py
@@ -77,9 +77,27 @@
])
for gle in gl_entries:
- self.assertEqual(expected_values[gle.account][0], gle.account)
- self.assertEqual(expected_values[gle.account][1], gle.debit)
- self.assertEqual(expected_values[gle.account][2], gle.credit)
+ self.assertEquals(expected_values[gle.account][0], gle.account)
+ self.assertEquals(expected_values[gle.account][1], gle.debit)
+ self.assertEquals(expected_values[gle.account][2], gle.credit)
+
+ def test_rejected_expense_claim(self):
+ payable_account = get_payable_account("Wind Power LLC")
+ expense_claim = frappe.get_doc({
+ "doctype": "Expense Claim",
+ "employee": "_T-Employee-00001",
+ "payable_account": payable_account,
+ "approval_status": "Rejected",
+ "expenses":
+ [{ "expense_type": "Travel", "default_account": "Travel Expenses - WP", "claim_amount": 300, "sanctioned_amount": 200 }]
+ })
+ expense_claim.submit()
+
+ self.assertEquals(expense_claim.status, 'Rejected')
+ self.assertEquals(expense_claim.total_sanctioned_amount, 0.0)
+
+ gl_entry = frappe.get_all('GL Entry', {'voucher_type': 'Expense Claim', 'voucher_no': expense_claim.name})
+ self.assertEquals(len(gl_entry), 0)
def get_payable_account(company):
return frappe.db.get_value('Company', company, 'default_payable_account')
@@ -89,6 +107,7 @@
"doctype": "Expense Claim",
"employee": "_T-Employee-00001",
"payable_account": payable_account,
+ "approval_status": "Approved",
"company": company,
"expenses":
[{ "expense_type": "Travel", "default_account": account, "claim_amount": claim_amount, "sanctioned_amount": sanctioned_amount }]
@@ -100,5 +119,3 @@
expense_claim.submit()
return expense_claim
-
-
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.json b/erpnext/hr/doctype/holiday_list/holiday_list.json
index 6b71ffc..f417cb2 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list.json
+++ b/erpnext/hr/doctype/holiday_list/holiday_list.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 1,
"autoname": "field:holiday_list_name",
@@ -13,6 +14,7 @@
"engine": "InnoDB",
"fields": [
{
+ "allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -23,6 +25,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Holiday List Name",
@@ -39,9 +42,11 @@
"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,
@@ -52,6 +57,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "From Date",
@@ -67,9 +73,11 @@
"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,
@@ -80,6 +88,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "To Date",
@@ -95,9 +104,11 @@
"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,
@@ -108,6 +119,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Weekly Off",
@@ -123,9 +135,11 @@
"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,
@@ -136,6 +150,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Get Weekly Off Dates",
@@ -151,9 +166,11 @@
"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,
@@ -164,6 +181,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Holidays",
@@ -181,9 +199,11 @@
"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,
@@ -194,6 +214,7 @@
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
+ "in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Clear Table",
@@ -209,21 +230,83 @@
"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,
+ "fieldname": "section_break_9",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "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
}
],
+ "has_web_view": 0,
"hide_heading": 0,
"hide_toolbar": 0,
"icon": "fa fa-calendar",
"idx": 1,
"image_view": 0,
"in_create": 0,
- "in_dialog": 0,
"is_submittable": 0,
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-11-07 05:31:24.729126",
+ "modified": "2018-04-30 12:49:59.239227",
"modified_by": "Administrator",
"module": "HR",
"name": "Holiday List",
@@ -231,7 +314,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -239,7 +321,6 @@
"export": 0,
"if_owner": 0,
"import": 0,
- "is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,
@@ -254,7 +335,9 @@
"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/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py
index 17d0a91..26919595 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list.py
+++ b/erpnext/hr/doctype/holiday_list/holiday_list.py
@@ -78,8 +78,7 @@
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
if end:
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
-
return frappe.get_list('Holiday List',
- fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description'],
+ fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
filters = filters,
update={"allDay": 1})
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.json b/erpnext/hr/doctype/hr_settings/hr_settings.json
index d1e02be..225785d 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.json
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.json
@@ -452,6 +452,66 @@
"set_only_once": 0,
"translatable": 0,
"unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "leave_settings",
+ "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": "Leave Settings",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "show_leaves_of_all_department_members_in_calendar",
+ "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": "Show Leaves Of All Department Members In Calendar",
+ "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,
@@ -465,7 +525,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-04-14 17:09:15.904645",
+ "modified": "2018-05-03 15:36:13.015466",
"modified_by": "Administrator",
"module": "HR",
"name": "HR Settings",
diff --git a/erpnext/hr/doctype/hr_settings/test_hr_settings.py b/erpnext/hr/doctype/hr_settings/test_hr_settings.py
index 00f183e..2d5b18b 100644
--- a/erpnext/hr/doctype/hr_settings/test_hr_settings.py
+++ b/erpnext/hr/doctype/hr_settings/test_hr_settings.py
@@ -3,6 +3,7 @@
# See license.txt
from __future__ import unicode_literals
+import frappe
import unittest
class TestHRSettings(unittest.TestCase):
diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js
index 76b5ae5..b53852a 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.js
+++ b/erpnext/hr/doctype/leave_application/leave_application.js
@@ -9,7 +9,19 @@
if (!frm.doc.posting_date) {
frm.set_value("posting_date", frappe.datetime.get_today());
}
-
+ if (frm.doc.docstatus == 0) {
+ return frappe.call({
+ method: "erpnext.hr.doctype.leave_application.leave_application.get_mandatory_approval",
+ args: {
+ doctype: frm.doc.doctype,
+ },
+ callback: function(r) {
+ if (!r.exc && r.message) {
+ frm.toggle_reqd("leave_approver", true);
+ }
+ }
+ });
+ }
frm.set_query("leave_approver", function() {
return {
query: "erpnext.hr.doctype.department_approver.department_approver.get_approvers",
@@ -62,11 +74,6 @@
if(frm.doc.__islocal && !in_list(frappe.user_roles, "Employee")) {
frm.set_intro(__("Fill the form and save it"));
}
- frappe.db.get_value('HR Settings', {name: 'HR Settings'}, 'leave_approver_mandatory_in_leave_application', (r) => {
- if (frm.doc.docstatus < 1 && (r.leave_approver_mandatory_in_leave_application == 1)) {
- frm.toggle_reqd("leave_approver", true);
- }
- });
},
employee: function(frm) {
diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json
index d657ec4..290120b 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.json
+++ b/erpnext/hr/doctype/leave_application/leave_application.json
@@ -691,6 +691,37 @@
},
{
"allow_bulk_edit": 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_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -823,7 +854,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 3,
- "modified": "2018-04-16 09:46:44.650629",
+ "modified": "2018-04-30 12:49:40.845022",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application",
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index fad4068..3f7fd4c 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -265,24 +265,24 @@
})
def notify_leave_approver(self):
+ if self.leave_approver:
+ parent_doc = frappe.get_doc('Leave Application', self.name)
+ args = parent_doc.as_dict()
- parent_doc = frappe.get_doc('Leave Application', self.name)
- args = parent_doc.as_dict()
+ template = frappe.db.get_single_value('HR Settings', 'leave_approval_notification_template')
+ if not template:
+ frappe.msgprint(_("Please set default template for Leave Approval Notification in HR Settings."))
+ return
+ email_template = frappe.get_doc("Email Template", template)
+ message = frappe.render_template(email_template.response, args)
- template = frappe.db.get_single_value('HR Settings', 'leave_approval_notification_template')
- if not template:
- frappe.msgprint(_("Please set default template for Leave Approval Notification in HR Settings."))
- return
- email_template = frappe.get_doc("Email Template", template)
- message = frappe.render_template(email_template.response, args)
-
- self.notify({
- # for post in messages
- "message": message,
- "message_to": self.leave_approver,
- # for email
- "subject": email_template.subject
- })
+ self.notify({
+ # for post in messages
+ "message": message,
+ "message_to": self.leave_approver,
+ # for email
+ "subject": email_template.subject
+ })
def notify(self, args):
args = frappe._dict(args)
@@ -434,7 +434,6 @@
from frappe.desk.reportview import get_filters_cond
conditions = get_filters_cond("Leave Application", filters, [])
-
# show department leaves for employee
if "Employee" in frappe.get_roles():
add_department_leaves(events, start, end, employee, company)
@@ -457,16 +456,29 @@
and company=%s""", (department, company))
match_conditions = "and employee in (\"%s\")" % '", "'.join(department_employees)
- add_leaves(events, start, end, match_conditions=match_conditions)
+ add_leaves(events, start, end, filter_conditions=match_conditions)
-def add_leaves(events, start, end, match_conditions=None):
+def add_leaves(events, start, end, filter_conditions=None):
+ conditions = []
+
+ if filter_conditions:
+ conditions.append(filter_conditions)
+
+ if not cint(frappe.db.get_value("HR Settings", None, "show_leaves_of_all_department_members_in_calendar")):
+ from frappe.desk.reportview import build_match_conditions
+ match_conditions = build_match_conditions("Leave Application")
+
+ if match_conditions:
+ conditions.append(match_conditions)
+
query = """select name, from_date, to_date, employee_name, half_day,
- employee, docstatus
+ status, employee, docstatus
from `tabLeave Application` where
from_date <= %(end)s and to_date >= %(start)s <= to_date
and docstatus < 2"""
- if match_conditions:
- query += match_conditions
+
+ if conditions:
+ query += ' and '.join(conditions)
for d in frappe.db.sql(query, {"start":start, "end": end}, as_dict=True):
e = {
@@ -474,9 +486,10 @@
"doctype": "Leave Application",
"from_date": d.from_date,
"to_date": d.to_date,
+ "docstatus": d.docstatus,
+ "color": d.color,
"title": cstr(d.employee_name) + \
(d.half_day and _(" (Half Day)") or ""),
- "docstatus": d.docstatus
}
if e not in events:
events.append(e)
@@ -513,3 +526,16 @@
"title": _("Holiday") + ": " + cstr(holiday.description),
"name": holiday.name
})
+
+@frappe.whitelist()
+def get_mandatory_approval(doctype):
+ mandatory = ""
+ if doctype == "Leave Application":
+ mandatory = frappe.db.get_single_value('HR Settings',
+ 'leave_approver_mandatory_in_leave_application')
+ else:
+ mandatory = frappe.db.get_single_value('HR Settings',
+ 'expense_approver_mandatory_in_expense_claim')
+
+ return mandatory
+
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 9b9e964..eb43d5a 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -50,9 +50,6 @@
def tearDown(self):
frappe.set_user("Administrator")
- # so that this test doesn't affect other tests
- frappe.db.sql("""delete from `tabEmployee Leave Approver`""")
-
def _clear_roles(self):
frappe.db.sql("""delete from `tabHas Role` where parent in
("test@example.com", "test1@example.com", "test2@example.com")""")
@@ -81,6 +78,7 @@
application = self.get_application(_test_records[0])
application.insert()
+ application.status = "Approved"
self.assertRaises(LeaveDayBlockedError, application.submit)
frappe.set_user("test1@example.com")
@@ -220,7 +218,7 @@
frappe.set_user("test1@example.com")
application.insert()
-
+ application.status = "Approved"
frappe.set_user("test@example.com")
self.assertRaises(LeaveDayBlockedError, application.submit)
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
index 0dd2b4c..aa27e5b 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py
+++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py
@@ -184,7 +184,7 @@
Get loan details from submitted salary slip based on selected criteria
"""
cond = self.get_filter_condition()
- return frappe.db.sql(""" select eld.loan_account,
+ return frappe.db.sql(""" select eld.loan_account, eld.loan
eld.interest_income_account, eld.principal_amount, eld.interest_amount, eld.total_payment
from
`tabSalary Slip` t1, `tabSalary Slip Loan` eld
@@ -294,7 +294,7 @@
})
if data.interest_amount and not data.interest_income_account:
- frappe.throw(_("Select interest income account in employee loan {0}").format(data.employee_loan))
+ frappe.throw(_("Select interest income account in loan {0}").format(data.loan))
if data.interest_income_account and data.interest_amount:
accounts.append({
diff --git a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
index fe5a755..2a9d87c 100644
--- a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
+++ b/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
@@ -57,7 +57,7 @@
salary_component = frappe.get_doc('Salary Component', 'Basic Salary')
salary_component.append('accounts', {
'company': company,
- 'default_account': 'Salary - WP'
+ 'default_account': "Salary - " + frappe.db.get_value('Company', company, 'abbr')
})
company_doc = frappe.get_doc('Company', company)
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index a99a919..cec5356 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -29,9 +29,10 @@
})
},
- start_date: function(frm){
+ start_date: function(frm, dt, dn){
if(frm.doc.start_date){
frm.trigger("set_end_date");
+ get_emp_and_leave_details(frm.doc, dt, dn);
}
},
@@ -65,18 +66,20 @@
cur_frm.fields_dict['deductions'].grid.set_column_disp(salary_detail_fields,false);
},
- salary_slip_based_on_timesheet: function(frm) {
+ salary_slip_based_on_timesheet: function(frm, dt, dn) {
frm.trigger("toggle_fields");
- frm.set_value('start_date', '');
+ get_emp_and_leave_details(frm.doc, dt, dn);
},
- payroll_frequency: function(frm) {
+ payroll_frequency: function(frm, dt, dn) {
frm.trigger("toggle_fields");
+ frm.set_value('end_date', '');
frm.set_value('start_date', '');
+ get_emp_and_leave_details(frm.doc, dt, dn);
},
- employee: function(frm){
- frm.set_value('start_date', '');
+ employee: function(frm, dt, dn) {
+ get_emp_and_leave_details(frm.doc, dt, dn);
},
toggle_fields: function(frm) {
@@ -109,7 +112,7 @@
// Get leave details
//---------------------------------------------------------------------
-cur_frm.cscript.start_date = function(doc, dt, dn){
+var get_emp_and_leave_details = function(doc, dt, dn) {
if(!doc.start_date){
return frappe.call({
method: 'get_emp_and_leave_details',
@@ -122,11 +125,9 @@
}
}
-cur_frm.cscript.payroll_frequency = cur_frm.cscript.salary_slip_based_on_timesheet = cur_frm.cscript.start_date;
-
cur_frm.cscript.employee = function(doc,dt,dn){
doc.salary_structure = ''
- cur_frm.cscript.start_date(doc, dt, dn)
+ get_emp_and_leave_details(doc, dt, dn);
}
cur_frm.cscript.leave_without_pay = function(doc,dt,dn){
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js
index 6f5c923..ca92234 100755
--- a/erpnext/hr/doctype/salary_structure/salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.js
@@ -123,6 +123,28 @@
}
});
+frappe.ui.form.on('Salary Structure Employee', {
+ from_date: function(frm, cdt, cdn) {
+ validate_date(frm, cdt, cdn);
+ },
+ to_date: function(frm, cdt, cdn) {
+ validate_date(frm, cdt, cdn);
+ }
+});
+
+var validate_date = function(frm, cdt, cdn) {
+ var doc = locals[cdt][cdn];
+ if(doc.to_date && doc.from_date) {
+ var from_date = frappe.datetime.str_to_obj(doc.from_date);
+ var to_date = frappe.datetime.str_to_obj(doc.to_date);
+
+ if(to_date < from_date) {
+ frappe.model.set_value(cdt, cdn, "to_date", "");
+ frappe.throw(__("From Date cannot be greater than To Date"));
+ }
+ }
+}
+
cur_frm.cscript.amount = function(doc, cdt, cdn){
calculate_totals(doc, cdt, cdn);
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 007299a..73c8ca0 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -591,6 +591,7 @@
@frappe.whitelist()
def get_bom_items(bom, company, qty=1, fetch_exploded=1):
items = get_bom_items_as_dict(bom, company, qty, fetch_exploded).values()
+ items = list(items)
items.sort(key = functools.cmp_to_key(lambda a, b: a.item_code > b.item_code and 1 or -1))
return items
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.json b/erpnext/manufacturing/doctype/work_order/work_order.json
index e6bdc26..1cc2459 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.json
+++ b/erpnext/manufacturing/doctype/work_order/work_order.json
@@ -1526,7 +1526,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-03-05 12:43:10.442928",
+ "modified": "2018-04-30 12:49:21.211740",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Work Order",
@@ -1534,7 +1534,6 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -1554,7 +1553,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py
index 8b53fc3..90a7149 100644
--- a/erpnext/manufacturing/doctype/work_order/work_order.py
+++ b/erpnext/manufacturing/doctype/work_order/work_order.py
@@ -567,7 +567,7 @@
if not res["bom_no"]:
if project:
res = get_item_details(item)
- frappe.msgprint(_("Default BOM not found for Item {0} and Project {1}").format(item, project))
+ frappe.msgprint(_("Default BOM not found for Item {0} and Project {1}").format(item, project), alert=1)
else:
frappe.throw(_("Default BOM for {0} not found").format(item))
diff --git a/erpnext/non_profit/doctype/chapter/chapter.py b/erpnext/non_profit/doctype/chapter/chapter.py
index 3320690..e9554b1 100644
--- a/erpnext/non_profit/doctype/chapter/chapter.py
+++ b/erpnext/non_profit/doctype/chapter/chapter.py
@@ -35,7 +35,6 @@
context.title = 'All Chapters'
context.no_breadcrumbs = True
context.order_by = 'creation desc'
- context.introduction = '<p>All Chapters</p>'
@frappe.whitelist()
@@ -47,4 +46,4 @@
member.leave_reason = leave_reason
chapter.save(ignore_permissions=1)
frappe.db.commit()
- return "Thank you for Feedback"
\ No newline at end of file
+ return "Thank you for Feedback"
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 70f4ecd..cdea9e7 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -523,6 +523,12 @@
erpnext.patches.v11_0.add_default_email_template_for_leave
erpnext.patches.v11_0.set_default_email_template_in_hr
erpnext.patches.v10_0.taxes_issue_with_pos
+erpnext.patches.v10_1.transfer_subscription_to_auto_repeat
+erpnext.patches.v10_1.drop_old_subscription_records
+erpnext.patches.v11_0.update_brand_in_item_price
+erpnext.patches.v11_0.create_default_success_action
+erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input
+erpnext.patches.v10_0.show_leaves_of_all_department_members_in_calendar
erpnext.patches.v11_0.rename_field_max_days_allowed
erpnext.patches.v11_0.create_salary_structure_assignments
erpnext.patches.v11_0.rename_health_insurance
diff --git a/erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py b/erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py
new file mode 100644
index 0000000..5dbcb1d
--- /dev/null
+++ b/erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ frappe.reload_doc("stock", "doctype", "stock_settings")
+
+ ss = frappe.get_doc("Stock Settings")
+ ss.set_qty_in_transactions_based_on_serial_no_input = 1
+ ss.save()
\ No newline at end of file
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
new file mode 100644
index 0000000..1ae8b4a
--- /dev/null
+++ b/erpnext/patches/v10_0/show_leaves_of_all_department_members_in_calendar.py
@@ -0,0 +1,5 @@
+import frappe
+
+def execute():
+ frappe.reload_doc("hr", "doctype", "hr_settings")
+ frappe.db.set_value("HR Settings", None, "show_leaves_of_all_department_members_in_calendar", 1)
\ No newline at end of file
diff --git a/erpnext/patches/v10_1/__init__.py b/erpnext/patches/v10_1/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v10_1/__init__.py
diff --git a/erpnext/patches/v10_1/drop_old_subscription_records.py b/erpnext/patches/v10_1/drop_old_subscription_records.py
new file mode 100644
index 0000000..7573f15
--- /dev/null
+++ b/erpnext/patches/v10_1/drop_old_subscription_records.py
@@ -0,0 +1,6 @@
+from __future__ import unicode_literals
+import frappe
+
+
+def execute():
+ frappe.db.sql('DELETE from `tabSubscription`')
diff --git a/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
new file mode 100644
index 0000000..481c557
--- /dev/null
+++ b/erpnext/patches/v10_1/transfer_subscription_to_auto_repeat.py
@@ -0,0 +1,31 @@
+from __future__ import unicode_literals
+import frappe
+from frappe.model.utils.rename_field import rename_field
+
+
+def execute():
+ to_rename = ['Purchase Order', 'Journal Entry', 'Sales Invoice', 'Payment Entry',
+ 'Delivery Note', 'Purchase Invoice', 'Quotation', 'Sales Order',
+ 'Purchase Receipt', 'Supplier Quotation']
+
+ frappe.reload_doc('accounts', 'doctype', 'sales_invoice')
+ frappe.reload_doc('accounts', 'doctype', 'purchase_invoice')
+ frappe.reload_doc('accounts', 'doctype', 'payment_entry')
+ frappe.reload_doc('accounts', 'doctype', 'journal_entry')
+ frappe.reload_doc('buying', 'doctype', 'purchase_order')
+ frappe.reload_doc('buying', 'doctype', 'supplier_quotation')
+ frappe.reload_doc('desk', 'doctype', 'auto_repeat')
+ frappe.reload_doc('selling', 'doctype', 'quotation')
+ frappe.reload_doc('selling', 'doctype', 'sales_order')
+ frappe.reload_doc('stock', 'doctype', 'purchase_receipt')
+ frappe.reload_doc('stock', 'doctype', 'delivery_note')
+
+ for doctype in to_rename:
+ rename_field(doctype, 'subscription', 'auto_repeat')
+
+ subscriptions = frappe.db.sql('select * from `tabSubscription`', as_dict=1)
+
+ for doc in subscriptions:
+ doc['doctype'] = 'Auto Repeat'
+ auto_repeat = frappe.get_doc(doc)
+ auto_repeat.db_insert()
diff --git a/erpnext/patches/v11_0/create_default_success_action.py b/erpnext/patches/v11_0/create_default_success_action.py
new file mode 100644
index 0000000..29687d2
--- /dev/null
+++ b/erpnext/patches/v11_0/create_default_success_action.py
@@ -0,0 +1,6 @@
+import frappe
+from erpnext.setup.install import create_default_success_action
+
+def execute():
+ frappe.reload_doc("core", "doctype", "success_action")
+ create_default_success_action()
diff --git a/erpnext/patches/v11_0/update_brand_in_item_price.py b/erpnext/patches/v11_0/update_brand_in_item_price.py
new file mode 100644
index 0000000..a19a6c4
--- /dev/null
+++ b/erpnext/patches/v11_0/update_brand_in_item_price.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+import frappe
+
+def execute():
+ frappe.reload_doc('stock', 'doctype', 'item_price')
+
+ frappe.db.sql(""" update `tabItem Price`, `tabItem`
+ set
+ `tabItem Price`.brand = `tabItem`.brand
+ where
+ `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/v9_0/fix_subscription_next_date.py b/erpnext/patches/v9_0/fix_subscription_next_date.py
index 07af712..ac9db31 100644
--- a/erpnext/patches/v9_0/fix_subscription_next_date.py
+++ b/erpnext/patches/v9_0/fix_subscription_next_date.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate
-from erpnext.accounts.doctype.subscription.subscription import get_next_schedule_date
+from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
def execute():
frappe.reload_doctype('Subscription')
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 7fbeaee..1e36a95 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -87,25 +87,27 @@
}
});
},
- edit_task: function (frm, doctype, name) {
+});
+
+frappe.ui.form.on("Project Task", {
+ edit_task: function(frm, doctype, name) {
var doc = frappe.get_doc(doctype, name);
- if (doc.task_id) {
+ if(doc.task_id) {
frappe.set_route("Form", "Task", doc.task_id);
} else {
frappe.msgprint(__("Save the document first."));
}
},
- edit_timesheet: function (frm, cdt, cdn) {
+
+ edit_timesheet: function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
- frappe.route_options = {
- "project": frm.doc.project_name,
- "task": child.task_id
- };
+ frappe.route_options = {"project": frm.doc.project_name, "task": child.task_id};
frappe.set_route("List", "Timesheet");
},
- make_timesheet: function (frm, cdt, cdn) {
+
+ make_timesheet: function(frm, cdt, cdn) {
var child = locals[cdt][cdn];
- frappe.model.with_doctype('Timesheet', function () {
+ frappe.model.with_doctype('Timesheet', function() {
var doc = frappe.model.get_new_doc('Timesheet');
var row = frappe.model.add_child(doc, 'time_logs');
row.project = frm.doc.project_name;
@@ -114,13 +116,11 @@
})
},
- status: function (frm, doctype, name) {
+ status: function(frm, doctype, name) {
frm.trigger('tasks_refresh');
},
-
});
-
frappe.ui.form.on("Project", "validate", function (frm) {
frappe.call({
method: "erpnext.projects.doctype.project.project.times_check",
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index c1b7aa1..9323e20 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -502,6 +502,37 @@
"allow_on_submit": 0,
"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": 0,
+ "print_hide_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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"collapsible_depends_on": "",
"columns": 0,
"depends_on": "",
diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
index b948238..b1f7372 100644
--- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
+++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json
@@ -264,7 +264,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:parent.production_order",
+ "depends_on": "eval:parent.work_order",
"fieldname": "completed_qty",
"fieldtype": "Float",
"hidden": 0,
@@ -296,7 +296,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:parent.production_order",
+ "depends_on": "eval:parent.work_order",
"fieldname": "workstation",
"fieldtype": "Link",
"hidden": 0,
@@ -359,7 +359,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:parent.production_order",
+ "depends_on": "eval:parent.work_order",
"fieldname": "operation",
"fieldtype": "Link",
"hidden": 0,
@@ -392,7 +392,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "depends_on": "eval:parent.production_order",
+ "depends_on": "eval:parent.work_order",
"fieldname": "operation_id",
"fieldtype": "Data",
"hidden": 1,
@@ -932,7 +932,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-03-21 17:13:32.561550",
+ "modified": "2018-05-07 15:12:31.510813",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet Detail",
diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js
index 5baf848..3f664ae 100644
--- a/erpnext/public/js/controllers/accounts.js
+++ b/erpnext/public/js/controllers/accounts.js
@@ -145,6 +145,8 @@
frappe.model.set_value(cdt, cdn, "description", r.message.account_name);
}
})
+ } else if (d.charge_type == 'Actual' && d.account_head) {
+ frappe.model.set_value(cdt, cdn, "description", d.account_head.split(' - ')[0]);
}
}
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index eb4a700..2130d2b 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -296,7 +296,6 @@
var me = this;
var item = frappe.get_doc(cdt, cdn);
var update_stock = 0, show_batch_dialog = 0;
-
if(['Sales Invoice'].includes(this.frm.doc.doctype)) {
update_stock = cint(me.frm.doc.update_stock);
show_batch_dialog = update_stock;
@@ -305,7 +304,6 @@
this.frm.doc.doctype === 'Delivery Note') {
show_batch_dialog = 1;
}
-
// clear barcode if setting item (else barcode will take priority)
if(!from_barcode) {
item.barcode = null;
@@ -402,7 +400,7 @@
item.serial_no = valid_serial_nos.join('\n');
refresh_field("serial_no", item.name, item.parentfield);
- if(!doc.is_return) {
+ if(!doc.is_return && cint(user_defaults.set_qty_in_transactions_based_on_serial_no_input)) {
frappe.model.set_value(item.doctype, item.name,
"qty", valid_serial_nos.length / item.conversion_factor);
frappe.model.set_value(item.doctype, item.name, "stock_qty", valid_serial_nos.length);
diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js
index e812f19..fa843bc 100644
--- a/erpnext/public/js/help_links.js
+++ b/erpnext/public/js/help_links.js
@@ -504,10 +504,6 @@
{ label: 'Operation', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/operation' },
]
-frappe.help.help_links['Form/Production Planning Tool'] = [
- { label: 'Production Planning Tool', url: 'https://frappe.github.io/erpnext/user/manual/en/manufacturing/tools/production-planning-tool' },
-]
-
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' },
]
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 0e60179..a9ac8c4 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -69,7 +69,7 @@
"get_query": function () {
return {
filters: {
- item_code:grid_row.doc.item_code ,
+ item_code:grid_row.doc.item_code,
warehouse:cur_frm.doc.is_return ? null : grid_row.doc.warehouse
}
}
diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py
index 50a2e0d..f9e0156 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -143,7 +143,17 @@
""" % (self.doctype, ', '.join(['%s']*len(self.invoices))), tuple(self.invoices), as_dict=1)
for d in items:
- self.invoice_items.setdefault(d.parent, {}).setdefault(d.item_code, d.base_net_amount)
+ item_details = {}
+ item_details[d.item_code] = d.base_net_amount
+
+ if d.parent in self.invoice_items:
+ parent_dict = self.invoice_items[d.parent]
+ if d.item_code in parent_dict:
+ item_details[d.item_code] += parent_dict[d.item_code]
+ else:
+ item_details.update(parent_dict)
+
+ self.invoice_items[d.parent] = item_details
def get_items_based_on_tax_rate(self):
self.tax_details = frappe.db.sql("""
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/__init__.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/__init__.py
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js
new file mode 100644
index 0000000..df0ef25
--- /dev/null
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.query_reports["HSN-wise-summary of outward supplies"] = {
+ "filters": [
+ {
+ "fieldname":"company",
+ "label": __("Company"),
+ "fieldtype": "Link",
+ "options": "Company",
+ "reqd": 1,
+ "default": frappe.defaults.get_user_default("Company")
+ },
+ {
+ "fieldname":"gst_hsn_code",
+ "label": __("HSN/SAC"),
+ "fieldtype": "Link",
+ "options": "GST HSN Code",
+ "width": "80"
+ }
+ ]
+}
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.json b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.json
new file mode 100644
index 0000000..0cafdc8
--- /dev/null
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.json
@@ -0,0 +1,29 @@
+{
+ "add_total_row": 0,
+ "creation": "2018-04-26 10:49:29.159400",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "letter_head": "Standard",
+ "modified": "2018-04-26 12:59:38.603649",
+ "modified_by": "Administrator",
+ "module": "Regional",
+ "name": "HSN-wise-summary of outward supplies",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "HSN-wise-summary of outward supplies",
+ "report_type": "Script Report",
+ "roles": [
+ {
+ "role": "Accounts User"
+ },
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Auditor"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
new file mode 100644
index 0000000..165458c
--- /dev/null
+++ b/erpnext/regional/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py
@@ -0,0 +1,217 @@
+# Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe, erpnext
+from frappe import _
+from frappe.utils import flt
+from frappe.model.meta import get_field_precision
+from frappe.utils.xlsxutils import handle_html
+
+def execute(filters=None):
+ return _execute(filters)
+
+def _execute(filters=None):
+ if not filters: filters = {}
+ columns = get_columns()
+
+ company_currency = erpnext.get_company_currency(filters.company)
+ item_list = get_items(filters)
+ if item_list:
+ itemised_tax, tax_columns = get_tax_accounts(item_list, columns, company_currency)
+
+ data = []
+ for d in item_list:
+ row = [d.gst_hsn_code, d.description, d.stock_uom, d.stock_qty]
+ total_tax = 0
+ for tax in tax_columns:
+ item_tax = itemised_tax.get(d.name, {}).get(tax, {})
+ total_tax += flt(item_tax.get("tax_amount"))
+
+ row += [d.base_net_amount + total_tax]
+ row += [d.base_net_amount]
+
+ for tax in tax_columns:
+ item_tax = itemised_tax.get(d.name, {}).get(tax, {})
+ row += [item_tax.get("tax_amount", 0)]
+
+ data.append(row)
+ if data:
+ data = get_merged_data(columns, data) # merge same hsn code data
+ return columns, data
+
+def get_columns():
+ columns = [
+ {
+ "fieldname": "gst_hsn_code",
+ "label": _("HSN/SAC"),
+ "fieldtype": "Link",
+ "options": "GST HSN Code",
+ "width": 100
+ },
+ {
+ "fieldname": "description",
+ "label": _("Description"),
+ "fieldtype": "Data",
+ "width": 300
+ },
+ {
+ "fieldname": "stock_uom",
+ "label": _("Stock UOM"),
+ "fieldtype": "Data",
+ "width": 100
+ },
+ {
+ "fieldname": "stock_qty",
+ "label": _("Stock Qty"),
+ "fieldtype": "Float",
+ "width": 90
+ },
+ {
+ "fieldname": "total_amount",
+ "label": _("Total Amount"),
+ "fieldtype": "Currency",
+ "width": 120
+ },
+ {
+ "fieldname": "taxable_amount",
+ "label": _("Total Taxable Amount"),
+ "fieldtype": "Currency",
+ "width": 170
+ }
+ ]
+
+ return columns
+
+def get_conditions(filters):
+ conditions = ""
+
+ for opts in (("company", " and company=%(company)s"),
+ ("gst_hsn_code", " and gst_hsn_code=%(gst_hsn_code)s")):
+ if filters.get(opts[0]):
+ conditions += opts[1]
+
+ return conditions
+
+def get_items(filters):
+ conditions = get_conditions(filters)
+ match_conditions = frappe.build_match_conditions("Sales Invoice")
+ if match_conditions:
+ match_conditions = " and {0} ".format(match_conditions)
+
+
+ return frappe.db.sql("""
+ select
+ `tabSales Invoice Item`.name, `tabSales Invoice Item`.base_price_list_rate,
+ `tabSales Invoice Item`.gst_hsn_code, `tabSales Invoice Item`.stock_qty,
+ `tabSales Invoice Item`.stock_uom, `tabSales Invoice Item`.base_net_amount,
+ `tabSales Invoice Item`.parent, `tabSales Invoice Item`.item_code,
+ `tabGST HSN Code`.description
+ from `tabSales Invoice`, `tabSales Invoice Item`, `tabGST HSN Code`
+ where `tabSales Invoice`.name = `tabSales Invoice Item`.parent
+ and `tabSales Invoice`.docstatus = 1
+ and `tabSales Invoice Item`.gst_hsn_code is not NULL
+ and `tabSales Invoice Item`.gst_hsn_code = `tabGST HSN Code`.name %s %s
+
+ """ % (conditions, match_conditions), filters, as_dict=1)
+
+
+def get_tax_accounts(item_list, columns, company_currency,
+ doctype="Sales Invoice", tax_doctype="Sales Taxes and Charges"):
+ import json
+ item_row_map = {}
+ tax_columns = []
+ invoice_item_row = {}
+ itemised_tax = {}
+ conditions = ""
+
+ tax_amount_precision = get_field_precision(frappe.get_meta(tax_doctype).get_field("tax_amount"),
+ currency=company_currency) or 2
+
+ for d in item_list:
+ invoice_item_row.setdefault(d.parent, []).append(d)
+ item_row_map.setdefault(d.parent, {}).setdefault(d.item_code or d.item_name, []).append(d)
+
+ tax_details = frappe.db.sql("""
+ select
+ parent, description, item_wise_tax_detail,
+ base_tax_amount_after_discount_amount
+ from `tab%s`
+ where
+ parenttype = %s and docstatus = 1
+ and (description is not null and description != '')
+ and parent in (%s)
+ %s
+ order by description
+ """ % (tax_doctype, '%s', ', '.join(['%s']*len(invoice_item_row)), conditions),
+ tuple([doctype] + list(invoice_item_row)))
+
+ for parent, description, item_wise_tax_detail, tax_amount in tax_details:
+ description = handle_html(description)
+ if description not in tax_columns and tax_amount:
+ # as description is text editor earlier and markup can break the column convention in reports
+ tax_columns.append(description)
+
+ if item_wise_tax_detail:
+ try:
+ item_wise_tax_detail = json.loads(item_wise_tax_detail)
+
+ for item_code, tax_data in item_wise_tax_detail.items():
+ if not frappe.db.get_value("Item", item_code, "gst_hsn_code"):
+ continue
+ itemised_tax.setdefault(item_code, frappe._dict())
+ if isinstance(tax_data, list):
+ tax_amount = tax_data[1]
+ else:
+ tax_amount = 0
+
+ for d in item_row_map.get(parent, {}).get(item_code, []):
+ item_tax_amount = tax_amount
+ if item_tax_amount:
+ itemised_tax.setdefault(d.name, {})[description] = frappe._dict({
+ "tax_amount": flt(item_tax_amount, tax_amount_precision)
+ })
+ except ValueError:
+ continue
+
+ tax_columns.sort()
+ for desc in tax_columns:
+ columns.append(desc + " Amount:Currency/currency:160")
+
+ # columns += ["Total Amount:Currency/currency:110"]
+ return itemised_tax, tax_columns
+
+def get_merged_data(columns, data):
+ merged_hsn_dict = {} # to group same hsn under one key and perform row addition
+ add_column_index = [] # store index of columns that needs to be added
+ tax_col = len(get_columns())
+ fields_to_merge = ["stock_qty", "total_amount", "taxable_amount"] # columns for which index needs to be found
+
+ for i,d in enumerate(columns):
+ # check if fieldname in to_merge list and ignore tax-columns
+ if i < tax_col and d["fieldname"] in fields_to_merge:
+ add_column_index.append(i)
+
+ for row in data:
+ if merged_hsn_dict.has_key(row[0]):
+ to_add_row = merged_hsn_dict.get(row[0])
+
+ # add columns from the add_column_index table
+ for k in add_column_index:
+ to_add_row[k] += row[k]
+
+ # add tax columns
+ for k in range(len(columns)):
+ if tax_col <= k < len(columns):
+ to_add_row[k] += row[k]
+
+ # update hsn dict with the newly added data
+ merged_hsn_dict[row[0]] = to_add_row
+ else:
+ merged_hsn_dict[row[0]] = row
+
+ # extract data rows to be displayed in report
+ data = [merged_hsn_dict[d] for d in merged_hsn_dict]
+
+ return data
+
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 92db12b..63e85fd 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -206,11 +206,6 @@
}
-cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
- if(cint(frappe.boot.notification_settings.quotation))
- cur_frm.email_doc(frappe.boot.notification_settings.quotation_message);
-}
-
frappe.ui.form.on("Quotation Item", "items_on_form_rendered", function(frm, cdt, cdn) {
// enable tax_amount field if Actual
})
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 0d4835e..b58cd4e 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -71,6 +72,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -103,6 +105,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -136,6 +139,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -169,6 +173,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -202,6 +207,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -232,6 +238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -261,6 +268,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -294,6 +302,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -328,6 +337,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -361,6 +371,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -392,6 +403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -425,6 +437,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -457,6 +470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -487,6 +501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -518,6 +533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -551,6 +567,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -580,6 +597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -609,6 +627,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -639,6 +658,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -668,6 +688,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -699,6 +720,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -728,6 +750,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -762,6 +785,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -793,6 +817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -823,6 +848,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -855,6 +881,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -889,6 +916,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -918,6 +946,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -951,6 +980,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -982,6 +1012,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1013,6 +1044,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1042,6 +1074,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1073,6 +1106,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1105,6 +1139,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "40px"
},
@@ -1134,6 +1169,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1165,6 +1201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1197,6 +1234,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1226,6 +1264,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1257,6 +1296,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1287,6 +1327,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1317,6 +1358,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1348,6 +1390,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1380,6 +1423,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1408,6 +1452,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1439,6 +1484,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1499,6 +1546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1529,6 +1577,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1559,6 +1608,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1587,6 +1637,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1619,6 +1670,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1647,6 +1699,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1677,6 +1730,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1708,6 +1762,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1740,6 +1795,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1771,6 +1827,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1800,6 +1857,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1830,6 +1888,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1860,6 +1919,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1891,6 +1951,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1923,6 +1984,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -1955,6 +2017,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1987,6 +2050,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2020,6 +2084,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2050,6 +2115,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2083,6 +2149,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2115,6 +2182,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2147,6 +2215,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2179,6 +2248,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2212,6 +2282,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2243,6 +2314,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2274,6 +2346,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2306,6 +2379,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2338,6 +2412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2369,6 +2444,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2399,6 +2475,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2431,6 +2508,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2463,6 +2541,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2492,6 +2571,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2522,6 +2602,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2539,7 +2620,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2552,6 +2633,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2560,7 +2642,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2569,10 +2651,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2583,6 +2665,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2614,6 +2697,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2646,6 +2730,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2678,6 +2763,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2710,6 +2796,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2739,6 +2826,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2773,6 +2861,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2804,6 +2893,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2835,6 +2925,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2866,6 +2957,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2881,7 +2973,7 @@
"istable": 0,
"max_attachments": 1,
"menu_index": 0,
- "modified": "2018-01-11 14:42:22.052380",
+ "modified": "2018-03-10 07:34:23.971888",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 6d9c170..dbb1e9f 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -103,7 +103,7 @@
print_lst.append(lst1)
return print_lst
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.valid_till = None
def get_list_context(context=None):
diff --git a/erpnext/selling/doctype/quotation/quotation_dashboard.py b/erpnext/selling/doctype/quotation/quotation_dashboard.py
index c6297e2..d32fd0c 100644
--- a/erpnext/selling/doctype/quotation/quotation_dashboard.py
+++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py
@@ -4,7 +4,7 @@
return {
'fieldname': 'prevdoc_docname',
'non_standard_fieldnames': {
- 'Subscription': 'reference_document',
+ 'Auto Repeat': 'reference_document',
},
'transactions': [
{
@@ -13,7 +13,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 20685de..9a2311d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -442,11 +442,6 @@
frappe.ui.form.is_saving = false;
}
});
- },
- on_submit: function(doc, cdt, cdn) {
- if(cint(frappe.boot.notification_settings.sales_order)) {
- this.frm.email_doc(frappe.boot.notification_settings.sales_order_message);
- }
}
});
$.extend(cur_frm.cscript, new erpnext.selling.SalesOrderController({frm: cur_frm}));
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index f302c1c..711f9f4 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,6 +137,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -196,6 +201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -292,6 +300,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -326,6 +335,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -359,6 +369,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "160px"
},
@@ -390,6 +401,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -423,6 +435,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -457,6 +470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -488,6 +502,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -521,11 +536,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -551,11 +567,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -580,6 +597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -610,6 +628,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -639,6 +658,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -668,6 +688,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -698,6 +719,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -726,12 +748,13 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -757,11 +780,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"columns": 0,
@@ -786,6 +810,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -817,6 +842,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -848,6 +874,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -878,6 +905,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -910,6 +938,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -944,6 +973,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -973,6 +1003,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1006,6 +1037,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1037,6 +1069,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1068,6 +1101,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1097,6 +1131,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1128,6 +1163,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1160,6 +1196,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1188,6 +1225,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1216,6 +1254,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1247,6 +1286,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1279,6 +1319,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1308,6 +1349,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1339,6 +1381,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1369,6 +1412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1399,6 +1443,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1430,6 +1475,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1462,6 +1508,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1490,6 +1537,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1521,6 +1569,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1549,6 +1598,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1581,6 +1631,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1611,6 +1662,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1641,6 +1693,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1669,6 +1722,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1701,6 +1755,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1731,6 +1786,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1761,6 +1817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1792,6 +1849,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1824,6 +1882,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1855,6 +1914,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1883,6 +1943,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1914,6 +1975,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1945,6 +2007,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1976,6 +2039,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2008,6 +2072,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2040,6 +2105,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2072,6 +2138,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2105,6 +2172,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2135,6 +2203,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2168,6 +2237,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2201,6 +2271,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2233,6 +2304,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2265,6 +2337,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2296,6 +2369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2329,6 +2403,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2360,6 +2435,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2391,6 +2467,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2422,6 +2499,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2453,6 +2531,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2485,6 +2564,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2517,6 +2597,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2548,6 +2629,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2580,6 +2662,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2613,6 +2696,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2644,6 +2728,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2673,6 +2758,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2705,6 +2791,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2738,8 +2825,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -2768,6 +2856,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2798,6 +2887,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2830,6 +2920,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2859,6 +2950,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2892,6 +2984,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2922,6 +3015,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2952,6 +3046,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2986,6 +3081,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3017,6 +3113,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3050,6 +3147,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3079,6 +3177,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3112,6 +3211,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3143,6 +3243,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3175,6 +3276,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3207,6 +3309,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3236,6 +3339,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3268,6 +3372,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3301,6 +3406,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3331,6 +3437,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3363,6 +3470,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3380,7 +3488,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Section",
+ "label": "Auto Repeat Section",
"length": 0,
"no_copy": 1,
"permlevel": 0,
@@ -3393,6 +3501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3424,6 +3533,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3455,6 +3565,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3484,6 +3595,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3492,7 +3604,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3501,10 +3613,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 0,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -3515,6 +3627,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3529,7 +3642,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-01-12 15:56:12.483019",
+ "modified": "2018-04-30 12:49:10.225292",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
@@ -3537,7 +3650,6 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -3557,7 +3669,6 @@
},
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -3577,7 +3688,6 @@
},
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -3597,7 +3707,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -3617,7 +3726,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -3637,7 +3745,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 72723eb..7e6c3dc 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -13,7 +13,7 @@
from frappe.desk.notifications import clear_doctype_notifications
from frappe.contacts.doctype.address.address import get_company_address
from erpnext.controllers.selling_controller import SellingController
-from erpnext.accounts.doctype.subscription.subscription import get_next_schedule_date
+from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
from erpnext.selling.doctype.customer.customer import check_credit_limit
form_grid_templates = {
@@ -369,16 +369,16 @@
))
return items
- def on_recurring(self, reference_doc, subscription_doc):
+ def on_recurring(self, reference_doc, auto_repeat_doc):
self.set("delivery_date", get_next_schedule_date(reference_doc.delivery_date,
- subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
+ auto_repeat_doc.frequency, cint(auto_repeat_doc.repeat_on_day)))
for d in self.get("items"):
reference_delivery_date = frappe.db.get_value("Sales Order Item",
{"parent": reference_doc.name, "item_code": d.item_code, "idx": d.idx}, "delivery_date")
d.set("delivery_date", get_next_schedule_date(reference_delivery_date,
- subscription_doc.frequency, cint(subscription_doc.repeat_on_day)))
+ auto_repeat_doc.frequency, cint(auto_repeat_doc.repeat_on_day)))
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
diff --git a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
index 34ed6bc..35c643d 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
+++ b/erpnext/selling/doctype/sales_order/sales_order_dashboard.py
@@ -8,7 +8,7 @@
'Journal Entry': 'reference_name',
'Payment Entry': 'reference_name',
'Payment Request': 'reference_name',
- 'Subscription': 'reference_document',
+ 'Auto Repeat': 'reference_document',
},
'internal_links': {
'Quotation': ['items', 'prevdoc_docname']
@@ -32,7 +32,7 @@
},
{
'label': _('Reference'),
- 'items': ['Quotation', 'Subscription']
+ 'items': ['Quotation', 'Auto Repeat']
},
{
'label': _('Payment'),
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index aa5b3ba..d6f4677 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -186,25 +186,32 @@
warehouse: function(doc, cdt, cdn) {
var me = this;
var item = frappe.get_doc(cdt, cdn);
-
- if(item.item_code && item.warehouse) {
- return this.frm.call({
- method: "erpnext.stock.get_item_details.get_bin_details_and_serial_nos",
- child: item,
- args: {
- item_code: item.item_code,
- warehouse: item.warehouse,
- stock_qty: item.stock_qty,
- serial_no: item.serial_no || ""
- },
- callback:function(r){
- if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
- me.set_batch_number(cdt, cdn);
- me.batch_no(doc, cdt, cdn);
- }
- }
- });
+ if (item.serial_no && !item.batch_no) {
+ item.serial_no = null;
}
+ var has_batch_no;
+ frappe.db.get_value('Item', {'item_code': item.item_code}, 'has_batch_no', (r) => {
+ has_batch_no = r && r.has_batch_no;
+ if(item.item_code && item.warehouse) {
+ return this.frm.call({
+ method: "erpnext.stock.get_item_details.get_bin_details_and_serial_nos",
+ child: item,
+ args: {
+ item_code: item.item_code,
+ warehouse: item.warehouse,
+ has_batch_no: has_batch_no,
+ stock_qty: item.stock_qty,
+ serial_no: item.serial_no || "",
+ },
+ callback:function(r){
+ if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
+ me.set_batch_number(cdt, cdn);
+ me.batch_no(doc, cdt, cdn);
+ }
+ }
+ });
+ }
+ })
},
toggle_editable_price_list_rate: function() {
@@ -245,19 +252,25 @@
batch_no: function(doc, cdt, cdn) {
var me = this;
var item = frappe.get_doc(cdt, cdn);
-
- if(item.warehouse && item.item_code && item.batch_no) {
- return this.frm.call({
- method: "erpnext.stock.get_item_details.get_batch_qty",
- child: item,
- args: {
- "batch_no": item.batch_no,
- "warehouse": item.warehouse,
- "item_code": item.item_code
- },
- "fieldname": "actual_batch_qty"
- });
- }
+ item.serial_no = null;
+ var has_serial_no;
+ frappe.db.get_value('Item', {'item_code': item.item_code}, 'has_serial_no', (r) => {
+ has_serial_no = r && r.has_serial_no;
+ if(item.warehouse && item.item_code && item.batch_no) {
+ return this.frm.call({
+ method: "erpnext.stock.get_item_details.get_batch_qty_and_serial_no",
+ child: item,
+ args: {
+ "batch_no": item.batch_no,
+ "stock_qty": item.stock_qty,
+ "warehouse": item.warehouse,
+ "item_code": item.item_code,
+ "has_serial_no": has_serial_no
+ },
+ "fieldname": "actual_batch_qty"
+ });
+ }
+ })
},
set_dynamic_labels: function() {
@@ -348,7 +361,7 @@
},
qty: function(doc, cdt, cdn) {
- this._super(doc, cdt, cdn);
+ this._super(doc, cdt, cdn);
this.set_batch_number(cdt, cdn);
},
diff --git a/erpnext/setup/default_success_action.py b/erpnext/setup/default_success_action.py
new file mode 100644
index 0000000..e8494a1
--- /dev/null
+++ b/erpnext/setup/default_success_action.py
@@ -0,0 +1,26 @@
+from frappe import _
+
+doctype_list = [
+ 'Purchase Receipt',
+ 'Purchase Invoice',
+ 'Quotation',
+ 'Sales Order',
+ 'Delivery Note',
+ 'Sales Invoice'
+]
+
+def get_message(doctype):
+ return _("{0} has been submitted successfully".format(_(doctype)))
+
+def get_first_success_message(doctype):
+ return _("{0} has been submitted successfully".format(_(doctype)))
+
+def get_default_success_action():
+ return [{
+ 'doctype': 'Success Action',
+ 'ref_doctype': doctype,
+ 'message': get_message(doctype),
+ 'first_success_message': get_first_success_message(doctype),
+ 'next_actions': 'new\nprint\nemail'
+ } for doctype in doctype_list]
+
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 9040bb7..a2feddc 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -126,6 +126,7 @@
if not wh_detail["is_group"] else ""
})
warehouse.flags.ignore_permissions = True
+ warehouse.flags.ignore_mandatory = True
warehouse.insert()
def create_default_accounts(self):
@@ -192,6 +193,36 @@
if not self.default_payable_account:
self.db_set("default_payable_account", self.default_payable_account)
+ if not self.default_payroll_payable_account:
+ payroll_payable_account = frappe.db.get_value("Account",
+ {"account_name": _("Payroll Payable"), "company": self.name, "is_group": 0})
+
+ self.db_set("default_payroll_payable_account", payroll_payable_account)
+
+ if not self.default_employee_advance_account:
+ employe_advance_account = frappe.db.get_value("Account",
+ {"account_name": _("Employee Advances"), "company": self.name, "is_group": 0})
+
+ self.db_set("default_employee_advance_account", employe_advance_account)
+
+ if not self.write_off_account:
+ write_off_acct = frappe.db.get_value("Account",
+ {"account_name": _("Write Off"), "company": self.name, "is_group": 0})
+
+ self.db_set("write_off_account", write_off_acct)
+
+ if not self.exchange_gain_loss_account:
+ exchange_gain_loss_acct = frappe.db.get_value("Account",
+ {"account_name": _("Exchange Gain/Loss"), "company": self.name, "is_group": 0})
+
+ self.db_set("exchange_gain_loss_account", exchange_gain_loss_acct)
+
+ if not self.disposal_account:
+ disposal_acct = frappe.db.get_value("Account",
+ {"account_name": _("Gain/Loss on Asset Disposal"), "company": self.name, "is_group": 0})
+
+ self.db_set("disposal_account", disposal_acct)
+
def _set_default_account(self, fieldname, account_type):
if self.get(fieldname):
return
diff --git a/erpnext/setup/doctype/notification_control/README.md b/erpnext/setup/doctype/notification_control/README.md
deleted file mode 100644
index 3c411b7..0000000
--- a/erpnext/setup/doctype/notification_control/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Tool to automatically prompt sending of Email on Submission of various records.
\ No newline at end of file
diff --git a/erpnext/setup/doctype/notification_control/__init__.py b/erpnext/setup/doctype/notification_control/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/setup/doctype/notification_control/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
deleted file mode 100644
index 7f58ede..0000000
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-frappe.ui.form.on("Notification Control", {
- refresh: function(frm) {
- frm.page.set_primary_action(__('Update'), function() { frm.events.set_message(frm); });
- },
- select_transaction: function(frm) {
- frm.set_value("custom_message", frm.doc[frm.events.get_fieldname(frm)]);
- },
- set_message: function(frm) {
- if(frm.doc.select_transaction && frm.doc.select_transaction !== "") {
- frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message);
- }
- frm.save();
- },
- get_fieldname: function(frm) {
- return frm.doc.select_transaction.replace(" ", "_").toLowerCase() + "_message";
- },
- after_save: function(frm) {
- // update notification settings in current session
- frappe.boot.notification_settings = frm.doc;
- }
-});
diff --git a/erpnext/setup/doctype/notification_control/notification_control.json b/erpnext/setup/doctype/notification_control/notification_control.json
deleted file mode 100644
index fc3316e..0000000
--- a/erpnext/setup/doctype/notification_control/notification_control.json
+++ /dev/null
@@ -1,566 +0,0 @@
-{
- "allow_copy": 1,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2012-07-12 23:29:45",
- "custom": 0,
- "description": "Send automatic emails to Contacts on Submitting transactions.",
- "docstatus": 0,
- "doctype": "DocType",
- "fields": [
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "When any of the checked transactions are \"Submitted\", an email pop-up automatically opened to send an email to the associated \"Contact\" in that transaction, with the transaction as an attachment. The user may or may not send the email.",
- "fieldname": "send_autonotification_for",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Prompt for Email on Submission of",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "50%",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "quotation",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Quotation",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_order",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Sales Order",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_note",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Delivery Note",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_invoice",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Sales Invoice",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Purchase",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "50%",
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_order",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Purchase Order",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_receipt",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Purchase Receipt",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "expense_claim",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Expense Claim",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.",
- "fieldname": "customize_the_notification",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customize the Notification",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "select_transaction",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Select Transaction",
- "length": 0,
- "no_copy": 0,
- "options": "\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "custom_message",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Custom Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "quotation_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Quotation Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_order_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Order Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_note_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivery Note Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_invoice_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Invoice Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_order_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Purchase Order Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "purchase_receipt_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Purchase Receipt Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "expense_claim_approved_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Expense Claim Approved Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "expense_claim_rejected_message",
- "fieldtype": "Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Expense Claim Rejected Message",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- }
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "fa fa-envelope",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 1,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2016-06-01 13:06:06.981905",
- "modified_by": "Administrator",
- "module": "Setup",
- "name": "Notification Control",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "sort_order": "ASC",
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py
deleted file mode 100644
index c50baca..0000000
--- a/erpnext/setup/doctype/notification_control/notification_control.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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.document import Document
-
-class NotificationControl(Document):
- def validate(self):
- frappe.clear_cache()
diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py
index 8548f92..03da833 100644
--- a/erpnext/setup/install.py
+++ b/erpnext/setup/install.py
@@ -5,6 +5,7 @@
import frappe
from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
+from .default_success_action import get_default_success_action
from frappe import _
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
@@ -20,6 +21,7 @@
create_print_zero_amount_taxes_custom_field()
add_all_roles_to("Administrator")
create_default_cash_flow_mapper_templates()
+ create_default_success_action()
frappe.db.commit()
@@ -72,9 +74,13 @@
def create_default_cash_flow_mapper_templates():
- mappers = DEFAULT_MAPPERS
-
- for mapper in mappers:
+ for mapper in DEFAULT_MAPPERS:
if not frappe.db.exists('Cash Flow Mapper', mapper['section_name']):
doc = frappe.get_doc(mapper)
doc.insert(ignore_permissions=True)
+
+def create_default_success_action():
+ for success_action in get_default_success_action():
+ if not frappe.db.exists('Success Action', success_action.get("ref_doctype")):
+ doc = frappe.get_doc(success_action)
+ doc.insert(ignore_permissions=True)
diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py
index 7fe7f0c..7f9795b 100644
--- a/erpnext/setup/setup_wizard/operations/company_setup.py
+++ b/erpnext/setup/setup_wizard/operations/company_setup.py
@@ -113,8 +113,7 @@
"<img src='{0}' style='max-width: 40px; max-height: 25px;'> {1}".format(fileurl, args.get("company_name") ))
def create_website(args):
- if args.get('setup_website'):
- website_maker(args)
+ website_maker(args)
def get_fy_details(fy_start_date, fy_end_date):
start_year = getdate(fy_start_date).year
diff --git a/erpnext/setup/setup_wizard/operations/default_website.py b/erpnext/setup/setup_wizard/operations/default_website.py
index d137676..8ca213b 100644
--- a/erpnext/setup/setup_wizard/operations/default_website.py
+++ b/erpnext/setup/setup_wizard/operations/default_website.py
@@ -12,7 +12,7 @@
self.args = args
self.company = args.company_name
self.tagline = args.company_tagline
- self.user = args.name
+ self.user = args.get('email')
self.make_web_page()
self.make_website_settings()
self.make_blog()
@@ -50,6 +50,17 @@
website_settings.save()
def make_blog(self):
+ blog_category = frappe.get_doc({
+ "doctype": "Blog Category",
+ "category_name": "general",
+ "published": 1,
+ "title": _("General")
+ }).insert()
+
+ if not self.user:
+ # Admin setup
+ return
+
blogger = frappe.new_doc("Blogger")
user = frappe.get_doc("User", self.user)
blogger.user = self.user
@@ -58,13 +69,6 @@
blogger.avatar = user.user_image
blogger.insert()
- blog_category = frappe.get_doc({
- "doctype": "Blog Category",
- "category_name": "general",
- "published": 1,
- "title": _("General")
- }).insert()
-
frappe.get_doc({
"doctype": "Blog Post",
"title": "Welcome",
diff --git a/erpnext/setup/setup_wizard/operations/defaults_setup.py b/erpnext/setup/setup_wizard/operations/defaults_setup.py
index 08b8a06..086b60e 100644
--- a/erpnext/setup/setup_wizard/operations/defaults_setup.py
+++ b/erpnext/setup/setup_wizard/operations/defaults_setup.py
@@ -36,6 +36,7 @@
stock_settings.auto_indent = 1
stock_settings.auto_insert_price_list_rate_if_missing = 1
stock_settings.automatically_set_serial_nos_based_on_fifo = 1
+ stock_settings.set_qty_in_transactions_based_on_serial_no_input = 1
stock_settings.save()
selling_settings = frappe.get_doc("Selling Settings")
@@ -53,12 +54,6 @@
buying_settings.allow_multiple_items = 1
buying_settings.save()
- notification_control = frappe.get_doc("Notification Control")
- notification_control.quotation = 1
- notification_control.sales_invoice = 1
- notification_control.purchase_order = 1
- notification_control.save()
-
hr_settings = frappe.get_doc("HR Settings")
hr_settings.emp_created_by = "Naming Series"
hr_settings.leave_approval_notification_template = "Leave Approval Notification"
diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py
index 33cac17..e62d633 100644
--- a/erpnext/shopping_cart/product_info.py
+++ b/erpnext/shopping_cart/product_info.py
@@ -33,7 +33,7 @@
"in_stock": stock_status.in_stock if stock_status.is_stock_item else 1,
"qty": 0,
"uom": frappe.db.get_value("Item", item_code, "stock_uom"),
- "show_stock_qty": show_quantity_in_website() if stock_status.is_stock_item else 0,
+ "show_stock_qty": show_quantity_in_website(),
"sales_uom": frappe.db.get_value("Item", item_code, "sales_uom")
}
@@ -50,6 +50,7 @@
product_info = get_product_info_for_website(item.item_code)
if product_info:
+ item.update(product_info)
item["stock_uom"] = product_info.get("uom")
item["sales_uom"] = product_info.get("sales_uom")
if product_info.get("price"):
diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py
index f22c70c..8c43306 100644
--- a/erpnext/startup/boot.py
+++ b/erpnext/startup/boot.py
@@ -25,9 +25,6 @@
bootinfo.sysdefaults.quotation_valid_till = cint(frappe.db.get_single_value('Selling Settings',
'default_valid_till'))
- bootinfo.notification_settings = frappe.get_doc("Notification Control",
- "Notification Control")
-
# if no company, show a dialog box to create a new company
bootinfo.customer_count = frappe.db.sql("""select count(*) from tabCustomer""")[0][0]
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 7ee0c5c..a2faa9a 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -66,11 +66,6 @@
},
print_without_amount: function(frm) {
erpnext.stock.delivery_note.set_print_hide(frm.doc);
- },
- on_submit: function(frm) {
- if(cint(frappe.boot.notification_settings.delivery_note)) {
- frm.email_doc(frappe.boot.notification_settings.delivery_note_message);
- }
}
});
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index f2c7fcb..552483a 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -134,6 +137,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -166,6 +170,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -197,6 +202,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -226,6 +232,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -259,6 +266,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -294,6 +302,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -312,7 +321,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
- "in_list_view": 1,
+ "in_list_view": 0,
"in_standard_filter": 0,
"label": "Date",
"length": 0,
@@ -329,6 +338,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -364,6 +374,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -396,6 +407,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -426,6 +438,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -458,6 +471,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -489,6 +503,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -521,6 +536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -551,6 +567,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -584,6 +601,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -616,6 +634,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -646,6 +665,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -675,6 +695,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -705,6 +726,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -734,6 +756,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -763,6 +786,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -793,6 +817,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -822,6 +847,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -854,6 +880,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -884,6 +911,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -913,6 +941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -944,6 +973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -974,6 +1004,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1004,6 +1035,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1036,6 +1068,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1069,6 +1102,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1097,6 +1131,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1129,6 +1164,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1159,6 +1195,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1190,6 +1227,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1219,6 +1257,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1250,6 +1289,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1282,6 +1322,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1314,6 +1355,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1346,6 +1388,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1375,6 +1418,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1403,6 +1447,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1434,6 +1479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1496,6 +1543,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1527,6 +1575,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1557,6 +1606,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1587,6 +1637,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1618,6 +1669,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1651,6 +1703,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1679,6 +1732,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1710,6 +1764,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1738,6 +1793,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1770,6 +1826,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1800,6 +1857,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1830,6 +1888,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1858,6 +1917,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1891,6 +1951,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1921,6 +1982,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1951,6 +2013,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1982,6 +2045,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2014,6 +2078,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2045,6 +2110,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2073,6 +2139,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2103,6 +2170,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2133,6 +2201,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2164,6 +2233,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2197,6 +2267,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2229,6 +2300,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2262,6 +2334,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2296,6 +2369,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "200px"
},
@@ -2326,6 +2400,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2359,6 +2434,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2391,6 +2467,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2424,6 +2501,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2458,6 +2536,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2491,95 +2570,7 @@
"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": "payment_terms_template_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,
- "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": "payment_terms_template",
- "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": "Payment Terms Template",
- "length": 0,
- "no_copy": 0,
- "options": "Payment Terms Template",
- "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,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "terms_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,
- "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
},
{
@@ -2612,6 +2603,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2643,6 +2635,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2674,6 +2667,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2706,6 +2700,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2736,6 +2731,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2770,6 +2766,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -2805,6 +2802,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -2837,6 +2835,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2870,6 +2869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2903,6 +2903,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2935,6 +2936,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2965,6 +2967,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2996,6 +2999,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3027,6 +3031,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3058,6 +3063,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3088,6 +3094,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3120,6 +3127,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3152,6 +3160,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3182,6 +3191,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3211,6 +3221,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3242,6 +3253,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3271,6 +3283,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3305,6 +3318,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3339,6 +3353,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3368,6 +3383,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3396,6 +3412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3429,6 +3446,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3460,6 +3478,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3491,6 +3510,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3521,6 +3541,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3529,7 +3550,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -3538,10 +3559,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -3552,6 +3573,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3584,6 +3606,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3617,6 +3640,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -3647,6 +3671,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3680,6 +3705,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3713,6 +3739,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3743,6 +3770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3775,6 +3803,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -3790,8 +3819,8 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-03-13 15:35:02.234116",
- "modified_by": "Administrator",
+ "modified": "2018-04-30 15:35:02.234116",
+ "modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
"owner": "Administrator",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
index 2e150f7..cf28a52 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note_dashboard.py
@@ -6,7 +6,7 @@
'non_standard_fieldnames': {
'Stock Entry': 'delivery_note_no',
'Quality Inspection': 'reference_name',
- 'Subscription': 'reference_document',
+ 'Auto Repeat': 'reference_document',
},
'internal_links': {
'Sales Order': ['items', 'against_sales_order'],
@@ -26,7 +26,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
}
\ No newline at end of file
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 5487193..ebf7ea1 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -73,6 +74,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -106,6 +108,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -135,6 +138,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -164,6 +168,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -194,6 +199,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -226,6 +232,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "300px"
},
@@ -256,6 +263,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -286,6 +294,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -317,6 +326,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -346,6 +356,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -378,6 +389,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -412,6 +424,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50px"
},
@@ -441,6 +454,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -472,6 +486,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -502,6 +517,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -532,6 +548,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -561,6 +578,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -594,6 +612,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -628,6 +647,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -659,6 +679,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -691,6 +712,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -722,6 +744,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -754,6 +777,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -783,6 +807,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -816,6 +841,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -849,6 +875,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -877,6 +904,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -910,6 +938,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -944,6 +973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -973,6 +1003,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1006,6 +1037,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1040,6 +1072,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1071,6 +1104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1100,6 +1134,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1131,6 +1166,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1162,6 +1198,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1191,6 +1228,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1222,6 +1260,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1253,6 +1292,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1283,6 +1323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1313,6 +1354,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1343,6 +1385,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1372,6 +1415,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1403,6 +1447,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1432,6 +1477,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1465,6 +1511,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -1499,6 +1546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1531,6 +1579,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1560,37 +1609,7 @@
"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": "serial_no",
- "fieldtype": "Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Serial No",
- "length": 0,
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Text",
- "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
},
{
@@ -1623,6 +1642,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1655,6 +1675,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1688,6 +1709,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1697,6 +1719,38 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 0,
+ "label": "Serial No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Text",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
"description": "",
"fieldname": "item_group",
"fieldtype": "Link",
@@ -1722,6 +1776,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1755,6 +1810,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1787,6 +1843,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1815,6 +1872,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1845,6 +1903,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "120px"
},
@@ -1877,6 +1936,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "120px"
},
@@ -1908,6 +1968,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1938,6 +1999,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1968,6 +2030,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2000,6 +2063,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2031,6 +2095,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2063,6 +2128,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2095,6 +2161,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2126,6 +2193,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -2139,7 +2207,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-11-30 14:07:12.217563",
+ "modified": "2018-04-11 14:05:39.905947",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip.js b/erpnext/stock/doctype/delivery_trip/delivery_trip.js
index f7ec7e3..3e7dfc9 100644
--- a/erpnext/stock/doctype/delivery_trip/delivery_trip.js
+++ b/erpnext/stock/doctype/delivery_trip/delivery_trip.js
@@ -3,6 +3,14 @@
frappe.ui.form.on('Delivery Trip', {
setup: function(frm) {
+ frm.set_query("driver", function() {
+ return {
+ filters: {
+ "status": "Active"
+ }
+ };
+ });
+
frm.set_query("address", "delivery_stops", function(doc, cdt, cdn) {
var row = locals[cdt][cdn];
if (row.customer) {
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index b862171..7381336 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -1,371 +1,371 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:item_code",
- "beta": 0,
- "creation": "2013-05-03 10:45:46",
- "custom": 0,
- "default_print_format": "",
- "description": "A Product or a Service that is bought, sold or kept in stock.",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Setup",
- "editable_grid": 1,
- "engine": "InnoDB",
+ "allow_copy": 0,
+ "allow_guest_to_view": 0,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:item_code",
+ "beta": 0,
+ "creation": "2013-05-03 10:45:46",
+ "custom": 0,
+ "default_print_format": "",
+ "description": "A Product or a Service that is bought, sold or kept in stock.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "editable_grid": 1,
+ "engine": "InnoDB",
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "name_and_description_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": "",
- "length": 0,
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "fa fa-flag",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "name_and_description_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": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-flag",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "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": 0,
- "options": "ITEM-",
- "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": 1,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "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": 0,
+ "options": "ITEM-",
+ "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": 1,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "item_code",
- "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": "Item Code",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_code",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "item_code",
+ "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": "Item Code",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "variant_of",
- "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified",
- "fieldname": "variant_of",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Variant Of",
- "length": 0,
- "no_copy": 0,
- "options": "Item",
- "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": 1,
- "set_only_once": 1,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "variant_of",
+ "description": "If item is a variant of another item then description, image, pricing, taxes etc will be set from the template unless explicitly specified",
+ "fieldname": "variant_of",
+ "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": "Variant Of",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item",
+ "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": 1,
+ "set_only_once": 1,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "item_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": "Item Name",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "item_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": "Item Name",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
- "allow_bulk_edit": 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,
+ "allow_bulk_edit": 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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Item Group",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Item Group",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "is_item_from_hub",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Is Item from Hub",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_item_from_hub",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Item from Hub",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "stock_uom",
- "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": "Default Unit of Measure",
- "length": 0,
- "no_copy": 0,
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "",
+ "fieldname": "stock_uom",
+ "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": "Default Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break0",
- "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break0",
+ "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_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "disabled",
- "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": "Disabled",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "disabled",
+ "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": "Disabled",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@@ -395,6 +395,3216 @@
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "description": "",
+ "fieldname": "is_stock_item",
+ "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": "Maintain Stock",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_stock_item",
+ "oldfieldtype": "Select",
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.__islocal&&doc.is_stock_item && !doc.has_serial_no && !doc.has_batch_no)",
+ "fieldname": "opening_stock",
+ "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": "Opening Stock",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "valuation_rate",
+ "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": "Valuation 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_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "standard_rate",
+ "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": "Standard Selling 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "is_fixed_asset",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Fixed Asset",
+ "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": 1,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_fixed_asset",
+ "fieldname": "asset_category",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Asset Category",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Asset Category",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "description": "",
+ "fieldname": "tolerance",
+ "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": "Allow over delivery or receipt upto this percent",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "tolerance",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "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": 0,
+ "options": "image",
+ "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_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": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "brand",
+ "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": "Brand",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Description",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sb_barcodes",
+ "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": "Barcodes",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "barcodes",
+ "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": "Barcodes",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Barcode",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "is_stock_item",
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "inventory",
+ "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": "Inventory",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-truck",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "default_warehouse",
+ "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": "Default Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "default_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "shelf_life_in_days",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Shelf Life In Days",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "2099-12-31",
+ "depends_on": "is_stock_item",
+ "fieldname": "end_of_life",
+ "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 of Life",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "end_of_life",
+ "oldfieldtype": "Date",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Purchase",
+ "fieldname": "default_material_request_type",
+ "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": "Default Material Request Type",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Purchase\nMaterial Transfer\nMaterial Issue\nManufacture",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "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,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "valuation_method",
+ "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": "Valuation Method",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nFIFO\nMoving Average",
+ "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": 1,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "warranty_period",
+ "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": "Warranty Period (in days)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "warranty_period",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "weight_per_unit",
+ "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": "Weight Per Unit",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "weight_uom",
+ "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": "Weight UOM",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "reorder_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": "Auto re-order",
+ "length": 0,
+ "no_copy": 0,
+ "options": "fa fa-rss",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Will also apply for variants unless overrridden",
+ "fieldname": "reorder_levels",
+ "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": "Reorder level based on Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Reorder",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "unit_of_measure_conversion",
+ "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": "Units of Measure",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Will also apply for variants",
+ "fieldname": "uoms",
+ "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": "UOMs",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "uom_conversion_details",
+ "oldfieldtype": "Table",
+ "options": "UOM Conversion Detail",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:doc.has_batch_no || doc.has_serial_no",
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "serial_nos_and_batches",
+ "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": "Serial Nos and Batches",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.is_stock_item",
+ "fieldname": "has_batch_no",
+ "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": "Has Batch No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "has_batch_no",
+ "oldfieldtype": "Select",
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_batch_no",
+ "description": "",
+ "fieldname": "create_new_batch",
+ "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": "Automatically Create New Batch",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_batch_no",
+ "fieldname": "has_expiry_date",
+ "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": "Has Expiry 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_batch_no",
+ "fieldname": "retain_sample",
+ "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": "Retain Sample",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: (doc.retain_sample && doc.has_batch_no)",
+ "description": "Maximum sample quantity that can be retained",
+ "fieldname": "sample_quantity",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Max Sample Quantity",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_37",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "depends_on": "eval:doc.is_stock_item",
+ "description": "",
+ "fieldname": "has_serial_no",
+ "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": "Has Serial No",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "has_serial_no",
+ "oldfieldtype": "Select",
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "has_serial_no",
+ "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
+ "fieldname": "serial_no_series",
+ "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": "Serial Number Series",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "attributes",
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "variants_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": "Variants",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "depends_on": "eval:!doc.variant_of",
+ "description": "If this item has variants, then it cannot be selected in sales orders etc.",
+ "fieldname": "has_variants",
+ "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": 1,
+ "label": "Has Variants",
+ "length": 0,
+ "no_copy": 1,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "Item Attribute",
+ "depends_on": "has_variants",
+ "fieldname": "variant_based_on",
+ "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": "Variant Based On",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Attribute\nManufacturer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 1,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.has_variants || doc.variant_of) && doc.variant_based_on==='Item Attribute'",
+ "fieldname": "attributes",
+ "fieldtype": "Table",
+ "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": "Attributes",
+ "length": 0,
+ "no_copy": 1,
+ "options": "Item Variant Attribute",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "purchase_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": "Purchase Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-shopping-cart",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "1",
+ "fieldname": "is_purchase_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Purchase Item",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "purchase_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Purchase Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0.00",
+ "depends_on": "is_stock_item",
+ "description": "",
+ "fieldname": "min_order_qty",
+ "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": "Minimum Order Qty",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "min_order_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "safety_stock",
+ "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": "Safety Stock",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "purchase_details_cb",
+ "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,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "Average time taken by the supplier to deliver",
+ "fieldname": "lead_time_days",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Lead Time in days",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "lead_time_days",
+ "oldfieldtype": "Int",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "buying_cost_center",
+ "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": "Default Buying Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "expense_account",
+ "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": "Default Expense Account",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "purchase_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 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,
+ "depends_on": "",
+ "fieldname": "last_purchase_rate",
+ "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": "Last Purchase Rate",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "last_purchase_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "supplier_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": "Supplier 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "default_supplier",
+ "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": "Default Supplier",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Supplier",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "delivered_by_supplier",
+ "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": "Delivered by Supplier (Drop Ship)",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "manufacturer",
+ "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": "Manufacturer",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Manufacturer",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "manufacturer_part_no",
+ "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": "Manufacturer Part Number",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "column_break2",
+ "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,
+ "label": "Item Code for Suppliers",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "supplier_items",
+ "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 Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Supplier",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "foreign_trade_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": "Foreign Trade 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "country_of_origin",
+ "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": "Country of Origin",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Country",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_59",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customs_tariff_number",
+ "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": "Customs Tariff Number",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Customs Tariff Number",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "sales_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": "Sales Details",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-tag",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "sales_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Default Sales Unit of Measure",
+ "length": 0,
+ "no_copy": 0,
+ "options": "UOM",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "income_account",
+ "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": "Default Income Account",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 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,
+ "default": "1",
+ "fieldname": "is_sales_item",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Is Sales Item",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "column_break3",
+ "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,
+ "label": "",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0,
+ "width": "50%"
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "selling_cost_center",
+ "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": "Default Selling Cost Center",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "max_discount",
+ "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 Discount (%)",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "max_discount",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "customer_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": "Customer 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "description": "",
+ "fieldname": "customer_items",
+ "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": "Customer Items",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Customer Detail",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "item_tax_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Item Tax",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-money",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "description": "Will also apply for variants",
+ "fieldname": "taxes",
+ "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": "Taxes",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "item_tax",
+ "oldfieldtype": "Table",
+ "options": "Item Tax",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "inspection_criteria",
+ "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": "Inspection Criteria",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-search",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "fieldname": "inspection_required_before_purchase",
+ "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": "Inspection Required before Purchase",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "inspection_required",
+ "oldfieldtype": "Select",
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "inspection_required_before_delivery",
+ "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": "Inspection Required before Delivery",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(doc.inspection_required_before_purchase || doc.inspection_required_before_delivery)",
+ "fieldname": "quality_inspection_template",
+ "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": "Quality Inspection Template",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Quality Inspection Template",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "depends_on": "is_stock_item",
+ "fieldname": "manufacturing",
+ "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": "Manufacturing",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "fa fa-cogs",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "",
+ "fieldname": "default_bom",
+ "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": "Default BOM",
+ "length": 0,
+ "no_copy": 1,
+ "oldfieldname": "default_bom",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "",
+ "description": "If subcontracted to a vendor",
+ "fieldname": "is_sub_contracted_item",
+ "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": "Supply Raw Materials for Purchase",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldname": "is_sub_contracted_item",
+ "oldfieldtype": "Select",
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "column_break_74",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "customer_code",
+ "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": "Customer Code",
+ "length": 0,
+ "no_copy": 1,
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "columns": 0,
+ "fieldname": "website_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": "Website",
+ "length": 0,
+ "no_copy": 0,
+ "options": "fa fa-globe",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:!doc.variant_of",
+ "fieldname": "show_in_website",
+ "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": "Show in Website",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "variant_of",
+ "fieldname": "show_variant_in_website",
+ "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": "Show in Website (Variant)",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "route",
+ "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": "Route",
+ "length": 0,
+ "no_copy": 1,
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Items with higher weightage will be shown higher",
+ "fieldname": "weightage",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Weightage",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Show a slideshow at the top of the page",
+ "fieldname": "slideshow",
+ "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": "Slideshow",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Website Slideshow",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Item Image (if not slideshow)",
+ "fieldname": "website_image",
+ "fieldtype": "Attach",
+ "hidden": 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": "Image",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "thumbnail",
+ "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": "Thumbnail",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "cb72",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
+ "fieldname": "website_warehouse",
+ "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": "Website Warehouse",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Warehouse",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "description": "List this Item in multiple groups on the website.",
+ "fieldname": "website_item_groups",
+ "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": "Website Item Groups",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Website Item Group",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "website_specifications",
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "sb72",
+ "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": "Website Specifications",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "copy_from_item_group",
+ "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": "Copy From Item Group",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "website_specifications",
+ "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": "Website Specifications",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Item Website Specification",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval: doc.show_in_website || doc.show_variant_in_website",
+ "fieldname": "web_long_description",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Website Description",
+ "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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "total_projected_qty",
+ "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": "Total Projected Qty",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "depends_on": "eval:(!doc.is_item_from_hub)",
+ "fieldname": "hub_publishing_sb",
+ "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": "Hub Publishing 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_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "default": "0",
+ "description": "Publish Item to hub.erpnext.com",
+ "fieldname": "publish_in_hub",
+ "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": "Publish in Hub",
+ "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
},
{
@@ -3907,15 +7117,15 @@
"submit": 0,
"write": 0
}
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "item_name,description,item_group,customer_code",
- "show_name_in_global_search": 1,
- "sort_field": "idx desc,modified desc",
- "sort_order": "DESC",
- "title_field": "item_name",
- "track_changes": 1,
+ ],
+ "quick_entry": 1,
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "item_name,description,item_group,customer_code",
+ "show_name_in_global_search": 1,
+ "sort_field": "idx desc,modified desc",
+ "sort_order": "DESC",
+ "title_field": "item_name",
+ "track_changes": 1,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 94b907b..945bde3 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -536,8 +536,8 @@
def update_item_price(self):
frappe.db.sql("""update `tabItem Price` set item_name=%s,
- item_description=%s, modified=NOW() where item_code=%s""",
- (self.item_name, self.description, self.name))
+ item_description=%s, brand=%s, modified=NOW() where item_code=%s""",
+ (self.item_name, self.description, self.brand, self.name))
def on_trash(self):
super(Item, self).on_trash()
@@ -577,7 +577,7 @@
where ifnull(item_wise_tax_detail, '') != ''""".format(dt), as_dict=1):
item_wise_tax_detail = json.loads(d.item_wise_tax_detail)
- if old_name in item_wise_tax_detail:
+ if isinstance(item_wise_tax_detail, dict) and old_name in item_wise_tax_detail:
item_wise_tax_detail[new_name] = item_wise_tax_detail[old_name]
item_wise_tax_detail.pop(old_name)
@@ -640,19 +640,20 @@
def update_template_item(self):
"""Set Show in Website for Template Item if True for its Variant"""
- if self.variant_of and self.show_in_website:
- self.show_variant_in_website = 1
- self.show_in_website = 0
+ if self.variant_of:
+ if self.show_in_website:
+ self.show_variant_in_website = 1
+ self.show_in_website = 0
- if self.show_variant_in_website:
- # show template
- template_item = frappe.get_doc("Item", self.variant_of)
+ if self.show_variant_in_website:
+ # show template
+ template_item = frappe.get_doc("Item", self.variant_of)
- if not template_item.show_in_website:
- template_item.show_in_website = 1
- template_item.flags.dont_update_variants = True
- template_item.flags.ignore_permissions = True
- template_item.save()
+ if not template_item.show_in_website:
+ template_item.show_in_website = 1
+ template_item.flags.dont_update_variants = True
+ template_item.flags.ignore_permissions = True
+ template_item.save()
def update_variants(self):
if self.flags.dont_update_variants or \
@@ -676,10 +677,10 @@
def validate_stock_exists_for_template_item(self):
if self.stock_ledger_created() and self._doc_before_save:
- if (self._doc_before_save.has_variants != self.has_variants
- or self._doc_before_save.variant_of != self.variant_of):
- frappe.throw(_("Cannot change Variant properties after stock transction. You will have to make a new Item to do this.").format(self.name),
- StockExistsForTemplate)
+ if (cint(self._doc_before_save.has_variants) != cint(self.has_variants)
+ or self._doc_before_save.variant_of != self.variant_of):
+ frappe.throw(_("Cannot change Variant properties after stock transaction. You will have to make a new Item to do this.").format(self.name),
+ StockExistsForTemplate)
if self.has_variants or self.variant_of:
if not self.is_child_table_same('attributes'):
diff --git a/erpnext/stock/doctype/item_price/item_price.json b/erpnext/stock/doctype/item_price/item_price.json
index fdc2df2..9f05937 100644
--- a/erpnext/stock/doctype/item_price/item_price.json
+++ b/erpnext/stock/doctype/item_price/item_price.json
@@ -42,6 +42,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -72,6 +73,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -101,6 +103,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -130,6 +133,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -159,6 +163,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -189,6 +194,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -219,6 +225,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -251,6 +258,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -283,6 +291,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -311,6 +320,39 @@
"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,
+ "fieldname": "brand",
+ "fieldtype": "Read Only",
+ "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": "Brand",
+ "length": 0,
+ "no_copy": 0,
+ "options": "item_code.brand",
+ "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
},
{
@@ -340,6 +382,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -369,6 +412,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -383,7 +427,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-12-01 13:03:53.397382",
+ "modified": "2018-05-03 12:50:14.207842",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Price",
@@ -391,7 +435,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -411,7 +454,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/stock/doctype/material_request/material_request_dashboard.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py
index c3fe8f3..6cfb8af 100644
--- a/erpnext/stock/doctype/material_request/material_request_dashboard.py
+++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py
@@ -7,7 +7,7 @@
'transactions': [
{
'label': _('Related'),
- 'items': ['Request for Quotation', 'Supplier Quotation', 'Purchase Order']
+ 'items': ['Request for Quotation', 'Supplier Quotation', 'Purchase Order', "Stock Entry"]
},
{
'label': _('Manufacturing'),
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 69d2f2a..c55013e 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -227,11 +227,6 @@
}
}
-cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
- if(cint(frappe.boot.notification_settings.purchase_receipt))
- cur_frm.email_doc(frappe.boot.notification_settings.purchase_receipt_message);
-}
-
frappe.provide("erpnext.buying");
frappe.ui.form.on("Purchase Receipt", "is_subcontracted", function(frm) {
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 9f609be..4f9f301 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -40,6 +40,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -70,6 +71,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -102,6 +104,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -135,6 +138,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -168,6 +172,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -200,6 +205,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -230,6 +236,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -260,6 +267,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -295,6 +303,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -330,6 +339,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -362,6 +372,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -396,6 +407,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -427,6 +439,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -459,6 +472,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -489,6 +503,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -519,6 +534,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -549,6 +565,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -579,6 +596,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -608,6 +626,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -637,6 +656,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -666,6 +686,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -695,6 +716,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -727,6 +749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -757,6 +780,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -787,6 +811,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -819,6 +844,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -852,6 +878,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -882,6 +909,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -913,6 +941,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -944,6 +973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -975,6 +1005,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1004,6 +1035,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1035,6 +1067,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1067,6 +1100,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1098,6 +1132,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1127,6 +1162,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1158,6 +1194,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1191,6 +1228,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1220,6 +1258,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1251,6 +1290,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1283,6 +1323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1313,6 +1354,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1345,6 +1387,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1378,6 +1421,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1407,6 +1451,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1438,6 +1483,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1467,6 +1513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1499,6 +1546,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1529,6 +1577,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1559,6 +1608,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1591,6 +1641,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1623,6 +1674,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1655,6 +1707,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1687,6 +1740,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1716,6 +1770,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1749,6 +1804,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1781,6 +1837,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1812,6 +1869,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1843,6 +1901,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1875,6 +1934,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1906,6 +1966,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1935,6 +1996,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1965,6 +2027,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1996,6 +2059,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2025,6 +2089,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2057,6 +2122,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2088,6 +2154,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2120,6 +2187,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2152,6 +2220,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2181,6 +2250,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2213,6 +2283,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2244,6 +2315,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2275,6 +2347,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2307,6 +2380,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2339,6 +2413,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2370,6 +2445,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2403,6 +2479,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2437,6 +2514,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2471,6 +2549,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50px"
},
@@ -2504,6 +2583,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2535,6 +2615,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2566,6 +2647,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2597,6 +2679,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2631,6 +2714,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2665,6 +2749,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2698,6 +2783,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -2730,6 +2816,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2760,6 +2847,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -2791,6 +2879,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2808,7 +2897,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription Detail",
+ "label": "Auto Repeat Detail",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -2821,6 +2910,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2829,7 +2919,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "subscription",
+ "fieldname": "auto_repeat",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -2838,10 +2928,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Subscription",
+ "label": "Auto Repeat",
"length": 0,
"no_copy": 1,
- "options": "Subscription",
+ "options": "Auto Repeat",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -2852,6 +2942,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2882,6 +2973,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2912,6 +3004,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2944,6 +3037,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -2974,6 +3068,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3006,6 +3101,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "30%"
},
@@ -3038,6 +3134,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3067,6 +3164,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3098,6 +3196,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3129,6 +3228,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -3158,6 +3258,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -3192,6 +3293,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
},
@@ -3226,6 +3328,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "100px"
}
@@ -3242,7 +3345,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2018-01-11 14:40:58.353712",
+ "modified": "2018-03-10 07:36:31.378606",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
index bcedd71..7ed7dd6 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_dashboard.py
@@ -7,7 +7,7 @@
'Purchase Invoice': 'purchase_receipt',
'Asset': 'purchase_receipt',
'Landed Cost Voucher': 'receipt_document',
- 'Subscription': 'reference_document'
+ 'Auto Repeat': 'reference_document'
},
'internal_links': {
'Purchase Order': ['items', 'purchase_order'],
@@ -29,7 +29,7 @@
},
{
'label': _('Subscription'),
- 'items': ['Subscription']
+ 'items': ['Auto Repeat']
},
]
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/serial_no/serial_no.json b/erpnext/stock/doctype/serial_no/serial_no.json
index f84cbef..edd29a2 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.json
+++ b/erpnext/stock/doctype/serial_no/serial_no.json
@@ -41,6 +41,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -69,6 +70,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -100,6 +102,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -132,6 +135,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -165,6 +169,38 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "batch_no",
+ "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": "Batch No",
+ "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
},
{
@@ -193,6 +229,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -222,6 +259,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -253,6 +291,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "300px"
},
@@ -287,6 +326,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -319,6 +359,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -348,6 +389,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -376,6 +418,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -407,6 +450,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -437,6 +481,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -468,6 +513,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -497,6 +543,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -529,6 +576,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -557,6 +605,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -588,6 +637,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -617,6 +667,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -831,6 +882,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -861,6 +913,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -891,6 +944,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -922,6 +976,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -951,6 +1006,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -983,6 +1039,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1011,6 +1068,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1044,6 +1102,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1075,6 +1134,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1105,6 +1165,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1136,6 +1197,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1165,6 +1227,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1193,6 +1256,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1226,6 +1290,7 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1258,6 +1323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1287,6 +1353,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "50%"
},
@@ -1319,6 +1386,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1351,6 +1419,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0,
"width": "150px"
},
@@ -1381,6 +1450,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1410,6 +1480,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -1440,6 +1511,7 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -1462,7 +1534,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -1482,7 +1553,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -1502,7 +1572,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index 333963b..8ce49c5 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -17,6 +17,7 @@
class SerialNoQtyError(ValidationError): pass
class SerialNoItemError(ValidationError): pass
class SerialNoWarehouseError(ValidationError): pass
+class SerialNoBatchError(ValidationError): pass
class SerialNoNotExistsError(ValidationError): pass
class SerialNoDuplicateError(ValidationError): pass
@@ -188,6 +189,7 @@
update_serial_nos(sle, item_det)
def validate_serial_no(sle, item_det):
+
if item_det.has_serial_no==0:
if sle.serial_no:
frappe.throw(_("Item {0} is not setup for Serial Nos. Column must be blank").format(sle.item_code),
@@ -199,7 +201,7 @@
frappe.throw(_("Serial No {0} quantity {1} cannot be a fraction").format(sle.item_code, sle.actual_qty))
if len(serial_nos) and len(serial_nos) != abs(cint(sle.actual_qty)):
- frappe.throw(_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(sle.actual_qty, sle.item_code, len(serial_nos)),
+ frappe.throw(_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(abs(sle.actual_qty), sle.item_code, len(serial_nos)),
SerialNoQtyError)
if len(serial_nos) != len(set(serial_nos)):
@@ -229,8 +231,13 @@
frappe.throw(_("Serial No {0} does not belong to Warehouse {1}").format(serial_no,
sle.warehouse), SerialNoWarehouseError)
- if sle.voucher_type in ("Delivery Note", "Sales Invoice") \
- and sle.is_cancelled=="No" and not sr.warehouse:
+ if sle.voucher_type in ("Delivery Note", "Sales Invoice"):
+
+ if sr.batch_no and sr.batch_no != sle.batch_no:
+ frappe.throw(_("Serial No {0} does not belong to Batch {1}").format(serial_no,
+ sle.batch_no), SerialNoBatchError)
+
+ if sle.is_cancelled=="No" and not sr.warehouse:
frappe.throw(_("Serial No {0} does not belong to any Warehouse")
.format(serial_no), SerialNoWarehouseError)
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index a86dea7..3342768 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -23,6 +23,10 @@
return erpnext.queries.warehouse(frm.doc);
});
}
+
+ if (!frm.doc.expense_account) {
+ frm.trigger("set_expense_account");
+ }
},
refresh: function(frm) {
@@ -114,6 +118,25 @@
toggle_display_account_head: function(frm) {
frm.toggle_display(['expense_account', 'cost_center'],
erpnext.is_perpetual_inventory_enabled(frm.doc.company));
+ },
+ purpose: function(frm) {
+ frm.trigger("set_expense_account");
+ },
+ set_expense_account: function(frm) {
+ if (frm.doc.company && erpnext.is_perpetual_inventory_enabled(frm.doc.company)) {
+ return frm.call({
+ method: "erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_difference_account",
+ args: {
+ "purpose": frm.doc.purpose,
+ "company": frm.doc.company
+ },
+ callback: function(r) {
+ if (!r.exc) {
+ frm.set_value("expense_account", r.message);
+ }
+ }
+ });
+ }
}
});
@@ -137,37 +160,12 @@
});
erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
- onload: function() {
- this.set_default_expense_account();
- },
-
- set_default_expense_account: function() {
- var me = this;
- if(this.frm.doc.company) {
- if (erpnext.is_perpetual_inventory_enabled(this.frm.doc.company) && !this.frm.doc.expense_account) {
- return this.frm.call({
- method: "erpnext.accounts.utils.get_company_default",
- args: {
- "fieldname": "stock_adjustment_account",
- "company": this.frm.doc.company
- },
- callback: function(r) {
- if (!r.exc) {
- me.frm.set_value("expense_account", r.message);
- }
- }
- });
- }
- }
- },
-
setup: function() {
var me = this;
this.setup_posting_date_time_check();
if (me.frm.doc.company && erpnext.is_perpetual_inventory_enabled(me.frm.doc.company)) {
- this.frm.add_fetch("company", "stock_adjustment_account", "expense_account");
this.frm.add_fetch("company", "cost_center", "cost_center");
}
this.frm.fields_dict["expense_account"].get_query = function() {
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
index dc9a322..421ee77 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
@@ -42,6 +42,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 1,
+ "translatable": 0,
"unique": 0
},
{
@@ -72,6 +73,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -80,28 +82,31 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
+ "default": "Stock Reconciliation",
+ "fieldname": "purpose",
+ "fieldtype": "Select",
"hidden": 0,
- "ignore_user_permissions": 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": "Amended From",
+ "label": "Purpose",
"length": 0,
- "no_copy": 1,
- "options": "Stock Reconciliation",
+ "no_copy": 0,
+ "options": "Opening Stock\nStock Reconciliation",
"permlevel": 0,
- "print_hide": 1,
+ "precision": "",
+ "print_hide": 0,
"print_hide_if_no_value": 0,
- "read_only": 1,
+ "read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -130,6 +135,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -162,6 +168,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -193,6 +200,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -223,6 +231,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -252,6 +261,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -283,6 +293,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -312,6 +323,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -343,6 +355,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -374,6 +387,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -403,6 +417,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -432,6 +447,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -463,6 +479,38 @@
"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,
+ "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": "Stock Reconciliation",
+ "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
}
],
@@ -478,7 +526,7 @@
"istable": 0,
"max_attachments": 1,
"menu_index": 0,
- "modified": "2017-08-02 23:54:28.516007",
+ "modified": "2018-04-26 12:01:25.377081",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation",
@@ -486,7 +534,6 @@
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 73a7ef3..938173d 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -8,6 +8,7 @@
from frappe.utils import cstr, flt, cint
from erpnext.stock.stock_ledger import update_entries_after
from erpnext.controllers.stock_controller import StockController
+from erpnext.accounts.utils import get_company_default
from erpnext.stock.utils import get_stock_balance
class OpeningEntryAccountError(frappe.ValidationError): pass
@@ -304,3 +305,13 @@
'qty': qty,
'rate': rate
}
+
+@frappe.whitelist()
+def get_difference_account(purpose, company):
+ if purpose == 'Stock Reconciliation':
+ account = get_company_default(company, "stock_adjustment_account")
+ else:
+ account = frappe.db.get_value('Account', {'is_group': 0,
+ 'company': company, 'account_type': 'Temporary'}, 'name')
+
+ return account
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.json b/erpnext/stock/doctype/stock_settings/stock_settings.json
index 48f89ec..4d5423e 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.json
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.json
@@ -470,6 +470,37 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
+ "default": "1",
+ "fieldname": "set_qty_in_transactions_based_on_serial_no_input",
+ "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": "Set Qty in Transactions based on Serial No Input",
+ "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": "auto_material_request",
"fieldtype": "Section Break",
"hidden": 0,
@@ -773,7 +804,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-01-12 09:38:58.200950",
+ "modified": "2018-05-03 12:38:12.905394",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Settings",
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py
index 23a18f4..97d24c6 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.py
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.py
@@ -11,8 +11,9 @@
class StockSettings(Document):
def validate(self):
- for key in ["item_naming_by", "item_group", "stock_uom", "allow_negative_stock", "default_warehouse"]:
- frappe.db.set_default(key, self.get(key, ""))
+ for key in ["item_naming_by", "item_group", "stock_uom",
+ "allow_negative_stock", "default_warehouse", "set_qty_in_transactions_based_on_serial_no_input"]:
+ frappe.db.set_default(key, self.get(key, ""))
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
set_by_naming_series("Item", "item_code",
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 7e456dd..b36cd39 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -76,20 +76,23 @@
args[key] = value
out.update(get_pricing_rule_for_item(args))
-
if (args.get("doctype") == "Delivery Note" or
(args.get("doctype") == "Sales Invoice" and args.get('update_stock'))) \
and out.warehouse and out.stock_qty > 0:
- if out.has_serial_no:
- out.serial_no = get_serial_no(out, args.serial_no)
-
if out.has_batch_no and not args.get("batch_no"):
out.batch_no = get_batch_no(out.item_code, out.warehouse, out.qty)
actual_batch_qty = get_batch_qty(out.batch_no, out.warehouse, out.item_code)
if actual_batch_qty:
out.update(actual_batch_qty)
+ if out.has_serial_no and args.get('batch_no'):
+ out.batch_no = args.get('batch_no')
+ out.serial_no = get_serial_no(out, args.serial_no)
+
+ elif out.has_serial_no:
+ out.serial_no = get_serial_no(out, args.serial_no)
+
if args.transaction_date and item.lead_time_days:
out.schedule_date = out.lead_time_date = add_days(args.transaction_date,
item.lead_time_days)
@@ -465,6 +468,17 @@
"qty": abs(cint(args.stock_qty))
}))
+def get_serial_no_batchwise(args):
+ if frappe.db.get_single_value("Stock Settings", "automatically_set_serial_nos_based_on_fifo"):
+ return "\n".join(frappe.db.sql_list("""select name from `tabSerial No`
+ where item_code=%(item_code)s and warehouse=%(warehouse)s and (batch_no=%(batch_no)s or batch_no is NULL)
+ order by timestamp(purchase_date, purchase_time) asc limit %(qty)s""", {
+ "item_code": args.item_code,
+ "warehouse": args.warehouse,
+ "batch_no": args.batch_no,
+ "qty": abs(cint(args.stock_qty))
+ }))
+
@frappe.whitelist()
def get_conversion_factor(item_code, uom):
variant_of = frappe.db.get_value("Item", item_code, "variant_of")
@@ -492,14 +506,31 @@
return {'serial_no': serial_no}
@frappe.whitelist()
-def get_bin_details_and_serial_nos(item_code, warehouse, stock_qty=None, serial_no=None):
+def get_bin_details_and_serial_nos(item_code, warehouse, has_batch_no, stock_qty=None, serial_no=None):
bin_details_and_serial_nos = {}
bin_details_and_serial_nos.update(get_bin_details(item_code, warehouse))
if stock_qty > 0:
+ if has_batch_no:
+ args = frappe._dict({"item_code":item_code, "warehouse":warehouse, "stock_qty":stock_qty})
+ serial_no = get_serial_no(args)
+ bin_details_and_serial_nos.update({'serial_no': serial_no})
+ return bin_details_and_serial_nos
+
bin_details_and_serial_nos.update(get_serial_no_details(item_code, warehouse, stock_qty, serial_no))
return bin_details_and_serial_nos
@frappe.whitelist()
+def get_batch_qty_and_serial_no(batch_no, stock_qty, warehouse, item_code, has_serial_no):
+ batch_qty_and_serial_no = {}
+ batch_qty_and_serial_no.update(get_batch_qty(batch_no, warehouse, item_code))
+
+ if (flt(batch_qty_and_serial_no.get('actual_batch_qty')) >= flt(stock_qty)) and has_serial_no:
+ args = frappe._dict({"item_code":item_code, "warehouse":warehouse, "stock_qty":stock_qty, "batch_no":batch_no})
+ serial_no = get_serial_no(args)
+ batch_qty_and_serial_no.update({'serial_no': serial_no})
+ return batch_qty_and_serial_no
+
+@frappe.whitelist()
def get_batch_qty(batch_no, warehouse, item_code):
from erpnext.stock.doctype.batch import batch
if batch_no:
@@ -659,8 +690,10 @@
return ""
if args.get('warehouse') and args.get('stock_qty') and args.get('item_code'):
-
- if frappe.get_value('Item', {'item_code': args.item_code}, "has_serial_no") == 1:
+ has_serial_no = frappe.get_value('Item', {'item_code': args.item_code}, "has_serial_no")
+ if args.get('batch_no') and has_serial_no == 1:
+ return get_serial_no_batchwise(args)
+ elif has_serial_no == 1:
args = json.dumps({"item_code": args.get('item_code'),"warehouse": args.get('warehouse'),"stock_qty": args.get('stock_qty')})
args = process_args(args)
serial_no = get_serial_nos_by_fifo(args)
diff --git a/erpnext/stock/report/item_price_stock/item_price_stock.py b/erpnext/stock/report/item_price_stock/item_price_stock.py
index ed010cd..30fcad8 100644
--- a/erpnext/stock/report/item_price_stock/item_price_stock.py
+++ b/erpnext/stock/report/item_price_stock/item_price_stock.py
@@ -20,6 +20,12 @@
"width": 120
},
{
+ "label": _("Brand"),
+ "fieldname": "brand",
+ "fieldtype": "Data",
+ "width": 100
+ },
+ {
"label": _("Warehouse"),
"fieldname": "warehouse",
"fieldtype": "Link",
@@ -71,7 +77,7 @@
conditions += "where a.item_code=%(item_code)s"
item_results = frappe.db.sql("""select a.item_code as item_name, a.name as price_list_name,
- b.warehouse as warehouse, b.actual_qty as actual_qty
+ a.brand as brand, b.warehouse as warehouse, b.actual_qty as actual_qty
from `tabItem Price` a left join `tabBin` b
ON a.item_code = b.item_code
{conditions}"""
@@ -87,6 +93,7 @@
for item_dict in item_results:
data = {
'item_name': item_dict.item_name,
+ 'brand': item_dict.brand,
'warehouse': item_dict.warehouse,
'stock_available': item_dict.actual_qty or 0,
'buying_price_list': "",
diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py
index ca01d19..0375d8f 100644
--- a/erpnext/stock/report/item_prices/item_prices.py
+++ b/erpnext/stock/report/item_prices/item_prices.py
@@ -21,7 +21,7 @@
data = []
for item in sorted(item_map):
data.append([item, item_map[item]["item_name"],item_map[item]["item_group"],
- item_map[item]["description"], item_map[item]["stock_uom"],
+ item_map[item]["brand"], item_map[item]["description"], item_map[item]["stock_uom"],
flt(last_purchase_rate.get(item, 0), precision),
flt(val_rate_map.get(item, 0), precision),
pl.get(item, {}).get("Selling"),
@@ -34,7 +34,8 @@
def get_columns(filters):
"""return columns based on filters"""
- columns = [_("Item") + ":Link/Item:100", _("Item Name") + "::150",_("Item Group") + ":Link/Item Group:125", _("Description") + "::150", _("UOM") + ":Link/UOM:80",
+ columns = [_("Item") + ":Link/Item:100", _("Item Name") + "::150",_("Item Group") + ":Link/Item Group:125",
+ _("Brand") + "::100", _("Description") + "::150", _("UOM") + ":Link/UOM:80",
_("Last Purchase Rate") + ":Currency:90", _("Valuation Rate") + ":Currency:80", _("Sales Price List") + "::180",
_("Purchase Price List") + "::180", _("BOM Rate") + ":Currency:90"]
@@ -45,9 +46,9 @@
item_map = {}
- for i in frappe.db.sql("select name, item_group, item_name, description, \
- stock_uom from tabItem \
- order by item_code, item_group", as_dict=1):
+ for i in frappe.db.sql("""select name, item_group, item_name, description,
+ brand, stock_uom from tabItem
+ order by item_code, item_group""", as_dict=1):
item_map.setdefault(i.name, i)
return item_map
diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
index 137d603..3b901dc 100644
--- a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
+++ b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json
@@ -1,14 +1,13 @@
{
"add_total_row": 0,
- "apply_user_permissions": 1,
"creation": "2013-09-25 10:21:15",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 3,
"is_standard": "Yes",
- "json": "{\"add_total_row\": 0, \"sort_by\": \"Item Price.modified\", \"sort_order\": \"desc\", \"sort_by_next\": null, \"filters\": [], \"sort_order_next\": \"desc\", \"columns\": [[\"name\", \"Item Price\"], [\"price_list\", \"Item Price\"], [\"item_code\", \"Item Price\"], [\"item_name\", \"Item Price\"], [\"item_description\", \"Item Price\"], [\"price_list_rate\", \"Item Price\"], [\"buying\", \"Item Price\"], [\"selling\", \"Item Price\"], [\"currency\", \"Item Price\"]]}",
- "modified": "2017-02-24 20:02:09.364303",
+ "json": "{\"fields\": [[\"name\", \"Item Price\"], [\"price_list\", \"Item Price\"], [\"currency\", \"Item Price\"], [\"item_code\", \"Item Price\"], [\"brand\", \"Item Price\"], [\"price_list_rate\", \"Item Price\"], [\"docstatus\", \"Item Price\"]], \"order_by\": \"`tabItem Price`.`modified` asc\", \"add_total_row\": 0, \"filters\": []}",
+ "modified": "2018-05-03 12:48:39.802088",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item-wise Price List Rate",
diff --git a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
index c5fb518..d73f83d 100644
--- a/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
+++ b/erpnext/stock/report/warehouse_wise_item_balance_age_and_value/warehouse_wise_item_balance_age_and_value.py
@@ -39,7 +39,7 @@
item_value.setdefault((item, item_map[item]["item_group"]),[])
item_value[(item, item_map[item]["item_group"])].append(total_stock_value)
-
+
# sum bal_qty by item
for (item, item_group), wh_balance in item_balance.items():
total_stock_value = sum(item_value[(item, item_group)])
@@ -87,7 +87,9 @@
def get_warehouse_list(filters):
from frappe.defaults import get_user_permissions
condition = ''
- user_permitted_warehouse = filter(None, get_user_permissions().get("Warehouse", []))
+ user_permitted_warehouse = filter(None, get_user_permissions()
+ .get("Warehouse", {})
+ .get("docs", []))
value = ()
if user_permitted_warehouse:
condition = "and name in %s"
@@ -96,7 +98,7 @@
condition = "and name = %s"
value = filters.get("warehouse")
- return frappe.db.sql("""select name
+ return frappe.db.sql("""select name
from `tabWarehouse` where is_group = 0
{condition}""".format(condition=condition), value, as_dict=1)
diff --git a/erpnext/templates/emails/recurring_document_failed.html b/erpnext/templates/emails/recurring_document_failed.html
deleted file mode 100644
index f9e8c2d..0000000
--- a/erpnext/templates/emails/recurring_document_failed.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<h2>{{_("Recurring")}} {{ type }} {{ _("Failed")}}</h2>
-
-<p>{{_("An error occured while creating recurring")}} {{ type }} <b>{{ name }}</b> {{_("for")}} <b>{{ party }}</b>.</p>
-<p>{{_("This could be because of some invalid Email Addresses in the")}} {{ type }}.</p>
-<p>{{_("To stop sending repetitive error notifications from the system, we have checked Disabled field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.</p>
-<p><b>{{_("Please correct the")}} {{ type }} {{_('and unchcked Disabled in the')}} {{ subscription }} {{_("for making recurring again.")}}</b></p>
-<hr>
-<p><b>{{_("It is necessary to take this action today itself for the above mentioned recurring")}} {{ type }}
-{{_('to be generated. If delayed, you will have to manually change the "Repeat on Day of Month" field
-of this')}} {{ type }} {{_("for generating the recurring")}} {{ type }} {{_("in the subscription")}} {{ subscription }}.</b></p>
-<p>[{{_("This email is autogenerated")}}]</p>
diff --git a/erpnext/templates/includes/products_as_grid.html b/erpnext/templates/includes/products_as_grid.html
index 34c2ccd..a057f5d 100644
--- a/erpnext/templates/includes/products_as_grid.html
+++ b/erpnext/templates/includes/products_as_grid.html
@@ -12,10 +12,12 @@
<div> </div>
<div style='font-size: small; margin-bottom: 10px;'> </div>
{% endif %}
- {% if in_stock or not is_stock_item %}
- <div style='color: green'> <i class='fa fa-check'></i> {{ _("In stock") }}</div>
- {% else %}
- <div style='color: red'> <i class='fa fa-close'></i> {{ _("Not in stock") }}</div>
+ {% if show_stock_qty %}
+ {% if in_stock %}
+ <div style='color: green'> <i class='fa fa-check'></i> {{ _("In stock") }}</div>
+ {% else %}
+ <div style='color: red'> <i class='fa fa-close'></i> {{ _("Not in stock") }}</div>
+ {% endif %}
{% endif %}
</div>
</div>
diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html
index 750fa38..f36b4e0 100644
--- a/erpnext/templates/pages/home.html
+++ b/erpnext/templates/pages/home.html
@@ -18,7 +18,8 @@
<a class="product-link" href="{{ item.route|abs_url }}">
<div class="col-sm-4 col-xs-4 product-image-wrapper">
<div class="product-image-img">
- {{ product_image_square(item.thumbnail or item.image) }}
+ <!-- thumbnail not updated, and used as background image in item card -->
+ {{ product_image_square(item.image) }}
<div class="product-text" itemprop="name">{{ item.item_name }}</div>
</div>
</div>
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 0c2b6c5..d3769a2 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -13,12 +13,6 @@
class UOMMustBeIntegerError(frappe.ValidationError): pass
class TransactionBase(StatusUpdater):
- def load_notification_message(self):
- dt = self.doctype.lower().replace(" ", "_")
- if int(frappe.db.get_value("Notification Control", None, dt) or 0):
- self.set("__notification_message",
- frappe.db.get_value("Notification Control", None, dt + "_message"))
-
def validate_posting_time(self):
# set Edit Posting Date and Time to 1 while data import
if frappe.flags.in_import and self.posting_date:
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..48e341a
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,3 @@
+{
+ "lockfileVersion": 1
+}
diff --git a/setup.py b/setup.py
index c293fb8..71107a9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,20 +1,17 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
-try: # for pip >= 10
- from pip._internal.req import parse_requirements
-except ImportError: # for pip <= 9.0.3
- from pip.req import parse_requirements
import re, ast
# get version from __version__ variable in erpnext/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
+with open('requirements.txt') as f:
+ install_requires = f.read().strip().split('\n')
+
with open('erpnext/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
-requirements = parse_requirements("requirements.txt", session="")
-
setup(
name='erpnext',
version=version,
@@ -24,6 +21,5 @@
packages=find_packages(),
zip_safe=False,
include_package_data=True,
- install_requires=[str(ir.req) for ir in requirements],
- dependency_links=[str(ir._link) for ir in requirements if ir._link]
+ install_requires=install_requires
)