diff --git a/.travis.yml b/.travis.yml index b74289f70c..70df757fa3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ install: - 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 @@ before_script: - 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 8a247cc745..3eaf994672 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.27' +__version__ = '10.1.33' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index fe1977c16e..a71c4f24dc 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -32,9 +32,7 @@ frappe.treeview_settings["Account"] = { options: ['Asset', 'Liability', 'Equity', 'Income', 'Expense'].join('\n'), depends_on: 'eval:doc.is_group && !doc.parent_account'}, {fieldtype:'Select', fieldname:'account_type', label:__('Account Type'), - options: ['', 'Accumulated Depreciation', 'Bank', 'Cash', 'Chargeable', 'Cost of Goods Sold', 'Depreciation', - 'Equity', 'Expense Account', 'Expenses Included In Valuation', 'Fixed Asset', 'Income Account', 'Payable', 'Receivable', - 'Round Off', 'Stock', 'Stock Adjustment', 'Stock Received But Not Billed', 'Tax', 'Temporary'].join('\n'), + options: frappe.get_meta("Account").fields.filter(d => d.fieldname=='account_type')[0].options, description: __("Optional. This setting will be used to filter in various transactions.") }, {fieldtype:'Float', fieldname:'tax_rate', label:__('Tax Rate'), 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 6e1637165a..161e52a67d 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 @@ def get(): "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 5ed3e45086..6c83e3bd67 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 @@ def get(): "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 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/bank/bank.js b/erpnext/accounts/doctype/bank/bank.js new file mode 100644 index 0000000000..1063a07b82 --- /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 0000000000..0a24726f36 --- /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 0000000000..b205d56678 --- /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 0000000000..9ec264415a --- /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 0000000000..d8741f24c5 --- /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 0439b73818..f7ffc6ceb5 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 @@ frappe.ui.form.on('Bank Guarantee', { }; }); }, + + 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 807c544d87..b3cd157799 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 71647b9e26..1a62c42749 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 0e56991856..0000000000 --- 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 0000000000..e69de29bb2 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 0000000000..46aa4f2031 --- /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 0000000000..53fbf7d446 --- /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 0000000000..6c4dd1b85b --- /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 0000000000..f2381c042e --- /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 0000000000..aa7fe83328 --- /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 0000000000..e69de29bb2 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 0000000000..7c93f268f5 --- /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 0000000000..9438e9a63f --- /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 0000000000..e69de29bb2 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 0000000000..d852935d87 --- /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/setup/doctype/notification_control/notification_control.json b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json similarity index 52% rename from erpnext/setup/doctype/notification_control/notification_control.json rename to erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json index fc3316ed01..a7c56a1e56 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.json +++ b/erpnext/accounts/doctype/bank_statement_transaction_entry/bank_statement_transaction_entry.json @@ -1,566 +1,768 @@ { - "allow_copy": 1, + "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, - "allow_rename": 0, + "allow_rename": 1, "beta": 0, - "creation": "2012-07-12 23:29:45", + "creation": "2017-11-07 13:48:13.123185", "custom": 0, - "description": "Send automatic emails to Contacts on Submitting transactions.", "docstatus": 0, "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", "fields": [ { + "allow_bulk_edit": 0, "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", + "columns": 0, + "fieldname": "bank_account", + "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 0, - "label": "Prompt for Email on Submission of", + "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, - "fieldname": "sales", + "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, - "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", + "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, - "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", + "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, - "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", + "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, - "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", + "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, - "label": "Expense Claim", + "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, - "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.", - "fieldname": "customize_the_notification", + "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, - "label": "Customize the Notification", + "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, - "fieldname": "select_transaction", - "fieldtype": "Select", + "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, - "label": "Select Transaction", + "in_standard_filter": 0, + "label": "New Transactions", "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", + "options": "Bank Statement Transaction Payment Item", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "custom_message", - "fieldtype": "Text Editor", + "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, - "label": "Custom Message", + "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, - "fieldname": "quotation_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Quotation Message", + "in_standard_filter": 0, + "label": "Match Transaction to Invoices", "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "sales_order_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Sales Order Message", + "in_standard_filter": 0, "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "delivery_note_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Delivery Note Message", + "in_standard_filter": 0, + "label": "Create New Payment/Journal Entry", "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "sales_invoice_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Sales Invoice Message", + "in_standard_filter": 0, "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "purchase_order_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Purchase Order Message", + "in_standard_filter": 0, + "label": "Submit/Reconcile Payments", "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "purchase_receipt_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Purchase Receipt Message", + "in_standard_filter": 0, + "label": "Matching Invoices", "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "expense_claim_approved_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Expense Claim Approved Message", + "in_standard_filter": 0, + "label": "Payment Invoice Items", "length": 0, "no_copy": 0, + "options": "Bank Statement Transaction Invoice Item", "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "fieldname": "expense_claim_rejected_message", - "fieldtype": "Text", - "hidden": 1, + "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, - "label": "Expense Claim Rejected Message", + "in_standard_filter": 0, + "label": "Reconciled Transactions", "length": 0, "no_copy": 0, "permlevel": 0, - "print_hide": 1, + "precision": "", + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_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, - "icon": "fa fa-envelope", - "idx": 1, + "idx": 0, + "image_view": 0, "in_create": 0, - "in_dialog": 0, - "is_submittable": 0, - "issingle": 1, + "is_submittable": 1, + "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-06-01 13:06:06.981905", + "modified": "2018-04-07 17:01:47.480572", "modified_by": "Administrator", - "module": "Setup", - "name": "Notification Control", + "module": "Accounts", + "name": "Bank Statement Transaction Entry", + "name_case": "", "owner": "Administrator", "permissions": [ { - "amend": 0, + "amend": 1, "apply_user_permissions": 0, - "cancel": 0, + "cancel": 1, "create": 1, - "delete": 0, - "email": 0, - "export": 0, + "delete": 1, + "email": 1, + "export": 1, "if_owner": 0, "import": 0, "permlevel": 0, - "print": 0, + "print": 1, "read": 1, - "report": 0, + "report": 1, "role": "System Manager", "set_user_permissions": 0, "share": 1, - "submit": 0, + "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": 1, + "quick_entry": 0, "read_only": 0, "read_only_onload": 0, - "sort_order": "ASC", + "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 0000000000..45663df4e1 --- /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 0000000000..46d570f515 --- /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 0000000000..458948372f --- /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 0000000000..e69de29bb2 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 0000000000..bcffff0528 --- /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 0000000000..cb1b15815f --- /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 0000000000..e69de29bb2 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 0000000000..177dccd82c --- /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 0000000000..9840c0dbe3 --- /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 0000000000..e69de29bb2 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 0000000000..46aa4f2031 --- /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 0000000000..474bb90db7 --- /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 0000000000..de9a85fe5c --- /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 0000000000..f2381c042e --- /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 0000000000..aa7fe83328 --- /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 0000000000..e69de29bb2 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 0000000000..47c32097a9 --- /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 0000000000..bf0a590d48 --- /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 0556e9b992..24cd3dda9b 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 @@ def create_or_update_cheque_print_format(template_name): doc = frappe.get_doc("Cheque Print Template", template_name) cheque_print.html = """ +
+ border-bottom: solid 1px;border-top:solid 1px; width:2cm;text-align: center; position: absolute;"> %(message_to_show)s + position: absolute; min-width: 6cm;"> {{ doc.account_no or '' }} + position: absolute; min-width: 6cm;"> {{doc.party_name}} + position: absolute; min-width: 4cm;"> {{doc.get_formatted("base_paid_amount") or doc.get_formatted("base_received_amount")}} + position: absolute; min-width: 6cm;"> {{doc.company}}
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.json b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json index f12de7915a..4ca9f6b96f 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 517a2a332e..92da787286 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -104,6 +104,7 @@ def auto_create_fiscal_year(): 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/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json index 4b3396828b..b4da2db952 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.json +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json @@ -532,6 +532,37 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "voucher_detail_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": "Voucher Detail 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 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -772,6 +803,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, + "modified": "2018-05-15 02:12:50.035755", "modified": "2018-04-23 02:15:22.297509", "modified_by": "Administrator", "module": "Accounts", diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index a975aa0756..ffccf8ed07 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 9bbd137159..a69ffcf39c 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -102,7 +102,7 @@ class JournalEntry(AccountsController): 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 5712bf83ab..679750de4d 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 @@ class OpeningInvoiceCreationTool(Document): 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 @@ class OpeningInvoiceCreationTool(Document): "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 60a54c22ba..564a93c7c7 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 0a22ae0a47..9b50252bd4 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -508,7 +508,7 @@ class PaymentEntry(AccountsController): 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 e136a1dbad..8acdf5c4b8 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 c9cf47d114..f6103cc89f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -727,7 +727,7 @@ class PurchaseInvoice(BuyingController): 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 062a2d2c64..f101b6aa7e 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 @@ def get_data(): '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 @@ def get_data(): }, { 'label': _('Subscription'), - 'items': ['Subscription'] + 'items': ['Auto Repeat'] }, ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py index be6078a871..47894647ee 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -97,7 +97,7 @@ def update_pos_profile_data(doc, pos_profile, company_data): doc.conversion_rate = 1.0 if doc.currency != company_data.default_currency: - doc.conversion_rate = get_exchange_rate(doc.currency, company_data.default_currency, doc.posting_date) + doc.conversion_rate = get_exchange_rate(doc.currency, company_data.default_currency, doc.posting_date, args="for_selling") doc.selling_price_list = pos_profile.get('selling_price_list') or \ frappe.db.get_value('Selling Settings', None, 'selling_price_list') diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 77babf41f5..4e33cb8397 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -126,18 +126,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte $.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( - ` - ${__('Print')} - - ${__('New')}` - ); - - } 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 8fe63b4589..11edefc1ed 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 f27d3775b7..031e320012 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe, erpnext import frappe.defaults -from frappe.utils import cint, flt +from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days from frappe import _, msgprint, throw from erpnext.accounts.party import get_party_account, get_due_date from erpnext.controllers.stock_controller import update_gl_entries_after @@ -111,7 +111,7 @@ class SalesInvoice(SellingController): 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) @@ -699,7 +699,7 @@ class SalesInvoice(SellingController): account_currency = get_account_currency(item.income_account) gl_entries.append( self.get_gl_dict({ - "account": item.income_account, + "account": item.income_account if not item.enable_deferred_revenue else item.deferred_revenue_account, "against": self.customer, "credit": item.base_net_amount, "credit_in_account_currency": item.base_net_amount \ @@ -832,7 +832,7 @@ class SalesInvoice(SellingController): 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)) @@ -916,6 +916,86 @@ class SalesInvoice(SellingController): for entry in self.payments: if entry.amount < 0: frappe.throw(_("Row #{0} (Payment Table): Amount must be positive").format(entry.idx)) + + def book_income_for_deferred_revenue(self): + # book the income on the last day, but it will be trigger on the 1st of month at 12:00 AM + # start_date: 1st of the last month or the start date + # end_date: end_date or today-1 + + gl_entries = [] + for item in self.get('items'): + last_gl_entry = False + + booking_start_date = getdate(add_months(today(), -1)) + booking_start_date = booking_start_date if booking_start_date>item.service_start_date else item.service_start_date + + booking_end_date = getdate(add_days(today(), -1)) + if booking_end_date>=item.service_end_date: + last_gl_entry = True + booking_end_date = item.service_end_date + + total_days = date_diff(item.service_end_date, item.service_start_date) + total_booking_days = date_diff(booking_end_date, booking_start_date) + 1 + + account_currency = get_account_currency(item.income_account) + if not last_gl_entry: + base_amount = flt(item.base_net_amount*total_booking_days/flt(total_days), item.precision("base_net_amount")) + if account_currency==self.company_currency: + amount = base_amount + else: + amount = flt(item.net_amount*total_booking_days/flt(total_days), item.precision("net_amount")) + else: + gl_entries_details = frappe.db.sql(''' + select sum(debit) as total_debit, sum(debit_in_account_currency) as total_debit_in_account_currency, voucher_detail_no + from `tabGL Entry` where company=%s and account=%s and voucher_type=%s and voucher_no=%s and voucher_detail_no=%s + group by voucher_detail_no + ''', (self.company, item.deferred_revenue_account, "Sales Invoice", self.name, item.name), as_dict=True)[0] + base_amount = flt(item.base_net_amount - gl_entries_details.total_debit, item.precision("base_net_amount")) + if account_currency==self.company_currency: + amount = base_amount + else: + amount = flt(item.net_amount - gl_entries_details.total_debit_in_account_currency, item.precision("net_amount")) + + # GL Entry for crediting the amount in the income + gl_entries.append( + self.get_gl_dict({ + "account": item.income_account, + "against": self.customer, + "credit": base_amount, + "credit_in_account_currency": amount, + "cost_center": item.cost_center, + 'posting_date': booking_end_date + }, account_currency) + ) + # GL Entry to debit the amount from the deferred account + gl_entries.append( + self.get_gl_dict({ + "account": item.deferred_revenue_account, + "against": self.customer, + "debit": base_amount, + "debit_in_account_currency": amount, + "cost_center": item.cost_center, + "voucher_detail_no": item.name, + 'posting_date': booking_end_date + }, account_currency) + ) + + if gl_entries: + from erpnext.accounts.general_ledger import make_gl_entries + make_gl_entries(gl_entries, cancel=(self.docstatus == 2), merge_entries=True) + + +def booked_deferred_revenue(): + # check for the sales invoice for which GL entries has to be done + invoices = frappe.db.sql_list(''' + select parent from `tabSales Invoice Item` where service_start_date<=%s and service_end_date>=%s + ''', (today(), add_months(today(), -1))) + + # ToDo also find the list on the basic of the GL entry, and make another list + for invoice in invoices: + doc = frappe.get_doc("Sales Invoice", invoice) + doc.book_income_for_deferred_revenue() + def validate_inter_company_party(doctype, party, company, inter_company_invoice_reference): if doctype == "Sales Invoice": diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py index efd18b5215..71fce77695 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 @@ def get_data(): '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 @@ def get_data(): }, { 'label': _('Subscription'), - 'items': ['Subscription'] + 'items': ['Auto Repeat'] }, ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index bb735564eb..d1c1838d30 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -1,2367 +1,2633 @@ { - "allow_copy": 0, - "allow_guest_to_view": 0, - "allow_import": 0, - "allow_rename": 0, - "autoname": "hash", - "beta": 0, - "creation": "2013-06-04 11:02:19", - "custom": 0, - "docstatus": 0, - "doctype": "DocType", - "document_type": "Document", - "editable_grid": 1, - "engine": "InnoDB", + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "hash", + "beta": 0, + "creation": "2013-06-04 11:02:19", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", "fields": [ { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "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": 0, - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "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": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 4, - "fieldname": "item_code", - "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, - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "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": 1, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 4, + "fieldname": "item_code", + "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, + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "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": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "col_break1", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_break1", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "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": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "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": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "customer_item_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's Item Code", - "length": 0, - "no_copy": 0, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "customer_item_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's Item Code", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "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": "Edit 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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "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": "Edit 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": "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, - "print_width": "200px", - "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": "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, + "print_width": "200px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "200px" - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_8", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_8", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "image_view", - "fieldtype": "Image", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Image View", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "image_view", + "fieldtype": "Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Image View", + "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": 0, - "columns": 0, - "fieldname": "image", - "fieldtype": "Attach", - "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, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "image", + "fieldtype": "Attach", + "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, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "quantity_and_rate", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 1, - "collapsible": 0, - "columns": 2, - "fieldname": "qty", - "fieldtype": "Float", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Quantity", - "length": 0, - "no_copy": 0, - "oldfieldname": "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 2, + "fieldname": "qty", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Quantity", + "length": 0, + "no_copy": 0, + "oldfieldname": "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": "stock_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": "Stock UOM", - "length": 0, - "no_copy": 0, - "options": "UOM", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "stock_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": "Stock UOM", + "length": 0, + "no_copy": 0, + "options": "UOM", + "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, - "fieldname": "col_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, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_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, + "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": "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": "UOM", - "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": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "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": "UOM", + "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": 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": "conversion_factor", - "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": "UOM Conversion Factor", - "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": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "conversion_factor", + "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": "UOM Conversion Factor", + "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": 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": "stock_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": "Qty as per Stock UOM", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "stock_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": "Qty as per Stock UOM", + "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 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "section_break_17", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_17", + "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": "price_list_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": "Price List Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "price_list_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": "Price List Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "base_price_list_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": "Price List Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_price_list_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": "Price List Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "discount_and_margin", - "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": "Discount and Margin", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "discount_and_margin", + "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": "Discount and Margin", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "price_list_rate", - "fieldname": "margin_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": "Margin Type", - "length": 0, - "no_copy": 0, - "options": "\nPercentage\nAmount", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "price_list_rate", + "fieldname": "margin_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": "Margin Type", + "length": 0, + "no_copy": 0, + "options": "\nPercentage\nAmount", + "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": "eval:doc.margin_type && doc.price_list_rate", - "fieldname": "margin_rate_or_amount", - "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": "Margin Rate or Amount", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:doc.margin_type && doc.price_list_rate", + "fieldname": "margin_rate_or_amount", + "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": "Margin Rate or Amount", + "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": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", - "fieldname": "rate_with_margin", - "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": "Rate With Margin", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "2", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", + "fieldname": "rate_with_margin", + "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": "Rate With Margin", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "2", + "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, - "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, + "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, - "depends_on": "price_list_rate", - "fieldname": "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": "Discount (%) on Price List Rate with Margin", - "length": 0, - "no_copy": 0, - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "permlevel": 0, - "precision": "2", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "price_list_rate", + "fieldname": "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": "Discount (%) on Price List Rate with Margin", + "length": 0, + "no_copy": 0, + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "precision": "2", + "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": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", - "fieldname": "base_rate_with_margin", - "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": "Rate With Margin (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "2", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", + "fieldname": "base_rate_with_margin", + "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": "Rate With Margin (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "2", + "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, - "fieldname": "section_break1", - "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, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break1", + "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, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": 2, - "fieldname": "rate", - "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": "Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 1, + "collapsible": 0, + "columns": 2, + "fieldname": "rate", + "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": "Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 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": 2, - "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, - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "permlevel": 0, - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "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, + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 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": "col_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, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_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, + "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": "base_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": "Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_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": "Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "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, - "fieldname": "base_amount", - "fieldtype": "Currency", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 0, - "print_hide": 1, - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "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, - "fieldname": "pricing_rule", - "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": "Pricing Rule", - "length": 0, - "no_copy": 0, - "options": "Pricing Rule", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "pricing_rule", + "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": "Pricing Rule", + "length": 0, + "no_copy": 0, + "options": "Pricing Rule", + "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, - "fieldname": "section_break_21", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_21", + "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": "net_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": "Net Rate", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "net_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": "Net Rate", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "net_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": "Net Amount", - "length": 0, - "no_copy": 0, - "options": "currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "net_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": "Net Amount", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_24", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_24", + "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": "base_net_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": "Net Rate (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_net_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": "Net Rate (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "base_net_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": "Net Amount (Company Currency)", - "length": 0, - "no_copy": 0, - "options": "Company:company:default_currency", - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "base_net_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": "Net Amount (Company Currency)", + "length": 0, + "no_copy": 0, + "options": "Company:company:default_currency", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "collapsible_depends_on": "eval:doc.delivered_by_supplier==1", - "columns": 0, - "fieldname": "drop_ship", - "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": "Drop Ship", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": "eval:doc.delivered_by_supplier==1", + "columns": 0, + "fieldname": "drop_ship", + "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": "Drop Ship", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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", - "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, + "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", + "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": 1, - "columns": 0, - "fieldname": "accounting", - "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": "Accounting Details", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "accounting", + "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": "Accounting Details", + "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": "income_account", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Income Account", - "length": 0, - "no_copy": 0, - "oldfieldname": "income_account", - "oldfieldtype": "Link", - "options": "Account", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "120px", - "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": "income_account", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Income Account", + "length": 0, + "no_copy": 0, + "oldfieldname": "income_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "120px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "120px" - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "expense_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": "Expense Account", - "length": 0, - "no_copy": 0, - "options": "Account", - "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, - "unique": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "expense_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": "Expense Account", + "length": 0, + "no_copy": 0, + "options": "Account", + "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, "width": "120px" - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "col_break4", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "col_break4", + "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, - "default": ":Company", - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Cost Center", - "length": 0, - "no_copy": 0, - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "120px", - "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": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Cost Center", + "length": 0, + "no_copy": 0, + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "120px", + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "120px" - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "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": "Item Weight 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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "deferred_revenue", + "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": "Deferred Revenue", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "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, - "options": "", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "enable_deferred_revenue", + "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": "Enable Deferred Revenue", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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_weight", - "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": "Total Weight", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "enable_deferred_revenue", + "fieldname": "deferred_revenue_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": "Deferred Revenue Account", + "length": 0, + "no_copy": 0, + "options": "Account", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_21", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_50", + "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": "weight_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": "Weight UOM", - "length": 0, - "no_copy": 0, - "options": "UOM", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "enable_deferred_revenue", + "fieldname": "service_start_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Service 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": 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.serial_no || doc.batch_no", - "columns": 0, - "depends_on": "", - "fieldname": "warehouse_and_reference", - "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": "Stock Details", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "enable_deferred_revenue", + "fieldname": "service_end_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Service 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, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "warehouse", - "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": "Warehouse", - "length": 0, - "no_copy": 0, - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "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": "Item Weight 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": "target_warehouse", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 1, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Customer Warehouse (Optional)", - "length": 0, - "no_copy": 1, - "options": "Warehouse", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "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, + "options": "", + "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.__islocal", - "fieldname": "quality_inspection", - "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", - "length": 0, - "no_copy": 0, - "options": "Quality Inspection", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "total_weight", + "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": "Total Weight", + "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, - "fieldname": "batch_no", - "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": "Batch No", - "length": 0, - "no_copy": 0, - "options": "Batch", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_21", + "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": "col_break5", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "weight_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": "Weight UOM", + "length": 0, + "no_copy": 0, + "options": "UOM", + "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, - "fieldname": "allow_zero_valuation_rate", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Allow Zero Valuation Rate", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "collapsible_depends_on": "eval:doc.serial_no || doc.batch_no", + "columns": 0, + "depends_on": "", + "fieldname": "warehouse_and_reference", + "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": "Stock Details", + "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": "serial_no", - "fieldtype": "Small Text", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 1, - "in_standard_filter": 0, - "label": "Serial No", - "length": 0, - "no_copy": 0, - "oldfieldname": "serial_no", - "oldfieldtype": "Small 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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "warehouse", + "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": "Warehouse", + "length": 0, + "no_copy": 0, + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "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, - "description": "", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Group", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "target_warehouse", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 1, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Customer Warehouse (Optional)", + "length": 0, + "no_copy": 1, + "options": "Warehouse", + "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, - "fieldname": "brand", - "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": "Brand Name", - "length": 0, - "no_copy": 0, - "oldfieldname": "brand", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.__islocal", + "fieldname": "quality_inspection", + "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", + "length": 0, + "no_copy": 0, + "options": "Quality Inspection", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Item Tax Rate", - "length": 0, - "no_copy": 0, - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "batch_no", + "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": "Batch No", + "length": 0, + "no_copy": 0, + "options": "Batch", + "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": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "actual_batch_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": "Available Batch Qty at Warehouse", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "print_width": "150px", - "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": "col_break5", + "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": "allow_zero_valuation_rate", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Allow Zero Valuation Rate", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "serial_no", + "fieldtype": "Small Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Serial No", + "length": 0, + "no_copy": 0, + "oldfieldname": "serial_no", + "oldfieldtype": "Small 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", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Group", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "brand", + "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": "Brand Name", + "length": 0, + "no_copy": 0, + "oldfieldname": "brand", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Item Tax Rate", + "length": 0, + "no_copy": 0, + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "actual_batch_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": "Available Batch Qty at Warehouse", + "length": 0, + "no_copy": 1, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": "150px", + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0, "width": "150px" - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "actual_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": "Available Qty at Warehouse", - "length": 0, - "no_copy": 0, - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "actual_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": "Available Qty at Warehouse", + "length": 0, + "no_copy": 0, + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 1, - "columns": 0, - "fieldname": "edit_references", - "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": "References", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 1, + "columns": 0, + "fieldname": "edit_references", + "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": "References", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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_order", - "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": "Sales Order", - "length": 0, - "no_copy": 1, - "oldfieldname": "sales_order", - "oldfieldtype": "Link", - "options": "Sales Order", - "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": 1, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "sales_order", + "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": "Sales Order", + "length": 0, + "no_copy": 1, + "oldfieldname": "sales_order", + "oldfieldtype": "Link", + "options": "Sales Order", + "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": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "so_detail", - "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": "Sales Order Item", - "length": 0, - "no_copy": 1, - "oldfieldname": "so_detail", - "oldfieldtype": "Data", - "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": 1, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "so_detail", + "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": "Sales Order Item", + "length": 0, + "no_copy": 1, + "oldfieldname": "so_detail", + "oldfieldtype": "Data", + "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": 1, + "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_50", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_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": "delivery_note", - "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": "Delivery Note", - "length": 0, - "no_copy": 1, - "oldfieldname": "delivery_note", - "oldfieldtype": "Link", - "options": "Delivery Note", - "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": 1, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "delivery_note", + "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": "Delivery Note", + "length": 0, + "no_copy": 1, + "oldfieldname": "delivery_note", + "oldfieldtype": "Link", + "options": "Delivery Note", + "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": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "dn_detail", - "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": "Delivery Note Item", - "length": 0, - "no_copy": 1, - "oldfieldname": "dn_detail", - "oldfieldtype": "Data", - "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": 1, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "dn_detail", + "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": "Delivery Note Item", + "length": 0, + "no_copy": 1, + "oldfieldname": "dn_detail", + "oldfieldtype": "Data", + "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": 1, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "delivered_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": "Delivered Qty", - "length": 0, - "no_copy": 0, - "oldfieldname": "delivered_qty", - "oldfieldtype": "Currency", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "delivered_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": "Delivered Qty", + "length": 0, + "no_copy": 0, + "oldfieldname": "delivered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "is_fixed_asset", - "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": "Is Fixed Asset", - "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, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "is_fixed_asset", + "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": "Is Fixed Asset", + "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 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "asset", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Asset", - "length": 0, - "no_copy": 1, - "options": "Asset", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "asset", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Asset", + "length": 0, + "no_copy": 1, + "options": "Asset", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 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_54", - "fieldtype": "Section Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "section_break_54", + "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": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "page_break", - "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": "Page Break", - "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": 1, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "page_break", + "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": "Page Break", + "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": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, "unique": 0 } - ], - "has_web_view": 0, - "hide_heading": 0, - "hide_toolbar": 0, - "idx": 1, - "image_view": 0, - "in_create": 0, - "is_submittable": 0, - "issingle": 0, - "istable": 1, - "max_attachments": 0, - "modified": "2017-11-29 13:42:59.003120", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Sales Invoice Item", - "owner": "Administrator", - "permissions": [], - "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, + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 1, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-05-14 06:26:59.609228", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Item", + "owner": "Administrator", + "permissions": [], + "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/accounts/doctype/subscriber/__init__.py b/erpnext/accounts/doctype/subscriber/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/subscriber/subscriber.js b/erpnext/accounts/doctype/subscriber/subscriber.js new file mode 100644 index 0000000000..f5ea8047c6 --- /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 0000000000..28a57d8b1a --- /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 0000000000..03eb0f5ebb --- /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 0000000000..1fd4a1e011 --- /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 0000000000..3e2fc07c7b --- /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 8db5be8772..dcbec12f8b 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 7ff2e4b632..1165bede2d 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
New {{ doc.doctype }} #{{ doc.name }}
", - "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 480abd42ee..1edc138546 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 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() -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) @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 71e3cce79d..abcfc5e696 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 118188c29c..47efa45429 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 0000000000..e69de29bb2 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 0000000000..f5ea8047c6 --- /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 0000000000..c4bae1d3c3 --- /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 0000000000..6f459b4790 --- /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 0000000000..15d3df2a63 --- /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 0000000000..e60a4eeca9 --- /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 0000000000..e69de29bb2 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 0000000000..f5ea8047c6 --- /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 0000000000..ab58e7c3c6 --- /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 0000000000..4b8c8fcedd --- /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 0000000000..3ceb9a6050 --- /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 0000000000..73afbf620e --- /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 0000000000..e69de29bb2 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 0000000000..c112923397 --- /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 0000000000..1d9606ff78 --- /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 0000000000..e69de29bb2 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 0000000000..f5ea8047c6 --- /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 0000000000..8c7c6f34e5 --- /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 0000000000..cc378e4d9f --- /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 0000000000..5a751ea99c --- /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 0000000000..82c7e1d269 --- /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 0000000000..e69de29bb2 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 0000000000..e69de29bb2 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 0000000000..2e524d6e0f --- /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": "

{{_(\"Fiscal Year\")}}

\n\n

{{ _(\"New fiscal year created :- \") }} {{ doc.name }}

", + "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 0000000000..c674ab6d0e --- /dev/null +++ b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.md @@ -0,0 +1,3 @@ +

{{_("Fiscal Year")}}

+ +

{{ _("New fiscal year created :- ") }} {{ 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.py b/erpnext/accounts/email_alert/notification_for_new_fiscal_year/notification_for_new_fiscal_year.py new file mode 100644 index 0000000000..1bc4d1874c --- /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 a32e182abe..c07b851864 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -405,7 +405,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ } 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 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ 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 75089b2ff4..69b369f081 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -130,15 +130,15 @@ def get_default_price_list(party): 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 f39df3da3d..1066a3eb77 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -38,7 +38,7 @@ frappe.query_reports["Accounts Payable"] = { "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 5b68f1d2ab..9fefc03716 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -19,7 +19,13 @@

{%= __(report.report_name) %}

-

{%= filters.customer || filters.supplier %}

+

+ {% if (filters.customer_name) { %} + {%= filters.customer_name %} + {% } else { %} + {%= filters.customer || filters.supplier %} + {% } %} +

{% 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 2caf3590fb..d421b6ec96 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js @@ -23,8 +23,9 @@ frappe.query_reports["Accounts Receivable"] = { "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 @@ frappe.query_reports["Accounts Receivable"] = { "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 ca806bfc4a..8581a25446 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -151,6 +151,7 @@ class ReceivablePayableReport(object): # 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 @@ class ReceivablePayableReport(object): 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 c97db6db10..671408f5a1 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.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt } } -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 fc1779a8f1..35d2cf066d 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 d57b0e2568..cce4b2747b 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 @@ def get_data(): '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 @@ def get_data(): }, { '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/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index 7fae7b9fb1..d9032c8646 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -4,6 +4,9 @@ frappe.ui.form.on("Supplier", { setup: function (frm) { frm.set_query('default_price_list', { 'buying': 1 }); + if (frm.doc.__islocal == 1) { + frm.set_value("represents_company", ""); + } frm.set_query('account', 'accounts', function (doc, cdt, cdn) { var d = locals[cdt][cdn]; return { @@ -45,4 +48,13 @@ frappe.ui.form.on("Supplier", { erpnext.utils.set_party_dashboard_indicators(frm); } }, + + is_internal_supplier: function(frm) { + if (frm.doc.is_internal_supplier == 1) { + frm.toggle_reqd("represents_company", true); + } + else { + frm.toggle_reqd("represents_company", false); + } + } }); diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index b94710fa2a..722c2d2504 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 4321f27f2a..0387437b32 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 @@ def get_data(): 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 @@ def get_data(): }, { 'label': _('Subscription'), - 'items': ['Subscription'] + 'items': ['Auto Repeat'] }, ] diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index 6c7c298bd9..636c160d39 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -34,8 +34,8 @@ def get_data(): }, { "type": "doctype", - "name": "Subscription", - "label": _("Subscription"), + "name": "Auto Repeat", + "label": _("Auto Repeat"), "description": _("To make recurring documents") }, { diff --git a/erpnext/config/hr.py b/erpnext/config/hr.py index 5da0fbc20c..c2ccbd3905 100644 --- a/erpnext/config/hr.py +++ b/erpnext/config/hr.py @@ -200,52 +200,14 @@ def get_data(): { "type": "doctype", "name": "Employee Promotion", - } - ] - }, - { - "label": _("Recruitment"), - "items": [ - { - "type": "doctype", - "name": "Job Applicant", }, { "type": "doctype", - "name": "Job Opening", + "name": "Employee Separation" }, { "type": "doctype", - "name": "Job Offer", - }, - ] - }, - { - "label": _("Employee Lifecycle"), - "items": [ - { - "type": "doctype", - "name": "Employee Transfer", - }, - { - "type": "doctype", - "name": "Employee Promotion", - }, - { - "type": "doctype", - "name": "Employee Lifecycle Activity", - }, - { - "type": "doctype", - "name": "Employee Lifecycle Activity Type", - }, - { - "type": "doctype", - "name": "Employee Lifecycle Process Template", - }, - { - "type": "doctype", - "name": "Employee Lifecycle Process", + "name": "Employee Onboarding" } ] }, diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py index 878b2f2a0c..e38b30d5e0 100644 --- a/erpnext/config/setup.py +++ b/erpnext/config/setup.py @@ -81,12 +81,6 @@ def get_data(): "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 186aad3a5a..0c8e485f62 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -148,8 +148,13 @@ class AccountsController(TransactionBase): if self.meta.get_field("currency"): # price list part - fieldname = "selling_price_list" if buying_or_selling.lower() == "selling" \ - else "buying_price_list" + if buying_or_selling.lower() == "selling": + fieldname = "selling_price_list" + args = "for_selling" + else: + fieldname = "buying_price_list" + args = "for_buying" + if self.meta.get_field(fieldname) and self.get(fieldname): self.price_list_currency = frappe.db.get_value("Price List", self.get(fieldname), "currency") @@ -159,7 +164,7 @@ class AccountsController(TransactionBase): elif not self.plc_conversion_rate: self.plc_conversion_rate = get_exchange_rate(self.price_list_currency, - self.company_currency, transaction_date) + self.company_currency, transaction_date, args) # currency if not self.currency: @@ -169,7 +174,7 @@ class AccountsController(TransactionBase): self.conversion_rate = 1.0 elif not self.conversion_rate: self.conversion_rate = get_exchange_rate(self.currency, - self.company_currency, transaction_date) + self.company_currency, transaction_date, args) def set_missing_item_details(self, for_validate=False): """set missing item values""" @@ -198,7 +203,6 @@ class AccountsController(TransactionBase): 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 3bf720fd5d..8b6dd176e1 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -168,6 +168,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals 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 ab189cf1af..62295d4a69 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -83,15 +83,15 @@ def validate_returned_items(doc): 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 @@ def validate_quantity(doc, args, ref, valid_items, already_returned_items): 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 @@ def get_ref_item_dict(valid_items, ref_item_row): 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 047ef4a40e..658c7b4d3e 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -29,6 +29,7 @@ class calculate_taxes_and_totals(object): self.set_item_wise_tax_breakup() def _calculate(self): + self.validate_conversion_rate() self.calculate_item_values() self.initialize_taxes() self.determine_exclusive_rate() @@ -566,7 +567,8 @@ def get_itemised_tax_breakup_html(doc): itemised_tax=itemised_tax, itemised_taxable_amount=itemised_taxable_amount, tax_accounts=tax_accounts, - company_currency=erpnext.get_company_currency(doc.company) + conversion_rate=doc.conversion_rate, + currency=doc.currency ) ) diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index fc886ac69d..5c203d9e1b 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -227,7 +227,7 @@ def make_quotation(source_name, target_doc=None): exchange_rate = 1 else: exchange_rate = get_exchange_rate(quotation.currency, company_currency, - quotation.transaction_date) + quotation.transaction_date, args="for_selling") quotation.conversion_rate = exchange_rate diff --git a/erpnext/demo/user/purchase.py b/erpnext/demo/user/purchase.py index d9fc1f3c4a..327f617cc9 100644 --- a/erpnext/demo/user/purchase.py +++ b/erpnext/demo/user/purchase.py @@ -56,7 +56,7 @@ def work(): if company_currency == party_account_currency: exchange_rate = 1 else: - exchange_rate = get_exchange_rate(party_account_currency, company_currency) + exchange_rate = get_exchange_rate(party_account_currency, company_currency, args="for_buying") # make supplier quotations if random.random() < 0.2: diff --git a/erpnext/demo/user/sales.py b/erpnext/demo/user/sales.py index 2fd2565aad..02e1d427a5 100644 --- a/erpnext/demo/user/sales.py +++ b/erpnext/demo/user/sales.py @@ -89,7 +89,7 @@ def make_quotation(): if company_currency == party_account_currency: exchange_rate = 1 else: - exchange_rate = get_exchange_rate(party_account_currency, company_currency) + exchange_rate = get_exchange_rate(party_account_currency, company_currency, args="for_selling") qtn = frappe.get_doc({ "creation": frappe.flags.current_date, 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 0000000000..e91a2d0f66 Binary files /dev/null and b/erpnext/docs/assets/img/accounts/bulk-payment.gif 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 0000000000..a02a22244c Binary files /dev/null and b/erpnext/docs/assets/img/accounts/company-round-off-account.png 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 0000000000..912f966515 Binary files /dev/null and b/erpnext/docs/assets/img/accounts/exchange-rate-frozen.png differ diff --git a/erpnext/docs/assets/img/accounts/invoice.jpg b/erpnext/docs/assets/img/accounts/invoice.jpg new file mode 100644 index 0000000000..07688304b6 Binary files /dev/null and b/erpnext/docs/assets/img/accounts/invoice.jpg 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 0000000000..3eeb9c8836 Binary files /dev/null and b/erpnext/docs/assets/img/accounts/retail-hero.jpg 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 0000000000..2810026f7c Binary files /dev/null and b/erpnext/docs/assets/img/accounts/round-off-account.png 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 0000000000..215e71f943 Binary files /dev/null and b/erpnext/docs/assets/img/agriculture/land-unit.png 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 0000000000..9b2233c59b Binary files /dev/null and b/erpnext/docs/assets/img/agriculture/soil-texture.png differ diff --git a/erpnext/docs/assets/img/articles/subscriber.png b/erpnext/docs/assets/img/articles/subscriber.png new file mode 100644 index 0000000000..e4ce64d440 Binary files /dev/null and b/erpnext/docs/assets/img/articles/subscriber.png 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 0000000000..cbff30f906 Binary files /dev/null and b/erpnext/docs/assets/img/articles/subscription-1.png 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 0000000000..b60f796c2c Binary files /dev/null and b/erpnext/docs/assets/img/articles/subscription-plan.png 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 0000000000..405f0bf1a2 Binary files /dev/null and b/erpnext/docs/assets/img/articles/subscription-settings.png differ diff --git a/erpnext/docs/assets/img/education/assessment.png b/erpnext/docs/assets/img/education/assessment.png new file mode 100644 index 0000000000..b5581a8b97 Binary files /dev/null and b/erpnext/docs/assets/img/education/assessment.png 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 0000000000..4f53a1f8e6 Binary files /dev/null and b/erpnext/docs/assets/img/education/school-hero.png 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 0000000000..b431db16d4 Binary files /dev/null and b/erpnext/docs/assets/img/healthcare/appointment-analytics.png 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 0000000000..9c0970cc35 Binary files /dev/null and b/erpnext/docs/assets/img/healthcare/patient-appointment.png 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 317de4f093..0000000000 Binary files a/erpnext/docs/assets/img/human-resources/employee-loan-application.png and /dev/null 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 19f3181ec2..0000000000 Binary files a/erpnext/docs/assets/img/human-resources/employee-loan.png and /dev/null 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 0000000000..3c6cfd2889 Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/loan-application.png 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 0000000000..f2f71d48e9 Binary files /dev/null and b/erpnext/docs/assets/img/human-resources/loan.png differ diff --git a/erpnext/docs/assets/img/human-resources/repayment-schedule.png b/erpnext/docs/assets/img/human-resources/repayment-schedule.png index f2ddf02fab..31085c1a20 100644 Binary files a/erpnext/docs/assets/img/human-resources/repayment-schedule.png and b/erpnext/docs/assets/img/human-resources/repayment-schedule.png 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 0000000000..6f64dd8e1f Binary files /dev/null and b/erpnext/docs/assets/img/manufacturing/BOM-hero.png 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 0000000000..a74a63d3bf Binary files /dev/null and b/erpnext/docs/assets/img/manufacturing/manufacturing-hero.png 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 0000000000..c1f1a274b0 Binary files /dev/null and b/erpnext/docs/assets/img/manufacturing/purchase-order.png 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 0000000000..d7dfc6bf82 Binary files /dev/null and b/erpnext/docs/assets/img/non_profit/chapter.png 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 0000000000..176389f680 Binary files /dev/null and b/erpnext/docs/assets/img/non_profit/non-profit-hero-linus.png differ diff --git a/erpnext/docs/assets/img/project/projects.png b/erpnext/docs/assets/img/project/projects.png new file mode 100644 index 0000000000..8768b29465 Binary files /dev/null and b/erpnext/docs/assets/img/project/projects.png 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 0000000000..70e0c4e3e5 Binary files /dev/null and b/erpnext/docs/assets/img/project/services-hero.png differ diff --git a/erpnext/docs/assets/img/project/support.png b/erpnext/docs/assets/img/project/support.png new file mode 100644 index 0000000000..4026e7ce94 Binary files /dev/null and b/erpnext/docs/assets/img/project/support.png 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 0000000000..c1f1a274b0 Binary files /dev/null and b/erpnext/docs/assets/img/stock/purchase-order-hero.png 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 0000000000..fa222cdaeb Binary files /dev/null and b/erpnext/docs/assets/img/stock/stock-hero.jpg 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 d2762dd7b6..d9e1a6a2a1 100644 Binary files a/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png and b/erpnext/docs/assets/img/users-and-permissions/user-perms/new-user-permission.png 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 1f798d0637..bdd357cd3d 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 63e51f8c48..0000000000 --- a/erpnext/docs/user/manual/de/manufacturing/tools/production-planning-tool.md +++ /dev/null @@ -1,51 +0,0 @@ -# Werkzeug zur Fertigungsplanung -Beigetragen von CWT Connector & Wire Technology GmbH - -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 - -Werkzeug zur Fertigungsplanung - -### 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. - -Werkzeug zur Fertigungsplanung - -### Schritt 2: Artikel aus Kundenaufträgen abrufen - -Sie können Artikel hinzufügen, entfernen oder die Menge dieser Artikel verändern. - -Werkzeug zur Fertigungsplanung - -### Schritt 3: Fertigungsaufträge erstellen - -Werkzeug zur Fertigungsplanung - -### Schritt 4: Materialanfragen erstellen - -Erstellen Sie für Artikel mit prognostiziertem Engpass Materialanfragen. - -Werkzeug zur Fertigungsplanung - -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 0000000000..5b94f2c21e --- /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 + +Bulk Payment \ 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 0000000000..8e93c78e07 --- /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". + Exchange Rate Frozen +* 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 0000000000..97e6638f49 --- /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. + +Subscriber form + +### 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. + +Subscription Plan Form + +### 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. + +Subscription Settings Form + +## Creating A Subscription +To create a Subscription, go to the Subscription creation form +`Explore > Accounts > Subscriptions` + +Subscription form + +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 af8572c233..419196a02c 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 @@ withdrawing-salary-from-owners-equity-account 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 0000000000..c50159a4e3 --- /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? + +Fees Section + +**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. + Fees Section + +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 3f1d6eb64a..8fd348a975 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 @@ To check Budget Variance report, go to: [Click here to learn how to do budgeting from Cost Center](/docs/user/manual/en/accounts/budgeting.html). - \ No newline at end of file + diff --git a/erpnext/docs/user/manual/en/accounts/index.txt b/erpnext/docs/user/manual/en/accounts/index.txt index a7e27cd3f1..61e0db47ed 100644 --- a/erpnext/docs/user/manual/en/accounts/index.txt +++ b/erpnext/docs/user/manual/en/accounts/index.txt @@ -2,6 +2,7 @@ chart-of-accounts 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 166f2c56e6..c04c082453 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. - +POS Invoice -###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) +POS Invoice -#### 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. - -POS Customer - -### 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. - -POS Item - -> 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 - -POS Item - - -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. - -POS Payment - -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. - -POS Payment - -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. - -POS Payment - -### 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 - -POS Payment - -#### 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 -POS Payment -After sync of an order, email sent to the customer with the print of the bill in the attachment +
+ +
{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 0000000000..fe7484f3d4 --- /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). + + + +###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. + +POS Customer + +### 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. + +POS Item + +> 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 + +POS Item + + +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. + +POS Payment + +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. + +POS Payment + +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. + +POS Payment + +### 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 + +POS Payment + +#### 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 +POS Payment +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 932bb95948..772382345c 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. +Land Unit + +### 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. -Task +Soil Texture + +### 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 @@ The Agriculture module in ERPNext helps you keep track of your farming operation * Record sale of the harvest or transfer to warehouse for further processing * View reports -Task +To see feature of ERPNext Agriculture in action, check the following demo video.
-### 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 49dfd64e9c..ff505f00d5 100644 --- a/erpnext/docs/user/manual/en/education/index.md +++ b/erpnext/docs/user/manual/en/education/index.md @@ -1,8 +1,47 @@ -# Education + +# 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!** -Fees Section +School Hero + +### 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) + +Fees Section + +### 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. + +
+
+ +
+
+ +### 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 f13205f33f..62e537d27b 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. -ERPNext Healthcare +ERPNext Healthcare -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 +ERPNext Healthcare -{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. + +
+
+ +
+
+ +### 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 d8a548b5df..9457e1a765 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 @@ Employee can apply for loan by going to: > Human Resources > Loan Management > Loan Application > New Loan Application -Loan Application +Loan Application #### In the Loan Application, @@ -35,7 +35,7 @@ Once the Loan is approved, Manager can create Loan record for the Employee. > Human Resources > Loan Management > Loan > New Loan -Loan Application +Loan Application #### In the Loan, diff --git a/erpnext/docs/user/manual/en/manufacturing/index.md b/erpnext/docs/user/manual/en/manufacturing/index.md index cd397e84a2..13ef6f85b3 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 +BOM + +### 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). + +BOM + +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. + +
+ +
+ +### 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 a385154589..bdd357cd3d 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 4b7ee7afc6..0000000000 --- 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). - -
- -
- -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 - -Production Planing Tool - -#### 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. - -Production Planing Tool - - - -#### Step 3: Get Items - -* Get the items for the Sales Order / Material request list -* You can add/remove or change quantity of these Items. - -Production Planing Tool - -#### Step 4: Create Work Orders - -Production Planing Tool - - - -#### Step 5: Create Material Request - -Create Material Request for Items with projected shortfall. - -Production Planing Tool - - - -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 7d56f4d6cc..819cf79c77 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. +Non Profit -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 - +This will track all activity related to Memberships, Chapters, Volunteer Management, Donor Management, Event and Grant etc. -
-
- Non Profit Domain -
-
+Non Profit -### Non Profit Domain -Non Profit +### Demonstration of ERPNext Non-Profit Domain + +Check the following video to educate yourself on each feature in the non-profit module. + +
+
+ +
+
+ +### 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 95af437f24..e658eb847a 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. + +Gannt + +### 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. +Project 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. + +Non Profit + +### Demo on ERPNext for the Service Business + +Check the following video to educate yourself on the ERPNext features for services business. + +
+
+ +
+
+ +### 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 8b99894705..138a62e585 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 @@ To create new Authorization Rule, go to: 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 db444d1ebd..4ff84df075 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 @@ When you create a new record you will have to specify 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" - -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. - -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" -Ignore User Permissions on specific properties +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 75872eeb0d..ebf77161bf 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. + +ERPNext Stock + +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? +ERPNext Healthcare -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. +
+
+ +
+
-### 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 4457de0408..f10061c5cc 100644 --- a/erpnext/docs/user/videos/learn/index.md +++ b/erpnext/docs/user/videos/learn/index.md @@ -215,10 +215,6 @@ Bill of Materials 3:27 -
  • - Production Planning Tool - 1:41 -
  • Work Order 2:24 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 2af4c91d1a..0000000000 --- a/erpnext/docs/user/videos/learn/production-planning.md +++ /dev/null @@ -1,9 +0,0 @@ -# Production Planning Tool - - - -**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 5edc0378e1..8571bf9381 100644 --- a/erpnext/education/api.py +++ b/erpnext/education/api.py @@ -189,7 +189,7 @@ def get_course_schedule_events(start, end, filters=None): 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 9049a80bd9..9b7d89794c 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 2a7218a775..7346a8d55b 100644 --- a/erpnext/education/doctype/fees/fees.js +++ b/erpnext/education/doctype/fees/fees.js @@ -66,6 +66,9 @@ frappe.ui.form.on("Fees", { }; 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 d5103ca2ad..565074d878 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 @@ frappe.ui.form.on('Student Report Generation Tool', { 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 7b2e00713a..f9979752f7 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 @@ class StudentReportGenerationTool(Document): @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 @@ def preview_report_card(**kwargs): 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 @@ def preview_report_card(**kwargs): "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 451c4914b0..472a2f2946 100755 --- a/erpnext/healthcare/doctype/consultation/consultation.py +++ b/erpnext/healthcare/doctype/consultation/consultation.py @@ -108,9 +108,11 @@ def insert_consultation_to_medical_record(doc): 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 766491d318..c910d7cc88 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/lab_test.py @@ -244,7 +244,7 @@ def insert_lab_test_to_medical_record(doc): 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 b1150abb3a..b40f78d383 100644 --- a/erpnext/healthcare/doctype/patient/patient.js +++ b/erpnext/healthcare/doctype/patient/patient.js @@ -40,7 +40,7 @@ frappe.ui.form.on('Patient', { }, 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', { }); 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 @@ frappe.ui.form.on("Patient", "dob", function(frm) { $(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 c35e397801..dfff5a4f6e 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 @@ frappe.views.calendar["Patient Appointment"] = { '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 a42ff02ea2..41d9258a76 100644 --- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py +++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py @@ -27,7 +27,7 @@ def insert_vital_signs_to_medical_record(doc): 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 627455b021..938f7fa187 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -216,8 +216,8 @@ doc_events = { 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", @@ -236,6 +236,9 @@ scheduler_events = { "erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms", "erpnext.assets.doctype.asset.asset.update_maintenance_status", "erpnext.assets.doctype.asset.asset.make_post_gl_entry" + ], + "monthly": [ + "erpnext.accounts.doctype.sales_invoice.sales_invoice.booked_deferred_revenue" ] } @@ -277,4 +280,4 @@ regional_overrides = { 'Saudi Arabia': { 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data' } -} \ No newline at end of file +} diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 7b04f7dbae..ad162c69a1 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -8,6 +8,7 @@ from frappe.utils import getdate, nowdate 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): @@ -20,17 +21,19 @@ class Attendance(Document): set_employee_name(self) def check_leave_record(self): - leave_record = frappe.db.sql("""select leave_type, half_day from `tabLeave Application` - where employee = %s and %s between from_date and to_date + leave_record = frappe.db.sql("""select leave_type, half_day, half_day_date from `tabLeave Application` + where employee = %s and %s between from_date and to_date and status = 'Approved' and docstatus = 1""", (self.employee, self.attendance_date), as_dict=True) if leave_record: - if leave_record[0].half_day: - self.status = 'Half Day' - frappe.msgprint(_("Employee {0} on Half day on {1}").format(self.employee, self.attendance_date)) - else: - self.status = 'On Leave' - self.leave_type = leave_record[0].leave_type - frappe.msgprint(_("Employee {0} on Leave on {1}").format(self.employee, self.attendance_date)) + for d in leave_record: + if d.half_day_date == getdate(self.attendance_date): + self.status = 'Half Day' + frappe.msgprint(_("Employee {0} on Half day on {1}").format(self.employee, self.attendance_date)) + else: + self.status = 'On Leave' + self.leave_type = d.leave_type + frappe.msgprint(_("Employee {0} on Leave on {1}").format(self.employee, self.attendance_date)) + if self.status == "On Leave" and not leave_record: frappe.throw(_("No leave record found for employee {0} for {1}").format(self.employee, self.attendance_date)) @@ -54,3 +57,36 @@ class Attendance(Document): 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 0000000000..b21afe5eae --- /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 8f83db0852..a945312a52 100644 --- a/erpnext/hr/doctype/department/department.js +++ b/erpnext/hr/doctype/department/department.js @@ -2,22 +2,16 @@ // For license information, please see license.txt 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 - } - }; - }); + refresh: function(frm) { + // read-only for root department + if(!frm.doc.parent_department) { + cur_frm.set_read_only(); + cur_frm.set_intro(__("This is a root customer group and cannot be edited.")); + } + }, + validate: function(frm) { + if(frm.doc.name=="All Departments") { + frappe.throw(__("You cannot edit root node.")); + } } }); diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py index 19994ae5ef..6544390ee5 100644 --- a/erpnext/hr/doctype/department/department.py +++ b/erpnext/hr/doctype/department/department.py @@ -11,8 +11,11 @@ class Department(NestedSet): nsm_parent_field = 'parent_department' def autoname(self): - abbr = frappe.db.get_value('Company', self.company, 'abbr') - self.name = '{0} - {1}'.format(self.department_name, abbr) + if not self.department_name=="All Departments": + abbr = frappe.db.get_value('Company', self.company, 'abbr') + self.name = '{0} - {1}'.format(self.department_name, abbr) + else: + self.name = self.department_name def update_nsm_model(self): frappe.utils.nestedset.update_nsm(self) diff --git a/erpnext/hr/doctype/department_approver/department_approver.py b/erpnext/hr/doctype/department_approver/department_approver.py index b65e8ffd82..d30d801491 100644 --- a/erpnext/hr/doctype/department_approver/department_approver.py +++ b/erpnext/hr/doctype/department_approver/department_approver.py @@ -10,16 +10,6 @@ from frappe.model.document import Document 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 @@ def get_approvers(doctype, txt, searchfield, start, page_len, filters): 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/employee/employee.js b/erpnext/hr/doctype/employee/employee.js index 6f6873ac1d..7d153d432c 100755 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -37,6 +37,15 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({ }); frappe.ui.form.on('Employee',{ + setup: function(frm) { + frm.set_query("leave_policy", function() { + return { + "filters": { + "docstatus": 1 + } + }; + }); + }, onload:function(frm) { frm.set_query("department", function() { return { diff --git a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py index 3390e8ffe5..fab084698b 100644 --- a/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py +++ b/erpnext/hr/doctype/employee_onboarding/employee_onboarding.py @@ -10,7 +10,7 @@ from frappe.model.mapper import get_mapped_doc class EmployeeOnboarding(EmployeeBoardingController): - def validate(): + def validate(self): super(EmployeeOnboarding, self).validate() def validate_employee_creation(self): diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js index b31bf0ec45..23d158c7f0 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js @@ -11,14 +11,20 @@ frappe.ui.form.on('Employee Tax Exemption Declaration', { } }); frm.set_query('payroll_period', function() { - if(frm.doc.employee && frm.doc.company){ + const fields = {'employee': 'Employee', 'company': 'Company'}; + + for (let [field, label] of Object.entries(fields)) { + if (!frm.doc[field]) { + frappe.msgprint(__("Please select {0}", [label])) + } + }; + + if (frm.doc.employee && frm.doc.company){ return { filters: { 'company': frm.doc.company } } - }else { - frappe.msgprint(__("Please select Employee")); } }); frm.set_query('exemption_sub_category', 'declarations', function() { diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json index 3c361eea60..9dee848029 100644 --- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json +++ b/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json @@ -42,6 +42,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -67,12 +68,13 @@ "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 }, { @@ -102,6 +104,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -133,6 +136,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -163,6 +167,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -192,6 +197,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 }, { @@ -223,6 +229,7 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -236,7 +243,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-05-10 13:26:25.241545", + "modified": "2018-05-15 16:16:46.075493", "modified_by": "Administrator", "module": "HR", "name": "Employee Tax Exemption Declaration", @@ -245,7 +252,6 @@ "permissions": [ { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -265,7 +271,6 @@ }, { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -285,7 +290,6 @@ }, { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, @@ -305,7 +309,6 @@ }, { "amend": 1, - "apply_user_permissions": 0, "cancel": 1, "create": 1, "delete": 1, diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 5e0648827b..f9d1c43d63 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_amount = function(doc,cdt,cdn){ 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 @@ frappe.ui.form.on("Expense Claim", { }, 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 @@ frappe.ui.form.on("Expense Claim", { 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 @@ frappe.ui.form.on("Expense Claim", { } }); }, - + set_query_for_cost_center: function(frm) { frm.fields_dict["cost_center"].get_query = function() { return { @@ -262,7 +264,7 @@ frappe.ui.form.on("Expense Claim", { 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 f89beba2f6..3e031c9cce 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 @@ class TestExpenseClaim(unittest.TestCase): ]) 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 @@ def make_expense_claim(payable_account,claim_amount, sanctioned_amount, company, "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 @@ def make_expense_claim(payable_account,claim_amount, sanctioned_amount, company, 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 6b71ffcd1e..f417cb2b71 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 17d0a91b24..269195957a 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -78,8 +78,7 @@ def get_events(start, end, filters=None): 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 d1e02be1c6..225785d305 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 00f183e60a..2d5b18b6fb 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 76b5ae54fa..5f1c8830fb 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.js +++ b/erpnext/hr/doctype/leave_application/leave_application.js @@ -9,7 +9,19 @@ frappe.ui.form.on("Leave Application", { 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 @@ frappe.ui.form.on("Leave Application", { 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) { @@ -131,6 +138,9 @@ frappe.ui.form.on("Leave Application", { if (!r.exc && r.message) { frm.set_value('leave_balance', r.message); } + else { + frm.set_value('leave_balance', "0"); + } } }); } diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index d657ec4b9b..290120b5bf 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -689,6 +689,37 @@ "translatable": 0, "unique": 0 }, + { + "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, @@ -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 b33def2058..31fd3e6c93 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -9,11 +9,10 @@ from frappe.utils import cint, cstr, date_diff, flt, formatdate, getdate, get_li from erpnext.hr.utils import set_employee_name, get_leave_period from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee +from erpnext.buying.doctype.supplier_scorecard.supplier_scorecard import daterange class LeaveDayBlockedError(frappe.ValidationError): pass class OverlapError(frappe.ValidationError): pass -class InvalidLeaveApproverError(frappe.ValidationError): pass -class LeaveApproverIdentityError(frappe.ValidationError): pass class AttendanceAlreadyMarkedError(frappe.ValidationError): pass class NotAnOptionalHoliday(frappe.ValidationError): pass @@ -47,6 +46,7 @@ class LeaveApplication(Document): frappe.throw(_("Only Leave Applications with status 'Approved' and 'Rejected' can be submitted")) self.validate_back_dated_application() + self.update_attendance() # notify leave applier about approval self.notify_employee() @@ -112,6 +112,41 @@ class LeaveApplication(Document): frappe.throw(_("Leave cannot be applied/cancelled before {0}, as leave balance has already been carry-forwarded in the future leave allocation record {1}") .format(formatdate(future_allocation[0].from_date), future_allocation[0].name)) + def update_attendance(self): + if self.status == "Approved": + attendance = frappe.db.sql("""select name from `tabAttendance` where employee = %s\ + and (attendance_date between %s and %s) and docstatus < 2""",(self.employee, self.from_date, self.to_date), as_dict=1) + + if attendance: + for d in attendance: + doc = frappe.get_doc("Attendance", d.name) + if getdate(self.half_day_date) == doc.attendance_date: + status = "Half Day" + else: + status = "On Leave" + frappe.db.sql("""update `tabAttendance` set status = %s, leave_type = %s\ + where name = %s""",(status, self.leave_type, d.name)) + + elif self.from_date <= nowdate(): + for dt in daterange(getdate(self.from_date), getdate(self.to_date)): + date = dt.strftime("%Y-%m-%d") + if not date == self.half_day_date: + doc = frappe.new_doc("Attendance") + doc.employee = self.employee + doc.attendance_date = date + doc.company = self.company + doc.status = "On Leave" + doc.leave_type = self.leave_type + doc.submit() + else: + doc = frappe.new_doc("Attendance") + doc.employee = self.employee + doc.attendance_date = date + doc.company = self.company + doc.status = "Half Day" + doc.leave_type = self.leave_type + doc.submit() + def validate_salary_processed_days(self): if not frappe.db.get_value("Leave Type", self.leave_type, "is_lwp"): return @@ -265,24 +300,24 @@ class LeaveApplication(Document): }) 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) @@ -351,7 +386,7 @@ def get_leave_balance_on(employee, leave_type, date, allocation_records=None, if consider_all_leaves_in_the_allocation_period: date = allocation.to_date - leaves_taken = get_leaves_for_period(employee, leave_type, allocation.from_date, date, status=Approved) + leaves_taken = get_leaves_for_period(employee, leave_type, allocation.from_date, date, status="Approved") if frappe.db.get_value("Leave Type", leave_type, 'allow_encashment') and consider_encshed_leaves: leaves_encashed = flt(allocation.total_leaves_encashed) @@ -438,7 +473,6 @@ def get_events(start, end, filters=None): 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) @@ -465,10 +499,12 @@ def add_department_leaves(events, start, end, employee, company): def add_leaves(events, start, end, match_conditions=None): 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""" + and docstatus < 2 + and status!="Rejected" """ + if match_conditions: query += match_conditions @@ -478,9 +514,10 @@ def add_leaves(events, start, end, match_conditions=None): "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) @@ -517,3 +554,51 @@ def add_holidays(events, start, end, employee, company): "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 + +def get_approved_leaves_for_period(employee, leave_type, from_date, to_date): + query = """ + select employee, leave_type, from_date, to_date, total_leave_days + from `tabLeave Application` + where employee=%(employee)s + and docstatus=1 + and (from_date between %(from_date)s and %(to_date)s + or to_date between %(from_date)s and %(to_date)s + or (from_date < %(from_date)s and to_date > %(to_date)s)) + """ + if leave_type: + query += "and leave_type=%(leave_type)s" + + leave_applications = frappe.db.sql(query,{ + "from_date": from_date, + "to_date": to_date, + "employee": employee, + "leave_type": leave_type + }, as_dict=1) + + leave_days = 0 + for leave_app in leave_applications: + if leave_app.from_date >= getdate(from_date) and leave_app.to_date <= getdate(to_date): + leave_days += leave_app.total_leave_days + else: + if leave_app.from_date < getdate(from_date): + leave_app.from_date = from_date + if leave_app.to_date > getdate(to_date): + leave_app.to_date = to_date + + leave_days += get_number_of_leave_days(employee, leave_type, + leave_app.from_date, leave_app.to_date) + + return leave_days + diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 9b9e964e3b..eb43d5a9ed 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 @@ class TestLeaveApplication(unittest.TestCase): 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 @@ class TestLeaveApplication(unittest.TestCase): 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 @@ class TestLeaveApplication(unittest.TestCase): 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/leave_period/leave_period.py b/erpnext/hr/doctype/leave_period/leave_period.py index 1ef6f196d4..4097169ad8 100644 --- a/erpnext/hr/doctype/leave_period/leave_period.py +++ b/erpnext/hr/doctype/leave_period/leave_period.py @@ -60,7 +60,6 @@ class LeavePeriod(Document): frappe.throw(_("Employee {0} already have Leave Allocation {1} for this period").format(employee, leave_alloc[0][0])\ + """ {0}""".format(leave_alloc[0][0])) - def validate_dates(self): if getdate(self.from_date) >= getdate(self.to_date): frappe.throw(_("To date can not be equal or less than from date")) @@ -79,3 +78,4 @@ class LeavePeriod(Document): allocation.carry_forward = self.carry_forward_leaves allocation.save(ignore_permissions = True) allocation.submit() + frappe.msgprint(_("Leave Allocation {0} created").format(allocation.name)) diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/hr/doctype/payroll_entry/payroll_entry.py index 0dd2b4cb07..aa27e5b48f 100644 --- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py +++ b/erpnext/hr/doctype/payroll_entry/payroll_entry.py @@ -184,7 +184,7 @@ class PayrollEntry(Document): 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 @@ class PayrollEntry(Document): }) 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 fe5a7551c6..2a9d87c754 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 @@ class TestPayrollEntry(unittest.TestCase): 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 a99a919406..cec53563a6 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -29,9 +29,10 @@ frappe.ui.form.on("Salary Slip", { }) }, - 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 @@ frappe.ui.form.on("Salary Slip", { 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 @@ frappe.ui.form.on('Salary Slip Timesheet', { // 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.start_date = function(doc, dt, dn){ } } -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 6f5c923a35..ca92234461 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', { } }); +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/hr/employee_property_update.js b/erpnext/hr/employee_property_update.js index 473916ca42..60d06b41f0 100644 --- a/erpnext/hr/employee_property_update.js +++ b/erpnext/hr/employee_property_update.js @@ -57,7 +57,10 @@ var show_dialog = function(frm, table, field_labels) { primary_action_label: __('Add to Details'), primary_action: () => { d.get_primary_btn().attr('disabled', true); - if(d.data){ + if(d.data) { + var input = $('[data-fieldname="field_html"] input'); + d.data.new = input.val(); + $(input).remove(); add_to_details(frm, d, table); } } @@ -99,11 +102,6 @@ var render_dynamic_field = function(d, fieldtype, options, fieldname) { }); dynamic_field.make_input(); $(dynamic_field.label_area).text(__("New")); - dynamic_field.$input.on("change", function(e) { - d.data.new = e.target.value; - }).on("awesomplete-close", function(e) { - d.data.new = e.target.value; - }); }; var add_to_details = function(frm, d, table) { diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py index 698c4fbd7c..0c338e0136 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py @@ -22,6 +22,10 @@ def execute(filters=None): holiday_map = get_holiday(holiday_list, filters["month"]) data = [] + leave_types = frappe.db.sql("""select name from `tabLeave Type`""", as_list=True) + leave_list = [d[0] for d in leave_types] + columns.extend(leave_list) + for emp in sorted(att_map): emp_det = emp_map.get(emp) if not emp_det: @@ -49,10 +53,35 @@ def execute(filters=None): elif status == "Half Day": total_p += 0.5 total_a += 0.5 + total_l += 0.5 row += [total_p, total_l, total_a] - data.append(row) + if not filters.get("employee"): + filters.update({"employee": emp}) + conditions += " and employee = %(employee)s" + elif not filters.get("employee") == emp: + filters.update({"employee": emp}) + + leave_details = frappe.db.sql("""select leave_type, status, count(*) as count from `tabAttendance`\ + where leave_type is not NULL %s group by leave_type, status""" % conditions, filters, as_dict=1) + + leaves = {} + for d in leave_details: + if d.status == "Half Day": + d.count = d.count * 0.5 + if d.leave_type in leaves: + leaves[d.leave_type] += d.count + else: + leaves[d.leave_type] = d.count + + for d in leave_list: + if d in leaves: + row.append(leaves[d]) + else: + row.append("0.0") + + data.append(row) return columns, data def get_columns(filters): diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py index 5c64b2ef2c..df720c4cc6 100644 --- a/erpnext/hr/utils.py +++ b/erpnext/hr/utils.py @@ -21,11 +21,11 @@ class EmployeeBoardingController(Document): def on_submit(self): # create the project for the given employee onboarding - project_name = _(self.doctype) + " : " + self.employee_name + project_name = _(self.doctype) + " : " if self.doctype == "Employee Onboarding": - project_name += " (" + self.job_applicant + ")" + project_name += self.job_applicant else: - project_name += " (" + self.employee + ")" + project_name += self.employee project = frappe.get_doc({ "doctype": "Project", "project_name": project_name, diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 007299a798..1fbc8068db 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -303,7 +303,7 @@ class BOM(WebsiteGenerator): if self.currency == self.company_currency(): self.conversion_rate = 1 elif self.conversion_rate == 1 or flt(self.conversion_rate) <= 0: - self.conversion_rate = get_exchange_rate(self.currency, self.company_currency()) + self.conversion_rate = get_exchange_rate(self.currency, self.company_currency(), args="for_buying") def validate_materials(self): """ Validate raw material entries """ @@ -591,6 +591,7 @@ def get_bom_items_as_dict(bom, company, qty=1, fetch_exploded=1, fetch_scrap_ite @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 e6bdc26a78..1cc2459ab2 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 8b53fc390e..90a714940d 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -567,7 +567,7 @@ def get_item_details(item, project = None): 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 33206904d6..e9554b1f55 100644 --- a/erpnext/non_profit/doctype/chapter/chapter.py +++ b/erpnext/non_profit/doctype/chapter/chapter.py @@ -35,7 +35,6 @@ def get_list_context(context): context.title = 'All Chapters' context.no_breadcrumbs = True context.order_by = 'creation desc' - context.introduction = '

    All Chapters

    ' @frappe.whitelist() @@ -47,4 +46,4 @@ def leave(title, user_id, leave_reason): 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 70f4ecd71e..fa2251f042 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -523,6 +523,12 @@ erpnext.patches.v11_0.update_department_lft_rgt 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 @@ -531,3 +537,4 @@ erpnext.patches.v11_0.rename_supplier_type_to_supplier_group erpnext.patches.v11_0.create_department_records_for_each_company erpnext.patches.v11_0.make_location_from_warehouse erpnext.patches.v11_0.make_asset_finance_book_against_old_entries +erpnext.patches.v11_0.check_buying_selling_in_currency_exchange 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 0000000000..083b7f4b20 --- /dev/null +++ b/erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py @@ -0,0 +1,21 @@ +# 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 + + if ss.default_warehouse \ + and not frappe.db.exists("Warehouse", ss.default_warehouse): + ss.default_warehouse = None + + if ss.stock_uom and not frappe.db.exists("UOM", ss.stock_uom): + ss.stock_uom = None + + ss.flags.ignore_mandatory = True + 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 0000000000..1ae8b4a54e --- /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 0000000000..e69de29bb2 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 0000000000..7573f1568f --- /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 0000000000..481c5571b5 --- /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/check_buying_selling_in_currency_exchange.py b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py new file mode 100644 index 0000000000..ee336be3b5 --- /dev/null +++ b/erpnext/patches/v11_0/check_buying_selling_in_currency_exchange.py @@ -0,0 +1,5 @@ +import frappe + +def execute(): + frappe.reload_doc('setup', 'doctype', 'currency_exchange') + frappe.db.sql("""update `tabCurrency Exchange` set for_buying = 1, for_selling = 1""") \ No newline at end of file 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 0000000000..29687d2692 --- /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/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py index 94071857d7..6f869b0042 100644 --- a/erpnext/patches/v11_0/create_department_records_for_each_company.py +++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py @@ -2,7 +2,9 @@ import frappe from frappe.utils.nestedset import rebuild_tree def execute(): - frappe.reload_doc("hr", "doctype", "department") + for doctype in ['department', 'leave_period', 'staffing_plan', 'job_opening']: + frappe.reload_doc("hr", "doctype", doctype) + companies = frappe.db.get_all("Company", fields=["name", "abbr"]) departments = frappe.db.get_all("Department") comp_dict = {} 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 0000000000..a19a6c47b6 --- /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 07af7129f6..ac9db31a37 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 7fbeaee693..1e36a95efd 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -87,25 +87,27 @@ frappe.ui.form.on("Project", { } }); }, - 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 @@ frappe.ui.form.on("Project", { }) }, - 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/project/project.py b/erpnext/projects/doctype/project/project.py index abb497c397..93ff62d758 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -77,8 +77,8 @@ class Project(Document): def validate_weights(self): sum = 0 for task in self.tasks: - if task.task_weight or 0 > 0: - sum = sum + task.task_weight + if task.task_weight > 0: + sum = flt(sum + task.task_weight, task.precision('task_weight')) if sum > 0 and sum != 1: frappe.throw( _("Total of all task weights should be 1. Please adjust weights of all Project tasks accordingly")) diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json index c1b7aa1c60..9323e206e9 100644 --- a/erpnext/projects/doctype/task/task.json +++ b/erpnext/projects/doctype/task/task.json @@ -497,6 +497,37 @@ "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": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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, diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json index b9482384a8..b1f737296d 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 5baf84873e..3f664ae421 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -145,6 +145,8 @@ cur_frm.cscript.account_head = function(doc, cdt, cdn) { 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 eb4a7001f3..ef0fe8d783 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -106,7 +106,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } if( - this.frm.docstatus < 2 + this.frm.docstatus < 2 && this.frm.fields_dict["payment_terms_template"] && this.frm.fields_dict["payment_schedule"] && this.frm.doc.payment_terms_template @@ -296,7 +296,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ 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 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ 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); @@ -601,14 +599,13 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ /* manqala 19/09/2016: let the translation date be whichever of the transaction_date or posting_date is available */ var transaction_date = this.frm.doc.transaction_date || this.frm.doc.posting_date; /* end manqala */ - var me = this; this.set_dynamic_labels(); - var company_currency = this.get_company_currency(); // Added `ignore_pricing_rule` to determine if document is loading after mapping from another doc if(this.frm.doc.currency && this.frm.doc.currency !== company_currency && !this.frm.doc.ignore_pricing_rule) { + this.get_exchange_rate(transaction_date, this.frm.doc.currency, company_currency, function(exchange_rate) { me.frm.set_value("conversion_rate", exchange_rate); @@ -670,13 +667,22 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }, get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) { + var args; + if (["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"].includes(this.frm.doctype)) { + args = "for_selling"; + } + else if (["Purchase Order", "Purchase Receipt", "Purchase Invoice"].includes(this.frm.doctype)) { + args = "for_buying"; + } + if (!transaction_date || !from_currency || !to_currency) return; return frappe.call({ method: "erpnext.setup.utils.get_exchange_rate", args: { transaction_date: transaction_date, from_currency: from_currency, - to_currency: to_currency + to_currency: to_currency, + args: args }, callback: function(r) { callback(flt(r.message)); @@ -1099,6 +1105,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ me.in_apply_price_list = false; } } + }).always(() => { + me.in_apply_price_list = false; }); }, diff --git a/erpnext/public/js/help_links.js b/erpnext/public/js/help_links.js index e812f19ced..fa843bc984 100644 --- a/erpnext/public/js/help_links.js +++ b/erpnext/public/js/help_links.js @@ -504,10 +504,6 @@ frappe.help.help_links['Form/Operation'] = [ { 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 0e6017987a..a9ac8c4e61 100644 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -69,7 +69,7 @@ $.extend(erpnext, { "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 50a2e0de8f..f9e01561f8 100644 --- a/erpnext/regional/report/gstr_1/gstr_1.py +++ b/erpnext/regional/report/gstr_1/gstr_1.py @@ -143,7 +143,17 @@ class Gstr1Report(object): """ % (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 0000000000..e69de29bb2 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 0000000000..df0ef25315 --- /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 0000000000..0cafdc89fe --- /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 0000000000..165458c4d5 --- /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/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index ed8e6c8f5f..88e66ca668 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -5,7 +5,6 @@ frappe.ui.form.on("Customer", { setup: function(frm) { frm.add_fetch('lead_name', 'company_name', 'customer_name'); frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate'); - frm.set_query('customer_group', {'is_group': 0}); frm.set_query('default_price_list', { 'selling': 1}); frm.set_query('account', 'accounts', function(doc, cdt, cdn) { @@ -19,12 +18,15 @@ frappe.ui.form.on("Customer", { if(doc.party_account_currency) { $.extend(filters, {"account_currency": doc.party_account_currency}); } - return { filters: filters } }); + if (frm.doc.__islocal == 1) { + frm.set_value("represents_company", ""); + } + frm.set_query('customer_primary_contact', function(doc) { return { query: "erpnext.selling.doctype.customer.customer.get_customer_primary_contact", @@ -58,6 +60,16 @@ frappe.ui.form.on("Customer", { frm.set_value("primary_address", ""); } }, + + is_internal_customer: function(frm) { + if (frm.doc.is_internal_customer == 1) { + frm.toggle_reqd("represents_company", true); + } + else { + frm.toggle_reqd("represents_company", false); + } + }, + customer_primary_contact: function(frm){ if(!frm.doc.customer_primary_contact){ frm.set_value("mobile_no", ""); @@ -73,7 +85,6 @@ frappe.ui.form.on("Customer", { } frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Customer'} - frm.toggle_display(['address_html','contact_html','primary_address_and_contact_detail'], !frm.doc.__islocal); if(!frm.doc.__islocal) { diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json index e38f6b3e02..881a6a5dbc 100644 --- a/erpnext/selling/doctype/customer/customer.json +++ b/erpnext/selling/doctype/customer/customer.json @@ -493,7 +493,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 0, "set_only_once": 0, "translatable": 0, @@ -1625,7 +1625,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-04-19 12:19:35.311509", + "modified": "2018-05-15 15:58:22.255321", "modified_by": "Administrator", "module": "Selling", "name": "Customer", diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 239b5320ac..5a95b55d65 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -317,7 +317,7 @@ def make_address(args, is_primary_address=1): return address def get_customer_primary_contact(doctype, txt, searchfield, start, page_len, filters): - customer = frappe.db.escape(filters.get('customer')) + customer = filters.get('customer') return frappe.db.sql(""" select `tabContact`.name from `tabContact`, `tabDynamic Link` where `tabContact`.name = `tabDynamic Link`.parent and `tabDynamic Link`.link_name = %(customer)s diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 92db12be91..63e85fd0ab 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -206,11 +206,6 @@ cur_frm.cscript['Declare Order Lost'] = function(){ } -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 0d4835ebdb..b58cd4ef1f 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 6d9c170aef..dbb1e9f86e 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -103,7 +103,7 @@ class Quotation(SellingController): 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 c6297e22ab..d32fd0cfed 100644 --- a/erpnext/selling/doctype/quotation/quotation_dashboard.py +++ b/erpnext/selling/doctype/quotation/quotation_dashboard.py @@ -4,7 +4,7 @@ def get_data(): return { 'fieldname': 'prevdoc_docname', 'non_standard_fieldnames': { - 'Subscription': 'reference_document', + 'Auto Repeat': 'reference_document', }, 'transactions': [ { @@ -13,7 +13,7 @@ def get_data(): }, { '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 20685deaac..9a2311d6b0 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -442,11 +442,6 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( 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 f302c1cd1c..711f9f4030 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 72723eb115..7e6c3dcbae 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -13,7 +13,7 @@ from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty 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 @@ class SalesOrder(SellingController): )) 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 34ed6bce57..35c643de6c 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 @@ def get_data(): '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 @@ def get_data(): }, { '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 aa5b3ba498..d6f4677f8e 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -186,25 +186,32 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ 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 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ 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 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ }, 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 0000000000..e8494a1f96 --- /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.json b/erpnext/setup/doctype/company/company.json index 07051eeba8..e2f6adfebb 100644 --- a/erpnext/setup/doctype/company/company.json +++ b/erpnext/setup/doctype/company/company.json @@ -1217,6 +1217,39 @@ "translatable": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:!doc.__islocal", + "fieldname": "default_deferred_revenue_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 Deferred Revenue Account", + "length": 0, + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2496,7 +2529,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-07 15:35:06.736602", + "modified": "2018-05-14 06:02:22.105952", "modified_by": "Administrator", "module": "Setup", "name": "Company", diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 9040bb7c8f..a2feddc529 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -126,6 +126,7 @@ class Company(NestedSet): 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 @@ class Company(NestedSet): 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/currency_exchange/currency_exchange.json b/erpnext/setup/doctype/currency_exchange/currency_exchange.json index 76e1a6b97e..89c373603b 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.json +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 0, "beta": 0, @@ -13,6 +14,7 @@ "engine": "InnoDB", "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -23,7 +25,9 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Date", "length": 0, "no_copy": 0, @@ -32,14 +36,17 @@ "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, "width": "5" }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -50,6 +57,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": "From Currency", @@ -65,10 +73,12 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "3" }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -79,6 +89,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": "To Currency", @@ -94,10 +105,12 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "3" }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -108,6 +121,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": "Exchange Rate", @@ -123,22 +137,117 @@ "reqd": 1, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "3" + }, + { + "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, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fieldname": "for_buying", + "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": "For Buying", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "for_selling", + "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": "For Selling", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "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-exchange", "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-08 05:28:09.772560", + "modified": "2018-05-15 11:23:35.639039", "modified_by": "Administrator", "module": "Setup", "name": "Currency Exchange", @@ -146,7 +255,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, @@ -154,7 +262,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -167,7 +274,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -175,7 +281,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -188,7 +293,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -196,7 +300,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -209,7 +312,6 @@ }, { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 0, "delete": 0, @@ -217,7 +319,6 @@ "export": 0, "if_owner": 0, "import": 0, - "is_custom": 0, "permlevel": 0, "print": 1, "read": 1, @@ -232,8 +333,10 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, "sort_field": "name", "sort_order": "DESC", "title_field": "", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py index ab892fb41b..4effb5ab01 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe -from frappe import _ +from frappe import _, throw from frappe.model.document import Document -from frappe.utils import get_datetime_str, formatdate, nowdate +from frappe.utils import get_datetime_str, formatdate, nowdate, cint class CurrencyExchange(Document): def autoname(self): @@ -20,4 +20,7 @@ class CurrencyExchange(Document): self.validate_value("exchange_rate", ">", 0) if self.from_currency == self.to_currency: - frappe.throw(_("From Currency and To Currency cannot be same")) + throw(_("From Currency and To Currency cannot be same")) + + if not cint(self.for_buying) and not cint(self.for_selling): + throw(_("Currency Exchange must be applicable for Buying or for Selling.")) \ No newline at end of file diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.js b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.js new file mode 100644 index 0000000000..19fde2e148 --- /dev/null +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.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: Currency Exchange", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Currency Exchange + () => frappe.tests.make('Currency Exchange', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/setup/doctype/notification_control/README.md b/erpnext/setup/doctype/notification_control/README.md deleted file mode 100644 index 3c411b7a82..0000000000 --- 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 baffc48825..0000000000 --- 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 7f58ede1df..0000000000 --- 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.py b/erpnext/setup/doctype/notification_control/notification_control.py deleted file mode 100644 index c50bacac4c..0000000000 --- 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 8548f92dfa..03da833dec 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -5,6 +5,7 @@ from __future__ import print_function, unicode_literals 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 @@ def after_install(): 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_print_zero_amount_taxes_custom_field(): 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 7fe7f0c2bc..7f9795bcfd 100644 --- a/erpnext/setup/setup_wizard/operations/company_setup.py +++ b/erpnext/setup/setup_wizard/operations/company_setup.py @@ -113,8 +113,7 @@ def create_logo(args): " {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 d13767648d..8ca213b1a0 100644 --- a/erpnext/setup/setup_wizard/operations/default_website.py +++ b/erpnext/setup/setup_wizard/operations/default_website.py @@ -12,7 +12,7 @@ class website_maker(object): 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 @@ class website_maker(object): 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 @@ class website_maker(object): 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 08b8a06013..086b60e306 100644 --- a/erpnext/setup/setup_wizard/operations/defaults_setup.py +++ b/erpnext/setup/setup_wizard/operations/defaults_setup.py @@ -36,6 +36,7 @@ def set_default_settings(args): 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 @@ def set_default_settings(args): 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/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index 7d842bb1c1..f2eaece7db 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -104,22 +104,6 @@ def install(country=None): {'doctype': 'Employment Type', 'employee_type_name': _('Intern')}, {'doctype': 'Employment Type', 'employee_type_name': _('Apprentice')}, - # Department - {'doctype': 'Department', 'department_name': _('All Departments'), 'is_group': 1, 'parent_department': ''}, - {'doctype': 'Department', 'department_name': _('Accounts'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Marketing'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Sales'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Purchase'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Operations'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Production'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Dispatch'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Customer Service'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Human Resources'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Management'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Quality Management'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Research & Development'), 'parent_department': _('All Departments')}, - {'doctype': 'Department', 'department_name': _('Legal'), 'parent_department': _('All Departments')}, - # Designation {'doctype': 'Designation', 'designation_name': _('CEO')}, {'doctype': 'Designation', 'designation_name': _('Manager')}, @@ -276,6 +260,14 @@ def install(country=None): from erpnext.buying.doctype.supplier_scorecard.supplier_scorecard import make_default_records make_default_records() + make_fixture_records(records) + + # set default customer group and territory + selling_settings = frappe.get_doc("Selling Settings") + selling_settings.set_default_customer_group_and_territory() + selling_settings.save() + +def make_fixture_records(records): from frappe.modules import scrub for r in records: doc = frappe.new_doc(r.get("doctype")) @@ -296,7 +288,23 @@ def install(country=None): else: raise - # set default customer group and territory - selling_settings = frappe.get_doc("Selling Settings") - selling_settings.set_default_customer_group_and_territory() - selling_settings.save() +def install_post_company_fixtures(company=None): + records = [ + # Department + {'doctype': 'Department', 'department_name': _('All Departments'), 'is_group': 1, 'parent_department': ''}, + {'doctype': 'Department', 'department_name': _('Accounts'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Marketing'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Sales'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Purchase'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Operations'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Production'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Dispatch'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Customer Service'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Human Resources'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Management'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Quality Management'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Research & Development'), 'parent_department': _('All Departments'), 'company': company}, + {'doctype': 'Department', 'department_name': _('Legal'), 'parent_department': _('All Departments'), 'company': company}, + ] + + make_fixture_records(records) diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index d6491a8659..101b6aa2c0 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -55,6 +55,11 @@ def get_setup_stages(args=None): 'status': _('Setting defaults'), 'fail_msg': 'Failed to set defaults', 'tasks': [ + { + 'fn': setup_post_company_fixtures, + 'args': args, + 'fail_msg': _("Failed to setup post company fixtures") + }, { 'fn': stage_three, 'args': args, @@ -92,6 +97,7 @@ def setup_complete(args=None): stage_fixtures(args) setup_company(args) setup_taxes(args) + setup_post_company_fixtures(args) stage_three(args) stage_four(args) fin(args) @@ -108,6 +114,9 @@ def setup_company(args): def setup_taxes(args): taxes_setup.create_sales_tax(args) +def setup_post_company_fixtures(args): + install_fixtures.install_post_company_fixtures(args.get("company_name")) + def stage_three(args): defaults_setup.create_employee_for_self(args) defaults_setup.set_default_settings(args) diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py index 8d9bba3ff8..bc17f8884f 100644 --- a/erpnext/setup/utils.py +++ b/erpnext/setup/utils.py @@ -55,17 +55,15 @@ def before_tests(): frappe.db.commit() @frappe.whitelist() -def get_exchange_rate(from_currency, to_currency, transaction_date=None): +def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=None): if not (from_currency and to_currency): # manqala 19/09/2016: Should this be an empty return or should it throw and exception? return - if from_currency == to_currency: return 1 if not transaction_date: transaction_date = nowdate() - currency_settings = frappe.get_doc("Accounts Settings").as_dict() allow_stale_rates = currency_settings.get("allow_stale") @@ -75,6 +73,11 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None): ["to_currency", "=", to_currency] ] + if args == "for_buying": + filters.append(["for_buying", "=", "1"]) + elif args == "for_selling": + filters.append(["for_selling", "=", "1"]) + if not allow_stale_rates: stale_days = currency_settings.get("stale_days") checkpoint_date = add_days(transaction_date, -stale_days) @@ -84,7 +87,6 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None): entries = frappe.get_all( "Currency Exchange", fields=["exchange_rate"], filters=filters, order_by="date desc", limit=1) - if entries: return flt(entries[0].exchange_rate) diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py index 33cac17304..e62d633a67 100644 --- a/erpnext/shopping_cart/product_info.py +++ b/erpnext/shopping_cart/product_info.py @@ -33,7 +33,7 @@ def get_product_info_for_website(item_code): "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 @@ def set_product_info_for_website(item): 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 f22c70cdff..8c43306527 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -25,9 +25,6 @@ def boot_session(bootinfo): 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 7ee0c5c2d0..a2faa9a6a3 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -66,11 +66,6 @@ frappe.ui.form.on("Delivery Note", { }, 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 f2c7fcb1f6..552483a59c 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 2e150f70d0..cf28a527c5 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 @@ def get_data(): '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 @@ def get_data(): }, { '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 5487193284..ebf7ea170e 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,9 +1709,42 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0, "width": "150px" }, + { + "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 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -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 f7ec7e3770..3e7dfc9bad 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 b8621719c4..5013e23837 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,42 +395,3278 @@ "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, + "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": 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": "deferred_revenue", + "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": "Deferred Revenue", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "enable_deferred_revenue", + "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": "Enable Deferred Revenue", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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": "enable_deferred_revenue", + "fieldname": "deferred_revenue_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": "Deferred Revenue Account", + "length": 0, + "no_copy": 0, + "options": "Account", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_85", + "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, + "depends_on": "enable_deferred_revenue", + "fieldname": "no_of_months", + "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": "No of Months", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_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 }, { "allow_bulk_edit": 0, @@ -528,37 +3764,6 @@ "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, @@ -591,3054 +3796,6 @@ "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": "eval:doc.is_stock_item || doc.is_fixed_asset", - "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 || doc.is_fixed_asset", - "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 - }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -3749,7 +3906,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2018-05-07 14:54:24.479267", + "modified": "2018-05-14 14:54:24.479267", "modified_by": "Administrator", "module": "Stock", "name": "Item", @@ -3907,15 +4064,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 94b907b914..945bde36fe 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -536,8 +536,8 @@ class Item(WebsiteGenerator): 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 @@ class Item(WebsiteGenerator): 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 @@ class Item(WebsiteGenerator): 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 @@ class Item(WebsiteGenerator): 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 fdc2df2f10..9f05937bcd 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 c3fe8f3222..6cfb8af0a2 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 @@ def get_data(): '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 69d2f2a3d7..c55013ea96 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.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt } } -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 9f609beee3..4f9f301b6a 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 bcedd7179a..7ed7dd6537 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 @@ def get_data(): '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 @@ def get_data(): }, { '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 f84cbef2c8..edd29a29d6 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 333963bd66..8ce49c5187 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -17,6 +17,7 @@ class SerialNoRequiredError(ValidationError): pass 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 @@ def process_serial_no(sle): 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 @@ def validate_serial_no(sle, item_det): 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 @@ def validate_serial_no(sle, item_det): 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 a86dea7683..3342768261 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -23,6 +23,10 @@ frappe.ui.form.on("Stock Reconciliation", { return erpnext.queries.warehouse(frm.doc); }); } + + if (!frm.doc.expense_account) { + frm.trigger("set_expense_account"); + } }, refresh: function(frm) { @@ -114,6 +118,25 @@ frappe.ui.form.on("Stock Reconciliation", { 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 @@ frappe.ui.form.on("Stock Reconciliation Item", { }); 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 dc9a3227c1..421ee77dd1 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 73a7ef3931..938173deb8 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 import msgprint, _ 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 @@ def get_stock_balance_for(item_code, warehouse, posting_date, posting_time): '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 48f89ec20f..4d5423e547 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.json +++ b/erpnext/stock/doctype/stock_settings/stock_settings.json @@ -464,6 +464,37 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "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, @@ -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 23a18f4e31..97d24c6c94 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/stock_settings.py @@ -11,8 +11,9 @@ from frappe.utils.html_utils import clean_html 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 7e456dd3d3..60039744f7 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _, throw -from frappe.utils import flt, cint, add_days, cstr +from frappe.utils import flt, cint, add_days, cstr, add_months import json from erpnext.accounts.doctype.pricing_rule.pricing_rule import get_pricing_rule_for_item, set_transaction_type from erpnext.setup.utils import get_exchange_rate @@ -76,20 +76,23 @@ def get_item_details(args): 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) @@ -251,6 +254,15 @@ def get_basic_details(args, item): "last_purchase_rate": item.last_purchase_rate if args.get("doctype") in ["Purchase Order"] else 0 }) + if item.enable_deferred_revenue: + service_end_date = add_months(args.transaction_date, item.no_of_months) + out.update({ + "enable_deferred_revenue": item.enable_deferred_revenue, + "deferred_revenue_account": get_default_deferred_revenue_account(args, item), + "service_start_date": args.transaction_date, + "service_end_date": service_end_date + }) + # calculate conversion factor if item.stock_uom == args.uom: out.conversion_factor = 1.0 @@ -291,6 +303,14 @@ def get_default_expense_account(args, item): or args.expense_account or frappe.db.get_value("Item Group", item.item_group, "default_expense_account")) +def get_default_deferred_revenue_account(args, item): + if item.enable_deferred_revenue: + return (item.deferred_revenue_account + or args.deferred_revenue_account + or frappe.db.get_value("Company", args.company, "default_deferred_revenue_account")) + else: + return None + def get_default_cost_center(args, item): return (frappe.db.get_value("Project", args.get("project"), "cost_center") or (item.selling_cost_center if args.get("customer") else item.buying_cost_center) @@ -465,6 +485,17 @@ def get_serial_nos_by_fifo(args): "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,13 +523,30 @@ def get_serial_no_details(item_code, warehouse, stock_qty, serial_no): 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 @@ -597,6 +645,11 @@ def get_price_list_currency_and_exchange_rate(args): if not args.price_list: return {} + if args.doctype in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']: + args.update({"exchange_rate": "for_selling"}) + elif args.doctype in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']: + args.update({"exchange_rate": "for_buying"}) + price_list_currency = get_price_list_currency(args.price_list) price_list_uom_dependant = get_price_list_uom_dependant(args.price_list) plc_conversion_rate = args.plc_conversion_rate @@ -606,7 +659,7 @@ def get_price_list_currency_and_exchange_rate(args): and price_list_currency != args.price_list_currency): # cksgb 19/09/2016: added args.transaction_date as posting_date argument for get_exchange_rate plc_conversion_rate = get_exchange_rate(price_list_currency, company_currency, - args.transaction_date) or plc_conversion_rate + args.transaction_date, args.exchange_rate) or plc_conversion_rate return frappe._dict({ "price_list_currency": price_list_currency, @@ -659,8 +712,10 @@ def get_serial_no(args, serial_nos=None): 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 ed010cd17a..30fcad8073 100644 --- a/erpnext/stock/report/item_price_stock/item_price_stock.py +++ b/erpnext/stock/report/item_price_stock/item_price_stock.py @@ -19,6 +19,12 @@ def get_columns(): "options": "Item", "width": 120 }, + { + "label": _("Brand"), + "fieldname": "brand", + "fieldtype": "Data", + "width": 100 + }, { "label": _("Warehouse"), "fieldname": "warehouse", @@ -71,7 +77,7 @@ def get_item_price_qty_data(filters): 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 @@ def get_item_price_qty_data(filters): 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 ca01d199b1..0375d8fabb 100644 --- a/erpnext/stock/report/item_prices/item_prices.py +++ b/erpnext/stock/report/item_prices/item_prices.py @@ -21,7 +21,7 @@ def execute(filters=None): 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 execute(filters=None): 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 @@ def get_item_details(): 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 137d6039f1..3b901dc5d3 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 c5fb51809a..d73f83d559 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 @@ def execute(filters=None): 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 validate_filters(filters): 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 @@ def get_warehouse_list(filters): 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 f9e8c2dafc..0000000000 --- a/erpnext/templates/emails/recurring_document_failed.html +++ /dev/null @@ -1,11 +0,0 @@ -

    {{_("Recurring")}} {{ type }} {{ _("Failed")}}

    - -

    {{_("An error occured while creating recurring")}} {{ type }} {{ name }} {{_("for")}} {{ party }}.

    -

    {{_("This could be because of some invalid Email Addresses in the")}} {{ type }}.

    -

    {{_("To stop sending repetitive error notifications from the system, we have checked Disabled field in the subscription")}} {{ subscription}} {{_("for the")}} {{ type }} {{ name }}.

    -

    {{_("Please correct the")}} {{ type }} {{_('and unchcked Disabled in the')}} {{ subscription }} {{_("for making recurring again.")}}

    -
    -

    {{_("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 }}.

    -

    [{{_("This email is autogenerated")}}]

    diff --git a/erpnext/templates/includes/itemised_tax_breakup.html b/erpnext/templates/includes/itemised_tax_breakup.html index 4162b3ab5a..982397e133 100644 --- a/erpnext/templates/includes/itemised_tax_breakup.html +++ b/erpnext/templates/includes/itemised_tax_breakup.html @@ -16,16 +16,16 @@ {{ item }} - {{ frappe.utils.fmt_money(itemised_taxable_amount.get(item), None, company_currency) }} + {{ frappe.utils.fmt_money(itemised_taxable_amount.get(item), None, currency) }} {% for tax_account in tax_accounts %} {% set tax_details = taxes.get(tax_account) %} {% if tax_details %} {% if tax_details.tax_rate or not tax_details.tax_amount %} - ({{ tax_details.tax_rate }}%) + ({{ tax_details.tax_rate }}%) {% endif %} - {{ frappe.utils.fmt_money(tax_details.tax_amount, None, company_currency) }} + {{ frappe.utils.fmt_money(tax_details.tax_amount / conversion_rate, None, currency) }} {% else %} diff --git a/erpnext/templates/includes/products_as_grid.html b/erpnext/templates/includes/products_as_grid.html index 34c2ccda37..a057f5d6f2 100644 --- a/erpnext/templates/includes/products_as_grid.html +++ b/erpnext/templates/includes/products_as_grid.html @@ -12,10 +12,12 @@
     
     
    {% endif %} - {% if in_stock or not is_stock_item %} -
    {{ _("In stock") }}
    - {% else %} -
    {{ _("Not in stock") }}
    + {% if show_stock_qty %} + {% if in_stock %} +
    {{ _("In stock") }}
    + {% else %} +
    {{ _("Not in stock") }}
    + {% endif %} {% endif %}
  • diff --git a/erpnext/templates/pages/home.html b/erpnext/templates/pages/home.html index 750fa3849f..f36b4e0817 100644 --- a/erpnext/templates/pages/home.html +++ b/erpnext/templates/pages/home.html @@ -18,7 +18,8 @@
    - {{ product_image_square(item.thumbnail or item.image) }} + + {{ product_image_square(item.image) }}
    {{ item.item_name }}
    diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 0c2b6c5877..d3769a23bd 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -13,12 +13,6 @@ from six import string_types 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 0000000000..48e341a095 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3 @@ +{ + "lockfileVersion": 1 +} diff --git a/setup.py b/setup.py index c293fb82d0..71107a9a2f 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 @@ setup( 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 )