From deb38f7a6884adb20b77398101a62e56f9eed591 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Wed, 2 Sep 2015 18:34:24 +0530
Subject: [PATCH 01/52] [enhancement] document management system
---
erpnext/hr/doctype/employee/employee.py | 2 +-
.../patches/v4_0/reset_permissions_for_masters.py | 2 +-
erpnext/patches/v5_0/execute_on_doctype_update.py | 2 +-
erpnext/patches/v5_4/fix_missing_item_images.py | 14 +++++++-------
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index a2bb10cc69..0d619c296d 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -89,7 +89,7 @@ class Employee(Document):
user.user_image = self.image
try:
frappe.get_doc({
- "doctype": "File Data",
+ "doctype": "File",
"file_name": self.image,
"attached_to_doctype": "User",
"attached_to_name": self.user_id
diff --git a/erpnext/patches/v4_0/reset_permissions_for_masters.py b/erpnext/patches/v4_0/reset_permissions_for_masters.py
index b1b56b3813..a718cb4dee 100644
--- a/erpnext/patches/v4_0/reset_permissions_for_masters.py
+++ b/erpnext/patches/v4_0/reset_permissions_for_masters.py
@@ -9,7 +9,7 @@ def execute():
"Blog Category", "Blog Settings", "Blogger", "Branch", "Brand", "Buying Settings",
"Comment", "Communication", "Company", "Contact Us Settings",
"Country", "Currency", "Currency Exchange", "Deduction Type", "Department",
- "Designation", "Earning Type", "Event", "Feed", "File Data", "Fiscal Year",
+ "Designation", "Earning Type", "Event", "Feed", "File", "Fiscal Year",
"HR Settings", "Industry Type", "Leave Type", "Letter Head",
"Mode of Payment", "Module Def", "Naming Series", "POS Setting", "Print Heading",
"Report", "Role", "Selling Settings", "Stock Settings", "Supplier Type", "UOM"):
diff --git a/erpnext/patches/v5_0/execute_on_doctype_update.py b/erpnext/patches/v5_0/execute_on_doctype_update.py
index 4fc640e32a..98cbd29923 100644
--- a/erpnext/patches/v5_0/execute_on_doctype_update.py
+++ b/erpnext/patches/v5_0/execute_on_doctype_update.py
@@ -4,5 +4,5 @@
import frappe
def execute():
- for dt in ("Stock Ledger Entry", "Communication", "Comment", "DefaultValue", "DocShare", "File Data", "ToDo", "Feed"):
+ for dt in ("Stock Ledger Entry", "Communication", "Comment", "DefaultValue", "DocShare", "File", "ToDo", "Feed"):
frappe.get_doc("DocType", dt).run_module_method("on_doctype_update")
\ No newline at end of file
diff --git a/erpnext/patches/v5_4/fix_missing_item_images.py b/erpnext/patches/v5_4/fix_missing_item_images.py
index d782cd179e..1dffc216cf 100644
--- a/erpnext/patches/v5_4/fix_missing_item_images.py
+++ b/erpnext/patches/v5_4/fix_missing_item_images.py
@@ -37,7 +37,7 @@ def fix_files_for_item(files_path, unlinked_files):
frappe.db.set_value(row.doctype, row.name, "image", new_file_url, update_modified=False)
# set it as attachment of this item code
- file_data = frappe.get_doc("File Data", unlinked_files[file_url]["file"])
+ file_data = frappe.get_doc("File", unlinked_files[file_url]["file"])
file_data.attached_to_doctype = "Item"
file_data.attached_to_name = item_code
file_data.save()
@@ -65,20 +65,20 @@ def rename_and_set_content_hash(files_path, unlinked_files, file_url):
# set content hash if missing
file_data_name = unlinked_files[file_url]["file"]
- if not frappe.db.get_value("File Data", file_data_name, "content_hash"):
+ if not frappe.db.get_value("File", file_data_name, "content_hash"):
with open(new_filename, "r") as f:
content_hash = get_content_hash(f.read())
- frappe.db.set_value("File Data", file_data_name, "content_hash", content_hash)
+ frappe.db.set_value("File", file_data_name, "content_hash", content_hash)
def get_unlinked_files(files_path):
- # find files that have the same name as a File Data doc
- # and the file_name mentioned in that File Data doc doesn't exist
+ # find files that have the same name as a File doc
+ # and the file_name mentioned in that File doc doesn't exist
# and it isn't already attached to a doc
unlinked_files = {}
files = os.listdir(files_path)
for file in files:
- if not frappe.db.exists("File Data", {"file_name": file}):
- file_data = frappe.db.get_value("File Data", {"name": file},
+ if not frappe.db.exists("File", {"file_name": file}):
+ file_data = frappe.db.get_value("File", {"name": file},
["file_name", "attached_to_doctype", "attached_to_name"], as_dict=True)
if (file_data
From 72e6aa160c911aa468885aa91b40e34822cae372 Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Fri, 14 Aug 2015 11:40:00 +0530
Subject: [PATCH 02/52] Added New Doctype Tax Rule
---
erpnext/accounts/doctype/tax_rule/__init__.py | 0
.../accounts/doctype/tax_rule/tax_rule.json | 475 ++++++++++++++++++
erpnext/accounts/doctype/tax_rule/tax_rule.py | 10 +
.../doctype/tax_rule/test_tax_rule.py | 12 +
4 files changed, 497 insertions(+)
create mode 100644 erpnext/accounts/doctype/tax_rule/__init__.py
create mode 100644 erpnext/accounts/doctype/tax_rule/tax_rule.json
create mode 100644 erpnext/accounts/doctype/tax_rule/tax_rule.py
create mode 100644 erpnext/accounts/doctype/tax_rule/test_tax_rule.py
diff --git a/erpnext/accounts/doctype/tax_rule/__init__.py b/erpnext/accounts/doctype/tax_rule/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
new file mode 100644
index 0000000000..7e20f41291
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -0,0 +1,475 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "creation": "2015-08-07 02:33:52.670866",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "fieldname": "filters",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Filters",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "options": "Customer",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "billing_city",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing City",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "billing_country",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing Country",
+ "no_copy": 0,
+ "options": "Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "shipping_city",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping City",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "shipping_country",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Country",
+ "no_copy": 0,
+ "options": "Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "section_break_4",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Validity",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "From Date",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "To Date",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "section_break_7",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "tax_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Tax Type",
+ "no_copy": 0,
+ "options": "\nSales\nPurchase",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "column_break_9",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval: doc.tax_type == \"Sales\"",
+ "fieldname": "sales_tax_template",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Tax Template",
+ "no_copy": 0,
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval: doc.tax_type == \"Purchase\"",
+ "fieldname": "purchase_tax_template",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Purchase Tax Template",
+ "no_copy": 0,
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "priority",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Priority",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "column_break_20",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Company",
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "modified": "2015-08-13 09:12:42.118276",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Tax Rule",
+ "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": "Administrator",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
new file mode 100644
index 0000000000..f4bf17746f
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class TaxRule(Document):
+ pass
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
new file mode 100644
index 0000000000..4712243495
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+# test_records = frappe.get_test_records('Tax Rule')
+
+class TestTaxRule(unittest.TestCase):
+ pass
From 949d7dbaba038c7188a687f571aebcb602bc800d Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Mon, 17 Aug 2015 14:55:15 +0530
Subject: [PATCH 03/52] Added validations, test-cases to Tax Rule
---
erpnext/accounts/doctype/tax_rule/tax_rule.js | 7 +++
.../accounts/doctype/tax_rule/tax_rule.json | 8 ++-
erpnext/accounts/doctype/tax_rule/tax_rule.py | 57 ++++++++++++++++++-
.../doctype/tax_rule/test_tax_rule.py | 33 ++++++++++-
.../doctype/customer_group/test_records.json | 6 ++
5 files changed, 106 insertions(+), 5 deletions(-)
create mode 100644 erpnext/accounts/doctype/tax_rule/tax_rule.js
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.js b/erpnext/accounts/doctype/tax_rule/tax_rule.js
new file mode 100644
index 0000000000..b9221785d5
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js
@@ -0,0 +1,7 @@
+// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+cur_frm.add_fetch("customer", "customer_group", "customer_group" );
+
+this.frm.toggle_reqd("sales_tax_template", this.frm.doc.tax_type=="Sales");
+this.frm.toggle_reqd("purchase_tax_template", this.frm.doc.tax_type=="Purchase");
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
index 7e20f41291..f2df6544c4 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.json
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -2,6 +2,7 @@
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 0,
+ "autoname": "TR.####",
"creation": "2015-08-07 02:33:52.670866",
"custom": 0,
"docstatus": 0,
@@ -320,7 +321,7 @@
"in_list_view": 0,
"label": "Sales Tax Template",
"no_copy": 0,
- "options": "Sales Taxes and Charges",
+ "options": "Sales Taxes and Charges Template",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -342,7 +343,7 @@
"in_list_view": 0,
"label": "Purchase Tax Template",
"no_copy": 0,
- "options": "Purchase Taxes and Charges",
+ "options": "Purchase Taxes and Charges Template",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -374,6 +375,7 @@
},
{
"allow_on_submit": 0,
+ "default": "1",
"fieldname": "priority",
"fieldtype": "Int",
"hidden": 0,
@@ -440,7 +442,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-08-13 09:12:42.118276",
+ "modified": "2015-08-14 08:10:56.694925",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index f4bf17746f..d1b0bdc8de 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -4,7 +4,62 @@
from __future__ import unicode_literals
import frappe
+from frappe import _
from frappe.model.document import Document
+class IncorrectCustomerGroup(frappe.ValidationError): pass
+
class TaxRule(Document):
- pass
+ def validate(self):
+ self.validate_tax_template()
+ self.validate_customer_group()
+ self.validate_date()
+ self.validate_filters()
+
+ def validate_tax_template(self):
+ if not (self.sales_tax_template or self.purchase_tax_template):
+ frappe.throw(_("Tax Template is mandatory."))
+ if self.tax_type=="Sales":
+ self.purchase_tax_template= None
+ else:
+ self.sales_tax_template= None
+
+ def validate_customer_group(self):
+ if self.customer and self.customer_group:
+ if not frappe.db.get_value("Customer", self.customer, "customer_group") == self.customer_group:
+ frappe.throw(_("Customer {0} does not belong to customer group {1}"). \
+ format(self.customer, self.customer_group), IncorrectCustomerGroup)
+
+ def validate_date(self):
+ if self.from_date and self.to_date and self.from_date > self.to_date:
+ frappe.throw(_("From Date cannot be greater than To Date"))
+
+ def validate_filters(self):
+ filters = {
+ "customer": self.customer,
+ "customer_group": self.customer_group,
+ "billing_city": self.billing_city,
+ "billing_country": self.billing_country,
+ "shipping_city": self.shipping_city,
+ "shipping_country": self.shipping_country,
+ "tax_type": self.tax_type,
+ "company": self.company
+ }
+
+ conds=""
+ for d in filters:
+ if conds:
+ conds += " and "
+ conds += """{0} = '{1}'""".format(d, filters[d])
+
+ conds += """ and ((from_date > '{from_date}' and from_date < '{to_date}') or
+ (to_date > '{from_date}' and to_date < '{to_date}') or
+ ('{from_date}' > from_date and '{from_date}' < to_date) or
+ ('{from_date}' = from_date and '{to_date}' = to_date))""".format(from_date=self.from_date, to_date=self.to_date)
+
+ tax_rule = frappe.db.sql("select name, priority \
+ from `tabTax Rule` where {0} and name != '{1}'".format(conds, self.name), as_dict=1)
+
+ if tax_rule:
+ if tax_rule[0].priority == self.priority:
+ frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)))
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 4712243495..7a2c6ef080 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -5,8 +5,39 @@ from __future__ import unicode_literals
import frappe
import unittest
+from frappe.utils import nowdate, add_days
+from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup
# test_records = frappe.get_test_records('Tax Rule')
class TestTaxRule(unittest.TestCase):
- pass
+ def test_customer_group(self):
+ tax_rule = make_tax_rule_test_record(customer_group= "_Test Customer Group 1", do_not_save= True)
+ self.assertRaises(IncorrectCustomerGroup, tax_rule.save)
+
+ def test_tax_template(self):
+ tax_rule = make_tax_rule_test_record()
+ self.assertEquals(tax_rule.purchase_tax_template, None)
+
+def make_tax_rule_test_record(**args):
+ args = frappe._dict(args)
+
+ tax_rule = frappe.new_doc("Tax Rule")
+ tax_rule.customer= args.customer or "_Test Customer"
+ tax_rule.customer_group= args.customer_group or "_Test Customer Group"
+ tax_rule.billing_city= args.billing_city or "_Test City"
+ tax_rule.billing_country= args.billing_country or "_Test Country"
+ tax_rule.shipping_city= args.shipping_city or "_Test City"
+ tax_rule.shipping_country= args.shipping_country or "_Test Country"
+ tax_rule.from_date= args.from_date or nowdate()
+ tax_rule.to_date= args.to_date or add_days(nowdate(), 1)
+ tax_rule.tax_type= args.tax_type or "Sales"
+ tax_rule.sales_tax_template= args.sales_tax_template or "_Test Sales Taxes and Charges Template"
+ tax_rule.purchase_tax_template= args.purchase_tax_template or "_Test Purchase Taxes and Charges Template"
+ tax_rule.priority= args.priority or 1
+ tax_rule.compant= args.company or "_Test Company"
+
+ if not args.do_not_save:
+ tax_rule.save()
+ return tax_rule
+
\ No newline at end of file
diff --git a/erpnext/setup/doctype/customer_group/test_records.json b/erpnext/setup/doctype/customer_group/test_records.json
index 14d815ce76..cc3f87e098 100644
--- a/erpnext/setup/doctype/customer_group/test_records.json
+++ b/erpnext/setup/doctype/customer_group/test_records.json
@@ -4,5 +4,11 @@
"doctype": "Customer Group",
"is_group": "No",
"parent_customer_group": "All Customer Groups"
+ },
+ {
+ "customer_group_name": "_Test Customer Group 1",
+ "doctype": "Customer Group",
+ "is_group": "No",
+ "parent_customer_group": "All Customer Groups"
}
]
From 810bd35609aade27e84a729bd82b03bd733e678f Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Fri, 21 Aug 2015 15:04:57 +0530
Subject: [PATCH 04/52] Apply Tax Rule based on Customer Selection in Sales /
Purchase Transactions
---
.../test_records.json | 60 +++++
erpnext/accounts/doctype/tax_rule/tax_rule.js | 39 ++-
.../accounts/doctype/tax_rule/tax_rule.json | 238 ++++++++++--------
erpnext/accounts/doctype/tax_rule/tax_rule.py | 83 ++++--
.../doctype/tax_rule/test_tax_rule.py | 132 ++++++++--
erpnext/accounts/party.py | 22 +-
erpnext/buying/doctype/supplier/supplier.json | 1 +
erpnext/public/js/utils/party.js | 1 +
8 files changed, 431 insertions(+), 145 deletions(-)
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
index 656d29c461..5c25517f7f 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
@@ -153,5 +153,65 @@
"territory": "_Test Territory Rest Of The World"
}
]
+ },
+ {
+ "company": "_Test Company",
+ "doctype": "Sales Taxes and Charges Template",
+ "taxes": [
+ {
+ "account_head": "_Test Account VAT - _TC",
+ "charge_type": "On Net Total",
+ "description": "VAT",
+ "doctype": "Sales Taxes and Charges",
+ "parentfield": "taxes",
+ "rate": 12
+ },
+ {
+ "account_head": "_Test Account Service Tax - _TC",
+ "charge_type": "On Net Total",
+ "description": "Service Tax",
+ "doctype": "Sales Taxes and Charges",
+ "parentfield": "taxes",
+ "rate": 4
+ }
+ ],
+ "title": "_Test Sales Taxes and Charges Template 1",
+ "territories": [
+ {
+ "doctype": "Applicable Territory",
+ "parentfield": "territories",
+ "territory": "_Test Territory Rest Of The World"
+ }
+ ]
+ },
+ {
+ "company": "_Test Company",
+ "doctype": "Sales Taxes and Charges Template",
+ "taxes": [
+ {
+ "account_head": "_Test Account VAT - _TC",
+ "charge_type": "On Net Total",
+ "description": "VAT",
+ "doctype": "Sales Taxes and Charges",
+ "parentfield": "taxes",
+ "rate": 12
+ },
+ {
+ "account_head": "_Test Account Service Tax - _TC",
+ "charge_type": "On Net Total",
+ "description": "Service Tax",
+ "doctype": "Sales Taxes and Charges",
+ "parentfield": "taxes",
+ "rate": 4
+ }
+ ],
+ "title": "_Test Sales Taxes and Charges Template 2",
+ "territories": [
+ {
+ "doctype": "Applicable Territory",
+ "parentfield": "territories",
+ "territory": "_Test Territory Rest Of The World"
+ }
+ ]
}
]
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.js b/erpnext/accounts/doctype/tax_rule/tax_rule.js
index b9221785d5..d4a10aaec3 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.js
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js
@@ -2,6 +2,41 @@
// License: GNU General Public License v3. See license.txt
cur_frm.add_fetch("customer", "customer_group", "customer_group" );
+cur_frm.add_fetch("supplier", "supplier_type", "supplier_type" );
-this.frm.toggle_reqd("sales_tax_template", this.frm.doc.tax_type=="Sales");
-this.frm.toggle_reqd("purchase_tax_template", this.frm.doc.tax_type=="Purchase");
\ No newline at end of file
+cur_frm.toggle_reqd("sales_tax_template", cur_frm.doc.tax_type=="Sales");
+cur_frm.toggle_reqd("purchase_tax_template", cur_frm.doc.tax_type=="Purchase");
+
+frappe.ui.form.on("Tax Rule", "customer", function(frm) {
+ frappe.call({
+ method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
+ args: {
+ "party": frm.doc.customer,
+ "party_type": "customer"
+ },
+ callback: function(r) {
+ if(!r.exc) {
+ $.each(r.message, function(k, v) {
+ frm.set_value(k, v);
+ });
+ }
+ }
+ });
+});
+
+frappe.ui.form.on("Tax Rule", "supplier", function(frm) {
+ frappe.call({
+ method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
+ args: {
+ "party": frm.doc.supplier,
+ "party_type": "supplier"
+ },
+ callback: function(r) {
+ if(!r.exc) {
+ $.each(r.message, function(k, v) {
+ frm.set_value(k, v);
+ });
+ }
+ }
+ });
+});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
index f2df6544c4..52ca63f62e 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.json
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -7,8 +7,93 @@
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
- "document_type": "Master",
+ "document_type": "Setup",
"fields": [
+ {
+ "allow_on_submit": 0,
+ "default": "Sales",
+ "fieldname": "tax_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Tax Type",
+ "no_copy": 0,
+ "options": "Sales\nPurchase",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "column_break_1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Sales\"",
+ "fieldname": "sales_tax_template",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Tax Template",
+ "no_copy": 0,
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Purchase\"",
+ "fieldname": "purchase_tax_template",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Purchase Tax Template",
+ "no_copy": 0,
+ "options": "Purchase Taxes and Charges Template",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"fieldname": "filters",
@@ -31,6 +116,7 @@
},
{
"allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer",
"fieldtype": "Link",
"hidden": 0,
@@ -50,6 +136,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Purchase\"",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier",
+ "no_copy": 0,
+ "options": "Supplier",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"fieldname": "billing_city",
@@ -112,6 +220,7 @@
},
{
"allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer_group",
"fieldtype": "Link",
"hidden": 0,
@@ -131,6 +240,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.tax_type==\"Purchase\"",
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier Type",
+ "no_copy": 0,
+ "options": "Supplier Type",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"fieldname": "shipping_city",
@@ -251,109 +382,6 @@
"set_only_once": 0,
"unique": 0
},
- {
- "allow_on_submit": 0,
- "fieldname": "section_break_7",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "fieldname": "tax_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Tax Type",
- "no_copy": 0,
- "options": "\nSales\nPurchase",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "fieldname": "column_break_9",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval: doc.tax_type == \"Sales\"",
- "fieldname": "sales_tax_template",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Tax Template",
- "no_copy": 0,
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval: doc.tax_type == \"Purchase\"",
- "fieldname": "purchase_tax_template",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Purchase Tax Template",
- "no_copy": 0,
- "options": "Purchase Taxes and Charges Template",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_on_submit": 0,
"fieldname": "section_break_6",
@@ -442,7 +470,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-08-14 08:10:56.694925",
+ "modified": "2015-08-21 03:27:43.564183",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index d1b0bdc8de..635bdc1ed9 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -6,43 +6,56 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
+from frappe.utils import cstr
class IncorrectCustomerGroup(frappe.ValidationError): pass
+class IncorrectSupplierType(frappe.ValidationError): pass
+class ConflictingTaxRule(frappe.ValidationError): pass
class TaxRule(Document):
def validate(self):
self.validate_tax_template()
self.validate_customer_group()
+ self.validate_supplier_type()
self.validate_date()
self.validate_filters()
-
+
def validate_tax_template(self):
+ if self.tax_type== "Sales":
+ self.purchase_tax_template = self.supplier = self.supplier_type= None
+ else:
+ self.sales_tax_template= self.customer = self.customer_group= None
+
if not (self.sales_tax_template or self.purchase_tax_template):
frappe.throw(_("Tax Template is mandatory."))
- if self.tax_type=="Sales":
- self.purchase_tax_template= None
- else:
- self.sales_tax_template= None
def validate_customer_group(self):
if self.customer and self.customer_group:
if not frappe.db.get_value("Customer", self.customer, "customer_group") == self.customer_group:
frappe.throw(_("Customer {0} does not belong to customer group {1}"). \
format(self.customer, self.customer_group), IncorrectCustomerGroup)
-
+
+ def validate_supplier_type(self):
+ if self.supplier and self.supplier_type:
+ if not frappe.db.get_value("Supplier", self.supplier, "supplier_type") == self.supplier_type:
+ frappe.throw(_("Supplier {0} does not belong to Supplier Type {1}"). \
+ format(self.supplier, self.supplier_type), IncorrectSupplierType)
+
def validate_date(self):
if self.from_date and self.to_date and self.from_date > self.to_date:
frappe.throw(_("From Date cannot be greater than To Date"))
def validate_filters(self):
filters = {
+ "tax_type": self.tax_type,
"customer": self.customer,
"customer_group": self.customer_group,
+ "supplier": self.supplier,
+ "supplier_type": self.supplier_type,
"billing_city": self.billing_city,
"billing_country": self.billing_country,
"shipping_city": self.shipping_city,
"shipping_country": self.shipping_country,
- "tax_type": self.tax_type,
"company": self.company
}
@@ -50,16 +63,58 @@ class TaxRule(Document):
for d in filters:
if conds:
conds += " and "
- conds += """{0} = '{1}'""".format(d, filters[d])
-
- conds += """ and ((from_date > '{from_date}' and from_date < '{to_date}') or
- (to_date > '{from_date}' and to_date < '{to_date}') or
- ('{from_date}' > from_date and '{from_date}' < to_date) or
- ('{from_date}' = from_date and '{to_date}' = to_date))""".format(from_date=self.from_date, to_date=self.to_date)
+ conds += """ifnull({0}, '') = '{1}'""".format(d, frappe.db.escape(cstr(filters[d])))
+
+ if self.from_date and self.to_date:
+ conds += """ and ((from_date > '{from_date}' and from_date < '{to_date}') or
+ (to_date > '{from_date}' and to_date < '{to_date}') or
+ ('{from_date}' > from_date and '{from_date}' < to_date) or
+ ('{from_date}' = from_date and '{to_date}' = to_date))""".format(from_date=self.from_date, to_date=self.to_date)
+
+ elif self.from_date and not self.to_date:
+ conds += """ and to_date > '{from_date}'""".format(from_date = self.from_date)
+
+ elif self.to_date and not self.from_date:
+ conds += """ and from_date < '{to_date}'""".format(to_date = self.to_date)
tax_rule = frappe.db.sql("select name, priority \
from `tabTax Rule` where {0} and name != '{1}'".format(conds, self.name), as_dict=1)
if tax_rule:
if tax_rule[0].priority == self.priority:
- frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)))
\ No newline at end of file
+ frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)), ConflictingTaxRule)
+
+@frappe.whitelist()
+def get_party_details(party, party_type):
+ out = {}
+ billing_address = frappe.get_list("Address", fields=["city", "country"], filters={party_type: party, "is_primary_address": 1})
+ shipping_address = frappe.get_list("Address", fields=["city", "country"], filters={party_type:party, "is_shipping_address": 1})
+ if billing_address:
+ out["billing_city"]= billing_address[0].city
+ out["billing_country"]= billing_address[0].country
+ if shipping_address:
+ out["shipping_city"]= shipping_address[0].city
+ out["shipping_country"]= shipping_address[0].country
+ return out
+
+def get_tax_template(posting_date, args):
+ """Get matching tax rule"""
+ args = frappe._dict(args)
+ conditions = []
+
+ for key, value in args.iteritems():
+ conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
+
+ matching = frappe.db.sql("""select * from `tabTax Rule`
+ where {0}""".format(" and ".join(conditions)), as_dict = True)
+
+ if not matching:
+ return None
+
+ for rule in matching:
+ rule.no_of_keys_matched = 0
+ for key in args:
+ if rule.get(key): rule.no_of_keys_matched += 1
+
+ rule = sorted(matching, lambda b, a: cmp(a.no_of_keys_matched, b.no_of_keys_matched) or cmp(a.priority, b.priority))[0]
+ return rule.sales_tax_template or rule.purchase_tax_template
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 7a2c6ef080..873a4e38a7 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -5,39 +5,127 @@ from __future__ import unicode_literals
import frappe
import unittest
-from frappe.utils import nowdate, add_days
-from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup
+from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template
# test_records = frappe.get_test_records('Tax Rule')
class TestTaxRule(unittest.TestCase):
+ def setUp(self):
+ frappe.db.sql("delete from `tabTax Rule`")
+
def test_customer_group(self):
- tax_rule = make_tax_rule_test_record(customer_group= "_Test Customer Group 1", do_not_save= True)
+ tax_rule = make_tax_rule(customer= "_Test Customer", customer_group= "_Test Customer Group 1",
+ sales_tax_template = "_Test Sales Taxes and Charges Template")
self.assertRaises(IncorrectCustomerGroup, tax_rule.save)
- def test_tax_template(self):
- tax_rule = make_tax_rule_test_record()
- self.assertEquals(tax_rule.purchase_tax_template, None)
+ def test_supplier_type(self):
+ tax_rule = make_tax_rule(supplier= "_Test Supplier", supplier_type= "_Test Supplier Type 1",
+ purchase_tax_template = "_Test Purchase Taxes and Charges Template")
+ self.assertRaises(IncorrectSupplierType, tax_rule.save)
+
+ def test_conflict(self):
+ tax_rule1 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1)
+ tax_rule1.save()
-def make_tax_rule_test_record(**args):
+ tax_rule2 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1)
+
+ self.assertRaises(ConflictingTaxRule, tax_rule2.save)
+
+ def test_conflict_with_non_overlapping_dates(self):
+ tax_rule1 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01")
+ tax_rule1.save()
+
+ tax_rule2 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, to_date = "2013-01-01")
+
+ tax_rule2.save()
+ self.assertTrue(tax_rule2.name)
+
+ def test_conflict_with_overlapping_dates(self):
+ tax_rule1 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-01", to_date = "2015-01-05")
+ tax_rule1.save()
+
+ tax_rule2 = make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority = 1, from_date = "2015-01-03", to_date = "2015-01-09")
+
+ self.assertRaises(ConflictingTaxRule, tax_rule2.save)
+
+ def test_tax_template(self):
+ tax_rule = make_tax_rule()
+ self.assertEquals(tax_rule.purchase_tax_template, None)
+
+
+ def test_select_tax_rule_based_on_customer(self):
+ make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ make_tax_rule(customer= "_Test Customer 1",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
+
+ make_tax_rule(customer= "_Test Customer 2",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 2", save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer 2"}),
+ "_Test Sales Taxes and Charges Template 2")
+
+ def test_select_tax_rule_based_on_better_match(self):
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ make_tax_rule(customer= "_Test Customer",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City"}),
+ "_Test Sales Taxes and Charges Template")
+
+ def test_select_tax_rule_based_on_better_priority(self):
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", priority=1, save=1)
+
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", priority=2, save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City"}),
+ "_Test Sales Taxes and Charges Template 1")
+
+ def test_select_tax_rule_based_cross_matching_keys(self):
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ make_tax_rule(customer= "_Test Customer 1", billing_city = "Test City 1",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City 1"}),
+ None)
+
+ def test_select_tax_rule_based_cross_partially_keys(self):
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ make_tax_rule(billing_city = "Test City 1",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City 1"}),
+ "_Test Sales Taxes and Charges Template 1")
+
+
+def make_tax_rule(**args):
args = frappe._dict(args)
tax_rule = frappe.new_doc("Tax Rule")
- tax_rule.customer= args.customer or "_Test Customer"
- tax_rule.customer_group= args.customer_group or "_Test Customer Group"
- tax_rule.billing_city= args.billing_city or "_Test City"
- tax_rule.billing_country= args.billing_country or "_Test Country"
- tax_rule.shipping_city= args.shipping_city or "_Test City"
- tax_rule.shipping_country= args.shipping_country or "_Test Country"
- tax_rule.from_date= args.from_date or nowdate()
- tax_rule.to_date= args.to_date or add_days(nowdate(), 1)
- tax_rule.tax_type= args.tax_type or "Sales"
- tax_rule.sales_tax_template= args.sales_tax_template or "_Test Sales Taxes and Charges Template"
- tax_rule.purchase_tax_template= args.purchase_tax_template or "_Test Purchase Taxes and Charges Template"
- tax_rule.priority= args.priority or 1
- tax_rule.compant= args.company or "_Test Company"
- if not args.do_not_save:
- tax_rule.save()
+ for key, val in args.iteritems():
+ if key != "save":
+ tax_rule.set(key, val)
+
+ tax_rule.company = args.company or "_Test Company"
+
+ if args.save:
+ tax_rule.insert()
+
return tax_rule
\ No newline at end of file
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 4f49bc07fd..313544f143 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -43,6 +43,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
+ out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out)
if not out.get("currency"):
out["currency"] = currency
@@ -99,7 +100,7 @@ def set_other_values(out, party, party_type):
out[f] = party.get(f)
# fields prepended with default in Customer doctype
- for f in ['currency', 'taxes_and_charges'] \
+ for f in ['currency'] \
+ (['sales_partner', 'commission_rate'] if party_type=="Customer" else []):
if party.get("default_" + f):
out[f] = party.get("default_" + f)
@@ -274,4 +275,21 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
msgprint(_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)")
.format(date_diff(due_date, default_due_date)))
else:
- frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
\ No newline at end of file
+ frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
+
+def set_taxes(party, party_type, posting_date, company, out):
+ print "posting_date", posting_date
+ from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
+ args = {
+ party_type: party,
+ "customer_group": out.customer_group,
+ "supplier_type": out.supplier_type,
+ "company": company
+ }
+ args.update(get_party_details(party, party_type))
+ if party_type=="Customer":
+ args.update({"tax_type": "Sales"})
+ else:
+ args.update({"tax_type": "Purchase"})
+
+ return get_tax_template(posting_date, args)
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 2a0a50d45d..ce68370d13 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -1,4 +1,5 @@
{
+<<<<<<< HEAD
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 1,
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index 919225f9a9..59992ebc04 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -20,6 +20,7 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
price_list: frm.doc.buying_price_list
};
}
+ args.posting_date = frm.doc.transaction_date;
}
if(!args) return;
From 1a2d121073e31d72a3790792cd3818d7a24b569e Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Fri, 21 Aug 2015 15:53:10 +0530
Subject: [PATCH 05/52] Removed default taxes and charges from customer and
supplier master. Added patch to create tax rules against customer/supplier
---
.../doctype/tax_rule/test_tax_rule.py | 2 +-
erpnext/patches/v5_8/tax_rule.py | 27 +++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 erpnext/patches/v5_8/tax_rule.py
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 873a4e38a7..9802c09600 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -19,7 +19,7 @@ class TestTaxRule(unittest.TestCase):
self.assertRaises(IncorrectCustomerGroup, tax_rule.save)
def test_supplier_type(self):
- tax_rule = make_tax_rule(supplier= "_Test Supplier", supplier_type= "_Test Supplier Type 1",
+ tax_rule = make_tax_rule(tax_type= "Purchase", supplier= "_Test Supplier", supplier_type= "_Test Supplier Type 1",
purchase_tax_template = "_Test Purchase Taxes and Charges Template")
self.assertRaises(IncorrectSupplierType, tax_rule.save)
diff --git a/erpnext/patches/v5_8/tax_rule.py b/erpnext/patches/v5_8/tax_rule.py
new file mode 100644
index 0000000000..b710ddcbe4
--- /dev/null
+++ b/erpnext/patches/v5_8/tax_rule.py
@@ -0,0 +1,27 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ customers = frappe.db.sql("""select name, default_taxes_and_charges from tabCustomer where
+ ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
+
+ for d in customers:
+ tr = frappe.new_doc("Tax Rule")
+ tr.tax_type = "Sales"
+ tr.customer = d.name
+ tr.sales_tax_template = d.default_taxes_and_charges
+ tr.save()
+
+
+ suppliers = frappe.db.sql("""select name, default_taxes_and_charges from tabSupplier where
+ ifnull(default_taxes_and_charges, '') != '' """, as_dict=1)
+
+ for d in suppliers:
+ tr = frappe.new_doc("Tax Rule")
+ tr.tax_type = "Purchase"
+ tr.supplier = d.name
+ tr.purchase_tax_template = d.default_taxes_and_charges
+ tr.save()
\ No newline at end of file
From 09f9c96c5375036f8379a25da46314af9fe9ad9d Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Wed, 26 Aug 2015 10:41:31 +0530
Subject: [PATCH 06/52] Fixes in Tax Rule
---
erpnext/accounts/doctype/tax_rule/tax_rule.py | 15 ++++++++++---
erpnext/accounts/party.py | 18 +++++++++-------
erpnext/public/js/utils/party.js | 21 ++++++++++++++++++-
3 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 635bdc1ed9..705a26e771 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -85,13 +85,22 @@ class TaxRule(Document):
frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)), ConflictingTaxRule)
@frappe.whitelist()
-def get_party_details(party, party_type):
+def get_party_details(party, party_type, args=None):
out = {}
- billing_address = frappe.get_list("Address", fields=["city", "country"], filters={party_type: party, "is_primary_address": 1})
- shipping_address = frappe.get_list("Address", fields=["city", "country"], filters={party_type:party, "is_shipping_address": 1})
+ if args:
+ billing_filters= {"name": args.get("billing_address")}
+ shipping_filters= {"name": args.get("shipping_address")}
+ else:
+ billing_filters= {party_type: party, "is_primary_address": 1}
+ shipping_filters= {party_type:party, "is_shipping_address": 1}
+
+ billing_address= frappe.get_all("Address", fields=["city", "country"], filters= billing_filters)
+ shipping_address= frappe.get_all("Address", fields=["city", "country"], filters= shipping_filters)
+
if billing_address:
out["billing_city"]= billing_address[0].city
out["billing_country"]= billing_address[0].country
+
if shipping_address:
out["shipping_city"]= shipping_address[0].city
out["shipping_country"]= shipping_address[0].country
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 313544f143..a6b5c78cad 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -43,7 +43,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
set_contact_details(out, party, party_type)
set_other_values(out, party, party_type)
set_price_list(out, party, party_type, price_list)
- out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out)
+ out["taxes_and_charges"] = set_taxes(party.name, party_type, posting_date, company, out.customer_group, out.supplier_type)
if not out.get("currency"):
out["currency"] = currency
@@ -277,19 +277,23 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
else:
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
-def set_taxes(party, party_type, posting_date, company, out):
- print "posting_date", posting_date
+@frappe.whitelist()
+def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None, billing_address=None, shipping_address=None):
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
party_type: party,
- "customer_group": out.customer_group,
- "supplier_type": out.supplier_type,
+ "customer_group": customer_group,
+ "supplier_type": supplier_type,
"company": company
}
- args.update(get_party_details(party, party_type))
+
+ if billing_address or shipping_address:
+ args.update(get_party_details(party, party_type, {"billing_address": billing_address, "shipping_address": shipping_address }))
+ else:
+ args.update(get_party_details(party, party_type))
+
if party_type=="Customer":
args.update({"tax_type": "Sales"})
else:
args.update({"tax_type": "Purchase"})
-
return get_tax_template(posting_date, args)
\ No newline at end of file
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index 59992ebc04..1a86b2b620 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -43,6 +43,7 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) {
erpnext.utils.get_address_display = function(frm, address_field, display_field) {
if(frm.updating_party_details) return;
+
if(!address_field) {
if(frm.doc.customer) {
address_field = "customer_address";
@@ -50,14 +51,32 @@ erpnext.utils.get_address_display = function(frm, address_field, display_field)
address_field = "supplier_address";
} else return;
}
+
if(!display_field) display_field = "address_display";
if(frm.doc[address_field]) {
frappe.call({
method: "erpnext.utilities.doctype.address.address.get_address_display",
args: {"address_dict": frm.doc[address_field] },
callback: function(r) {
- if(r.message)
+ if(r.message){
frm.set_value(display_field, r.message)
+ }
+ frappe.call({
+ method: "erpnext.accounts.party.set_taxes",
+ args: {
+ "party": frm.doc.customer || frm.doc.supplier,
+ "party_type": (frm.doc.customer ? "Customer" : "Supplier"),
+ "posting_date": frm.doc.posting_date || frm.doc.transaction_date,
+ "company": frm.doc.company,
+ "billing_address": ((frm.doc.customer) ? (frm.doc.customer_address) : (frm.doc.supplier_address)),
+ "shipping_address": frm.doc.shipping_address_name
+ },
+ callback: function(r) {
+ if(r.message){
+ frm.set_value("taxes_and_charges", r.message)
+ }
+ }
+ });
}
})
}
From ef511b160ee496d8f9e9bfb2de05b3d65050ec18 Mon Sep 17 00:00:00 2001
From: Neil Trini Lasrado
Date: Wed, 26 Aug 2015 15:01:20 +0530
Subject: [PATCH 07/52] Added Tax Rule under ERPNext > Accounts > Setup
---
.../purchase_invoice/purchase_invoice.json | 2 +-
.../purchase_taxes_and_charges.json | 2 +-
.../sales_taxes_and_charges.json | 2 +-
.../accounts/doctype/tax_rule/tax_rule.json | 46 ++-
.../purchase_order/purchase_order.json | 1 +
erpnext/buying/doctype/supplier/supplier.json | 269 ++++++++++++++++++
erpnext/config/accounts.py | 5 +
7 files changed, 323 insertions(+), 4 deletions(-)
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 25ac8ffcc3..c1801eb20a 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -2375,4 +2375,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title"
-}
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
index a00184bf01..9e43ca05f8 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
@@ -504,7 +504,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2015-08-19 12:46:32.687299",
+ "modified": "2015-08-28 02:57:08.769473",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Taxes and Charges",
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
index 29534d832d..a0d8df47b1 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
@@ -456,7 +456,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2015-08-19 12:46:33.165519",
+ "modified": "2015-08-28 02:57:00.766305",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges",
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
index 52ca63f62e..1974440692 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.json
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -11,6 +11,8 @@
"fields": [
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"default": "Sales",
"fieldname": "tax_type",
"fieldtype": "Select",
@@ -33,6 +35,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break_1",
"fieldtype": "Column Break",
"hidden": 0,
@@ -52,6 +56,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "sales_tax_template",
"fieldtype": "Link",
@@ -74,6 +80,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "purchase_tax_template",
"fieldtype": "Link",
@@ -96,6 +104,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "filters",
"fieldtype": "Section Break",
"hidden": 0,
@@ -116,6 +126,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer",
"fieldtype": "Link",
@@ -138,6 +150,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier",
"fieldtype": "Link",
@@ -160,6 +174,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "billing_city",
"fieldtype": "Data",
"hidden": 0,
@@ -180,6 +196,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "billing_country",
"fieldtype": "Link",
"hidden": 0,
@@ -201,6 +219,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
@@ -220,6 +240,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Sales\"",
"fieldname": "customer_group",
"fieldtype": "Link",
@@ -242,6 +264,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"depends_on": "eval:doc.tax_type==\"Purchase\"",
"fieldname": "supplier_type",
"fieldtype": "Link",
@@ -264,6 +288,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "shipping_city",
"fieldtype": "Data",
"hidden": 0,
@@ -284,6 +310,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "shipping_country",
"fieldtype": "Link",
"hidden": 0,
@@ -305,6 +333,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"hidden": 0,
@@ -325,6 +355,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "from_date",
"fieldtype": "Date",
"hidden": 0,
@@ -345,6 +377,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"hidden": 0,
@@ -364,6 +398,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "to_date",
"fieldtype": "Date",
"hidden": 0,
@@ -384,6 +420,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
@@ -403,6 +441,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"default": "1",
"fieldname": "priority",
"fieldtype": "Int",
@@ -424,6 +464,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break_20",
"fieldtype": "Column Break",
"hidden": 0,
@@ -443,6 +485,8 @@
},
{
"allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "company",
"fieldtype": "Link",
"hidden": 0,
@@ -470,7 +514,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-08-21 03:27:43.564183",
+ "modified": "2015-08-28 02:56:51.283291",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index b092037b71..f6b6b31f38 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1609,6 +1609,7 @@
{
"allow_on_submit": 0,
"bold": 0,
+<<<<<<< HEAD
"collapsible": 1,
"fieldname": "column_break5",
"fieldtype": "Section Break",
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index ce68370d13..ec7dd5e1a2 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -12,6 +12,7 @@
"document_type": "Setup",
"fields": [
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -32,9 +33,32 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "basic_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -56,9 +80,33 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SUPP-",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -79,9 +127,32 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier Name",
+ "no_copy": 1,
+ "oldfieldname": "supplier_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -100,9 +171,30 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"width": "50%"
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -124,9 +216,33 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Supplier Type",
+ "no_copy": 0,
+ "oldfieldname": "supplier_type",
+ "oldfieldtype": "Link",
+ "options": "Supplier Type",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -146,9 +262,31 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "is_frozen",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Frozen",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -167,9 +305,33 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "address_contacts",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address & Contacts",
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "options": "icon-map-marker",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -189,9 +351,30 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address HTML",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -254,9 +437,51 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "contact_html",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact HTML",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -275,9 +500,30 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "default_payable_accounts",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Default Payable Accounts",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
+<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -299,6 +545,29 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+=======
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "description": "Mention if non-standard receivable account applicable",
+ "fieldname": "accounts",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounts",
+ "no_copy": 0,
+ "options": "Party Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+>>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index f32aeed022..71a2d700a6 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -106,6 +106,11 @@ def get_data():
"name": "Accounts Settings",
"description": _("Default settings for accounting transactions.")
},
+ {
+ "type": "doctype",
+ "name": "Tax Rule",
+ "description": _("Tax Rule for transactions.")
+ },
{
"type": "doctype",
"name": "Sales Taxes and Charges Template",
From def71d4d5dddc2ac19428c45d228fa50721450f2 Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Fri, 11 Sep 2015 11:14:07 +0530
Subject: [PATCH 08/52] [Shopping Cart][Fixes] tax calculation based on tax
rule
---
erpnext/accounts/doctype/tax_rule/tax_rule.js | 18 ++++++++
.../accounts/doctype/tax_rule/tax_rule.json | 24 +++++++++-
erpnext/accounts/party.py | 6 ++-
erpnext/shopping_cart/cart.py | 15 ++++---
.../shopping_cart_settings.json | 44 +------------------
.../shopping_cart_settings.py | 22 +++++-----
6 files changed, 68 insertions(+), 61 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.js b/erpnext/accounts/doctype/tax_rule/tax_rule.js
index d4a10aaec3..4b059dc564 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.js
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js
@@ -7,6 +7,24 @@ cur_frm.add_fetch("supplier", "supplier_type", "supplier_type" );
cur_frm.toggle_reqd("sales_tax_template", cur_frm.doc.tax_type=="Sales");
cur_frm.toggle_reqd("purchase_tax_template", cur_frm.doc.tax_type=="Purchase");
+
+frappe.ui.form.on("Tax Rule", "onload", function(frm) {
+ if(frm.doc.__islocal){
+ frm.set_value("use_for_shopping_cart", 1);
+ }
+})
+
+frappe.ui.form.on("Tax Rule", "use_for_shopping_cart", function(frm) {
+ if(!frm.doc.use_for_shopping_cart && (frappe.get_list("Tax Rule", {"use_for_shopping_cart":1}).length == 0)){
+ frappe.model.get_value("Shopping Cart Settings", "Shopping Cart Settings", "enabled", function(docfield) {
+ if(docfield.enabled){
+ frm.set_value("use_for_shopping_cart", 1);
+ frappe.throw(__("Shopping Cart is enabled"));
+ }
+ });
+ }
+})
+
frappe.ui.form.on("Tax Rule", "customer", function(frm) {
frappe.call({
method:"erpnext.accounts.doctype.tax_rule.tax_rule.get_party_details",
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
index 1974440692..61d4d1d04a 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.json
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -33,6 +33,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "use_for_shopping_cart",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Use for Shopping Cart",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -514,7 +536,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-08-28 02:56:51.283291",
+ "modified": "2015-09-10 19:27:47.969867",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index a6b5c78cad..d830a20bf6 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -278,7 +278,7 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
@frappe.whitelist()
-def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None, billing_address=None, shipping_address=None):
+def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None, billing_address=None, shipping_address=None, for_shopping_cart=None):
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
party_type: party,
@@ -296,4 +296,8 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
args.update({"tax_type": "Sales"})
else:
args.update({"tax_type": "Purchase"})
+
+ if for_shopping_cart:
+ args.update({"use_for_shopping_cart": for_shopping_cart})
+
return get_tax_template(posting_date, args)
\ No newline at end of file
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index cfba98b4ab..78fd6ba141 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -266,12 +266,16 @@ def _set_price_list(quotation, cart_settings, billing_territory):
def set_taxes(quotation, cart_settings, billing_territory):
"""set taxes based on billing territory"""
- quotation.taxes_and_charges = cart_settings.get_tax_master(billing_territory)
-
- # clear table
+ from erpnext.accounts.party import set_taxes
+
+ quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer", \
+ quotation.transaction_date, quotation.company, None, None, \
+ quotation.customer_address, quotation.shipping_address_name, 1)
+#
+# # clear table
quotation.set("taxes", [])
-
- # append taxes
+#
+# # append taxes
quotation.append_taxes_from_master()
def get_lead_or_customer():
@@ -357,6 +361,7 @@ def get_shipping_rules(party=None, quotation=None, cart_settings=None):
shipping_territory = get_address_territory(quotation.shipping_address_name) or \
party.territory
+
shipping_rules = cart_settings.get_shipping_rules(shipping_territory)
return shipping_rules
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
index 818550e75f..873120f7e1 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
@@ -221,48 +221,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_10",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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_taxes_and_charges_masters",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges",
- "no_copy": 0,
- "options": "Shopping Cart Taxes and Charges Master",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"hide_heading": 0,
@@ -274,7 +232,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-02-05 05:11:46.714019",
+ "modified": "2015-09-10 19:05:17.386135",
"modified_by": "Administrator",
"module": "Shopping Cart",
"name": "Shopping Cart Settings",
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index 8fbf4a430e..425c6d6a9f 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -20,15 +20,15 @@ class ShoppingCartSettings(Document):
def validate(self):
if self.enabled:
self.validate_price_lists()
- self.validate_tax_masters()
self.validate_exchange_rates_exist()
-
+ self.validate_tax_rule()
+
def validate_overlapping_territories(self, parentfield, fieldname):
# for displaying message
doctype = self.meta.get_field(parentfield).options
# specify atleast one entry in the table
- self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
+ # self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
territory_name_map = self.get_territory_name_map(parentfield, fieldname)
for territory, names in territory_name_map.items():
@@ -48,20 +48,14 @@ class ShoppingCartSettings(Document):
msgprint(_("Please specify a Price List which is valid for Territory") +
": " + self.default_territory, raise_exception=ShoppingCartSetupError)
- def validate_tax_masters(self):
- self.validate_overlapping_territories("sales_taxes_and_charges_masters",
- "sales_taxes_and_charges_master")
-
def get_territory_name_map(self, parentfield, fieldname):
territory_name_map = {}
# entries in table
names = [doc.get(fieldname) for doc in self.get(parentfield)]
-
if names:
# for condition in territory check
parenttype = frappe.get_meta(self.meta.get_options(parentfield)).get_options(fieldname)
-
# to validate territory overlap
# make a map of territory: [list of names]
# if list against each territory has more than one element, raise exception
@@ -75,7 +69,6 @@ class ShoppingCartSettings(Document):
if len(territory_name_map[territory]) > 1:
territory_name_map[territory].sort(key=lambda val: names.index(val))
-
return territory_name_map
def validate_exchange_rates_exist(self):
@@ -131,7 +124,11 @@ class ShoppingCartSettings(Document):
"price_lists", "selling_price_list")
return price_list and price_list[0] or None
-
+
+ def validate_tax_rule(self):
+ if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart" : 1}, "name", debug=1):
+ frappe.throw(frappe._("Set Tax Rule for shopping cart"), ShoppingCartSetupError)
+
def get_tax_master(self, billing_territory):
tax_master = self.get_name_from_territory(billing_territory, "sales_taxes_and_charges_masters",
"sales_taxes_and_charges_master")
@@ -170,6 +167,9 @@ def check_shopping_cart_enabled():
def apply_shopping_cart_settings(quotation, method):
"""Called via a validate hook on Quotation"""
+
+ """no hooks call added yet. same functionality is in cart.py, which will get triggered by cart.js"""
+
from erpnext.shopping_cart import get_party
if quotation.order_type != "Shopping Cart":
return
From 957e7a37be8e71f18ea78971d64c5c8932bd211d Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Fri, 11 Sep 2015 15:44:06 +0530
Subject: [PATCH 09/52] [Shopping Cart][Fixes] tax calculation based on tax
rule
---
erpnext/accounts/doctype/tax_rule/tax_rule.py | 2 +-
erpnext/accounts/party.py | 12 ++--
.../shopping_cart_settings.py | 2 +-
.../test_shopping_cart_settings.py | 32 ++++-------
erpnext/shopping_cart/test_shopping_cart.py | 55 ++++++++++++++++---
5 files changed, 68 insertions(+), 35 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 705a26e771..ddd2a20013 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -115,7 +115,7 @@ def get_tax_template(posting_date, args):
conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
matching = frappe.db.sql("""select * from `tabTax Rule`
- where {0}""".format(" and ".join(conditions)), as_dict = True)
+ where {0}""".format(" and ".join(conditions)), as_dict = True, debug=True)
if not matching:
return None
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index d830a20bf6..edb362560f 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -278,7 +278,9 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
@frappe.whitelist()
-def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None, billing_address=None, shipping_address=None, for_shopping_cart=None):
+def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
+ billing_address=None, shipping_address=None, use_for_shopping_cart=None):
+
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
party_type: party,
@@ -288,7 +290,8 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
}
if billing_address or shipping_address:
- args.update(get_party_details(party, party_type, {"billing_address": billing_address, "shipping_address": shipping_address }))
+ args.update(get_party_details(party, party_type, {"billing_address": billing_address, \
+ "shipping_address": shipping_address }))
else:
args.update(get_party_details(party, party_type))
@@ -297,7 +300,8 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
else:
args.update({"tax_type": "Purchase"})
- if for_shopping_cart:
- args.update({"use_for_shopping_cart": for_shopping_cart})
+ if use_for_shopping_cart:
+ print "use_for_shopping_cart", use_for_shopping_cart
+ args.update({"use_for_shopping_cart": use_for_shopping_cart})
return get_tax_template(posting_date, args)
\ No newline at end of file
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index 425c6d6a9f..35f21dc3f7 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -126,7 +126,7 @@ class ShoppingCartSettings(Document):
return price_list and price_list[0] or None
def validate_tax_rule(self):
- if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart" : 1}, "name", debug=1):
+ if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart" : 1}, "name"):
frappe.throw(frappe._("Set Tax Rule for shopping cart"), ShoppingCartSetupError)
def get_tax_master(self, billing_territory):
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 46cbfdf9ed..23d74fa0bb 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -43,28 +43,6 @@ class TestShoppingCartSettings(unittest.TestCase):
return cart_settings
- def test_taxes_territory_overlap(self):
- cart_settings = self.get_cart_settings()
-
- def _add_tax_master(tax_master):
- cart_settings.append("sales_taxes_and_charges_masters", {
- "doctype": "Shopping Cart Taxes and Charges Master",
- "sales_taxes_and_charges_master": tax_master
- })
-
- for tax_master in ("_Test Sales Taxes and Charges Template", "_Test India Tax Master"):
- _add_tax_master(tax_master)
-
- controller = cart_settings
- controller.validate_overlapping_territories("sales_taxes_and_charges_masters",
- "sales_taxes_and_charges_master")
-
- _add_tax_master("_Test Sales Taxes and Charges Template - Rest of the World")
-
- controller = cart_settings
- self.assertRaises(ShoppingCartSetupError, controller.validate_overlapping_territories,
- "sales_taxes_and_charges_masters", "sales_taxes_and_charges_master")
-
def test_exchange_rate_exists(self):
frappe.db.sql("""delete from `tabCurrency Exchange`""")
@@ -77,3 +55,13 @@ class TestShoppingCartSettings(unittest.TestCase):
frappe.get_doc(currency_exchange_records[0]).insert()
controller.validate_exchange_rates_exist()
+ def test_tax_rule_validation(self):
+ frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 0")
+ frappe.db.commit()
+
+ cart_settings = self.get_cart_settings()
+ cart_settings.enabled = 1
+ if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart": 1}, "name"):
+ print "here"
+ self.assertRaises(ShoppingCartSetupError, cart_settings.validate_tax_rule)
+
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 1873b813be..086100c821 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -109,6 +109,54 @@ class TestShoppingCart(unittest.TestCase):
quotation = self.test_get_cart_lead()
self.assertEquals(quotation.net_total, 0)
self.assertEquals(len(quotation.get("items")), 0)
+
+ def test_taxe_rule(self):
+ frappe.set_user("Administrator")
+ self.create_tax_rule()
+ quotation = self.test_get_cart_customer()
+ set_item_in_cart("_Test Item", 1)
+
+ from erpnext.accounts.party import set_taxes
+
+ tax_rule_master = set_taxes(quotation.customer, "Customer", \
+ quotation.transaction_date, quotation.company, None, None, \
+ quotation.customer_address, quotation.shipping_address_name, 1)
+
+ self.assertEquals(quotation.taxes_and_charges, tax_rule_master)
+ self.assertEquals(quotation.total_taxes_and_charges, "1000")
+
+ def create_tax_rule(self):
+ for tax_rule_setting in [{"priority": 1, "use_for_shopping_cart": 1}, {"priority": 2, "use_for_shopping_cart": 0}]:
+ tax_template = self.get_tax_template(tax_rule_setting['priority']).name
+ print tax_template
+ tax_rule = frappe.get_doc({
+ "doctype": "Tax Rule",
+ "tax_type" : "Sales",
+ "sales_tax_template": tax_template,
+ "use_for_shopping_cart": tax_rule_setting["use_for_shopping_cart"],
+ "billing_city": "_Test City",
+ "billing_country": "India",
+ "shipping_city": "_Test City",
+ "shipping_country": "India",
+ "priority": tax_rule_setting['priority']
+ }).insert()
+
+ def get_tax_template(self, priority):
+ return frappe.get_doc({
+ "doctype" : "Sales Taxes and Charges Template",
+ "title": "_Test Tax %s"%priority,
+ "company": "_Test Company",
+ "taxes":[{
+ "charge_type": "Actual",
+ "account_head": "Sales Expenses - _TC",
+ "cost_center": "Main - _TC",
+ "description": "Test Shopping cart taxes with Tax Rule",
+ "tax_amount": 1000*priority
+ }],
+ "territories":[{
+ "territory" : "All Territories"
+ }]
+ }).insert()
# helper functions
def enable_shopping_cart(self):
@@ -131,13 +179,6 @@ class TestShoppingCart(unittest.TestCase):
{"doctype": "Shopping Cart Price List", "parentfield": "price_lists",
"selling_price_list": "_Test Price List Rest of the World"}
])
- settings.set("sales_taxes_and_charges_masters", [
- # tax masters
- {"doctype": "Shopping Cart Taxes and Charges Master", "parentfield": "sales_taxes_and_charges_masters",
- "sales_taxes_and_charges_master": "_Test India Tax Master"},
- {"doctype": "Shopping Cart Taxes and Charges Master", "parentfield": "sales_taxes_and_charges_masters",
- "sales_taxes_and_charges_master": "_Test Sales Taxes and Charges Template - Rest of the World"},
- ])
settings.set("shipping_rules", {"doctype": "Shopping Cart Shipping Rule", "parentfield": "shipping_rules",
"shipping_rule": "_Test Shipping Rule - India"})
From 8f7317175da1179fb8a258d8dbd9a05e6bd78a5c Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Mon, 14 Sep 2015 11:13:01 +0530
Subject: [PATCH 10/52] [enhancement] bring taxes from tax rules and test cases
---
erpnext/accounts/doctype/tax_rule/tax_rule.py | 2 +-
erpnext/accounts/party.py | 1 -
erpnext/shopping_cart/__init__.py | 1 +
erpnext/shopping_cart/cart.py | 7 +-
.../shopping_cart_settings.json | 23 ++++++-
.../shopping_cart_settings.py | 56 +--------------
.../test_shopping_cart_settings.py | 1 -
erpnext/shopping_cart/test_shopping_cart.py | 69 +++++++++++++------
8 files changed, 79 insertions(+), 81 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index ddd2a20013..705a26e771 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -115,7 +115,7 @@ def get_tax_template(posting_date, args):
conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
matching = frappe.db.sql("""select * from `tabTax Rule`
- where {0}""".format(" and ".join(conditions)), as_dict = True, debug=True)
+ where {0}""".format(" and ".join(conditions)), as_dict = True)
if not matching:
return None
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index edb362560f..8ad30583e1 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -301,7 +301,6 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
args.update({"tax_type": "Purchase"})
if use_for_shopping_cart:
- print "use_for_shopping_cart", use_for_shopping_cart
args.update({"use_for_shopping_cart": use_for_shopping_cart})
return get_tax_template(posting_date, args)
\ No newline at end of file
diff --git a/erpnext/shopping_cart/__init__.py b/erpnext/shopping_cart/__init__.py
index 1858c0d842..e92f94e9a7 100644
--- a/erpnext/shopping_cart/__init__.py
+++ b/erpnext/shopping_cart/__init__.py
@@ -35,6 +35,7 @@ def get_quotation(user=None):
quotation = frappe.new_doc("Quotation")
quotation.update(values)
if party.doctype == "Customer":
+ print "create quoation for cutomer"
quotation.contact_person = frappe.db.get_value("Contact", {"customer": party.name, "email_id": user})
quotation.insert(ignore_permissions=True)
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 78fd6ba141..30f4aba493 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -267,9 +267,11 @@ def _set_price_list(quotation, cart_settings, billing_territory):
def set_taxes(quotation, cart_settings, billing_territory):
"""set taxes based on billing territory"""
from erpnext.accounts.party import set_taxes
-
+
+ customer_group = frappe.db.get_value("Customer", quotation.customer, "customer_group")
+
quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer", \
- quotation.transaction_date, quotation.company, None, None, \
+ quotation.transaction_date, quotation.company, customer_group, None, \
quotation.customer_address, quotation.shipping_address_name, 1)
#
# # clear table
@@ -361,7 +363,6 @@ def get_shipping_rules(party=None, quotation=None, cart_settings=None):
shipping_territory = get_address_territory(quotation.shipping_address_name) or \
party.territory
-
shipping_rules = cart_settings.get_shipping_rules(shipping_territory)
return shipping_rules
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
index 873120f7e1..881ff4e377 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
@@ -200,6 +200,27 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -232,7 +253,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-09-10 19:05:17.386135",
+ "modified": "2015-09-11 19:03:54.750937",
"modified_by": "Administrator",
"module": "Shopping Cart",
"name": "Shopping Cart Settings",
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index 35f21dc3f7..da7d27af10 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -28,7 +28,7 @@ class ShoppingCartSettings(Document):
doctype = self.meta.get_field(parentfield).options
# specify atleast one entry in the table
- # self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
+ self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
territory_name_map = self.get_territory_name_map(parentfield, fieldname)
for territory, names in territory_name_map.items():
@@ -105,7 +105,6 @@ class ShoppingCartSettings(Document):
def get_name_from_territory(self, territory, parentfield, fieldname):
name = None
territory_name_map = self.get_territory_name_map(parentfield, fieldname)
-
if territory_name_map.get(territory):
name = territory_name_map.get(territory)
else:
@@ -164,55 +163,4 @@ def get_default_territory():
def check_shopping_cart_enabled():
if not get_shopping_cart_settings().enabled:
frappe.throw(_("You need to enable Shopping Cart"), ShoppingCartSetupError)
-
-def apply_shopping_cart_settings(quotation, method):
- """Called via a validate hook on Quotation"""
-
- """no hooks call added yet. same functionality is in cart.py, which will get triggered by cart.js"""
-
- from erpnext.shopping_cart import get_party
- if quotation.order_type != "Shopping Cart":
- return
-
- quotation.billing_territory = (get_territory_from_address(quotation.customer_address)
- or get_party(quotation.contact_email).territory or get_default_territory())
- quotation.shipping_territory = (get_territory_from_address(quotation.shipping_address_name)
- or get_party(quotation.contact_email).territory or get_default_territory())
-
- set_price_list(quotation)
- set_taxes_and_charges(quotation)
- quotation.calculate_taxes_and_totals()
- set_shipping_rule(quotation)
-
-def set_price_list(quotation):
- previous_selling_price_list = quotation.selling_price_list
- quotation.selling_price_list = get_shopping_cart_settings().get_price_list(quotation.billing_territory)
-
- if not quotation.selling_price_list:
- quotation.selling_price_list = get_shopping_cart_settings().get_price_list(get_default_territory())
-
- if previous_selling_price_list != quotation.selling_price_list:
- quotation.price_list_currency = quotation.currency = quotation.plc_conversion_rate = quotation.conversion_rate = None
- for d in quotation.get("items"):
- d.price_list_rate = d.discount_percentage = d.rate = d.amount = None
-
- quotation.set_price_list_and_item_details()
-
-def set_taxes_and_charges(quotation):
- previous_taxes_and_charges = quotation.taxes_and_charges
- quotation.taxes_and_charges = get_shopping_cart_settings().get_tax_master(quotation.billing_territory)
-
- if previous_taxes_and_charges != quotation.taxes_and_charges:
- quotation.set_other_charges()
-
-def set_shipping_rule(quotation):
- shipping_rules = get_shopping_cart_settings().get_shipping_rules(quotation.shipping_territory)
- if not shipping_rules:
- quotation.remove_shipping_charge()
- return
-
- if quotation.shipping_rule not in shipping_rules:
- quotation.remove_shipping_charge()
- quotation.shipping_rule = shipping_rules[0]
-
- quotation.apply_shipping_rule()
+
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 23d74fa0bb..b38072c5fb 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -62,6 +62,5 @@ class TestShoppingCartSettings(unittest.TestCase):
cart_settings = self.get_cart_settings()
cart_settings.enabled = 1
if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart": 1}, "name"):
- print "here"
self.assertRaises(ShoppingCartSetupError, cart_settings.validate_tax_rule)
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 086100c821..c0945a1c4f 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -4,7 +4,8 @@
from __future__ import unicode_literals
import unittest
import frappe
-from erpnext.shopping_cart import get_quotation, set_item_in_cart
+from erpnext.shopping_cart import get_quotation, set_item_in_cart, get_party
+import random
class TestShoppingCart(unittest.TestCase):
"""
@@ -110,42 +111,42 @@ class TestShoppingCart(unittest.TestCase):
self.assertEquals(quotation.net_total, 0)
self.assertEquals(len(quotation.get("items")), 0)
- def test_taxe_rule(self):
- frappe.set_user("Administrator")
+
+ def test_taxe_rule(self):
self.create_tax_rule()
- quotation = self.test_get_cart_customer()
- set_item_in_cart("_Test Item", 1)
-
+ self.login_as_customer()
+ quotation = self.create_quotation()
+
from erpnext.accounts.party import set_taxes
-
+
tax_rule_master = set_taxes(quotation.customer, "Customer", \
quotation.transaction_date, quotation.company, None, None, \
quotation.customer_address, quotation.shipping_address_name, 1)
-
+
self.assertEquals(quotation.taxes_and_charges, tax_rule_master)
- self.assertEquals(quotation.total_taxes_and_charges, "1000")
+ self.assertEquals(quotation.total_taxes_and_charges, 1000.0)
def create_tax_rule(self):
for tax_rule_setting in [{"priority": 1, "use_for_shopping_cart": 1}, {"priority": 2, "use_for_shopping_cart": 0}]:
tax_template = self.get_tax_template(tax_rule_setting['priority']).name
- print tax_template
tax_rule = frappe.get_doc({
- "doctype": "Tax Rule",
- "tax_type" : "Sales",
- "sales_tax_template": tax_template,
- "use_for_shopping_cart": tax_rule_setting["use_for_shopping_cart"],
- "billing_city": "_Test City",
- "billing_country": "India",
- "shipping_city": "_Test City",
- "shipping_country": "India",
- "priority": tax_rule_setting['priority']
+ "doctype": "Tax Rule",
+ "tax_type" : "Sales",
+ "sales_tax_template": tax_template,
+ "use_for_shopping_cart": tax_rule_setting["use_for_shopping_cart"],
+ "billing_city": "_Test City",
+ "billing_country": "India",
+ "shipping_city": "_Test City",
+ "shipping_country": "India",
+ "priority": tax_rule_setting['priority'],
+ "company": frappe.get_value("Global Defaults", "Global Defaults", "default_company")
}).insert()
def get_tax_template(self, priority):
return frappe.get_doc({
"doctype" : "Sales Taxes and Charges Template",
"title": "_Test Tax %s"%priority,
- "company": "_Test Company",
+ "company": frappe.get_value("Global Defaults", "Global Defaults", "default_company"),
"taxes":[{
"charge_type": "Actual",
"account_head": "Sales Expenses - _TC",
@@ -157,6 +158,34 @@ class TestShoppingCart(unittest.TestCase):
"territory" : "All Territories"
}]
}).insert()
+
+ def create_quotation(self):
+ quotation = frappe.new_doc("Quotation")
+
+ values = {
+ "doctype": "Quotation",
+ "quotation_to": "Customer",
+ "order_type": "Shopping Cart",
+ "customer": get_party(frappe.session.user).name,
+ "docstatus": 0,
+ "contact_email": frappe.session.user,
+ "selling_price_list": "_Test Price List Rest of the World",
+ "currency": "USD",
+ "taxes_and_charges" : "_Test Tax 1",
+ "items": [{
+ "item_code": "_Test Item",
+ "qty": 1
+ }],
+ "taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes
+ }
+
+ quotation.update(values)
+
+ quotation.insert(ignore_permissions=True)
+
+ frappe.reload_doc("selling", "Quotation", quotation.name)
+
+ return quotation
# helper functions
def enable_shopping_cart(self):
From 7c867ae9ad04df6f62f232cdf14e572baad3c02b Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Mon, 14 Sep 2015 16:59:10 +0530
Subject: [PATCH 11/52] [Fixes] Tax Rule preparation and test taxes creation,
remove dummy quotation
---
.../test_records.json | 30 +++++++++++
.../doctype/tax_rule/test_records.json | 26 ++++++++++
erpnext/controllers/accounts_controller.py | 1 +
erpnext/shopping_cart/__init__.py | 1 -
.../__init__.py | 0
...hopping_cart_taxes_and_charges_master.json | 49 -----------------
.../shopping_cart_taxes_and_charges_master.py | 12 -----
erpnext/shopping_cart/test_shopping_cart.py | 52 ++++---------------
8 files changed, 68 insertions(+), 103 deletions(-)
create mode 100644 erpnext/accounts/doctype/tax_rule/test_records.json
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/__init__.py
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
index 5c25517f7f..69dbd8e9a6 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
@@ -213,5 +213,35 @@
"territory": "_Test Territory Rest Of The World"
}
]
+ },
+ {
+ "doctype" : "Sales Taxes and Charges Template",
+ "title": "_Test Tax 1",
+ "company": "_Test Company",
+ "taxes":[{
+ "charge_type": "Actual",
+ "account_head": "Sales Expenses - _TC",
+ "cost_center": "Main - _TC",
+ "description": "Test Shopping cart taxes with Tax Rule",
+ "tax_amount": 1000
+ }],
+ "territories":[{
+ "territory" : "All Territories"
+ }]
+ },
+ {
+ "doctype" : "Sales Taxes and Charges Template",
+ "title": "_Test Tax 2",
+ "company": "_Test Company",
+ "taxes":[{
+ "charge_type": "Actual",
+ "account_head": "Sales Expenses - _TC",
+ "cost_center": "Main - _TC",
+ "description": "Test Shopping cart taxes with Tax Rule",
+ "tax_amount": 200
+ }],
+ "territories":[{
+ "territory" : "All Territories"
+ }]
}
]
diff --git a/erpnext/accounts/doctype/tax_rule/test_records.json b/erpnext/accounts/doctype/tax_rule/test_records.json
new file mode 100644
index 0000000000..ebfb0c5b1b
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/test_records.json
@@ -0,0 +1,26 @@
+[
+ {
+ "doctype": "Tax Rule",
+ "tax_type" : "Sales",
+ "sales_tax_template": "_Test Tax 1",
+ "use_for_shopping_cart": 1,
+ "billing_city": "_Test City",
+ "billing_country": "India",
+ "shipping_city": "_Test City",
+ "shipping_country": "India",
+ "priority": 1,
+ "company": "_Test Company"
+ },
+ {
+ "doctype": "Tax Rule",
+ "tax_type" : "Sales",
+ "sales_tax_template": "_Test Tax 2",
+ "use_for_shopping_cart": 0,
+ "billing_city": "_Test City",
+ "billing_country": "India",
+ "shipping_city": "_Test City",
+ "shipping_country": "India",
+ "priority": 2,
+ "company": "_Test Company"
+ }
+]
\ No newline at end of file
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index ceb993096a..8c61005a71 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -182,6 +182,7 @@ class AccountsController(TransactionBase):
self.append_taxes_from_master(tax_master_doctype)
def append_taxes_from_master(self, tax_master_doctype=None):
+ print "append_taxes_from_master"
if self.get("taxes_and_charges"):
if not tax_master_doctype:
tax_master_doctype = self.meta.get_field("taxes_and_charges").options
diff --git a/erpnext/shopping_cart/__init__.py b/erpnext/shopping_cart/__init__.py
index e92f94e9a7..1858c0d842 100644
--- a/erpnext/shopping_cart/__init__.py
+++ b/erpnext/shopping_cart/__init__.py
@@ -35,7 +35,6 @@ def get_quotation(user=None):
quotation = frappe.new_doc("Quotation")
quotation.update(values)
if party.doctype == "Customer":
- print "create quoation for cutomer"
quotation.contact_person = frappe.db.get_value("Contact", {"customer": party.name, "email_id": user})
quotation.insert(ignore_permissions=True)
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/__init__.py b/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json b/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json
deleted file mode 100644
index e15dcab5af..0000000000
--- a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "allow_copy": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "creation": "2013-06-20 16:57:03",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "fields": [
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_taxes_and_charges_master",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Tax Master",
- "no_copy": 0,
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- }
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "modified": "2013-12-20 19:30:47",
- "modified_by": "Administrator",
- "module": "Shopping Cart",
- "name": "Shopping Cart Taxes and Charges Master",
- "owner": "Administrator",
- "permissions": [],
- "read_only": 0,
- "read_only_onload": 0
-}
\ No newline at end of file
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py b/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
deleted file mode 100644
index d2ec545c7e..0000000000
--- a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-from frappe.model.document import Document
-
-class ShoppingCartTaxesandChargesMaster(Document):
- pass
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index c0945a1c4f..bd0b138d45 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -5,7 +5,6 @@ from __future__ import unicode_literals
import unittest
import frappe
from erpnext.shopping_cart import get_quotation, set_item_in_cart, get_party
-import random
class TestShoppingCart(unittest.TestCase):
"""
@@ -113,10 +112,9 @@ class TestShoppingCart(unittest.TestCase):
def test_taxe_rule(self):
- self.create_tax_rule()
self.login_as_customer()
quotation = self.create_quotation()
-
+
from erpnext.accounts.party import set_taxes
tax_rule_master = set_taxes(quotation.customer, "Customer", \
@@ -126,38 +124,7 @@ class TestShoppingCart(unittest.TestCase):
self.assertEquals(quotation.taxes_and_charges, tax_rule_master)
self.assertEquals(quotation.total_taxes_and_charges, 1000.0)
- def create_tax_rule(self):
- for tax_rule_setting in [{"priority": 1, "use_for_shopping_cart": 1}, {"priority": 2, "use_for_shopping_cart": 0}]:
- tax_template = self.get_tax_template(tax_rule_setting['priority']).name
- tax_rule = frappe.get_doc({
- "doctype": "Tax Rule",
- "tax_type" : "Sales",
- "sales_tax_template": tax_template,
- "use_for_shopping_cart": tax_rule_setting["use_for_shopping_cart"],
- "billing_city": "_Test City",
- "billing_country": "India",
- "shipping_city": "_Test City",
- "shipping_country": "India",
- "priority": tax_rule_setting['priority'],
- "company": frappe.get_value("Global Defaults", "Global Defaults", "default_company")
- }).insert()
-
- def get_tax_template(self, priority):
- return frappe.get_doc({
- "doctype" : "Sales Taxes and Charges Template",
- "title": "_Test Tax %s"%priority,
- "company": frappe.get_value("Global Defaults", "Global Defaults", "default_company"),
- "taxes":[{
- "charge_type": "Actual",
- "account_head": "Sales Expenses - _TC",
- "cost_center": "Main - _TC",
- "description": "Test Shopping cart taxes with Tax Rule",
- "tax_amount": 1000*priority
- }],
- "territories":[{
- "territory" : "All Territories"
- }]
- }).insert()
+ self.remove_test_quotation(quotation)
def create_quotation(self):
quotation = frappe.new_doc("Quotation")
@@ -176,16 +143,19 @@ class TestShoppingCart(unittest.TestCase):
"item_code": "_Test Item",
"qty": 1
}],
- "taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes
+ "taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes,
+ "company": "_Test Company"
}
quotation.update(values)
quotation.insert(ignore_permissions=True)
- frappe.reload_doc("selling", "Quotation", quotation.name)
-
return quotation
+
+ def remove_test_quotation(self, quotation):
+ frappe.set_user("Administrator")
+ quotation.delete()
# helper functions
def enable_shopping_cart(self):
@@ -210,6 +180,7 @@ class TestShoppingCart(unittest.TestCase):
])
settings.set("shipping_rules", {"doctype": "Shopping Cart Shipping Rule", "parentfield": "shipping_rules",
"shipping_rule": "_Test Shipping Rule - India"})
+
settings.save()
frappe.local.shopping_cart_settings = None
@@ -273,7 +244,6 @@ class TestShoppingCart(unittest.TestCase):
quotation = get_quotation()
quotation.set("items", [])
quotation.save(ignore_permissions=True)
-
-
+
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
- "Customer Group", "Lead", "Customer", "Contact", "Address", "Item"]
+ "Customer Group", "Lead", "Customer", "Contact", "Address", "Item", "Tax Rule"]
From 24fa06bc53ddad1b6a40e71b352bdd7b1171ce74 Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Mon, 14 Sep 2015 18:48:39 +0530
Subject: [PATCH 12/52] [Fixes] rebase conflict fixes
---
.../purchase_order/purchase_order.json | 1 -
erpnext/buying/doctype/supplier/supplier.json | 270 ------------------
2 files changed, 271 deletions(-)
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index f6b6b31f38..b092037b71 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1609,7 +1609,6 @@
{
"allow_on_submit": 0,
"bold": 0,
-<<<<<<< HEAD
"collapsible": 1,
"fieldname": "column_break5",
"fieldtype": "Section Break",
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index ec7dd5e1a2..2a0a50d45d 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -1,5 +1,4 @@
{
-<<<<<<< HEAD
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 1,
@@ -12,7 +11,6 @@
"document_type": "Setup",
"fields": [
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -33,32 +31,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "basic_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-user",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -80,33 +55,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SUPP-",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -127,32 +78,9 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Supplier Name",
- "no_copy": 1,
- "oldfieldname": "supplier_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -171,30 +99,9 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"width": "50%"
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -216,33 +123,9 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "supplier_type",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Supplier Type",
- "no_copy": 0,
- "oldfieldname": "supplier_type",
- "oldfieldtype": "Link",
- "options": "Supplier Type",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -262,31 +145,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "is_frozen",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Frozen",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -305,33 +166,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:!doc.__islocal",
- "fieldname": "address_contacts",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address & Contacts",
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "options": "icon-map-marker",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -351,30 +188,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address HTML",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -437,51 +253,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "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": "contact_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact HTML",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -500,30 +274,9 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "default_payable_accounts",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Default Payable Accounts",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
-<<<<<<< HEAD
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -545,29 +298,6 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
-=======
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:!doc.__islocal",
- "description": "Mention if non-standard receivable account applicable",
- "fieldname": "accounts",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Accounts",
- "no_copy": 0,
- "options": "Party Account",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
->>>>>>> Added Tax Rule under ERPNext > Accounts > Setup
"unique": 0
},
{
From 052babc6b6c2d5bbfbe35c7839fbaacf86680343 Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Mon, 14 Sep 2015 18:51:46 +0530
Subject: [PATCH 13/52] [Fixes] [Minor] removed console statement
---
erpnext/controllers/accounts_controller.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 8c61005a71..ceb993096a 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -182,7 +182,6 @@ class AccountsController(TransactionBase):
self.append_taxes_from_master(tax_master_doctype)
def append_taxes_from_master(self, tax_master_doctype=None):
- print "append_taxes_from_master"
if self.get("taxes_and_charges"):
if not tax_master_doctype:
tax_master_doctype = self.meta.get_field("taxes_and_charges").options
From bb9427d1efcefb850714d1dffa6ccc503e34edba Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Mon, 14 Sep 2015 19:15:16 +0530
Subject: [PATCH 14/52] [Fixes] deprecated
---
.../shopping_cart_settings/test_shopping_cart_settings.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index b38072c5fb..b18cece44a 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -12,7 +12,6 @@ class TestShoppingCartSettings(unittest.TestCase):
def setUp(self):
frappe.db.sql("""delete from `tabSingles` where doctype="Shipping Cart Settings" """)
frappe.db.sql("""delete from `tabShopping Cart Price List`""")
- frappe.db.sql("""delete from `tabShopping Cart Taxes and Charges Master`""")
frappe.db.sql("""delete from `tabShopping Cart Shipping Rule`""")
def get_cart_settings(self):
From adde1cff487d541370cb5cafbffb96fb6c3e09af Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Tue, 15 Sep 2015 12:49:32 +0530
Subject: [PATCH 15/52] [Enhancement] add state ccriteria in tax rule
---
.../accounts/doctype/tax_rule/tax_rule.json | 46 ++++++++++++++++++-
erpnext/accounts/doctype/tax_rule/tax_rule.py | 7 ++-
2 files changed, 50 insertions(+), 3 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.json b/erpnext/accounts/doctype/tax_rule/tax_rule.json
index 61d4d1d04a..60011dd9a3 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.json
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -216,6 +216,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "billing_state",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing State",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -330,6 +352,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_state",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping State",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -536,7 +580,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-10 19:27:47.969867",
+ "modified": "2015-09-15 12:29:34.435839",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Tax Rule",
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 705a26e771..93bbf459c3 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -94,16 +94,19 @@ def get_party_details(party, party_type, args=None):
billing_filters= {party_type: party, "is_primary_address": 1}
shipping_filters= {party_type:party, "is_shipping_address": 1}
- billing_address= frappe.get_all("Address", fields=["city", "country"], filters= billing_filters)
- shipping_address= frappe.get_all("Address", fields=["city", "country"], filters= shipping_filters)
+ billing_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= billing_filters)
+ shipping_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= shipping_filters)
if billing_address:
out["billing_city"]= billing_address[0].city
+ out["billing_state"]= billing_address[0].state
out["billing_country"]= billing_address[0].country
if shipping_address:
out["shipping_city"]= shipping_address[0].city
+ out["shipping_state"]= shipping_address[0].state
out["shipping_country"]= shipping_address[0].country
+
return out
def get_tax_template(posting_date, args):
From c663f5c2bd8bd524257ac077e1b3e1dd89cf3fd9 Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Tue, 15 Sep 2015 15:36:21 +0530
Subject: [PATCH 16/52] [Test] test state based taxasion
---
.../accounts/doctype/tax_rule/test_tax_rule.py | 18 ++++++++++++++----
erpnext/accounts/party.py | 1 -
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 9802c09600..85fbe52220 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -73,13 +73,23 @@ class TestTaxRule(unittest.TestCase):
"_Test Sales Taxes and Charges Template 2")
def test_select_tax_rule_based_on_better_match(self):
- make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City", billing_state = "Test State",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
- make_tax_rule(customer= "_Test Customer",
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City1", billing_state = "Test State",
sales_tax_template = "_Test Sales Taxes and Charges Template 1", save=1)
- self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City"}),
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "billing_city": "Test City", "billing_state": "Test State"}),
+ "_Test Sales Taxes and Charges Template")
+
+ def test_select_tax_rule_based_on_state_match(self):
+ make_tax_rule(customer= "_Test Customer", shipping_state = "Test State",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ make_tax_rule(customer= "_Test Customer", shipping_state = "Test State12",
+ sales_tax_template = "_Test Sales Taxes and Charges Template 1", priority=2, save=1)
+
+ self.assertEquals(get_tax_template("2015-01-01", {"customer":"_Test Customer", "shipping_state": "Test State"}),
"_Test Sales Taxes and Charges Template")
def test_select_tax_rule_based_on_better_priority(self):
@@ -93,7 +103,7 @@ class TestTaxRule(unittest.TestCase):
"_Test Sales Taxes and Charges Template 1")
def test_select_tax_rule_based_cross_matching_keys(self):
- make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
+ make_tax_rule(customer= "_Test Customer", billing_city = "Test City",
sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
make_tax_rule(customer= "_Test Customer 1", billing_city = "Test City 1",
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 8ad30583e1..a589a694dd 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -280,7 +280,6 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
@frappe.whitelist()
def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
billing_address=None, shipping_address=None, use_for_shopping_cart=None):
-
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
party_type: party,
From 0bd145a6086638ff753e9a552cf51e52c60dc9e7 Mon Sep 17 00:00:00 2001
From: Saurabh
Date: Tue, 15 Sep 2015 17:06:52 +0530
Subject: [PATCH 17/52] [fixes] test cases and tax rule validation
---
erpnext/accounts/doctype/tax_rule/tax_rule.py | 2 ++
erpnext/accounts/doctype/tax_rule/test_records.json | 2 ++
erpnext/accounts/doctype/tax_rule/test_tax_rule.py | 4 ++--
erpnext/utilities/doctype/address/test_records.json | 3 ++-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 93bbf459c3..0a9bb1114b 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -53,8 +53,10 @@ class TaxRule(Document):
"supplier": self.supplier,
"supplier_type": self.supplier_type,
"billing_city": self.billing_city,
+ "billing_state": self.billing_state,
"billing_country": self.billing_country,
"shipping_city": self.shipping_city,
+ "shipping_state": self.shipping_state,
"shipping_country": self.shipping_country,
"company": self.company
}
diff --git a/erpnext/accounts/doctype/tax_rule/test_records.json b/erpnext/accounts/doctype/tax_rule/test_records.json
index ebfb0c5b1b..0913fba4fb 100644
--- a/erpnext/accounts/doctype/tax_rule/test_records.json
+++ b/erpnext/accounts/doctype/tax_rule/test_records.json
@@ -5,6 +5,7 @@
"sales_tax_template": "_Test Tax 1",
"use_for_shopping_cart": 1,
"billing_city": "_Test City",
+ "billing_state": "Test State",
"billing_country": "India",
"shipping_city": "_Test City",
"shipping_country": "India",
@@ -19,6 +20,7 @@
"billing_city": "_Test City",
"billing_country": "India",
"shipping_city": "_Test City",
+ "shipping_state": "Test State",
"shipping_country": "India",
"priority": 2,
"company": "_Test Company"
diff --git a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
index 85fbe52220..3e175fabf7 100644
--- a/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -7,11 +7,11 @@ import frappe
import unittest
from erpnext.accounts.doctype.tax_rule.tax_rule import IncorrectCustomerGroup, IncorrectSupplierType, ConflictingTaxRule, get_tax_template
-# test_records = frappe.get_test_records('Tax Rule')
+test_records = frappe.get_test_records('Tax Rule')
class TestTaxRule(unittest.TestCase):
def setUp(self):
- frappe.db.sql("delete from `tabTax Rule`")
+ frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1")
def test_customer_group(self):
tax_rule = make_tax_rule(customer= "_Test Customer", customer_group= "_Test Customer Group 1",
diff --git a/erpnext/utilities/doctype/address/test_records.json b/erpnext/utilities/doctype/address/test_records.json
index 41a6abcd09..a7bde9a814 100644
--- a/erpnext/utilities/doctype/address/test_records.json
+++ b/erpnext/utilities/doctype/address/test_records.json
@@ -3,7 +3,8 @@
"address_line1": "_Test Address Line 1",
"address_title": "_Test Address",
"address_type": "Office",
- "city": "_Test City",
+ "city": "_Test City",
+ "state": "Test State",
"country": "India",
"customer": "_Test Customer",
"customer_name": "_Test Customer",
From 9ff52cd57e0c7185d2a91a14ab5f1b811bc1b9c2 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 17 Sep 2015 17:02:48 +0530
Subject: [PATCH 18/52] [fix] Multi currency patch
---
erpnext/patches/v6_0/multi_currency.py | 53 ++++++++++++++++----------
1 file changed, 32 insertions(+), 21 deletions(-)
diff --git a/erpnext/patches/v6_0/multi_currency.py b/erpnext/patches/v6_0/multi_currency.py
index 2b53134c05..979e03e2f2 100644
--- a/erpnext/patches/v6_0/multi_currency.py
+++ b/erpnext/patches/v6_0/multi_currency.py
@@ -9,8 +9,9 @@ def execute():
for dt in ("Account", "GL Entry", "Journal Entry",
"Journal Entry Account", "Sales Invoice", "Purchase Invoice", "Customer", "Supplier"):
frappe.reload_doctype(dt)
-
- for company in frappe.get_all("Company", fields=["name", "default_currency", "default_receivable_account"]):
+
+ company_list = frappe.get_all("Company", fields=["name", "default_currency", "default_receivable_account"])
+ for company in company_list:
# update currency in account and gl entry as per company currency
frappe.db.sql("""update `tabAccount` set account_currency = %s
@@ -63,30 +64,40 @@ def execute():
company=%s
""", (company.default_currency, company.name))
- # Set party account if default currency of party other than company's default currency
- for dt in ("Customer", "Supplier"):
- parties = frappe.get_all(dt)
- for p in parties:
+ # Set party account if default currency of party other than company's default currency
+ for dt in ("Customer", "Supplier"):
+ parties = frappe.get_all(dt)
+ for p in parties:
+ party = frappe.get_doc(dt, p.name)
+
+ for company in company_list:
# Get party GL Entries
party_gle = frappe.db.get_value("GL Entry", {"party_type": dt, "party": p.name,
- "company": company.name}, ["account", "account_currency"], as_dict=True)
-
- party = frappe.get_doc(dt, p.name)
-
+ "company": company.name}, ["account", "account_currency", "name"], as_dict=True)
+
# set party account currency
- if party_gle or not party.party_account_currency:
+ if party_gle:
+ party.party_account_currency = party_gle.account_currency
+ elif not party.party_account_currency:
party.party_account_currency = company.default_currency
# Add default receivable /payable account if not exists
# and currency is other than company currency
+ party_accounts = []
if party.party_account_currency and party.party_account_currency != company.default_currency:
- party_account_exists = False
+ party_account_exists_for_company = False
for d in party.get("accounts"):
if d.company == company.name:
- party_account_exists = True
- break
-
- if not party_account_exists:
+ account_currency = frappe.db.get_value("Account", d.account, "account_currency")
+ if account_currency == party.party_account_currency:
+ party_accounts.append({
+ "company": d.company,
+ "account": d.account
+ })
+ party_account_exists_for_company = True
+ break
+
+ if not party_account_exists_for_company:
party_account = None
if party_gle:
party_account = party_gle.account
@@ -95,12 +106,12 @@ def execute():
company.default_receivable_account, "account_currency")
if default_receivable_account_currency != company.default_currency:
party_account = company.default_receivable_account
-
+
if party_account:
- party.append("accounts", {
+ party_accounts.append({
"company": company.name,
"account": party_account
})
-
- party.flags.ignore_mandatory = True
- party.save()
\ No newline at end of file
+ party.set("accounts", party_accounts)
+ party.flags.ignore_mandatory = True
+ party.save()
\ No newline at end of file
From 340709b2dac9ef810f0025c67e665f471f03ea69 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 17:28:39 +0530
Subject: [PATCH 19/52] [hotfix] multicurrency patch
---
erpnext/patches/v6_0/multi_currency.py | 51 +++++++++++++-------------
1 file changed, 26 insertions(+), 25 deletions(-)
diff --git a/erpnext/patches/v6_0/multi_currency.py b/erpnext/patches/v6_0/multi_currency.py
index 979e03e2f2..127734434e 100644
--- a/erpnext/patches/v6_0/multi_currency.py
+++ b/erpnext/patches/v6_0/multi_currency.py
@@ -6,84 +6,84 @@ import frappe
def execute():
# Reload doctype
- for dt in ("Account", "GL Entry", "Journal Entry",
+ for dt in ("Account", "GL Entry", "Journal Entry",
"Journal Entry Account", "Sales Invoice", "Purchase Invoice", "Customer", "Supplier"):
frappe.reload_doctype(dt)
-
+
company_list = frappe.get_all("Company", fields=["name", "default_currency", "default_receivable_account"])
for company in company_list:
-
+
# update currency in account and gl entry as per company currency
- frappe.db.sql("""update `tabAccount` set account_currency = %s
+ frappe.db.sql("""update `tabAccount` set account_currency = %s
where ifnull(account_currency, '') = '' and company=%s""", (company.default_currency, company.name))
-
+
# update newly introduced field's value in sales / purchase invoice
frappe.db.sql("""
- update
+ update
`tabSales Invoice`
- set
+ set
base_paid_amount=paid_amount,
base_write_off_amount=write_off_amount,
party_account_currency=%s
where company=%s
""", (company.default_currency, company.name))
-
+
frappe.db.sql("""
- update
+ update
`tabPurchase Invoice`
- set
+ set
base_write_off_amount=write_off_amount,
party_account_currency=%s
where company=%s
""", (company.default_currency, company.name))
-
+
# update exchange rate, debit/credit in account currency in Journal Entry
frappe.db.sql("""
update `tabJournal Entry Account` jea
- set exchange_rate=1,
+ set exchange_rate=1,
debit_in_account_currency=debit,
credit_in_account_currency=credit,
account_type=(select account_type from `tabAccount` where name=jea.account)
""")
-
+
frappe.db.sql("""
update `tabJournal Entry Account` jea, `tabJournal Entry` je
set account_currency=%s
where jea.parent = je.name and je.company=%s
""", (company.default_currency, company.name))
-
+
# update debit/credit in account currency in GL Entry
frappe.db.sql("""
update
`tabGL Entry`
- set
+ set
debit_in_account_currency=debit,
credit_in_account_currency=credit,
account_currency=%s
where
company=%s
""", (company.default_currency, company.name))
-
+
# Set party account if default currency of party other than company's default currency
for dt in ("Customer", "Supplier"):
parties = frappe.get_all(dt)
for p in parties:
party = frappe.get_doc(dt, p.name)
-
+ party_accounts = []
+
for company in company_list:
# Get party GL Entries
- party_gle = frappe.db.get_value("GL Entry", {"party_type": dt, "party": p.name,
+ party_gle = frappe.db.get_value("GL Entry", {"party_type": dt, "party": p.name,
"company": company.name}, ["account", "account_currency", "name"], as_dict=True)
-
+
# set party account currency
if party_gle:
party.party_account_currency = party_gle.account_currency
elif not party.party_account_currency:
party.party_account_currency = company.default_currency
- # Add default receivable /payable account if not exists
+ # Add default receivable /payable account if not exists
# and currency is other than company currency
- party_accounts = []
if party.party_account_currency and party.party_account_currency != company.default_currency:
party_account_exists_for_company = False
for d in party.get("accounts"):
@@ -96,22 +96,23 @@ def execute():
})
party_account_exists_for_company = True
break
-
+
if not party_account_exists_for_company:
party_account = None
if party_gle:
party_account = party_gle.account
else:
- default_receivable_account_currency = frappe.db.get_value("Account",
+ default_receivable_account_currency = frappe.db.get_value("Account",
company.default_receivable_account, "account_currency")
if default_receivable_account_currency != company.default_currency:
party_account = company.default_receivable_account
-
+
if party_account:
party_accounts.append({
"company": company.name,
"account": party_account
})
+
party.set("accounts", party_accounts)
party.flags.ignore_mandatory = True
- party.save()
\ No newline at end of file
+ party.save()
From cba5a684cb7d77fdd8d0747ea8f27d986e01d0e5 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 17:36:05 +0530
Subject: [PATCH 20/52] [hotfix] multicurrency patch
---
erpnext/patches/v6_0/multi_currency.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erpnext/patches/v6_0/multi_currency.py b/erpnext/patches/v6_0/multi_currency.py
index 127734434e..242df94258 100644
--- a/erpnext/patches/v6_0/multi_currency.py
+++ b/erpnext/patches/v6_0/multi_currency.py
@@ -66,7 +66,7 @@ def execute():
# Set party account if default currency of party other than company's default currency
for dt in ("Customer", "Supplier"):
- parties = frappe.get_all(dt)
+ parties = frappe.get_all(dt, filters={"docstatus": 0})
for p in parties:
party = frappe.get_doc(dt, p.name)
party_accounts = []
From e9b14e497bd57bf5528a79cf475357636d2529b9 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 17:46:37 +0530
Subject: [PATCH 21/52] [fix] remove duplicate newsletter subscribers
---
erpnext/patches.txt | 3 ++-
erpnext/patches/v6_2/__init__.py | 1 +
erpnext/patches/v6_2/remove_newsletter_duplicates.py | 12 ++++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
create mode 100644 erpnext/patches/v6_2/__init__.py
create mode 100644 erpnext/patches/v6_2/remove_newsletter_duplicates.py
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index ffb7a21b5f..98c6f457f4 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -206,4 +206,5 @@ execute:frappe.db.set_value("Stock Settings", None, "automatically_set_serial_no
execute:frappe.db.sql("""update `tabProject` set percent_complete=round(percent_complete, 2) where percent_complete is not null""")
erpnext.patches.v6_0.fix_outstanding_amount
erpnext.patches.v6_0.fix_planned_qty
-erpnext.patches.v6_0.multi_currency
\ No newline at end of file
+erpnext.patches.v6_0.multi_currency
+erpnext.patches.v6_2.remove_newsletter_duplicates
diff --git a/erpnext/patches/v6_2/__init__.py b/erpnext/patches/v6_2/__init__.py
new file mode 100644
index 0000000000..baffc48825
--- /dev/null
+++ b/erpnext/patches/v6_2/__init__.py
@@ -0,0 +1 @@
+from __future__ import unicode_literals
diff --git a/erpnext/patches/v6_2/remove_newsletter_duplicates.py b/erpnext/patches/v6_2/remove_newsletter_duplicates.py
new file mode 100644
index 0000000000..4f25c95777
--- /dev/null
+++ b/erpnext/patches/v6_2/remove_newsletter_duplicates.py
@@ -0,0 +1,12 @@
+import frappe
+
+def execute():
+ duplicates = frappe.db.sql("""select newsletter_list, email, count(name)
+ from `tabNewsletter List Subscriber`
+ group by newsletter_list, email
+ having count(name) > 1""")
+
+ # delete all duplicates except 1
+ for newsletter_list, email, count in duplicates:
+ frappe.db.sql("""delete from `tabNewsletter List Subscriber`
+ where newsletter_list=%s and email=%s limit %s""", (newsletter_list, email, count-1))
From 5532a14938fc29d771320ab7b557681b0ffe5c94 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 18:27:36 +0530
Subject: [PATCH 22/52] [hotfix] create customer contact and address from lead
only on create
---
erpnext/selling/doctype/customer/customer.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 6b67c88702..7fe14596ee 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -31,8 +31,9 @@ class Customer(TransactionBase):
def validate_mandatory(self):
if frappe.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.naming_series:
frappe.throw(_("Series is mandatory"), frappe.MandatoryError)
-
+
def validate(self):
+ self.flags.is_new_doc = self.is_new()
self.validate_mandatory()
validate_accounting_currency(self)
validate_party_account(self)
@@ -76,7 +77,9 @@ class Customer(TransactionBase):
self.update_lead_status()
self.update_address()
self.update_contact()
- self.create_lead_address_contact()
+
+ if self.flags.is_new_doc:
+ self.create_lead_address_contact()
def validate_name_with_customer_group(self):
if frappe.db.exists("Customer Group", self.name):
@@ -131,7 +134,7 @@ def get_dashboard_info(customer):
billing_this_year = frappe.db.sql("""
select sum(ifnull(debit_in_account_currency, 0)) - sum(ifnull(credit_in_account_currency, 0))
from `tabGL Entry`
- where voucher_type='Sales Invoice' and party_type = 'Customer'
+ where voucher_type='Sales Invoice' and party_type = 'Customer'
and party=%s and fiscal_year = %s""",
(customer, frappe.db.get_default("fiscal_year")))
From 926ae17e5a32f8d2784a42b527da02b1cbc21ce5 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 17 Sep 2015 18:42:55 +0530
Subject: [PATCH 23/52] Update journal_entry.py
---
erpnext/accounts/doctype/journal_entry/journal_entry.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index cb12969112..11bf3847d1 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -551,7 +551,7 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice):
"""Returns new Journal Entry document as dict for given Purchase Invoice"""
pi = frappe.get_doc("Purchase Invoice", purchase_invoice)
- exchange_rate = get_exchange_rate(pi.debit_to, pi.party_account_currency, pi.company,
+ exchange_rate = get_exchange_rate(pi.credit_to, pi.party_account_currency, pi.company,
pi.doctype, pi.name)
jv = get_payment_entry(pi)
From 0332f83bc2cad93c4f649ac2abdc2efdc3c16aac Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 19:01:27 +0530
Subject: [PATCH 24/52] [fix] customer naming series validation and patch to
fix missing default taxes and lead
---
erpnext/patches.txt | 1 +
.../fix_missing_default_taxes_and_lead.py | 25 +++++++++++++++++++
erpnext/selling/doctype/customer/customer.py | 8 +++---
3 files changed, 29 insertions(+), 5 deletions(-)
create mode 100644 erpnext/patches/v6_2/fix_missing_default_taxes_and_lead.py
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 98c6f457f4..e20aab0b2e 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -208,3 +208,4 @@ erpnext.patches.v6_0.fix_outstanding_amount
erpnext.patches.v6_0.fix_planned_qty
erpnext.patches.v6_0.multi_currency
erpnext.patches.v6_2.remove_newsletter_duplicates
+erpnext.patches.v6_2.fix_missing_default_taxes_and_lead
diff --git a/erpnext/patches/v6_2/fix_missing_default_taxes_and_lead.py b/erpnext/patches/v6_2/fix_missing_default_taxes_and_lead.py
new file mode 100644
index 0000000000..9c16f63798
--- /dev/null
+++ b/erpnext/patches/v6_2/fix_missing_default_taxes_and_lead.py
@@ -0,0 +1,25 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ # remove missing default taxes
+ for customer in frappe.db.sql_list("""select name from `tabCustomer`
+ where ifnull(default_taxes_and_charges, '')!='' and not exists (
+ select name from `tabSales Taxes and Charges Template` where name=`tabCustomer`.default_taxes_and_charges
+ )"""):
+ c = frappe.get_doc("Customer", customer)
+ c.default_taxes_and_charges = None
+ c.save()
+
+ for supplier in frappe.db.sql_list("""select name from `tabSupplier`
+ where ifnull(default_taxes_and_charges, '')!='' and not exists (
+ select name from `tabPurchase Taxes and Charges Template` where name=`tabSupplier`.default_taxes_and_charges
+ )"""):
+ c = frappe.get_doc("Supplier", supplier)
+ c.default_taxes_and_charges = None
+ c.save()
+
+ # remove missing lead
+ for customer in frappe.db.sql_list("""select name from `tabCustomer`
+ where ifnull(lead_name, '')!='' and not exists (select name from `tabLead` where name=`tabCustomer`.lead_name)"""):
+ frappe.db.set_value("Customer", customer, "lead_name", None)
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index 7fe14596ee..b060fba3c6 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -26,15 +26,13 @@ class Customer(TransactionBase):
if cust_master_name == 'Customer Name':
self.name = self.customer_name
else:
- self.name = make_autoname(self.naming_series+'.#####')
+ if not self.naming_series:
+ frappe.throw(_("Series is mandatory"), frappe.MandatoryError)
- def validate_mandatory(self):
- if frappe.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.naming_series:
- frappe.throw(_("Series is mandatory"), frappe.MandatoryError)
+ self.name = make_autoname(self.naming_series+'.#####')
def validate(self):
self.flags.is_new_doc = self.is_new()
- self.validate_mandatory()
validate_accounting_currency(self)
validate_party_account(self)
From a8ef4c9220ede8192d88b0df8222323e72098c2a Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Thu, 17 Sep 2015 19:38:11 +0530
Subject: [PATCH 25/52] [fix] minor issue
---
erpnext/accounts/doctype/journal_entry/journal_entry.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 383b4b620d..a98130bfc4 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -350,6 +350,9 @@ frappe.ui.form.on("Journal Entry Account", {
account: function(frm, dt, dn) {
var d = locals[dt][dn];
if(d.account) {
+ if(!frm.doc.company) frappe.throw(__("Please select Company first"));
+ if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
+
return frappe.call({
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
args: {
From 9acd6a2629ba0b0eb7d4612bfd46af6dd78d3b38 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 20:29:15 +0530
Subject: [PATCH 26/52] [hotfix] set_balance_in_account_currency
---
erpnext/controllers/accounts_controller.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index ceb993096a..7a4a0df6b0 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -236,8 +236,10 @@ class AccountsController(TransactionBase):
.format(account, _(" or ").join(valid_currency)))
def set_balance_in_account_currency(self, gl_dict, account_currency=None):
- if (not self.get("conversion_rate") and self.doctype!="Journal Entry"
- and account_currency!=self.company_currency):
+ if self.doctype=="Journal Entry":
+ return
+
+ if (not self.get("conversion_rate") and account_currency!=self.company_currency):
frappe.throw(_("Account: {0} with currency: {1} can not be selected")
.format(gl_dict.account, account_currency))
From 26bcd89d109c19fc40bc5657f3c7512bf4f0ef79 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 20:36:19 +0530
Subject: [PATCH 27/52] [hotfix] journal entry - get balance
---
erpnext/accounts/doctype/journal_entry/journal_entry.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 11bf3847d1..6857c61a61 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -386,6 +386,7 @@ class JournalEntry(AccountsController):
# If any row without amount, set the diff on that row
if diff:
+ blank_row = None
for d in self.get('accounts'):
if not d.credit_in_account_currency and not d.debit_in_account_currency and diff != 0:
blank_row = d
From bf8c8df9ce3930aa796e0828bf3a7d87440566c5 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 20:51:41 +0530
Subject: [PATCH 28/52] Revert "[hotfix] set_balance_in_account_currency"
This reverts commit 9acd6a2629ba0b0eb7d4612bfd46af6dd78d3b38.
---
erpnext/controllers/accounts_controller.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 7a4a0df6b0..ceb993096a 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -236,10 +236,8 @@ class AccountsController(TransactionBase):
.format(account, _(" or ").join(valid_currency)))
def set_balance_in_account_currency(self, gl_dict, account_currency=None):
- if self.doctype=="Journal Entry":
- return
-
- if (not self.get("conversion_rate") and account_currency!=self.company_currency):
+ if (not self.get("conversion_rate") and self.doctype!="Journal Entry"
+ and account_currency!=self.company_currency):
frappe.throw(_("Account: {0} with currency: {1} can not be selected")
.format(gl_dict.account, account_currency))
From be6cfddc4d03efb4aa82a4c54d9cb9ea2c9b3bbb Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 17 Sep 2015 21:07:04 +0530
Subject: [PATCH 29/52] [hotfix] multicurrency gl entry
---
erpnext/controllers/accounts_controller.py | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index ceb993096a..f66b425ee9 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -219,14 +219,13 @@ class AccountsController(TransactionBase):
if not account_currency:
account_currency = frappe.db.get_value("Account", gl_dict.account, "account_currency")
- self.validate_account_currency(gl_dict.account, account_currency)
- gl_dict = self.set_balance_in_account_currency(gl_dict, account_currency)
+ if self.doctype != "Journal Entry":
+ self.validate_account_currency(gl_dict.account, account_currency)
+ self.set_balance_in_account_currency(gl_dict, account_currency)
return gl_dict
def validate_account_currency(self, account, account_currency=None):
- if self.doctype == "Journal Entry":
- return
valid_currency = [self.company_currency]
if self.get("currency") and self.currency != self.company_currency:
valid_currency.append(self.currency)
@@ -236,8 +235,7 @@ class AccountsController(TransactionBase):
.format(account, _(" or ").join(valid_currency)))
def set_balance_in_account_currency(self, gl_dict, account_currency=None):
- if (not self.get("conversion_rate") and self.doctype!="Journal Entry"
- and account_currency!=self.company_currency):
+ if (not self.get("conversion_rate") and account_currency!=self.company_currency):
frappe.throw(_("Account: {0} with currency: {1} can not be selected")
.format(gl_dict.account, account_currency))
@@ -253,8 +251,6 @@ class AccountsController(TransactionBase):
gl_dict.credit_in_account_currency = gl_dict.credit if account_currency==self.company_currency \
else flt(gl_dict.credit / (self.get("conversion_rate")), 2)
- return gl_dict
-
def clear_unallocated_advances(self, childtype, parentfield):
self.set(parentfield, self.get(parentfield, {"allocated_amount": ["not in", [0, None, ""]]}))
From 361df8993f50a46b6a78e6ce152e3e7c5da85f82 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Fri, 18 Sep 2015 12:59:51 +0530
Subject: [PATCH 30/52] [fix] no default party currency
---
erpnext/accounts/party.py | 59 +++++++++++++++++----------------------
1 file changed, 25 insertions(+), 34 deletions(-)
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index a589a694dd..75322ce590 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -20,7 +20,7 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
if not party:
return {}
-
+
if not frappe.db.exists(party_type, party):
frappe.throw(_("{0}: {1} does not exists").format(party_type, party))
@@ -29,7 +29,7 @@ def get_party_details(party=None, account=None, party_type="Customer", company=N
def _get_party_details(party=None, account=None, party_type="Customer", company=None,
posting_date=None, price_list=None, currency=None, doctype=None, ignore_permissions=False):
-
+
out = frappe._dict(set_account_and_due_date(party, account, party_type, company, posting_date, doctype))
party = out[party_type.lower()]
@@ -145,20 +145,11 @@ def set_account_and_due_date(party, account, party_type, company, posting_date,
"due_date": get_due_date(posting_date, party_type, party, company)
}
return out
-
+
def validate_accounting_currency(party):
- company_currency = get_company_currency()
-
- # set party account currency
- if not party.party_account_currency:
- if party.default_currency:
- party.party_account_currency = party.default_currency
- elif len(set(company_currency.values())) == 1:
- party.party_account_currency = company_currency.values()[0]
-
party_account_currency_in_db = frappe.db.get_value(party.doctype, party.name, "party_account_currency")
if party_account_currency_in_db != party.party_account_currency:
- existing_gle = frappe.db.get_value("GL Entry", {"party_type": party.doctype,
+ existing_gle = frappe.db.get_value("GL Entry", {"party_type": party.doctype,
"party": party.name}, ["name", "account_currency"], as_dict=1)
if existing_gle:
if party_account_currency_in_db:
@@ -166,8 +157,8 @@ def validate_accounting_currency(party):
.format(party.doctype), InvalidCurrency)
else:
party.party_account_currency = existing_gle.account_currency
-
-
+
+
def validate_party_account(party):
company_currency = get_company_currency()
if party.party_account_currency:
@@ -175,31 +166,31 @@ def validate_party_account(party):
for company, currency in company_currency.items():
if currency != party.party_account_currency:
companies_with_different_currency.append(company)
-
+
for d in party.get("accounts"):
if d.company in companies_with_different_currency:
companies_with_different_currency.remove(d.company)
-
+
selected_account_currency = frappe.db.get_value("Account", d.account, "account_currency")
if selected_account_currency != party.party_account_currency:
frappe.throw(_("Account {0} is invalid, account currency must be {1}")
.format(d.account, selected_account_currency), InvalidAccountCurrency)
-
+
if companies_with_different_currency:
frappe.msgprint(_("Please mention Default {0} Account for the following companies, as accounting currency is different from company's default currency: {1}")
.format(
- "Receivable" if party.doctype=="Customer" else "Payable",
+ "Receivable" if party.doctype=="Customer" else "Payable",
"\n" + "\n".join(companies_with_different_currency)
)
)
-
+
def get_company_currency():
company_currency = frappe._dict()
for d in frappe.get_all("Company", fields=["name", "default_currency"]):
company_currency.setdefault(d.name, d.default_currency)
-
+
return company_currency
-
+
@frappe.whitelist()
def get_party_account(company, party, party_type):
"""Returns the account for the given `party`.
@@ -241,7 +232,7 @@ def get_due_date(posting_date, party_type, party, company):
credit_days = get_credit_days(party_type, party, company)
if credit_days:
due_date = add_days(posting_date, credit_days)
-
+
return due_date
def get_credit_days(party_type, party, company):
@@ -249,21 +240,21 @@ def get_credit_days(party_type, party, company):
if party_type == "Customer":
credit_days_based_on, credit_days, customer_group = \
frappe.db.get_value(party_type, party, ["credit_days_based_on", "credit_days", "customer_group"])
-
+
if not credit_days_based_on:
credit_days_based_on, credit_days = \
frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"]) \
or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"])
-
+
return credit_days_based_on, credit_days
else:
credit_days, supplier_type = frappe.db.get_value(party_type, party, ["credit_days", "supplier_type"])
if not credit_days:
credit_days = frappe.db.get_value("Supplier Type", supplier_type, "credit_days") \
or frappe.db.get_value("Company", company, "credit_days")
-
+
return credit_days
-
+
def validate_due_date(posting_date, due_date, party_type, party, company):
if getdate(due_date) < getdate(posting_date):
frappe.throw(_("Due Date cannot be before Posting Date"))
@@ -276,9 +267,9 @@ def validate_due_date(posting_date, due_date, party_type, party, company):
.format(date_diff(due_date, default_due_date)))
else:
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
-
+
@frappe.whitelist()
-def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
+def set_taxes(party, party_type, posting_date, company, customer_group=None, supplier_type=None,
billing_address=None, shipping_address=None, use_for_shopping_cart=None):
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
@@ -287,19 +278,19 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
"supplier_type": supplier_type,
"company": company
}
-
+
if billing_address or shipping_address:
args.update(get_party_details(party, party_type, {"billing_address": billing_address, \
"shipping_address": shipping_address }))
else:
args.update(get_party_details(party, party_type))
-
+
if party_type=="Customer":
args.update({"tax_type": "Sales"})
else:
args.update({"tax_type": "Purchase"})
-
+
if use_for_shopping_cart:
args.update({"use_for_shopping_cart": use_for_shopping_cart})
-
- return get_tax_template(posting_date, args)
\ No newline at end of file
+
+ return get_tax_template(posting_date, args)
From 97c858a5e3893367e5e512f8cdf3d8151c66c4c8 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Mon, 21 Sep 2015 10:03:38 +0530
Subject: [PATCH 31/52] [fix] pull sales team from customer
---
erpnext/accounts/party.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 75322ce590..1a6e85bf77 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -51,9 +51,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company=
# sales team
if party_type=="Customer":
out["sales_team"] = [{
- "sales_person": d.sales_person,
- "sales_designation": d.sales_designation,
- "allocated_percentage": d.allocated_percentage
+ "sales_person": d.sales_person
} for d in party.get("sales_team")]
return out
From f7e6eb4fd70df665bc993651a09081b178769e01 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Mon, 21 Sep 2015 19:28:59 +0530
Subject: [PATCH 32/52] [optimization] get balance on
---
erpnext/accounts/doctype/gl_entry/gl_entry.json | 4 ++--
.../accounts/doctype/journal_entry/journal_entry.py | 13 +++++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index b4ec8beeb9..1cd722021e 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -330,7 +330,7 @@
"read_only": 0,
"report_hide": 0,
"reqd": 0,
- "search_index": 0,
+ "search_index": 1,
"set_only_once": 0,
"unique": 0
},
@@ -511,7 +511,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-11 15:51:26",
+ "modified": "2015-09-21 15:51:26",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 6857c61a61..ff5b37cd6c 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -476,9 +476,18 @@ class JournalEntry(AccountsController):
frappe.throw("Accounts table cannot be blank.")
def set_account_and_party_balance(self):
+ account_balance = {}
+ party_balance = {}
for d in self.get("accounts"):
- d.account_balance = get_balance_on(account=d.account, date=self.posting_date)
- d.party_balance = get_balance_on(party_type=d.party_type, party=d.party, date=self.posting_date)
+ if d.account not in account_balance:
+ account_balance[d.account] = get_balance_on(account=d.account, date=self.posting_date)
+
+ if (d.party_type, d.party) not in party_balance:
+ party_balance[(d.party_type, d.party)] = get_balance_on(party_type=d.party_type,
+ party=d.party, date=self.posting_date)
+
+ d.account_balance = account_balance[d.account]
+ d.party_balance = party_balance[(d.party_type, d.party)]
@frappe.whitelist()
def get_default_bank_cash_account(company, voucher_type, mode_of_payment=None):
From c0c94aef442aef80c65e61ffc70bc6792cbb8645 Mon Sep 17 00:00:00 2001
From: Nabin Hait
Date: Tue, 22 Sep 2015 08:35:46 +0530
Subject: [PATCH 33/52] [fix] Get outstanding invoices in Payment
Reconciliation and Payment Tool
---
.../payment_reconciliation/payment_reconciliation.py | 8 ++++++--
erpnext/accounts/doctype/payment_tool/payment_tool.py | 2 +-
erpnext/accounts/utils.py | 10 ++++++----
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
index 09bd7d2cc8..743df3704d 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
@@ -70,7 +70,7 @@ class PaymentReconciliation(Document):
non_reconciled_invoices = []
dr_or_cr = "debit" if self.party_type == "Customer" else "credit"
cond = self.check_condition(dr_or_cr)
-
+
invoice_list = frappe.db.sql("""
select
voucher_no, voucher_type, posting_date,
@@ -79,8 +79,12 @@ class PaymentReconciliation(Document):
`tabGL Entry`
where
party_type = %(party_type)s and party = %(party)s
- and voucher_type != "Journal Entry"
and account = %(account)s and {dr_or_cr} > 0 {cond}
+ and (CASE
+ WHEN voucher_type = 'Journal Entry'
+ THEN ifnull(against_voucher, '') = ''
+ ELSE 1=1
+ END)
group by voucher_type, voucher_no
""".format(**{
"cond": cond,
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.py b/erpnext/accounts/doctype/payment_tool/payment_tool.py
index eedf69fe5d..b02214c847 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.py
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.py
@@ -71,7 +71,7 @@ def get_outstanding_vouchers(args):
# Get all outstanding sales /purchase invoices
outstanding_invoices = get_outstanding_invoices(amount_query, args.get("party_account"),
- args.get("party_type"), args.get("party"), with_journal_entry=False)
+ args.get("party_type"), args.get("party"))
# Get all SO / PO which are not fully billed or aginst which full advance not paid
orders_to_be_billed = get_orders_to_be_billed(args.get("party_type"), args.get("party"),
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 04084ed0e8..645c91c8f7 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -397,7 +397,7 @@ def get_stock_rbnb_difference(posting_date, company):
# Amount should be credited
return flt(stock_rbnb) + flt(sys_bal)
-def get_outstanding_invoices(amount_query, account, party_type, party, with_journal_entry=True):
+def get_outstanding_invoices(amount_query, account, party_type, party):
all_outstanding_vouchers = []
outstanding_voucher_list = frappe.db.sql("""
select
@@ -407,6 +407,11 @@ def get_outstanding_invoices(amount_query, account, party_type, party, with_jour
`tabGL Entry`
where
account = %s and party_type=%s and party=%s and {amount_query} > 0
+ and (CASE
+ WHEN voucher_type = 'Journal Entry'
+ THEN ifnull(against_voucher, '') = ''
+ ELSE 1=1
+ END)
group by voucher_type, voucher_no
""".format(amount_query = amount_query), (account, party_type, party), as_dict = True)
@@ -425,9 +430,6 @@ def get_outstanding_invoices(amount_query, account, party_type, party, with_jour
payment_amount = -1*payment_amount[0][0] if payment_amount else 0
precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
- if not with_journal_entry and d.voucher_type=="Journal Entry":
- continue
-
if d.invoice_amount > payment_amount:
all_outstanding_vouchers.append({
From 798e75832cdb4306f4b981177db94d42a05eb902 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Tue, 22 Sep 2015 12:59:43 +0530
Subject: [PATCH 34/52] [fix] Show payment's invoice number as 'Invoice Type |
Invoice Number' for better unsability
---
.../payment_reconciliation.js | 6 +-
.../payment_reconciliation.json | 4 +-
.../payment_reconciliation.py | 8 +-
.../payment_reconciliation_payment.json | 92 +++++--------------
4 files changed, 35 insertions(+), 75 deletions(-)
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
index 1355ea4965..ab6db9d381 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js
@@ -44,7 +44,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
}
});
},
-
+
refresh: function() {
this.frm.disable_save();
},
@@ -77,8 +77,8 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext
var invoices = [];
$.each(me.frm.doc.invoices || [], function(i, row) {
- if (row.invoice_number && !inList(invoices, row.invoice_number))
- invoices.push(row.invoice_number);
+ if (row.invoice_number && !inList(invoices, row.invoice_number))
+ invoices.push(row.invoice_type + " | " + row.invoice_number);
});
frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number",
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
index e7d0f76505..c88928823d 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.json
@@ -130,7 +130,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Column Break",
+ "label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -362,7 +362,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-02-05 05:11:42.105088",
+ "modified": "2015-09-21 03:41:24.672227",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation",
diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
index 743df3704d..ff0d15bb66 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
@@ -70,7 +70,7 @@ class PaymentReconciliation(Document):
non_reconciled_invoices = []
dr_or_cr = "debit" if self.party_type == "Customer" else "credit"
cond = self.check_condition(dr_or_cr)
-
+
invoice_list = frappe.db.sql("""
select
voucher_no, voucher_type, posting_date,
@@ -140,12 +140,16 @@ class PaymentReconciliation(Document):
ent.outstanding_amount = e.get('outstanding_amount')
def reconcile(self, args):
+ for e in self.get('payments'):
+ if " | " in e.invoice_number:
+ e.invoice_type, e.invoice_number = e.invoice_number.split(" | ")
+
self.get_invoice_entries()
self.validate_invoice()
dr_or_cr = "credit" if self.party_type == "Customer" else "debit"
lst = []
for e in self.get('payments'):
- if e.invoice_type and e.invoice_number and e.allocated_amount:
+ if e.invoice_number and e.allocated_amount:
lst.append({
'voucher_no' : e.journal_entry,
'voucher_detail_no' : e.voucher_detail_number,
diff --git a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
index 5450b10dd2..26c77437a9 100644
--- a/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
+++ b/erpnext/accounts/doctype/payment_reconciliation_payment/payment_reconciliation_payment.json
@@ -124,7 +124,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Column Break",
+ "label": "",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -135,51 +135,6 @@
"set_only_once": 0,
"unique": 0
},
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "allocated_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Allocated amount",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Sales Invoice",
- "fieldname": "invoice_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Invoice Type",
- "no_copy": 0,
- "options": "\nSales Invoice\nPurchase Invoice\nJournal Entry",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_on_submit": 0,
"bold": 0,
@@ -202,6 +157,28 @@
"set_only_once": 0,
"unique": 0
},
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "allocated_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Allocated amount",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
{
"allow_on_submit": 0,
"bold": 0,
@@ -243,27 +220,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Column Break",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"hide_heading": 0,
@@ -273,7 +229,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2014-12-25 16:26:48.345281",
+ "modified": "2015-09-21 03:39:40.320070",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Reconciliation Payment",
From 53a0de76071af51fa79a1be09bec65c5908a5c51 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Tue, 22 Sep 2015 15:26:15 +0530
Subject: [PATCH 35/52] [fix] Recalculate rate after applying Pricing Rule
---
erpnext/controllers/accounts_controller.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index f66b425ee9..45b94d7399 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -167,6 +167,9 @@ class AccountsController(TransactionBase):
if ret.get("pricing_rule_for") == "Price":
item.set("pricing_list_rate", ret.get("pricing_list_rate"))
+ if item.price_list_rate:
+ item.rate = flt(item.price_list_rate *
+ (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
def set_taxes(self):
if not self.meta.get_field("taxes"):
From b6ec680c469d49812ad887cf2d3d8d746350615e Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Tue, 22 Sep 2015 16:36:04 +0530
Subject: [PATCH 36/52] [fix] round percentages in get_indicator
---
.../doctype/purchase_order/purchase_order_list.js | 8 ++++----
.../selling/doctype/sales_order/sales_order_list.js | 10 +++++-----
.../doctype/material_request/material_request_list.js | 4 ++--
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_list.js b/erpnext/buying/doctype/purchase_order/purchase_order_list.js
index 0de5286d5e..7f0ab658ef 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_list.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_list.js
@@ -4,17 +4,17 @@ frappe.listview_settings['Purchase Order'] = {
get_indicator: function(doc) {
if(doc.status==="Stopped") {
return [__("Stopped"), "darkgrey", "status,=,Stopped"];
- } else if(flt(doc.per_received) < 100 && doc.status!=="Stopped") {
- if(flt(doc.per_billed) < 100) {
+ } else if(flt(doc.per_received, 2) < 100 && doc.status!=="Stopped") {
+ if(flt(doc.per_billed, 2) < 100) {
return [__("To Receive and Bill"), "orange",
"per_received,<,100|per_billed,<,100|status,!=,Stopped"];
} else {
return [__("To Receive"), "orange",
"per_received,<,100|per_billed,=,100|status,!=,Stopped"];
}
- } else if(flt(doc.per_received) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") {
+ } else if(flt(doc.per_received, 2) == 100 && flt(doc.per_billed, 2) < 100 && doc.status!=="Stopped") {
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Stopped"];
- } else if(flt(doc.per_received) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") {
+ } else if(flt(doc.per_received, 2) == 100 && flt(doc.per_billed, 2) == 100 && doc.status!=="Stopped") {
return [__("Completed"), "green", "per_received,=,100|per_billed,=,100|status,!=,Stopped"];
}
},
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.js b/erpnext/selling/doctype/sales_order/sales_order_list.js
index e4e67fc0d2..f51b7dc0b7 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.js
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.js
@@ -4,14 +4,14 @@ frappe.listview_settings['Sales Order'] = {
get_indicator: function(doc) {
if(doc.status==="Stopped") {
return [__("Stopped"), "darkgrey", "status,=,Stopped"];
- } else if(flt(doc.per_delivered) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) {
+ } else if(flt(doc.per_delivered, 2) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) {
// to bill & overdue
return [__("Overdue"), "red", "per_delivered,<,100|delivery_date,<,Today|status,!=,Stopped"];
- } else if(flt(doc.per_delivered) < 100 && doc.status!=="Stopped") {
+ } else if(flt(doc.per_delivered, 2) < 100 && doc.status!=="Stopped") {
// not delivered
- if(flt(doc.per_billed) < 100) {
+ if(flt(doc.per_billed, 2) < 100) {
// not delivered & not billed
return [__("To Deliver and Bill"), "orange",
@@ -23,11 +23,11 @@ frappe.listview_settings['Sales Order'] = {
"per_delivered,<,100|per_billed,=,100|status,!=,Stopped"];
}
- } else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") {
+ } else if(flt(doc.per_delivered, 2) == 100 && flt(doc.per_billed, 2) < 100 && doc.status!=="Stopped") {
// to bill
return [__("To Bill"), "orange", "per_delivered,=,100|per_billed,<,100|status,!=,Stopped"];
- } else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") {
+ } else if(flt(doc.per_delivered, 2) == 100 && flt(doc.per_billed, 2) == 100 && doc.status!=="Stopped") {
return [__("Completed"), "green", "per_delivered,=,100|per_billed,=,100|status,!=,Stopped"];
}
diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js
index 390e22272f..6880aeae65 100644
--- a/erpnext/stock/doctype/material_request/material_request_list.js
+++ b/erpnext/stock/doctype/material_request/material_request_list.js
@@ -3,9 +3,9 @@ frappe.listview_settings['Material Request'] = {
get_indicator: function(doc) {
if(doc.status=="Stopped") {
return [__("Stopped"), "red", "status,=,Stopped"];
- } else if(doc.docstatus==1 && flt(doc.per_ordered) < 100) {
+ } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) < 100) {
return [__("Pending"), "orange", "per_ordered,<,100"];
- } else if(doc.docstatus==1 && flt(doc.per_ordered) == 100) {
+ } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) == 100) {
if (doc.material_request_type == "Purchase") {
return [__("Ordered"), "green", "per_ordered,=,100"];
} else if (doc.material_request_type == "Material Transfer") {
From 3bcb13b1b8740d3676d6cb11eb2f59f806ecfa6b Mon Sep 17 00:00:00 2001
From: bobzz-zone
Date: Wed, 23 Sep 2015 11:42:06 +0700
Subject: [PATCH 37/52] Update item_grid.html
Change the colour of the indicator to be green when delivered qty is bigger than ordered qty
---
erpnext/templates/form_grid/item_grid.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html
index 60467ca013..78f0da4a95 100644
--- a/erpnext/templates/form_grid/item_grid.html
+++ b/erpnext/templates/form_grid/item_grid.html
@@ -40,10 +40,10 @@
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1) {
var delivered = doc.doctype==="Sales Order Item" ?
- doc.delivered_qty : doc.received_qty,
- pending = flt(doc.qty) - flt(delivered);
- %}
- {%= doc.item_code %}
+ doc.delivered_qty : doc.received_qty;
+ var pending = flt(doc.qty) - flt(delivered);
+ %}
+ {%= doc.item_code %}
{% } else { %}
{%= doc.item_code %}
{% } %}
From abdfb4d3db1f38f83959947d4cec02eb2d38b944 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Wed, 23 Sep 2015 12:05:51 +0530
Subject: [PATCH 38/52] [fixed] New button in POS Sales Invoice, reported via
forum
---
.../doctype/sales_invoice/sales_invoice.js | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 5e8d3a5d9b..7ff0a364eb 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -36,6 +36,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
refresh: function(doc, dt, dn) {
this._super();
+ if(cur_frm.msgbox && cur_frm.msgbox.$wrapper.is(":visible")) {
+ // hide new msgbox
+ cur_frm.msgbox.hide();
+ }
+
cur_frm.dashboard.reset();
this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
@@ -146,7 +151,9 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
method: "set_missing_values",
callback: function(r) {
if(!r.exc) {
- cur_frm.pos_print_format = r.message.print_format;
+ if(r.message && r.message.print_format) {
+ cur_frm.pos_print_format = r.message.print_format;
+ }
cur_frm.doc.__missing_values_set = true;
me.frm.script_manager.trigger("update_stock");
frappe.model.set_default_values(me.frm.doc);
@@ -175,7 +182,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
me.apply_pricing_rule();
})
},
-
+
debit_to: function() {
var me = this;
if(this.frm.doc.debit_to) {
@@ -193,7 +200,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
}
}
});
- }
+ }
},
allocated_amount: function() {
@@ -417,9 +424,9 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
})
if(cur_frm.doc.is_pos) {
- frappe.msgprint('Print\
- New');
+ New');
} else if(cint(frappe.boot.notification_settings.sales_invoice)) {
cur_frm.email_doc(frappe.boot.notification_settings.sales_invoice_message);
From 156ce607e2a4051ddd47b603204a10574103c55f Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Fri, 11 Sep 2015 18:49:59 +0530
Subject: [PATCH 39/52] [cleanup] [wip] portal, shopping cart cleanup
---
.../controllers/website_list_for_contact.py | 51 +++++---
erpnext/hooks.py | 23 +++-
erpnext/public/css/website.css | 2 +
erpnext/public/less/website.less | 2 +
erpnext/shopping_cart/cart.py | 17 +--
erpnext/stock/doctype/item/item.py | 1 +
erpnext/templates/generators/item.html | 41 +++---
erpnext/templates/includes/address_row.html | 19 +--
erpnext/templates/includes/cart.css | 7 ++
erpnext/templates/includes/cart.js | 60 ++++-----
erpnext/templates/includes/issue_row.html | 22 ++--
erpnext/templates/includes/macros.html | 28 +++--
erpnext/templates/includes/order.css | 25 ++++
erpnext/templates/includes/product_page.js | 27 ++--
.../templates/includes/transaction_row.html | 23 ++--
erpnext/templates/pages/cart.html | 117 +++++++++++-------
erpnext/templates/pages/cart.py | 12 +-
erpnext/templates/pages/order.html | 90 ++++++++++++++
erpnext/templates/pages/order.py | 15 +++
erpnext/utilities/doctype/address/address.py | 3 +
20 files changed, 395 insertions(+), 190 deletions(-)
create mode 100644 erpnext/templates/includes/cart.css
create mode 100644 erpnext/templates/includes/order.css
create mode 100644 erpnext/templates/pages/order.html
create mode 100644 erpnext/templates/pages/order.py
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index 9282be286f..9ec94eb3f8 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -21,37 +21,54 @@ def get_list_context(context=None):
def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20):
from frappe.templates.pages.list import get_list
user = frappe.session.user
+ key = None
+
+ if not filters: filters = []
+
+ filters.append((doctype, "docstatus", "=", 1))
if user != "Guest" and is_website_user():
# find party for this contact
customers, suppliers = get_customers_suppliers(doctype, user)
+
if customers:
- return post_process(get_list(doctype, txt, filters=[(doctype, "customer", "in", customers)],
- limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=True))
-
+ key, parties = "customer", customers
elif suppliers:
- return post_process(get_list(doctype, txt, filters=[(doctype, "supplier", "in", suppliers)],
- limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=True))
+ key, parties = "supplier", suppliers
+ filters.append((doctype, key, "in", parties))
+
+ if key:
+ return post_process(doctype, get_list(doctype, txt,
+ filters=filters, fields = "name",
+ limit_start=limit_start, limit_page_length=limit_page_length,
+ ignore_permissions=True,
+ order_by = "modified desc"))
else:
return []
- return post_process(get_list(doctype, txt, filters, limit_start, limit_page_length))
+ return post_process(doctype, get_list(doctype, txt, filters, limit_start, limit_page_length,
+ fields="name", order_by = "modified desc"))
-def post_process(result):
- for r in result:
- r.status_percent = 0
- r.status_display = []
+def post_process(doctype, data):
+ result = []
+ for d in data:
+ doc = frappe.get_doc(doctype, d.name)
- if r.get("per_billed"):
- r.status_percent += flt(r.per_billed)
- r.status_display.append(_("Billed") if r.per_billed==100 else _("{0}% Billed").format(r.per_billed))
+ doc.status_percent = 0
+ doc.status_display = []
- if r.get("per_delivered"):
- r.status_percent += flt(r.per_delivered)
- r.status_display.append(_("Delivered") if r.per_delivered==100 else _("{0}% Delivered").format(r.per_delivered))
+ if doc.get("per_billed"):
+ doc.status_percent += flt(doc.per_billed)
+ doc.status_display.append(_("Billed") if doc.per_billed==100 else _("{0}% Billed").format(doc.per_billed))
- r.status_display = ", ".join(r.status_display)
+ if doc.get("per_delivered"):
+ doc.status_percent += flt(doc.per_delivered)
+ doc.status_display.append(_("Delivered") if doc.per_delivered==100 else _("{0}% Delivered").format(doc.per_delivered))
+
+ doc.status_display = ", ".join(doc.status_display)
+ doc.items_preview = ", ".join([d.item_name for d in doc.items])
+ result.append(doc)
return result
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 54f81b89d5..96f70a866f 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -1,4 +1,6 @@
from __future__ import unicode_literals
+from frappe import _
+
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
@@ -62,11 +64,26 @@ website_context = {
website_route_rules = [
{"from_route": "/orders", "to_route": "Sales Order"},
- {"from_route": "/orders/", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
+ {"from_route": "/orders/", "to_route": "order",
+ "defaults": {
+ "doctype": "Sales Order",
+ "parents": [{"title": _("Orders"), "name": "orders"}]
+ }
+ },
{"from_route": "/invoices", "to_route": "Sales Invoice"},
- {"from_route": "/invoices/", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
+ {"from_route": "/invoices/", "to_route": "order",
+ "defaults": {
+ "doctype": "Sales Invoice",
+ "parents": [{"title": _("Invoices"), "name": "invoices"}]
+ }
+ },
{"from_route": "/shipments", "to_route": "Delivery Note"},
- {"from_route": "/shipments/", "to_route": "print", "defaults": {"doctype": "Delivery Note"}}
+ {"from_route": "/shipments/", "to_route": "order",
+ "defaults": {
+ "doctype": "Delivery Notes",
+ "parents": [{"title": _("Shipments"), "name": "shipments"}]
+ }
+ }
]
has_website_permission = {
diff --git a/erpnext/public/css/website.css b/erpnext/public/css/website.css
index 9b4df40bd1..f3bc58d3de 100644
--- a/erpnext/public/css/website.css
+++ b/erpnext/public/css/website.css
@@ -29,6 +29,7 @@
background-repeat: no-repeat;
background-position: center top;
border-radius: 0.5em;
+ border: 1px solid #ebeff2;
}
.product-image.missing-image {
width: 100%;
@@ -38,6 +39,7 @@
background-repeat: no-repeat;
background-position: center top;
border-radius: 0.5em;
+ border: 1px solid #ebeff2;
border: 1px dashed #d1d8dd;
position: relative;
}
diff --git a/erpnext/public/less/website.less b/erpnext/public/less/website.less
index c0667cceab..96dd0966ab 100644
--- a/erpnext/public/less/website.less
+++ b/erpnext/public/less/website.less
@@ -1,4 +1,5 @@
@border-color: #d1d8dd;
+@light-border-color: #EBEFF2;
.web-long-description {
font-size: 18px;
@@ -35,6 +36,7 @@
background-repeat: no-repeat;
background-position: center top;
border-radius: 0.5em;
+ border: 1px solid @light-border-color;
}
.product-image.missing-image {
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 30f4aba493..e219d8ed5f 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
from frappe import throw, _
import frappe.defaults
-from frappe.utils import cint, flt, get_fullname, fmt_money, cstr
+from frappe.utils import cint, flt, get_fullname, cstr
from erpnext.utilities.doctype.address.address import get_address_display
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import get_shopping_cart_settings
from frappe.utils.nestedset import get_root_of
@@ -134,20 +134,10 @@ def guess_territory():
frappe.db.get_value("Shopping Cart Settings", None, "territory") or \
get_root_of("Territory")
-def decorate_quotation_doc(quotation_doc):
- doc = frappe._dict(quotation_doc.as_dict())
+def decorate_quotation_doc(doc):
for d in doc.get("items", []):
- d.update(frappe.db.get_value("Item", d["item_code"],
+ d.update(frappe.db.get_value("Item", d.item_code,
["website_image", "description", "page_name"], as_dict=True))
- d["formatted_rate"] = fmt_money(d.get("rate"), currency=doc.currency)
- d["formatted_amount"] = fmt_money(d.get("amount"), currency=doc.currency)
-
- for d in doc.get("taxes", []):
- d["formatted_tax_amount"] = fmt_money(flt(d.get("tax_amount_after_discount_amount")),
- currency=doc.currency)
-
- doc.formatted_grand_total_export = fmt_money(doc.grand_total,
- currency=doc.currency)
return doc
@@ -314,7 +304,6 @@ def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_
for address in address_docs:
address.display = get_address_display(address)
- address.display = (address.display).replace("\n", "
\n")
return address_docs
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 6eadb83779..310f4cca22 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -19,6 +19,7 @@ class Item(WebsiteGenerator):
condition_field = "show_in_website",
template = "templates/generators/item.html",
parent_website_route_field = "item_group",
+ no_cache = 1
)
def onload(self):
diff --git a/erpnext/templates/generators/item.html b/erpnext/templates/generators/item.html
index 535edcdb73..af4a795c9f 100644
--- a/erpnext/templates/generators/item.html
+++ b/erpnext/templates/generators/item.html
@@ -27,22 +27,31 @@
{{ _("Item Code") }}: {{ name }}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/erpnext/templates/includes/address_row.html b/erpnext/templates/includes/address_row.html
index f7eaa76ae9..fd287addf4 100644
--- a/erpnext/templates/includes/address_row.html
+++ b/erpnext/templates/includes/address_row.html
@@ -1,19 +1,8 @@
-
-
-
- {{ doc.address_title }}
-
-
- {{ doc.address_type }}
-
-
- {{ doc.address_line1 }}
- {% if doc.address_line2 %}{{ doc.address_line2 }}
{% endif %}
- {{ doc.city }}
-
-
diff --git a/erpnext/templates/includes/cart.css b/erpnext/templates/includes/cart.css
new file mode 100644
index 0000000000..ed98846a8d
--- /dev/null
+++ b/erpnext/templates/includes/cart.css
@@ -0,0 +1,7 @@
+.cart-content {
+ min-height: 400px;
+}
+
+.cart-header, .cart-footer {
+ margin-bottom: 40px;
+}
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index d5956f9912..349e2f5ed8 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -92,12 +92,12 @@ $.extend(shopping_cart, {
$('
').appendTo($cart_taxes);
shopping_cart.render_tax_row($cart_totals, {
- description: "
Total",
- formatted_tax_amount: "
" + doc.formatted_grand_total_export + ""
+ description: "",
+ formatted_tax_amount: __("Total") + ":
" + doc.formatted_grand_total_export + ""
});
if(!(addresses && addresses.length)) {
- $cart_shipping_address.html('
'+frappe._("Hey! Go ahead and add an address")+'
');
+ $cart_shipping_address.html('
'+frappe._("Please add a new address")+'
');
} else {
shopping_cart.render_address($cart_shipping_address, addresses, doc.shipping_address_name);
shopping_cart.render_address($cart_billing_address, addresses, doc.customer_address);
@@ -113,9 +113,9 @@ $.extend(shopping_cart, {
$(repl('
\
\
\
-
%(image_html)s
\
-
\
-
\
+
%(image_html)s
\
+
\
\
@@ -129,8 +129,8 @@ $.extend(shopping_cart, {
\
\
\
-
at %(formatted_rate)s
\
-
= %(formatted_amount)s\
+
' + __("Rate") + ': %(formatted_rate)s
\
+
%(formatted_amount)s\
\
', doc)).appendTo($cart_items);
},
@@ -189,12 +189,12 @@ $.extend(shopping_cart, {
\
\
\
-
%(display)s
\
+
%(display)s
\
\
', address))
.css({"margin": "10px auto"})
@@ -274,24 +274,24 @@ $.extend(shopping_cart, {
$(document).ready(function() {
shopping_cart.bind_events();
- return frappe.call({
- type: "POST",
- method: "erpnext.shopping_cart.cart.get_cart_quotation",
- callback: function(r) {
- $("#cart-container").removeClass("hide");
- $(".progress").remove();
- if(r.exc) {
- if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
- shopping_cart.show_error("Configuration Error", frappe._("Price List not configured."));
- } else if(r["403"]) {
- shopping_cart.show_error("Not Allowed", frappe._("You need to be logged in to view your cart."));
- } else {
- shopping_cart.show_error("Error", frappe._("Something went wrong."));
- }
- } else {
- shopping_cart.set_cart_count();
- shopping_cart.render(r.message);
- }
- }
- });
+ // return frappe.call({
+ // type: "POST",
+ // method: "erpnext.shopping_cart.cart.get_cart_quotation",
+ // callback: function(r) {
+ // $("#cart-container").removeClass("hide");
+ // $(".loading").remove();
+ // if(r.exc) {
+ // if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
+ // shopping_cart.show_error("Configuration Error", frappe._("Price List not configured."));
+ // } else if(r["403"]) {
+ // shopping_cart.show_error("Not Allowed", frappe._("You need to be logged in to view your cart."));
+ // } else {
+ // shopping_cart.show_error("Error", frappe._("Something went wrong."));
+ // }
+ // } else {
+ // shopping_cart.set_cart_count();
+ // shopping_cart.render(r.message);
+ // }
+ // }
+ // });
});
diff --git a/erpnext/templates/includes/issue_row.html b/erpnext/templates/includes/issue_row.html
index 16a8f7b7b7..8e87fcae7b 100644
--- a/erpnext/templates/includes/issue_row.html
+++ b/erpnext/templates/includes/issue_row.html
@@ -1,21 +1,15 @@
+
-
-
- {{ doc.subject }}
-
+
+
+ {{ doc.name }}
+
+ {{ doc.subject }}
-
-
- {{ doc.status }}
-
-
-
+
{{ frappe.format_date(doc.creation) }}
+
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html
index 6748a5ebd2..487968ba81 100644
--- a/erpnext/templates/includes/macros.html
+++ b/erpnext/templates/includes/macros.html
@@ -6,11 +6,25 @@
{% endmacro %}
{% macro product_image(website_image, css_class="") %}
-
- {% if website_image -%}
-
- {%- else -%}
-
- {%- endif %}
-
+
+ {% if website_image -%}
+
+ {%- else -%}
+
+ {%- endif %}
+
+{% endmacro %}
+
+{% macro item_name_and_description(d) %}
+
+
+
+ {{ product_image_square(d.image) }}
+
+
+
+ {{ d.item_code }}
+
{{ d.description }}
+
+
{% endmacro %}
diff --git a/erpnext/templates/includes/order.css b/erpnext/templates/includes/order.css
new file mode 100644
index 0000000000..54c8d0ffe2
--- /dev/null
+++ b/erpnext/templates/includes/order.css
@@ -0,0 +1,25 @@
+.order-container {
+ margin: 50px 0px;
+}
+
+.order-items {
+ margin: 20px 0px;
+}
+
+.order-item-table {
+ margin: 0px -15px;
+}
+
+.order-item-header {
+ border-bottom: 1px solid #d1d8dd;
+}
+
+.order-image-col {
+ padding-right: 0px;
+}
+
+.order-image {
+ max-width: 55px;
+ max-height: 55px;
+ margin-top: -5px;
+}
diff --git a/erpnext/templates/includes/product_page.js b/erpnext/templates/includes/product_page.js
index 4f4f11c9f3..98331a4f20 100644
--- a/erpnext/templates/includes/product_page.js
+++ b/erpnext/templates/includes/product_page.js
@@ -1,10 +1,10 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-$(document).ready(function() {
+frappe.ready(function() {
var item_code = $('[itemscope] [itemprop="productID"]').text().trim();
var qty = 0;
-
+
frappe.call({
type: "POST",
method: "erpnext.shopping_cart.product.get_product_info",
@@ -12,10 +12,12 @@ $(document).ready(function() {
item_code: "{{ name }}"
},
callback: function(r) {
+ console.log(r.message);
+ $(".item-cart").toggleClass("hide", !!!r.message.price);
if(r.message && r.message.price) {
$(".item-price")
.html(r.message.price.formatted_price + " per " + r.message.uom);
-
+
if(r.message.stock==0) {
$(".item-stock").html("
Not in stock
");
}
@@ -23,18 +25,17 @@ $(document).ready(function() {
$(".item-stock").html("
\
Available (in stock)
");
}
-
- $(".item-price-info").toggle(true);
-
+
if(r.message.qty) {
qty = r.message.qty;
- toggle_update_cart(qty);
- $("#item-update-cart input").val(qty);
+ toggle_update_cart(r.message.qty);
+ } else {
+ toggle_update_cart(0);
}
}
}
})
-
+
$("#item-add-to-cart button").on("click", function() {
shopping_cart.update_cart({
item_code: item_code,
@@ -45,10 +46,10 @@ $(document).ready(function() {
qty = 1;
}
},
- btn: this,
+ btn: this,
});
});
-
+
$("#item-update-cart button").on("click", function() {
shopping_cart.update_cart({
item_code: item_code,
@@ -63,7 +64,7 @@ $(document).ready(function() {
},
});
});
-
+
if(localStorage && localStorage.getItem("pending_add_to_cart") && full_name) {
localStorage.removeItem("pending_add_to_cart");
$("#item-add-to-cart button").trigger("click");
@@ -75,4 +76,4 @@ var toggle_update_cart = function(qty) {
$("#item-update-cart")
.toggle(qty ? true : false)
.find("input").val(qty);
-}
\ No newline at end of file
+}
diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html
index a677fa5ad3..9b9fd52350 100644
--- a/erpnext/templates/includes/transaction_row.html
+++ b/erpnext/templates/includes/transaction_row.html
@@ -1,29 +1,22 @@
-{% set doc = frappe.get_doc(doc) %}
-
+
-
{{ doc.customer or doc.supplier }}
+
+
{{ doc.name }}
+
{{ doc.items_preview }}
+
- {%- if doc.status_percent > 0 -%}
- {%- if doc.status_percent % 100 == 0 -%}
- {{ doc.status_display }}
- {%- else -%}
- {{ doc.status_display }}
- {%- endif -%}
- {%- elif doc.status -%}
- {{ doc.status }}
- {%- endif -%}
+
+ {{ doc.indicator_title or doc.status or "Submitted" }}
+
{{ doc.get_formatted("grand_total") }}
-
- {{ doc.name }}
-
{{ frappe.utils.pretty_date(doc.creation) }}
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index e4e4a6a6c1..2e1572869f 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -3,53 +3,84 @@
{% block header %}
{{ _("My Cart") }}
{% endblock %}
{% block script %}{% include "templates/includes/cart.js" %}{% endblock %}
+{% block style %}{% include "templates/includes/cart.css" %}{% endblock %}
{% block content %}
+
+{% from "erpnext/templates/includes/macros.html" import item_name_and_description %}
+
-
{{ _("Loading") }}...
-
-
-
+
{{ _("Loading") }}...
+
+
-
-
-
-
-
{{ _("Item Details") }}
-
-
-
{{ _("Qty, Amount") }}
-
-
-
-
-
-
-
-
-
-
-
-
{{ _("Shipping Address") }}
-
-
-
-
-
Billing Address
-
-
-
-
-
-
-
-
+
+ {% if doc.items %}
+ {% for d in doc.items %}
+
+
+
+ {{ item_name_and_description(d) }}
+
+
+
+
+ {{ _("Rate") + ': ' + d.get_formatted("rate") }}
+
+
+ {{ d.get_formatted("amount") }}
+
+
+
+ {% endfor %}
+ {% else %}
+
{{ _("Cart is Empty") }}
+ {% endif %}
+
+
+
+
+
+
+
+
+
{{ _("Shipping Address") }}
+
+
+
+
+
Billing Address
+
+
+
+
+
+
+
+
diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py
index fe50f0fe47..bb8645d816 100644
--- a/erpnext/templates/pages/cart.py
+++ b/erpnext/templates/pages/cart.py
@@ -2,7 +2,13 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
-from __future__ import unicode_literals
-
no_cache = 1
-no_sitemap = 1
\ No newline at end of file
+no_sitemap = 1
+
+import frappe
+from erpnext.shopping_cart.cart import get_cart_quotation
+
+def get_context(context):
+ context.update(get_cart_quotation())
+
+ print context
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
new file mode 100644
index 0000000000..c3bca5bb50
--- /dev/null
+++ b/erpnext/templates/pages/order.html
@@ -0,0 +1,90 @@
+{% block header %}
+{{ doc.name }}
+
+{% endblock %}
+
+{% block style %}{% include "templates/includes/order.css" %}{% endblock %}
+
+{% block content %}
+
+{% from "erpnext/templates/includes/macros.html" import item_name_and_description %}
+
+
+
+
+ {{ doc.indicator_title or doc.status or "Submitted" }}
+
+
+
+ {{ doc.get_formatted("transaction_date") }}
+
+
+
+{% if doc._header %}
+{{ doc._header }}
+{% endif %}
+
+
+
+
+
+
+ {% for d in doc.items %}
+
+
+ {{ item_name_and_description(d) }}
+
+
+ {{ d.qty }}
+ {% if d.delivered_qty != None %}
+
{{
+ _("Delivered: {0}").format(d.delivered_qty) }}
+ {% endif %}
+
+
+ {{ d.get_formatted("amount") }}
+
{{
+ _("Rate: {0}").format(d.get_formatted("rate")) }}
+
+
+ {% endfor %}
+
+
+
+
+
+
+ {% if doc.taxes %}
+
+
{{ _("Net Total") }}
+
+ {{ doc.get_formatted("net_total") }}
+
+ {% endif %}
+ {% for d in doc.taxes %}
+
+
{{ d.description }}
+
+ {{ d.get_formatted("total") }}
+
+ {% endfor %}
+
+
{{ _("Grand Total") }}
+
+ {{ doc.get_formatted("grand_total") }}
+
+
+
+
+
+{% endblock %}
diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py
new file mode 100644
index 0000000000..260490d129
--- /dev/null
+++ b/erpnext/templates/pages/order.py
@@ -0,0 +1,15 @@
+# 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 import _
+
+def get_context(context):
+ context.no_cache = 1
+ context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
+ context.parents = frappe.form_dict.parents
+
+ if not context.doc.has_permission("read"):
+ frappe.throw(_("Not Permitted"), frappe.PermissionError)
diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py
index b3f67175e5..8ae7c4da6f 100644
--- a/erpnext/utilities/doctype/address/address.py
+++ b/erpnext/utilities/doctype/address/address.py
@@ -70,6 +70,9 @@ class Address(Document):
(is_address_type, fieldname, "%s", "%s"), (self.get(fieldname), self.name))
break
+ def get_display(self):
+ return get_address_display(self.as_dict())
+
@frappe.whitelist()
def get_address_display(address_dict):
if not address_dict:
From 3d76686b82e49b35456fdf825781c3d80a1ccdeb Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Wed, 16 Sep 2015 18:52:52 +0530
Subject: [PATCH 40/52] [shopping-cart] cart via Jinja WIP
---
.../doctype/sales_invoice/sales_invoice.py | 33 ++++---
.../controllers/website_list_for_contact.py | 3 +
erpnext/shopping_cart/cart.py | 3 +-
erpnext/templates/includes/cart.css | 20 ++++-
erpnext/templates/includes/cart.js | 61 ++++++-------
.../templates/includes/cart/cart_address.html | 24 +++++
.../includes/cart/cart_item_line.html | 16 ++++
.../templates/includes/cart/cart_macros.html | 21 +++++
erpnext/templates/includes/macros.html | 13 ---
.../templates/includes/{ => order}/order.css | 0
.../includes/order/order_macros.html | 15 ++++
.../templates/includes/order/order_taxes.html | 19 ++++
erpnext/templates/pages/cart.html | 89 ++++++++-----------
erpnext/templates/pages/cart.py | 2 -
erpnext/templates/pages/order.html | 24 +----
erpnext/templates/pages/order.py | 3 +
16 files changed, 208 insertions(+), 138 deletions(-)
create mode 100644 erpnext/templates/includes/cart/cart_address.html
create mode 100644 erpnext/templates/includes/cart/cart_item_line.html
create mode 100644 erpnext/templates/includes/cart/cart_macros.html
rename erpnext/templates/includes/{ => order}/order.css (100%)
create mode 100644 erpnext/templates/includes/order/order_macros.html
create mode 100644 erpnext/templates/includes/order/order_taxes.html
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 030fddbb99..885e7bd160 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -35,6 +35,15 @@ class SalesInvoice(SellingController):
'overflow_type': 'billing'
}]
+ def set_indicator(self):
+ """Set indicator for portal"""
+ if self.outstanding_amount > 0:
+ self.indicator_color = "orange"
+ self.indicator_title = _("Unpaid")
+ else:
+ self.indicator_color = "green"
+ self.indicator_title = _("Paid")
+
def validate(self):
super(SalesInvoice, self).validate()
self.validate_posting_time()
@@ -90,7 +99,7 @@ class SalesInvoice(SellingController):
# this sequence because outstanding may get -ve
self.make_gl_entries()
-
+
if not self.is_return:
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
self.check_credit_limit()
@@ -161,10 +170,10 @@ class SalesInvoice(SellingController):
'extra_cond': """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)"""
}
])
-
+
def check_credit_limit(self):
from erpnext.selling.doctype.customer.customer import check_credit_limit
-
+
validate_against_credit_limit = False
for d in self.get("items"):
if not (d.sales_order or d.delivery_note):
@@ -282,7 +291,7 @@ class SalesInvoice(SellingController):
reconcile_against_document(lst)
def validate_debit_to_acc(self):
- account = frappe.db.get_value("Account", self.debit_to,
+ account = frappe.db.get_value("Account", self.debit_to,
["account_type", "report_type", "account_currency"], as_dict=True)
if account.report_type != "Balance Sheet":
@@ -290,7 +299,7 @@ class SalesInvoice(SellingController):
if self.customer and account.account_type != "Receivable":
frappe.throw(_("Debit To account must be a Receivable account"))
-
+
self.party_account_currency = account.account_currency
def validate_fixed_asset_account(self):
@@ -437,18 +446,18 @@ class SalesInvoice(SellingController):
if cint(self.is_pos) == 1:
if flt(self.paid_amount) == 0:
if self.cash_bank_account:
- frappe.db.set(self, 'paid_amount',
- flt(flt(self.grand_total) - flt(self.write_off_amount), self.precision("paid_amount")))
+ frappe.db.set(self, 'paid_amount',
+ flt(flt(self.grand_total) - flt(self.write_off_amount), self.precision("paid_amount")))
else:
# show message that the amount is not paid
frappe.db.set(self,'paid_amount',0)
frappe.msgprint(_("Note: Payment Entry will not be created since 'Cash or Bank Account' was not specified"))
else:
frappe.db.set(self,'paid_amount',0)
-
- frappe.db.set(self, 'base_paid_amount',
+
+ frappe.db.set(self, 'base_paid_amount',
flt(self.paid_amount*self.conversion_rate, self.precision("base_paid_amount")))
-
+
def check_prev_docstatus(self):
for d in self.get('items'):
if d.sales_order and frappe.db.get_value("Sales Order", d.sales_order, "docstatus") != 1:
@@ -487,7 +496,7 @@ class SalesInvoice(SellingController):
from erpnext.accounts.general_ledger import merge_similar_entries
gl_entries = []
-
+
self.make_customer_gl_entry(gl_entries)
self.make_tax_gl_entries(gl_entries)
@@ -586,7 +595,7 @@ class SalesInvoice(SellingController):
# write off entries, applicable if only pos
if self.write_off_account and self.write_off_amount:
write_off_account_currency = frappe.db.get_value("Account", self.write_off_account, "account_currency")
-
+
gl_entries.append(
self.get_gl_dict({
"account": self.debit_to,
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index 9ec94eb3f8..51fb0a5889 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -66,6 +66,9 @@ def post_process(doctype, data):
doc.status_percent += flt(doc.per_delivered)
doc.status_display.append(_("Delivered") if doc.per_delivered==100 else _("{0}% Delivered").format(doc.per_delivered))
+ if hasattr(doc, "set_indicator"):
+ doc.set_indicator()
+
doc.status_display = ", ".join(doc.status_display)
doc.items_preview = ", ".join([d.item_name for d in doc.items])
result.append(doc)
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index e219d8ed5f..6ff164b229 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -122,7 +122,8 @@ def update_cart_address(address_fieldname, address_name):
quotation.flags.ignore_permissions = True
quotation.save()
- return get_cart_quotation(quotation)
+ return frappe.render_template("templates/includes/cart/cart_address.html",
+ get_cart_quotation(quotation))
def guess_territory():
territory = None
diff --git a/erpnext/templates/includes/cart.css b/erpnext/templates/includes/cart.css
index ed98846a8d..7a18530286 100644
--- a/erpnext/templates/includes/cart.css
+++ b/erpnext/templates/includes/cart.css
@@ -1,7 +1,25 @@
.cart-content {
min-height: 400px;
+ margin-top: 60px;
}
.cart-header, .cart-footer {
- margin-bottom: 40px;
+ margin-bottom: 60px;
+}
+
+.cart-item-header {
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px solid #d1d8dd;
+}
+
+.tax-grand-total-row {
+ font-size: 14px;
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+.cart-addresses {
+ margin-top: 80px;
+ margin-bottom: 60px;
}
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index 349e2f5ed8..e0706f7fce 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -13,6 +13,8 @@ $.extend(shopping_cart, {
},
bind_events: function() {
+ shopping_cart.bind_address_select();
+
// bind update button
$(document).on("click", ".item-update-cart button", function() {
var item_code = $(this).attr("data-item-code");
@@ -31,19 +33,36 @@ $.extend(shopping_cart, {
});
});
- $("#cart-add-shipping-address").on("click", function() {
- window.location.href = "addresses";
- });
-
- $("#cart-add-billing-address").on("click", function() {
- window.location.href = "address";
- });
-
$(".btn-place-order").on("click", function() {
shopping_cart.place_order(this);
});
},
+ bind_address_select: function() {
+ $(".cart-addresses").find('input[data-address-name]').on("click", function() {
+ if($(this).prop("checked")) {
+ var me = this;
+
+ return frappe.call({
+ type: "POST",
+ method: "erpnext.shopping_cart.cart.update_cart_address",
+ args: {
+ address_fieldname: $(this).attr("data-fieldname"),
+ address_name: $(this).attr("data-address-name")
+ },
+ callback: function(r) {
+ if(!r.exc) {
+ $('.cart-addresses').html(r.message);
+ }
+ }
+ });
+ } else {
+ return false;
+ }
+ });
+
+ },
+
render: function(out) {
var doc = out.doc;
var addresses = out.addresses;
@@ -209,32 +228,6 @@ $.extend(shopping_cart, {
+$(this).attr("data-address-name")+'"]').collapse("toggle");
});
- $address_wrapper.find('input[type="checkbox"]').on("click", function() {
- if($(this).prop("checked")) {
- var me = this;
- $address_wrapper.find('input[type="checkbox"]').each(function(i, chk) {
- if($(chk).attr("data-address-name")!=$(me).attr("data-address-name")) {
- $(chk).prop("checked", false);
- }
- });
-
- return frappe.call({
- type: "POST",
- method: "erpnext.shopping_cart.cart.update_cart_address",
- args: {
- address_fieldname: $address_wrapper.attr("data-fieldname"),
- address_name: $(this).attr("data-address-name")
- },
- callback: function(r) {
- if(!r.exc) {
- shopping_cart.render(r.message);
- }
- }
- });
- } else {
- return false;
- }
- });
$address_wrapper.find('input[type="checkbox"][data-address-name="'+ address_name +'"]')
.prop("checked", true);
diff --git a/erpnext/templates/includes/cart/cart_address.html b/erpnext/templates/includes/cart/cart_address.html
new file mode 100644
index 0000000000..44964da47c
--- /dev/null
+++ b/erpnext/templates/includes/cart/cart_address.html
@@ -0,0 +1,24 @@
+{% from "erpnext/templates/includes/cart/cart_macros.html"
+ import show_address %}
+
+
+
{{ _("Shipping Address") }}
+
+ {% for address in addresses %}
+ {{ show_address(address, doc, "shipping_address_name") }}
+ {% endfor %}
+
+
+ {{ _("Manage Addresses") }}
+
+
+
Billing Address
+
+ {% for address in addresses %}
+ {{ show_address(address, doc, "customer_address") }}
+ {% endfor %}
+
+
+
diff --git a/erpnext/templates/includes/cart/cart_item_line.html b/erpnext/templates/includes/cart/cart_item_line.html
new file mode 100644
index 0000000000..cd157634a0
--- /dev/null
+++ b/erpnext/templates/includes/cart/cart_item_line.html
@@ -0,0 +1,16 @@
+{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
+
+
+
+ {{ item_name_and_description(d) }}
+
+
+
{{ d.get_formatted('qty') }}
+
+ {{ _("Rate") + ': ' + d.get_formatted("rate") }}
+
+
+
+ {{ d.get_formatted("amount") }}
+
+
diff --git a/erpnext/templates/includes/cart/cart_macros.html b/erpnext/templates/includes/cart/cart_macros.html
new file mode 100644
index 0000000000..250b487920
--- /dev/null
+++ b/erpnext/templates/includes/cart/cart_macros.html
@@ -0,0 +1,21 @@
+{% macro show_address(address, doc, fieldname) %}
+{% set selected=address.name==doc.get(fieldname) %}
+
+
+
+
+ {{ address.name }}
+
+
+
+
+
+
{{ address.display }}
+
+
+{% endmacro %}
diff --git a/erpnext/templates/includes/macros.html b/erpnext/templates/includes/macros.html
index 487968ba81..81a10c2779 100644
--- a/erpnext/templates/includes/macros.html
+++ b/erpnext/templates/includes/macros.html
@@ -15,16 +15,3 @@
{% endmacro %}
-{% macro item_name_and_description(d) %}
-
-
-
- {{ product_image_square(d.image) }}
-
-
-
- {{ d.item_code }}
-
{{ d.description }}
-
-
-{% endmacro %}
diff --git a/erpnext/templates/includes/order.css b/erpnext/templates/includes/order/order.css
similarity index 100%
rename from erpnext/templates/includes/order.css
rename to erpnext/templates/includes/order/order.css
diff --git a/erpnext/templates/includes/order/order_macros.html b/erpnext/templates/includes/order/order_macros.html
new file mode 100644
index 0000000000..af974aad2f
--- /dev/null
+++ b/erpnext/templates/includes/order/order_macros.html
@@ -0,0 +1,15 @@
+{% from "erpnext/templates/includes/macros.html" import product_image_square %}
+
+{% macro item_name_and_description(d) %}
+
+
+
+ {{ product_image_square(d.image) }}
+
+
+
+ {{ d.item_code }}
+
{{ d.description }}
+
+
+{% endmacro %}
diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html
new file mode 100644
index 0000000000..510e1a3d89
--- /dev/null
+++ b/erpnext/templates/includes/order/order_taxes.html
@@ -0,0 +1,19 @@
+{% if doc.taxes %}
+
+
{{ _("Net Total") }}
+
+ {{ doc.get_formatted("net_total") }}
+
+{% endif %}
+{% for d in doc.taxes %}
+
+
{{ d.description }}
+
+ {{ d.get_formatted("base_tax_amount") }}
+
+{% endfor %}
+
+
{{ _("Grand Total") }}
+
+ {{ doc.get_formatted("grand_total") }}
+
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index 2e1572869f..837df3b056 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -5,81 +5,62 @@
{% block script %}{% include "templates/includes/cart.js" %}{% endblock %}
{% block style %}{% include "templates/includes/cart.css" %}{% endblock %}
+
+{% block header_actions %}
+{% if doc.items %}
+
+{% endif %}
+{% endblock %}
+
{% block content %}
-{% from "erpnext/templates/includes/macros.html" import item_name_and_description %}
+{% from "templates/includes/macros.html" import item_name_and_description %}
-
{{ _("Loading") }}...
-
-
+
+
{% if doc.items %}
{% for d in doc.items %}
-
-
- {{ item_name_and_description(d) }}
-
-
-
-
- {{ _("Rate") + ': ' + d.get_formatted("rate") }}
-
-
- {{ d.get_formatted("amount") }}
-
-
+ {% include "templates/includes/cart/cart_item_line.html" %}
{% endfor %}
{% else %}
{{ _("Cart is Empty") }}
{% endif %}
-
-
+ {% if doc.items %}
+
+
+
+
+ {% include "templates/includes/order/order_taxes.html" %}
+
+
-
-
-
-
{{ _("Shipping Address") }}
-
-
-
-
-
Billing Address
-
-
-
-
+
+ {% include "templates/includes/cart/cart_address.html" %}
-
+ {% endif %}
diff --git a/erpnext/templates/pages/cart.py b/erpnext/templates/pages/cart.py
index bb8645d816..c57d826130 100644
--- a/erpnext/templates/pages/cart.py
+++ b/erpnext/templates/pages/cart.py
@@ -10,5 +10,3 @@ from erpnext.shopping_cart.cart import get_cart_quotation
def get_context(context):
context.update(get_cart_quotation())
-
- print context
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
index c3bca5bb50..73763921f8 100644
--- a/erpnext/templates/pages/order.html
+++ b/erpnext/templates/pages/order.html
@@ -3,11 +3,11 @@
{% endblock %}
-{% block style %}{% include "templates/includes/order.css" %}{% endblock %}
+{% block style %}{% include "templates/includes/order/order.css" %}{% endblock %}
{% block content %}
-{% from "erpnext/templates/includes/macros.html" import item_name_and_description %}
+{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
@@ -64,25 +64,7 @@
- {% if doc.taxes %}
-
-
{{ _("Net Total") }}
-
- {{ doc.get_formatted("net_total") }}
-
- {% endif %}
- {% for d in doc.taxes %}
-
-
{{ d.description }}
-
- {{ d.get_formatted("total") }}
-
- {% endfor %}
-
-
{{ _("Grand Total") }}
-
- {{ doc.get_formatted("grand_total") }}
-
+ {% include "erpnext/templates/includes/order/order_taxes.html" %}
diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py
index 260490d129..36444d1f30 100644
--- a/erpnext/templates/pages/order.py
+++ b/erpnext/templates/pages/order.py
@@ -9,6 +9,9 @@ from frappe import _
def get_context(context):
context.no_cache = 1
context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name)
+ if hasattr(context.doc, "set_indicator"):
+ context.doc.set_indicator()
+
context.parents = frappe.form_dict.parents
if not context.doc.has_permission("read"):
From 8ffd483e242187998d513a9c71ede7c87e6c05bf Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Thu, 17 Sep 2015 16:28:30 +0530
Subject: [PATCH 41/52] [wip] shopping cart shipping rule, price list cleanup
---
.../doctype/shipping_rule/shipping_rule.json | 14 +-
.../doctype/shipping_rule_country/__init__.py | 0
.../shipping_rule_country.json | 53 +++++
.../shipping_rule_country.py | 10 +
erpnext/public/js/shopping_cart.js | 2 +-
erpnext/shopping_cart/cart.py | 15 +-
.../shopping_cart_settings.py | 83 +-------
.../stock/doctype/price_list/price_list.json | 18 +-
.../stock/doctype/price_list/price_list.py | 13 --
.../doctype/price_list_country/__init__.py | 0
.../price_list_country.json | 53 +++++
.../price_list_country/price_list_country.py | 10 +
erpnext/templates/includes/cart.js | 189 +++---------------
.../includes/cart/cart_item_line.html | 16 --
.../templates/includes/cart/cart_items.html | 23 +++
erpnext/templates/includes/issue_row.html | 6 +-
.../templates/includes/order/order_taxes.html | 5 +-
erpnext/templates/pages/cart.html | 8 +-
18 files changed, 216 insertions(+), 302 deletions(-)
create mode 100644 erpnext/accounts/doctype/shipping_rule_country/__init__.py
create mode 100644 erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
create mode 100644 erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
create mode 100644 erpnext/stock/doctype/price_list_country/__init__.py
create mode 100644 erpnext/stock/doctype/price_list_country/price_list_country.json
create mode 100644 erpnext/stock/doctype/price_list_country/price_list_country.py
delete mode 100644 erpnext/templates/includes/cart/cart_item_line.html
create mode 100644 erpnext/templates/includes/cart/cart_items.html
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
index 97828d6f1b..62d5cb8e0c 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
@@ -141,17 +141,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Specify a list of Territories, for which, this Shipping Rule is valid",
- "fieldname": "territories",
+ "fieldname": "countries",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Valid For Territories",
+ "label": "Valid for Countries",
"no_copy": 0,
- "options": "Applicable Territory",
+ "options": "Shipping Rule Country",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -296,7 +296,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-07 15:51:26",
+ "modified": "2015-09-17 06:44:05.127516",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule",
@@ -304,7 +304,7 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -324,7 +324,7 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/accounts/doctype/shipping_rule_country/__init__.py b/erpnext/accounts/doctype/shipping_rule_country/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
new file mode 100644
index 0000000000..90fe3d3dd3
--- /dev/null
+++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
@@ -0,0 +1,53 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2015-09-17 06:43:22.767534",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "country",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Country",
+ "no_copy": 0,
+ "options": "Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "modified": "2015-09-17 06:43:22.767534",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Shipping Rule Country",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
new file mode 100644
index 0000000000..b9646cfc29
--- /dev/null
+++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class ShippingRuleCountry(Document):
+ pass
diff --git a/erpnext/public/js/shopping_cart.js b/erpnext/public/js/shopping_cart.js
index cff831d714..f52c296e3d 100644
--- a/erpnext/public/js/shopping_cart.js
+++ b/erpnext/public/js/shopping_cart.js
@@ -30,7 +30,7 @@ $.extend(shopping_cart, {
args: {
item_code: opts.item_code,
qty: opts.qty,
- with_doc: opts.with_doc || 0
+ with_items: opts.with_items || 0
},
btn: opts.btn,
callback: function(r) {
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 6ff164b229..0d28406f06 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -28,6 +28,8 @@ def get_cart_quotation(doc=None):
doc = quotation
set_cart_count(quotation)
+ print get_applicable_shipping_rules(party)
+
return {
"doc": decorate_quotation_doc(doc),
"addresses": [{"name": address.name, "display": address.display}
@@ -63,7 +65,7 @@ def place_order():
return sales_order.name
@frappe.whitelist()
-def update_cart(item_code, qty, with_doc):
+def update_cart(item_code, qty, with_items=False):
quotation = _get_cart_quotation()
qty = flt(qty)
@@ -95,8 +97,15 @@ def update_cart(item_code, qty, with_doc):
set_cart_count(quotation)
- if with_doc:
- return get_cart_quotation(quotation)
+
+ if with_items:
+ context = get_cart_quotation(quotation)
+ return {
+ "items": frappe.render_template("templates/includes/cart/cart_items.html",
+ context),
+ "taxes": frappe.render_template("templates/includes/order/order_taxes.html",
+ context),
+ }
else:
return quotation.name
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index da7d27af10..a8a4b7653f 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -8,8 +8,7 @@ import frappe
from frappe import _, msgprint
from frappe.utils import comma_and
from frappe.model.document import Document
-from frappe.utils.nestedset import get_ancestors_of, get_root_of
-from erpnext.utilities.doctype.address.address import get_territory_from_address
+from frappe.utils.nestedset import get_root_of
class ShoppingCartSetupError(frappe.ValidationError): pass
@@ -19,57 +18,8 @@ class ShoppingCartSettings(Document):
def validate(self):
if self.enabled:
- self.validate_price_lists()
+ self.validate_tax_masters()
self.validate_exchange_rates_exist()
- self.validate_tax_rule()
-
- def validate_overlapping_territories(self, parentfield, fieldname):
- # for displaying message
- doctype = self.meta.get_field(parentfield).options
-
- # specify atleast one entry in the table
- self.validate_table_has_rows(parentfield, raise_exception=ShoppingCartSetupError)
-
- territory_name_map = self.get_territory_name_map(parentfield, fieldname)
- for territory, names in territory_name_map.items():
- if len(names) > 1:
- frappe.throw(_("{0} {1} has a common territory {2}").format(_(doctype), comma_and(names), territory), ShoppingCartSetupError)
-
- return territory_name_map
-
- def validate_price_lists(self):
- self.validate_overlapping_territories("price_lists", "selling_price_list")
-
- # validate that a Shopping Cart Price List exists for the default territory as a catch all!
- price_list_for_default_territory = self.get_name_from_territory(self.default_territory, "price_lists",
- "selling_price_list")
-
- if not price_list_for_default_territory:
- msgprint(_("Please specify a Price List which is valid for Territory") +
- ": " + self.default_territory, raise_exception=ShoppingCartSetupError)
-
- def get_territory_name_map(self, parentfield, fieldname):
- territory_name_map = {}
-
- # entries in table
- names = [doc.get(fieldname) for doc in self.get(parentfield)]
- if names:
- # for condition in territory check
- parenttype = frappe.get_meta(self.meta.get_options(parentfield)).get_options(fieldname)
- # to validate territory overlap
- # make a map of territory: [list of names]
- # if list against each territory has more than one element, raise exception
- territory_name = frappe.db.sql("""select `territory`, `parent`
- from `tabApplicable Territory`
- where `parenttype`=%s and `parent` in (%s)""" %
- ("%s", ", ".join(["%s"]*len(names))), tuple([parenttype] + names))
-
- for territory, name in territory_name:
- territory_name_map.setdefault(territory, []).append(name)
-
- if len(territory_name_map[territory]) > 1:
- territory_name_map[territory].sort(key=lambda val: names.index(val))
- return territory_name_map
def validate_exchange_rates_exist(self):
"""check if exchange rates exist for all Price List currencies (to company's currency)"""
@@ -102,20 +52,6 @@ class ShoppingCartSettings(Document):
msgprint(_("Missing Currency Exchange Rates for {0}").format(comma_and(missing)),
raise_exception=ShoppingCartSetupError)
- def get_name_from_territory(self, territory, parentfield, fieldname):
- name = None
- territory_name_map = self.get_territory_name_map(parentfield, fieldname)
- if territory_name_map.get(territory):
- name = territory_name_map.get(territory)
- else:
- territory_ancestry = self.get_territory_ancestry(territory)
- for ancestor in territory_ancestry:
- if territory_name_map.get(ancestor):
- name = territory_name_map.get(ancestor)
- break
-
- return name
-
def get_price_list(self, billing_territory):
price_list = self.get_name_from_territory(billing_territory, "price_lists", "selling_price_list")
if not (price_list and price_list[0]):
@@ -123,11 +59,11 @@ class ShoppingCartSettings(Document):
"price_lists", "selling_price_list")
return price_list and price_list[0] or None
-
+
def validate_tax_rule(self):
if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart" : 1}, "name"):
frappe.throw(frappe._("Set Tax Rule for shopping cart"), ShoppingCartSetupError)
-
+
def get_tax_master(self, billing_territory):
tax_master = self.get_name_from_territory(billing_territory, "sales_taxes_and_charges_masters",
"sales_taxes_and_charges_master")
@@ -136,15 +72,6 @@ class ShoppingCartSettings(Document):
def get_shipping_rules(self, shipping_territory):
return self.get_name_from_territory(shipping_territory, "shipping_rules", "shipping_rule")
- def get_territory_ancestry(self, territory):
- if not hasattr(self, "_territory_ancestry"):
- self._territory_ancestry = {}
-
- if not self._territory_ancestry.get(territory):
- self._territory_ancestry[territory] = get_ancestors_of("Territory", territory)
-
- return self._territory_ancestry[territory]
-
def validate_cart_settings(doc, method):
frappe.get_doc("Shopping Cart Settings", "Shopping Cart Settings").run_method("validate")
@@ -163,4 +90,4 @@ def get_default_territory():
def check_shopping_cart_enabled():
if not get_shopping_cart_settings().enabled:
frappe.throw(_("You need to enable Shopping Cart"), ShoppingCartSetupError)
-
+
diff --git a/erpnext/stock/doctype/price_list/price_list.json b/erpnext/stock/doctype/price_list/price_list.json
index fcd204c18e..0d2baa461f 100644
--- a/erpnext/stock/doctype/price_list/price_list.json
+++ b/erpnext/stock/doctype/price_list/price_list.json
@@ -163,21 +163,21 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Specify a list of Territories, for which, this Price List is valid",
- "fieldname": "territories",
+ "fieldname": "countries",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Valid for Territories",
+ "label": "Applicable for Countries",
"no_copy": 0,
- "options": "Applicable Territory",
+ "options": "Price List Country",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -193,7 +193,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
- "modified": "2015-09-14 02:55:58.919822",
+ "modified": "2015-09-17 06:50:31.465221",
"modified_by": "Administrator",
"module": "Stock",
"name": "Price List",
@@ -201,7 +201,7 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -241,7 +241,7 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
@@ -281,7 +281,7 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py
index 6b03bb6b0e..8773b9c33f 100644
--- a/erpnext/stock/doctype/price_list/price_list.py
+++ b/erpnext/stock/doctype/price_list/price_list.py
@@ -13,19 +13,6 @@ class PriceList(Document):
if not cint(self.buying) and not cint(self.selling):
throw(_("Price List must be applicable for Buying or Selling"))
- try:
- # at least one territory
- self.validate_table_has_rows("territories")
- except frappe.EmptyTableError:
- # if no territory, set default territory
- if frappe.defaults.get_user_default("territory"):
- self.append("territories", {
- "doctype": "Applicable Territory",
- "territory": frappe.defaults.get_user_default("territory")
- })
- else:
- raise
-
def on_update(self):
self.set_default_if_missing()
self.update_item_price()
diff --git a/erpnext/stock/doctype/price_list_country/__init__.py b/erpnext/stock/doctype/price_list_country/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/stock/doctype/price_list_country/price_list_country.json b/erpnext/stock/doctype/price_list_country/price_list_country.json
new file mode 100644
index 0000000000..be02c202cc
--- /dev/null
+++ b/erpnext/stock/doctype/price_list_country/price_list_country.json
@@ -0,0 +1,53 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2015-09-17 06:49:51.810318",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "country",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Country",
+ "no_copy": 0,
+ "options": "Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "modified": "2015-09-17 06:49:51.810318",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Price List Country",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/price_list_country/price_list_country.py b/erpnext/stock/doctype/price_list_country/price_list_country.py
new file mode 100644
index 0000000000..db1a0607e6
--- /dev/null
+++ b/erpnext/stock/doctype/price_list_country/price_list_country.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+
+class PriceListCountry(Document):
+ pass
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index e0706f7fce..e6ce25a6a8 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -14,28 +14,9 @@ $.extend(shopping_cart, {
bind_events: function() {
shopping_cart.bind_address_select();
+ shopping_cart.bind_place_order();
+ shopping_cart.bind_change_qty();
- // bind update button
- $(document).on("click", ".item-update-cart button", function() {
- var item_code = $(this).attr("data-item-code");
- shopping_cart.update_cart({
- item_code: item_code,
- qty: $('input[data-item-code="'+item_code+'"]').val(),
- with_doc: 1,
- btn: this,
- callback: function(r) {
- if(!r.exc) {
- shopping_cart.render(r.message);
- var $button = $('button[data-item-code="'+item_code+'"]').addClass("btn-success");
- setTimeout(function() { $button.removeClass("btn-success"); }, 1000);
- }
- },
- });
- });
-
- $(".btn-place-order").on("click", function() {
- shopping_cart.place_order(this);
- });
},
bind_address_select: function() {
@@ -63,95 +44,31 @@ $.extend(shopping_cart, {
},
- render: function(out) {
- var doc = out.doc;
- var addresses = out.addresses;
-
- var $cart_items = $("#cart-items").empty();
- var $cart_taxes = $("#cart-taxes").empty();
- var $cart_totals = $("#cart-totals").empty();
- var $cart_billing_address = $("#cart-billing-address").empty();
- var $cart_shipping_address = $("#cart-shipping-address").empty();
-
- var no_items = $.map(doc.items || [],
- function(d) { return d.item_code || null;}).length===0;
- if(no_items) {
- shopping_cart.show_error("Cart Empty", frappe._("Go ahead and add something to your cart."));
- $("#cart-addresses").toggle(false);
- return;
- }
-
- var shipping_rule_added = false;
- var taxes_exist = false;
- var shipping_rule_labels = $.map(out.shipping_rules || [], function(rule) { return rule[1]; });
-
- $.each(doc.items || [], function(i, d) {
- shopping_cart.render_item_row($cart_items, d);
+ bind_place_order: function() {
+ $(".btn-place-order").on("click", function() {
+ shopping_cart.place_order(this);
});
-
- $.each(doc.taxes || [], function(i, d) {
- if(out.shipping_rules && out.shipping_rules.length &&
- shipping_rule_labels.indexOf(d.description)!==-1) {
- shipping_rule_added = true;
- shopping_cart.render_tax_row($cart_taxes, d, out.shipping_rules);
- } else {
- shopping_cart.render_tax_row($cart_taxes, d);
- }
-
- taxes_exist = true;
- });
-
- if(out.shipping_rules && out.shipping_rules.length && !shipping_rule_added) {
- shopping_cart.render_tax_row($cart_taxes, {description: "", formatted_tax_amount: ""},
- out.shipping_rules);
- taxes_exist = true;
- }
-
- if(taxes_exist)
- $('
').appendTo($cart_taxes);
-
- shopping_cart.render_tax_row($cart_totals, {
- description: "",
- formatted_tax_amount: __("Total") + ": " + doc.formatted_grand_total_export + ""
- });
-
- if(!(addresses && addresses.length)) {
- $cart_shipping_address.html(''+frappe._("Please add a new address")+'
');
- } else {
- shopping_cart.render_address($cart_shipping_address, addresses, doc.shipping_address_name);
- shopping_cart.render_address($cart_billing_address, addresses, doc.customer_address);
- }
},
- render_item_row: function($cart_items, doc) {
- doc.image_html = doc.website_image ?
- '': "";
+ bind_change_qty: function() {
+ // bind update button
+ $(".cart-items").on("change", ".cart-qty", function() {
+ var item_code = $(this).attr("data-item-code");
+ shopping_cart.update_cart({
+ item_code: item_code,
+ qty: $(this).val(),
+ with_items: 1,
+ btn: this,
+ callback: function(r) {
+ if(!r.exc) {
+ $(".cart-items").html(r.message.items);
+ $(".cart-tax-items").html(r.message.taxes);
+ }
+ $(".tax-grand-total").temp_highlight();
+ },
+ });
+ });
- if(doc.description === doc.item_name) doc.description = "";
-
- $(repl('\
-
\
-
\
-
%(image_html)s
\
-
\
-
\
-
%(description)s
\
-
\
-
\
-
\
-
\
-
\
-
' + __("Rate") + ': %(formatted_rate)s
\
-
%(formatted_amount)s\
-
\
-
', doc)).appendTo($cart_items);
},
render_tax_row: function($cart_taxes, doc, shipping_rules) {
@@ -201,46 +118,6 @@ $.extend(shopping_cart, {
});
},
- render_address: function($address_wrapper, addresses, address_name) {
- $.each(addresses, function(i, address) {
- $(repl('', address))
- .css({"margin": "10px auto"})
- .appendTo($address_wrapper);
- });
-
- $address_wrapper.find(".panel-heading")
- .find(".address-title")
- .css({"cursor": "pointer"})
- .on("click", function() {
- $address_wrapper.find('.panel-collapse[data-address-name="'
- +$(this).attr("data-address-name")+'"]').collapse("toggle");
- });
-
-
- $address_wrapper.find('input[type="checkbox"][data-address-name="'+ address_name +'"]')
- .prop("checked", true);
-
- $address_wrapper.find(".panel-collapse").collapse({
- parent: $address_wrapper,
- toggle: false
- });
-
- $address_wrapper.find('.panel-collapse[data-address-name="'+ address_name +'"]')
- .collapse("show");
- },
-
place_order: function(btn) {
return frappe.call({
type: "POST",
@@ -267,24 +144,4 @@ $.extend(shopping_cart, {
$(document).ready(function() {
shopping_cart.bind_events();
- // return frappe.call({
- // type: "POST",
- // method: "erpnext.shopping_cart.cart.get_cart_quotation",
- // callback: function(r) {
- // $("#cart-container").removeClass("hide");
- // $(".loading").remove();
- // if(r.exc) {
- // if(r.exc.indexOf("WebsitePriceListMissingError")!==-1) {
- // shopping_cart.show_error("Configuration Error", frappe._("Price List not configured."));
- // } else if(r["403"]) {
- // shopping_cart.show_error("Not Allowed", frappe._("You need to be logged in to view your cart."));
- // } else {
- // shopping_cart.show_error("Error", frappe._("Something went wrong."));
- // }
- // } else {
- // shopping_cart.set_cart_count();
- // shopping_cart.render(r.message);
- // }
- // }
- // });
});
diff --git a/erpnext/templates/includes/cart/cart_item_line.html b/erpnext/templates/includes/cart/cart_item_line.html
deleted file mode 100644
index cd157634a0..0000000000
--- a/erpnext/templates/includes/cart/cart_item_line.html
+++ /dev/null
@@ -1,16 +0,0 @@
-{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
-
-
-
- {{ item_name_and_description(d) }}
-
-
-
{{ d.get_formatted('qty') }}
-
- {{ _("Rate") + ': ' + d.get_formatted("rate") }}
-
-
-
- {{ d.get_formatted("amount") }}
-
-
diff --git a/erpnext/templates/includes/cart/cart_items.html b/erpnext/templates/includes/cart/cart_items.html
new file mode 100644
index 0000000000..f7efa78709
--- /dev/null
+++ b/erpnext/templates/includes/cart/cart_items.html
@@ -0,0 +1,23 @@
+{% from "erpnext/templates/includes/order/order_macros.html" import item_name_and_description %}
+
+{% for d in doc.items %}
+
+
+
+ {{ item_name_and_description(d) }}
+
+
+
+
+
+ {{ _("Rate") + ': ' + d.get_formatted("rate") }}
+
+
+
+ {{ d.get_formatted("amount") }}
+
+
+
+{% endfor %}
diff --git a/erpnext/templates/includes/issue_row.html b/erpnext/templates/includes/issue_row.html
index 8e87fcae7b..2935a24ea4 100644
--- a/erpnext/templates/includes/issue_row.html
+++ b/erpnext/templates/includes/issue_row.html
@@ -2,13 +2,13 @@
-
+
{{ doc.name }}
{{ doc.subject }}
-
- {{ frappe.format_date(doc.creation) }}
+
+ {{ frappe.format_date(doc.modified) }}
diff --git a/erpnext/templates/includes/order/order_taxes.html b/erpnext/templates/includes/order/order_taxes.html
index 510e1a3d89..8c8e88621b 100644
--- a/erpnext/templates/includes/order/order_taxes.html
+++ b/erpnext/templates/includes/order/order_taxes.html
@@ -15,5 +15,8 @@
{{ _("Grand Total") }}
- {{ doc.get_formatted("grand_total") }}
+
+ {{ doc.get_formatted("grand_total") }}
+
+
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html
index 837df3b056..a97e65876c 100644
--- a/erpnext/templates/pages/cart.html
+++ b/erpnext/templates/pages/cart.html
@@ -35,11 +35,9 @@
{% if doc.items %}
- {% for d in doc.items %}
-
- {% include "templates/includes/cart/cart_item_line.html" %}
+
+ {% include "templates/includes/cart/cart_items.html" %}
- {% endfor %}
{% else %}
{{ _("Cart is Empty") }}
{% endif %}
@@ -48,7 +46,7 @@
-
+
{% include "templates/includes/order/order_taxes.html" %}
From 72fbf902d7167cba5b3d150cac4ecd8d8acadb30 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Thu, 17 Sep 2015 18:29:44 +0530
Subject: [PATCH 42/52] [cleanup] added single price list for shopping cart,
removed Applicable Territory
---
.../sales_taxes_and_charges_template.json | 27 +----
.../sales_taxes_and_charges_template.py | 5 -
.../doctype/shipping_rule/shipping_rule.json | 63 ++++++-----
.../doctype/shipping_rule/shipping_rule.py | 3 +
erpnext/accounts/party.py | 19 +++-
erpnext/patches.txt | 2 +
.../v6_3}/__init__.py | 0
.../v6_3/convert_applicable_territory.py | 17 +++
.../applicable_territory.json | 50 ---------
.../applicable_territory.py | 12 ---
erpnext/shopping_cart/cart.py | 71 ++++++------
.../shopping_cart_price_list/__init__.py | 0
.../shopping_cart_price_list.json | 49 ---------
.../shopping_cart_price_list.py | 12 ---
.../shopping_cart_settings.json | 101 ++----------------
.../shopping_cart_settings.py | 11 +-
.../test_shopping_cart_settings.py | 42 ++------
erpnext/shopping_cart/test_shopping_cart.py | 32 +++---
erpnext/templates/includes/cart.js | 4 +-
19 files changed, 149 insertions(+), 371 deletions(-)
rename erpnext/{setup/doctype/applicable_territory => patches/v6_3}/__init__.py (100%)
create mode 100644 erpnext/patches/v6_3/convert_applicable_territory.py
delete mode 100644 erpnext/setup/doctype/applicable_territory/applicable_territory.json
delete mode 100644 erpnext/setup/doctype/applicable_territory/applicable_territory.py
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_price_list/__init__.py
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.json
delete mode 100644 erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.py
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
index 9a3a4580f5..d01866e447 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.json
@@ -164,29 +164,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Specify a list of Territories, for which, this Taxes Master is valid",
- "fieldname": "territories",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Valid for Territories",
- "no_copy": 0,
- "options": "Applicable Territory",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"hide_heading": 0,
@@ -198,7 +175,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-11 12:19:46.488710",
+ "modified": "2015-09-17 07:09:28.797959",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Taxes and Charges Template",
@@ -206,7 +183,7 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
+ "apply_user_permissions": 1,
"cancel": 0,
"create": 0,
"delete": 0,
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py
index b36287b691..886400e5f9 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.py
@@ -5,7 +5,6 @@ from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
-from frappe.utils.nestedset import get_root_of
class SalesTaxesandChargesTemplate(Document):
def validate(self):
@@ -20,10 +19,6 @@ def valdiate_taxes_and_charges_template(doc):
where ifnull(is_default,0) = 1 and name != %s and company = %s""".format(doc.doctype),
(doc.name, doc.company))
- if doc.meta.get_field("territories"):
- if not doc.territories:
- doc.append("territories", {"territory": get_root_of("Territory") })
-
for tax in doc.get("taxes"):
validate_taxes_and_charges(tax)
validate_inclusive_tax(tax, doc)
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
index 62d5cb8e0c..be65baf9de 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
@@ -35,14 +35,16 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "column_break_2",
- "fieldtype": "Column Break",
+ "fieldname": "disabled",
+ "fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+ "label": "Disabled",
"no_copy": 0,
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -78,6 +80,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval:!doc.disabled",
"fieldname": "rule_conditions_section",
"fieldtype": "Section Break",
"hidden": 0,
@@ -121,12 +124,14 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "depends_on": "eval:!doc.disabled",
"fieldname": "section_break_6",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+ "label": "Valid for Countries",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -141,6 +146,29 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "worldwide_shipping",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Worldwide Shipping",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
+ "depends_on": "eval:!doc.worldwide_shipping",
"fieldname": "countries",
"fieldtype": "Table",
"hidden": 0,
@@ -164,8 +192,9 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "column_break_8",
- "fieldtype": "Column Break",
+ "depends_on": "eval:!doc.disabled",
+ "fieldname": "section_break_10",
+ "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
@@ -206,8 +235,8 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "section_break_10",
- "fieldtype": "Section Break",
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
@@ -244,26 +273,6 @@
"set_only_once": 0,
"unique": 0
},
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_on_submit": 0,
"bold": 0,
@@ -296,7 +305,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-17 06:44:05.127516",
+ "modified": "2015-09-17 08:30:57.226342",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Shipping Rule",
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
index dbd121a45e..a2ee820b48 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
@@ -22,6 +22,9 @@ class ShippingRule(Document):
self.sort_shipping_rule_conditions()
self.validate_overlapping_shipping_rule_conditions()
+ if self.worldwide_shipping:
+ self.countries = []
+
def validate_from_to_values(self):
zero_to_values = []
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 1a6e85bf77..9596b44074 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -103,6 +103,19 @@ def set_other_values(out, party, party_type):
if party.get("default_" + f):
out[f] = party.get("default_" + f)
+def get_default_price_list(party):
+ """Return default price list for party (Document object)"""
+ if party.default_price_list:
+ return party.default_price_list
+
+ if party.doctype == "Customer":
+ price_list = frappe.db.get_value("Customer Group",
+ party.customer_group, "default_price_list")
+ if price_list:
+ return price_list
+
+ return None
+
def set_price_list(out, party, party_type, given_price_list):
# price list
price_list = filter(None, get_user_permissions().get("Price List", []))
@@ -110,11 +123,7 @@ def set_price_list(out, party, party_type, given_price_list):
price_list = price_list[0] if len(price_list)==1 else None
if not price_list:
- price_list = party.default_price_list
-
- if not price_list and party_type=="Customer":
- price_list = frappe.db.get_value("Customer Group",
- party.customer_group, "default_price_list")
+ price_list = get_default_price_list(party)
if not price_list:
price_list = given_price_list
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e20aab0b2e..51356e5ed9 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -209,3 +209,5 @@ erpnext.patches.v6_0.fix_planned_qty
erpnext.patches.v6_0.multi_currency
erpnext.patches.v6_2.remove_newsletter_duplicates
erpnext.patches.v6_2.fix_missing_default_taxes_and_lead
+erpnext.patches.v5_8.tax_rule
+erpnext.patches.v6_3.convert_applicable_territory
diff --git a/erpnext/setup/doctype/applicable_territory/__init__.py b/erpnext/patches/v6_3/__init__.py
similarity index 100%
rename from erpnext/setup/doctype/applicable_territory/__init__.py
rename to erpnext/patches/v6_3/__init__.py
diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py
new file mode 100644
index 0000000000..3054ecc879
--- /dev/null
+++ b/erpnext/patches/v6_3/convert_applicable_territory.py
@@ -0,0 +1,17 @@
+import frappe
+
+def execute():
+ # for price list
+ countries = frappe.db.sql_list("select name from tabCountry")
+
+ for doctype in ("Price List", "Shipping Rule"):
+ for at in frappe.db.sql("""select name, parent, territory from `tabApplicable Territory` where
+ parenttype = %s """, doctype, as_dict=True):
+ if at.territory in countries:
+ parent = frappe.get_doc(doctype, at.parent)
+ if not parent.countries:
+ parent.append("countries", {"country": at.territory})
+ parent.save()
+
+
+ frappe.delete_doc("DocType", "Applicable Territory")
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.json b/erpnext/setup/doctype/applicable_territory/applicable_territory.json
deleted file mode 100644
index 6fc549faa6..0000000000
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "allow_copy": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "creation": "2013-06-20 12:48:38",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "fields": [
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Territory",
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- }
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "modified": "2015-01-01 14:29:58.724652",
- "modified_by": "Administrator",
- "module": "Setup",
- "name": "Applicable Territory",
- "owner": "Administrator",
- "permissions": [],
- "read_only": 0,
- "read_only_onload": 0
-}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.py b/erpnext/setup/doctype/applicable_territory/applicable_territory.py
deleted file mode 100644
index 5e0ab4092a..0000000000
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# MIT License. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-from frappe.model.document import Document
-
-class ApplicableTerritory(Document):
- pass
\ No newline at end of file
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 0d28406f06..74d9e64436 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -131,8 +131,11 @@ def update_cart_address(address_fieldname, address_name):
quotation.flags.ignore_permissions = True
quotation.save()
- return frappe.render_template("templates/includes/cart/cart_address.html",
- get_cart_quotation(quotation))
+ context = get_cart_quotation(quotation)
+ return {
+ "taxes": frappe.render_template("templates/includes/order/order_taxes.html",
+ context),
+ }
def guess_territory():
territory = None
@@ -224,21 +227,19 @@ def apply_cart_settings(party=None, quotation=None):
quotation = _get_cart_quotation(party)
cart_settings = frappe.get_doc("Shopping Cart Settings")
- billing_territory = get_address_territory(quotation.customer_address) or \
- party.territory or get_root_of("Territory")
- set_price_list_and_rate(quotation, cart_settings, billing_territory)
+ set_price_list_and_rate(quotation, cart_settings)
quotation.run_method("calculate_taxes_and_totals")
- set_taxes(quotation, cart_settings, billing_territory)
+ set_taxes(quotation, cart_settings)
_apply_shipping_rule(party, quotation, cart_settings)
-def set_price_list_and_rate(quotation, cart_settings, billing_territory):
+def set_price_list_and_rate(quotation, cart_settings):
"""set price list based on billing territory"""
- _set_price_list(quotation, cart_settings, billing_territory)
+ _set_price_list(quotation, cart_settings)
# reset values
quotation.price_list_currency = quotation.currency = \
@@ -252,24 +253,29 @@ def set_price_list_and_rate(quotation, cart_settings, billing_territory):
# set it in cookies for using in product page
frappe.local.cookie_manager.set_cookie("selling_price_list", quotation.selling_price_list)
-def _set_price_list(quotation, cart_settings, billing_territory):
+def _set_price_list(quotation, cart_settings):
+ """Set price list based on customer or shopping cart default"""
+ if quotation.selling_price_list:
+ return
+
# check if customer price list exists
selling_price_list = None
if quotation.customer:
- selling_price_list = frappe.db.get_value("Customer", quotation.customer, "default_price_list")
+ from erpnext.accounts.party import get_default_price_list
+ selling_price_list = get_default_price_list(frappe.get_doc("Customer", quotation.customer))
# else check for territory based price list
if not selling_price_list:
- selling_price_list = cart_settings.get_price_list(billing_territory)
+ selling_price_list = cart_settings.price_list
quotation.selling_price_list = selling_price_list
-def set_taxes(quotation, cart_settings, billing_territory):
+def set_taxes(quotation, cart_settings):
"""set taxes based on billing territory"""
from erpnext.accounts.party import set_taxes
-
+
customer_group = frappe.db.get_value("Customer", quotation.customer, "customer_group")
-
+
quotation.taxes_and_charges = set_taxes(quotation.customer, "Customer", \
quotation.transaction_date, quotation.company, customer_group, None, \
quotation.customer_address, quotation.shipping_address_name, 1)
@@ -331,38 +337,39 @@ def apply_shipping_rule(shipping_rule):
return get_cart_quotation(quotation)
def _apply_shipping_rule(party=None, quotation=None, cart_settings=None):
- shipping_rules = get_shipping_rules(party, quotation, cart_settings)
+ if not quotation.shipping_rule:
+ shipping_rules = get_shipping_rules(quotation, cart_settings)
- if not shipping_rules:
- return
+ if not shipping_rules:
+ return
- elif quotation.shipping_rule not in shipping_rules:
- quotation.shipping_rule = shipping_rules[0]
+ elif quotation.shipping_rule not in shipping_rules:
+ quotation.shipping_rule = shipping_rules[0]
- quotation.run_method("apply_shipping_rule")
- quotation.run_method("calculate_taxes_and_totals")
+ if quotation.shipping_rule:
+ quotation.run_method("apply_shipping_rule")
+ quotation.run_method("calculate_taxes_and_totals")
def get_applicable_shipping_rules(party=None, quotation=None):
- shipping_rules = get_shipping_rules(party, quotation)
+ shipping_rules = get_shipping_rules(quotation)
if shipping_rules:
rule_label_map = frappe.db.get_values("Shipping Rule", shipping_rules, "label")
# we need this in sorted order as per the position of the rule in the settings page
return [[rule, rule_label_map.get(rule)] for rule in shipping_rules]
-def get_shipping_rules(party=None, quotation=None, cart_settings=None):
- if not party:
- party = get_lead_or_customer()
+def get_shipping_rules(quotation=None, cart_settings=None):
if not quotation:
quotation = _get_cart_quotation()
- if not cart_settings:
- cart_settings = frappe.get_doc("Shopping Cart Settings")
- # set shipping rule based on shipping territory
- shipping_territory = get_address_territory(quotation.shipping_address_name) or \
- party.territory
-
- shipping_rules = cart_settings.get_shipping_rules(shipping_territory)
+ shipping_rules = []
+ if quotation.shipping_address_name:
+ country = frappe.db.get_value("Address", quotation.shipping_address_name, "country")
+ if country:
+ shipping_rules = frappe.db.sql_list("""select distinct sr.name
+ from `tabShipping Rule Country` src, `tabShipping Rule` sr
+ where src.country = %s and
+ sr.disabled != 1 and sr.name = src.parent""", country)
return shipping_rules
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_price_list/__init__.py b/erpnext/shopping_cart/doctype/shopping_cart_price_list/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.json b/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.json
deleted file mode 100644
index e91731e8b3..0000000000
--- a/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "allow_copy": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "creation": "2013-06-20 16:00:18",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "fields": [
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Price List",
- "no_copy": 0,
- "options": "Price List",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- }
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "modified": "2013-12-20 19:30:47",
- "modified_by": "Administrator",
- "module": "Shopping Cart",
- "name": "Shopping Cart Price List",
- "owner": "Administrator",
- "permissions": [],
- "read_only": 0,
- "read_only_onload": 0
-}
\ No newline at end of file
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.py b/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.py
deleted file mode 100644
index 53c38d01a3..0000000000
--- a/erpnext/shopping_cart/doctype/shopping_cart_price_list/shopping_cart_price_list.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-# For license information, please see license.txt
-
-from __future__ import unicode_literals
-import frappe
-
-from frappe.model.document import Document
-
-class ShoppingCartPriceList(Document):
- pass
\ No newline at end of file
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
index 881ff4e377..fbc9ba0220 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.json
@@ -75,17 +75,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Add / Edit",
- "fieldname": "default_territory",
+ "fieldname": "price_list",
"fieldtype": "Link",
"hidden": 0,
- "ignore_user_permissions": 1,
+ "ignore_user_permissions": 0,
"in_filter": 0,
- "in_list_view": 1,
- "label": "Default Territory",
+ "in_list_view": 0,
+ "label": "Price List",
"no_copy": 0,
- "options": "Territory",
+ "options": "Price List",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -118,7 +118,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "description": "Add / Edit",
+ "description": "",
"fieldname": "default_customer_group",
"fieldtype": "Link",
"hidden": 0,
@@ -157,91 +157,6 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "price_lists",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price Lists",
- "no_copy": 0,
- "options": "Shopping Cart Price List",
- "permlevel": 0,
- "print_hide": 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": "column_break_10",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 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": "shipping_rules",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Rules",
- "no_copy": 0,
- "options": "Shopping Cart Shipping Rule",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
}
],
"hide_heading": 0,
@@ -253,7 +168,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-09-11 19:03:54.750937",
+ "modified": "2015-09-17 07:56:09.176098",
"modified_by": "Administrator",
"module": "Shopping Cart",
"name": "Shopping Cart Settings",
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index a8a4b7653f..4fac3a814d 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -18,7 +18,6 @@ class ShoppingCartSettings(Document):
def validate(self):
if self.enabled:
- self.validate_tax_masters()
self.validate_exchange_rates_exist()
def validate_exchange_rates_exist(self):
@@ -29,7 +28,7 @@ class ShoppingCartSettings(Document):
raise_exception=ShoppingCartSetupError)
price_list_currency_map = frappe.db.get_values("Price List",
- [d.selling_price_list for d in self.get("price_lists")],
+ [self.price_list],
"currency")
# check if all price lists have a currency
@@ -52,14 +51,6 @@ class ShoppingCartSettings(Document):
msgprint(_("Missing Currency Exchange Rates for {0}").format(comma_and(missing)),
raise_exception=ShoppingCartSetupError)
- def get_price_list(self, billing_territory):
- price_list = self.get_name_from_territory(billing_territory, "price_lists", "selling_price_list")
- if not (price_list and price_list[0]):
- price_list = self.get_name_from_territory(self.default_territory or get_root_of("Territory"),
- "price_lists", "selling_price_list")
-
- return price_list and price_list[0] or None
-
def validate_tax_rule(self):
if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart" : 1}, "name"):
frappe.throw(frappe._("Set Tax Rule for shopping cart"), ShoppingCartSetupError)
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index b18cece44a..66be927bcc 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -11,55 +11,29 @@ from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings
class TestShoppingCartSettings(unittest.TestCase):
def setUp(self):
frappe.db.sql("""delete from `tabSingles` where doctype="Shipping Cart Settings" """)
- frappe.db.sql("""delete from `tabShopping Cart Price List`""")
- frappe.db.sql("""delete from `tabShopping Cart Shipping Rule`""")
-
+
def get_cart_settings(self):
return frappe.get_doc({"doctype": "Shopping Cart Settings",
"company": "_Test Company"})
-
- def test_price_list_territory_overlap(self):
- cart_settings = self.get_cart_settings()
-
- def _add_price_list(price_list):
- cart_settings.append("price_lists", {
- "doctype": "Shopping Cart Price List",
- "selling_price_list": price_list
- })
-
- for price_list in ("_Test Price List Rest of the World", "_Test Price List India",
- "_Test Price List"):
- _add_price_list(price_list)
-
- controller = cart_settings
- controller.validate_overlapping_territories("price_lists", "selling_price_list")
-
- _add_price_list("_Test Price List 2")
-
- controller = cart_settings
- self.assertRaises(ShoppingCartSetupError, controller.validate_overlapping_territories,
- "price_lists", "selling_price_list")
-
- return cart_settings
-
+
def test_exchange_rate_exists(self):
frappe.db.sql("""delete from `tabCurrency Exchange`""")
-
+
cart_settings = self.test_price_list_territory_overlap()
controller = cart_settings
self.assertRaises(ShoppingCartSetupError, controller.validate_exchange_rates_exist)
-
+
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records as \
currency_exchange_records
frappe.get_doc(currency_exchange_records[0]).insert()
controller.validate_exchange_rates_exist()
-
+
def test_tax_rule_validation(self):
frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 0")
frappe.db.commit()
-
+
cart_settings = self.get_cart_settings()
- cart_settings.enabled = 1
+ cart_settings.enabled = 1
if not frappe.db.get_value("Tax Rule", {"use_for_shopping_cart": 1}, "name"):
self.assertRaises(ShoppingCartSetupError, cart_settings.validate_tax_rule)
-
+
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index bd0b138d45..dc3b4fe2ab 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -25,7 +25,7 @@ class TestShoppingCart(unittest.TestCase):
# test if lead is created and quotation with new lead is fetched
quotation = get_quotation()
self.assertEquals(quotation.quotation_to, "Lead")
- self.assertEquals(frappe.db.get_value("Lead", quotation.lead, "email_id"),
+ self.assertEquals(frappe.db.get_value("Lead", quotation.lead, "email_id"),
"test_cart_user@example.com")
self.assertEquals(quotation.customer, None)
self.assertEquals(quotation.contact_email, frappe.session.user)
@@ -61,7 +61,7 @@ class TestShoppingCart(unittest.TestCase):
# remove from cart
self.remove_all_items_from_cart()
-
+
# add first item
set_item_in_cart("_Test Item", 1)
quotation = self.test_get_cart_lead()
@@ -109,12 +109,12 @@ class TestShoppingCart(unittest.TestCase):
quotation = self.test_get_cart_lead()
self.assertEquals(quotation.net_total, 0)
self.assertEquals(len(quotation.get("items")), 0)
-
-
- def test_taxe_rule(self):
+
+
+ def test_tax_rule(self):
self.login_as_customer()
quotation = self.create_quotation()
-
+
from erpnext.accounts.party import set_taxes
tax_rule_master = set_taxes(quotation.customer, "Customer", \
@@ -123,12 +123,12 @@ class TestShoppingCart(unittest.TestCase):
self.assertEquals(quotation.taxes_and_charges, tax_rule_master)
self.assertEquals(quotation.total_taxes_and_charges, 1000.0)
-
+
self.remove_test_quotation(quotation)
-
+
def create_quotation(self):
quotation = frappe.new_doc("Quotation")
-
+
values = {
"doctype": "Quotation",
"quotation_to": "Customer",
@@ -146,13 +146,13 @@ class TestShoppingCart(unittest.TestCase):
"taxes": frappe.get_doc("Sales Taxes and Charges Template", "_Test Tax 1").taxes,
"company": "_Test Company"
}
-
+
quotation.update(values)
-
+
quotation.insert(ignore_permissions=True)
-
+
return quotation
-
+
def remove_test_quotation(self, quotation):
frappe.set_user("Administrator")
quotation.delete()
@@ -180,7 +180,7 @@ class TestShoppingCart(unittest.TestCase):
])
settings.set("shipping_rules", {"doctype": "Shopping Cart Shipping Rule", "parentfield": "shipping_rules",
"shipping_rule": "_Test Shipping Rule - India"})
-
+
settings.save()
frappe.local.shopping_cart_settings = None
@@ -239,11 +239,11 @@ class TestShoppingCart(unittest.TestCase):
"lead_name": "_Test Website Lead",
"phone": "+91 0000000000"
}).insert(ignore_permissions=True)
-
+
def remove_all_items_from_cart(self):
quotation = get_quotation()
quotation.set("items", [])
quotation.save(ignore_permissions=True)
-
+
test_dependencies = ["Sales Taxes and Charges Template", "Price List", "Item Price", "Shipping Rule", "Currency Exchange",
"Customer Group", "Lead", "Customer", "Contact", "Address", "Item", "Tax Rule"]
diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js
index e6ce25a6a8..cc321579bf 100644
--- a/erpnext/templates/includes/cart.js
+++ b/erpnext/templates/includes/cart.js
@@ -33,7 +33,7 @@ $.extend(shopping_cart, {
},
callback: function(r) {
if(!r.exc) {
- $('.cart-addresses').html(r.message);
+ $(".cart-tax-items").html(r.message.taxes);
}
}
});
@@ -54,12 +54,14 @@ $.extend(shopping_cart, {
// bind update button
$(".cart-items").on("change", ".cart-qty", function() {
var item_code = $(this).attr("data-item-code");
+ frappe.freeze();
shopping_cart.update_cart({
item_code: item_code,
qty: $(this).val(),
with_items: 1,
btn: this,
callback: function(r) {
+ frappe.unfreeze();
if(!r.exc) {
$(".cart-items").html(r.message.items);
$(".cart-tax-items").html(r.message.taxes);
From 52dfc32eca72fcf7058813bfe96783038df7194c Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Mon, 21 Sep 2015 17:03:47 +0530
Subject: [PATCH 43/52] [fix] validate_valuation_rate for Repack
---
erpnext/manufacturing/doctype/bom/bom.js | 2 +-
.../stock/doctype/stock_entry/stock_entry.py | 114 +++++++++---------
2 files changed, 60 insertions(+), 56 deletions(-)
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 3bad2f081e..9883ba30f6 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -147,7 +147,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) {
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) {
return{
query: "erpnext.controllers.queries.item_query",
- filters: [["Item", "name", "!=", doc.item]]
+ filters: [["Item", "name", "!=", cur_frm.doc.item]]
}
}
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 5f85ef91a8..68274d1b42 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -49,7 +49,7 @@ class StockEntry(StockController):
self.validate_finished_goods()
self.validate_with_material_request()
self.validate_batch()
-
+
self.set_actual_qty()
self.calculate_rate_and_amount()
@@ -212,10 +212,10 @@ class StockEntry(StockController):
if fg_qty_already_entered >= qty:
frappe.throw(_("Stock Entries already created for Production Order ")
+ self.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
-
+
def set_actual_qty(self):
allow_negative_stock = cint(frappe.db.get_value("Stock Settings", None, "allow_negative_stock"))
-
+
for d in self.get('items'):
previous_sle = get_previous_sle({
"item_code": d.item_code,
@@ -232,7 +232,7 @@ class StockEntry(StockController):
frappe.throw(_("""Row {0}: Qty not avalable in warehouse {1} on {2} {3}.
Available Qty: {4}, Transfer Qty: {5}""").format(d.idx, d.s_warehouse,
self.posting_date, self.posting_time, d.actual_qty, d.transfer_qty), NegativeStockError)
-
+
def get_stock_and_rate(self):
self.set_actual_qty()
self.calculate_rate_and_amount()
@@ -244,7 +244,7 @@ class StockEntry(StockController):
self.validate_valuation_rate()
self.set_total_incoming_outgoing_value()
self.set_total_amount()
-
+
def set_basic_rate(self, force=False):
"""get stock and incoming rate on posting date"""
raw_material_cost = 0.0
@@ -269,9 +269,9 @@ class StockEntry(StockController):
d.basic_amount = flt(flt(d.transfer_qty) * flt(d.basic_rate), d.precision("basic_amount"))
if not d.t_warehouse:
raw_material_cost += flt(d.basic_amount)
-
+
self.set_basic_rate_for_finished_goods(raw_material_cost)
-
+
def set_basic_rate_for_finished_goods(self, raw_material_cost):
if self.purpose in ["Manufacture", "Repack"]:
number_of_fg_items = len([t.t_warehouse for t in self.get("items") if t.t_warehouse])
@@ -279,11 +279,11 @@ class StockEntry(StockController):
if d.bom_no or (d.t_warehouse and number_of_fg_items == 1):
d.basic_rate = flt(raw_material_cost / flt(d.transfer_qty), d.precision("basic_rate"))
d.basic_amount = flt(raw_material_cost, d.precision("basic_amount"))
-
+
def distribute_additional_costs(self):
if self.purpose == "Material Issue":
self.additional_costs = []
-
+
self.total_additional_costs = sum([flt(t.amount) for t in self.get("additional_costs")])
total_basic_amount = sum([flt(t.basic_amount) for t in self.get("items") if t.t_warehouse])
@@ -292,11 +292,11 @@ class StockEntry(StockController):
d.additional_cost = (flt(d.basic_amount) / total_basic_amount) * self.total_additional_costs
else:
d.additional_cost = 0
-
+
def update_valuation_rate(self):
for d in self.get("items"):
d.amount = flt(d.basic_amount + flt(d.additional_cost), d.precision("amount"))
- d.valuation_rate = flt(flt(d.basic_rate) + flt(d.additional_cost) / flt(d.transfer_qty),
+ d.valuation_rate = flt(flt(d.basic_rate) + flt(d.additional_cost) / flt(d.transfer_qty),
d.precision("valuation_rate"))
def validate_valuation_rate(self):
@@ -373,7 +373,7 @@ class StockEntry(StockController):
def update_stock_ledger(self):
sl_entries = []
- for d in self.get('items'):
+ for d in self.get('items'):
if cstr(d.s_warehouse) and self.docstatus == 1:
sl_entries.append(self.get_sl_entries(d, {
"warehouse": cstr(d.s_warehouse),
@@ -399,15 +399,15 @@ class StockEntry(StockController):
}))
self.make_sl_entries(sl_entries, self.amended_from and 'Yes' or 'No')
-
+
def get_gl_entries(self, warehouse_account):
expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
-
+
gl_entries = super(StockEntry, self).get_gl_entries(warehouse_account)
-
+
for d in self.get("items"):
additional_cost = flt(d.additional_cost, d.precision("additional_cost"))
- if additional_cost:
+ if additional_cost:
gl_entries.append(self.get_gl_dict({
"account": expenses_included_in_valuation,
"against": d.expense_account,
@@ -415,7 +415,7 @@ class StockEntry(StockController):
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
"credit": additional_cost
}))
-
+
gl_entries.append(self.get_gl_dict({
"account": d.expense_account,
"against": expenses_included_in_valuation,
@@ -521,7 +521,7 @@ class StockEntry(StockController):
def get_items(self):
self.set('items', [])
self.validate_production_order()
-
+
if not self.posting_date or not self.posting_time:
frappe.throw(_("Posting date and posting time is mandatory"))
@@ -548,7 +548,7 @@ class StockEntry(StockController):
for item in item_dict.values():
item["to_warehouse"] = self.pro_doc.wip_warehouse
self.add_to_stock_entry_detail(item_dict)
-
+
elif self.production_order and self.purpose == "Manufacture" and \
frappe.db.get_single_value("Manufacturing Settings", "backflush_raw_materials_based_on")== "Material Transferred for Manufacture":
self.get_transfered_raw_materials()
@@ -578,10 +578,14 @@ class StockEntry(StockController):
to_warehouse = self.pro_doc.fg_warehouse
else:
item_code = frappe.db.get_value("BOM", self.bom_no, "item")
- to_warehouse = ""
+ to_warehouse = self.to_warehouse
item = frappe.db.get_value("Item", item_code, ["item_name",
- "description", "stock_uom", "expense_account", "buying_cost_center", "name"], as_dict=1)
+ "description", "stock_uom", "expense_account", "buying_cost_center", "name", "default_warehouse"], as_dict=1)
+
+ if not self.production_order and not to_warehouse:
+ # in case of BOM
+ to_warehouse = item.default_warehouse
self.add_to_stock_entry_detail({
item.name: {
@@ -600,57 +604,57 @@ class StockEntry(StockController):
from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict
# item dict = { item_code: {qty, description, stock_uom} }
- item_dict = get_bom_items_as_dict(self.bom_no, self.company, qty=qty,
+ item_dict = get_bom_items_as_dict(self.bom_no, self.company, qty=qty,
fetch_exploded = self.use_multi_level_bom)
for item in item_dict.values():
item.from_warehouse = self.from_warehouse or item.default_warehouse
return item_dict
-
+
def get_transfered_raw_materials(self):
transferred_materials = frappe.db.sql("""
- select
- item_name, item_code, sum(qty) as qty, sed.t_warehouse as warehouse,
- description, stock_uom, expense_account, cost_center
- from `tabStock Entry` se,`tabStock Entry Detail` sed
- where
- se.name = sed.parent and se.docstatus=1 and se.purpose='Material Transfer for Manufacture'
- and se.production_order= %s and ifnull(sed.t_warehouse, '') != ''
+ select
+ item_name, item_code, sum(qty) as qty, sed.t_warehouse as warehouse,
+ description, stock_uom, expense_account, cost_center
+ from `tabStock Entry` se,`tabStock Entry Detail` sed
+ where
+ se.name = sed.parent and se.docstatus=1 and se.purpose='Material Transfer for Manufacture'
+ and se.production_order= %s and ifnull(sed.t_warehouse, '') != ''
group by sed.item_code, sed.t_warehouse
""", self.production_order, as_dict=1)
-
+
materials_already_backflushed = frappe.db.sql("""
- select
- item_code, sed.s_warehouse as warehouse, sum(qty) as qty
- from
- `tabStock Entry` se, `tabStock Entry Detail` sed
- where
- se.name = sed.parent and se.docstatus=1 and se.purpose='Manufacture'
- and se.production_order= %s and ifnull(sed.s_warehouse, '') != ''
+ select
+ item_code, sed.s_warehouse as warehouse, sum(qty) as qty
+ from
+ `tabStock Entry` se, `tabStock Entry Detail` sed
+ where
+ se.name = sed.parent and se.docstatus=1 and se.purpose='Manufacture'
+ and se.production_order= %s and ifnull(sed.s_warehouse, '') != ''
group by sed.item_code, sed.s_warehouse
""", self.production_order, as_dict=1)
-
+
backflushed_materials= {}
for d in materials_already_backflushed:
backflushed_materials.setdefault(d.item_code,[]).append({d.warehouse: d.qty})
-
+
po_qty = frappe.db.sql("""select qty, produced_qty, material_transferred_for_manufacturing from
`tabProduction Order` where name=%s""", self.production_order, as_dict=1)[0]
manufacturing_qty = flt(po_qty.qty)
produced_qty = flt(po_qty.produced_qty)
trans_qty = flt(po_qty.material_transferred_for_manufacturing)
-
+
for item in transferred_materials:
qty= item.qty
-
+
if manufacturing_qty > (produced_qty + flt(self.fg_completed_qty)):
qty = (qty/trans_qty) * flt(self.fg_completed_qty)
-
+
elif backflushed_materials.get(item.item_code):
for d in backflushed_materials.get(item.item_code):
if d.get(item.warehouse):
qty-= d.get(item.warehouse)
-
+
if qty > 0:
self.add_to_stock_entry_detail({
item.item_code: {
@@ -729,7 +733,7 @@ class StockEntry(StockController):
se_child.s_warehouse = self.from_warehouse
if se_child.t_warehouse==None:
se_child.t_warehouse = self.to_warehouse
-
+
# in stock uom
se_child.transfer_qty = flt(item_dict[d]["qty"])
se_child.conversion_factor = 1.00
@@ -761,7 +765,7 @@ class StockEntry(StockController):
def get_production_order_details(production_order):
production_order = frappe.get_doc("Production Order", production_order)
pending_qty_to_produce = flt(production_order.qty) - flt(production_order.produced_qty)
-
+
return {
"from_bom": 1,
"bom_no": production_order.bom_no,
@@ -771,7 +775,7 @@ def get_production_order_details(production_order):
"fg_completed_qty": pending_qty_to_produce,
"additional_costs": get_additional_costs(production_order, fg_qty=pending_qty_to_produce)
}
-
+
def get_additional_costs(production_order=None, bom_no=None, fg_qty=None):
additional_costs = []
operating_cost_per_unit = get_operating_cost_per_unit(production_order, bom_no)
@@ -780,33 +784,33 @@ def get_additional_costs(production_order=None, bom_no=None, fg_qty=None):
"description": "Operating Cost as per Production Order / BOM",
"amount": operating_cost_per_unit * flt(fg_qty)
})
-
+
if production_order and production_order.additional_operating_cost:
additional_operating_cost_per_unit = \
flt(production_order.additional_operating_cost) / flt(production_order.qty)
-
+
additional_costs.append({
"description": "Additional Operating Cost",
"amount": additional_operating_cost_per_unit * flt(fg_qty)
})
-
+
return additional_costs
-
+
def get_operating_cost_per_unit(production_order=None, bom_no=None):
operating_cost_per_unit = 0
if production_order:
if not bom_no:
bom_no = production_order.bom_no
-
+
for d in production_order.get("operations"):
if flt(d.completed_qty):
operating_cost_per_unit += flt(d.actual_operating_cost) / flt(d.completed_qty)
else:
operating_cost_per_unit += flt(d.planned_operating_cost) / flt(production_order.qty)
-
+
# Get operating cost from BOM if not found in production_order.
if not operating_cost_per_unit and bom_no:
bom = frappe.db.get_value("BOM", bom_no, ["operating_cost", "quantity"], as_dict=1)
operating_cost_per_unit = flt(bom.operating_cost) / flt(bom.quantity)
-
- return operating_cost_per_unit
\ No newline at end of file
+
+ return operating_cost_per_unit
From 06ad308ca1e3c3e66d4ae8ae78f3bbc0ac4c40dd Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Wed, 23 Sep 2015 12:46:59 +0530
Subject: [PATCH 44/52] [fixes] setup wizard and other fixes related to cart
---
.../sales_taxes_and_charges_template.js | 3 -
.../test_records.json | 56 +-
.../doctype/shipping_rule/shipping_rule.js | 5 -
.../doctype/shipping_rule/shipping_rule.json | 714 +++++++++---------
.../doctype/shipping_rule/shipping_rule.py | 3 +
.../doctype/shipping_rule/test_records.json | 156 ++--
erpnext/accounts/doctype/tax_rule/tax_rule.py | 34 +-
erpnext/public/js/utils.js | 16 +-
.../setup/page/setup_wizard/setup_wizard.py | 9 +-
erpnext/shopping_cart/__init__.py | 101 ---
erpnext/shopping_cart/cart.py | 97 +--
.../shopping_cart_settings.py | 4 -
.../test_shopping_cart_settings.py | 8 +-
erpnext/shopping_cart/test_shopping_cart.py | 111 +--
.../stock/doctype/price_list/price_list.js | 6 +-
.../doctype/price_list/test_records.json | 89 +--
erpnext/templates/pages/user.py | 23 +-
17 files changed, 574 insertions(+), 861 deletions(-)
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
index d7a4f5ad7f..8828e0c8e6 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/sales_taxes_and_charges_template.js
@@ -5,6 +5,3 @@ cur_frm.cscript.tax_table = "Sales Taxes and Charges";
{% include "public/js/controllers/accounts.js" %}
-frappe.ui.form.on("Sales Taxes and Charges Template", "onload", function(frm) {
- erpnext.add_applicable_territory();
-});
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
index 69dbd8e9a6..2b737b9804 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
@@ -20,19 +20,7 @@
"rate": 6.36
}
],
- "title": "_Test Sales Taxes and Charges Template",
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "All Territories"
- },
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
+ "title": "_Test Sales Taxes and Charges Template"
},
{
"company": "_Test Company",
@@ -115,14 +103,7 @@
"row_id": 7
}
],
- "title": "_Test India Tax Master",
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory India"
- }
- ]
+ "title": "_Test India Tax Master"
},
{
"company": "_Test Company",
@@ -145,14 +126,7 @@
"rate": 4
}
],
- "title": "_Test Sales Taxes and Charges Template - Rest of the World",
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
+ "title": "_Test Sales Taxes and Charges Template - Rest of the World"
},
{
"company": "_Test Company",
@@ -175,14 +149,7 @@
"rate": 4
}
],
- "title": "_Test Sales Taxes and Charges Template 1",
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
+ "title": "_Test Sales Taxes and Charges Template 1"
},
{
"company": "_Test Company",
@@ -205,14 +172,7 @@
"rate": 4
}
],
- "title": "_Test Sales Taxes and Charges Template 2",
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
+ "title": "_Test Sales Taxes and Charges Template 2"
},
{
"doctype" : "Sales Taxes and Charges Template",
@@ -224,9 +184,6 @@
"cost_center": "Main - _TC",
"description": "Test Shopping cart taxes with Tax Rule",
"tax_amount": 1000
- }],
- "territories":[{
- "territory" : "All Territories"
}]
},
{
@@ -239,9 +196,6 @@
"cost_center": "Main - _TC",
"description": "Test Shopping cart taxes with Tax Rule",
"tax_amount": 200
- }],
- "territories":[{
- "territory" : "All Territories"
}]
}
]
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
index 233bea1782..17f2083983 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.js
@@ -1,8 +1,3 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-$.extend(cur_frm.cscript, {
- onload: function() {
- erpnext.add_applicable_territory();
- }
-});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
index be65baf9de..1c5d979dd4 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
@@ -1,397 +1,397 @@
{
- "allow_copy": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "field:label",
- "creation": "2013-06-25 11:48:03",
- "custom": 0,
- "description": "Specify conditions to calculate shipping amount",
- "docstatus": 0,
- "doctype": "DocType",
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "field:label",
+ "creation": "2013-06-25 11:48:03",
+ "custom": 0,
+ "description": "Specify conditions to calculate shipping amount",
+ "docstatus": 0,
+ "doctype": "DocType",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "example: Next Day Shipping",
- "fieldname": "label",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Shipping Rule Label",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "example: Next Day Shipping",
+ "fieldname": "label",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Shipping Rule Label",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "disabled",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Disabled",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Disabled",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "default": "Net Total",
- "fieldname": "calculate_based_on",
- "fieldtype": "Select",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Calculate Based On",
- "no_copy": 0,
- "options": "Net Total\nNet Weight",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Net Total",
+ "fieldname": "calculate_based_on",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Calculate Based On",
+ "no_copy": 0,
+ "options": "Net Total\nNet Weight",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:!doc.disabled",
- "fieldname": "rule_conditions_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Rule Conditions",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.disabled",
+ "fieldname": "rule_conditions_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Rule Conditions",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "conditions",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Rule Conditions",
- "no_copy": 0,
- "options": "Shipping Rule Condition",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "conditions",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Rule Conditions",
+ "no_copy": 0,
+ "options": "Shipping Rule Condition",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:!doc.disabled",
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Valid for Countries",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.disabled",
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Valid for Countries",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "worldwide_shipping",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Worldwide Shipping",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "worldwide_shipping",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Worldwide Shipping",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "depends_on": "eval:!doc.worldwide_shipping",
- "fieldname": "countries",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Valid for Countries",
- "no_copy": 0,
- "options": "Shipping Rule Country",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.worldwide_shipping",
+ "fieldname": "countries",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Valid for Countries",
+ "no_copy": 0,
+ "options": "Shipping Rule Country",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "depends_on": "eval:!doc.disabled",
- "fieldname": "section_break_10",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.disabled",
+ "fieldname": "section_break_10",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Company",
- "no_copy": 0,
- "options": "Company",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Company",
+ "no_copy": 0,
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Account",
- "no_copy": 0,
- "options": "Account",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Account",
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Cost Center",
- "no_copy": 0,
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "no_copy": 0,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-truck",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "modified": "2015-09-17 08:30:57.226342",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Shipping Rule",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-truck",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 0,
+ "modified": "2015-09-22 08:30:57.226342",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Shipping Rule",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 0,
- "apply_user_permissions": 1,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 1,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "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": 1,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "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": 1,
+ "role": "Accounts 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": 1,
- "role": "Sales Master Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 0,
+ "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": 1,
+ "role": "Sales Master Manager",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 0,
"write": 1
}
- ],
- "read_only": 0,
+ ],
+ "read_only": 0,
"read_only_onload": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
index a2ee820b48..80e4fb7415 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
@@ -25,6 +25,9 @@ class ShippingRule(Document):
if self.worldwide_shipping:
self.countries = []
+ elif not len([d.country for d in self.countries if d.country]):
+ frappe.throw(_("Please specify a country for this Shipping Rule or check Worldwide Shipping"))
+
def validate_from_to_values(self):
zero_to_values = []
diff --git a/erpnext/accounts/doctype/shipping_rule/test_records.json b/erpnext/accounts/doctype/shipping_rule/test_records.json
index 96e7770d5a..a271009b2b 100644
--- a/erpnext/accounts/doctype/shipping_rule/test_records.json
+++ b/erpnext/accounts/doctype/shipping_rule/test_records.json
@@ -1,116 +1,100 @@
[
{
- "account": "_Test Account Shipping Charges - _TC",
- "calculate_based_on": "Net Total",
- "company": "_Test Company",
- "cost_center": "_Test Cost Center - _TC",
- "doctype": "Shipping Rule",
- "label": "_Test Shipping Rule",
- "name": "_Test Shipping Rule",
+ "account": "_Test Account Shipping Charges - _TC",
+ "calculate_based_on": "Net Total",
+ "company": "_Test Company",
+ "cost_center": "_Test Cost Center - _TC",
+ "doctype": "Shipping Rule",
+ "label": "_Test Shipping Rule",
+ "name": "_Test Shipping Rule",
"conditions": [
{
- "doctype": "Shipping Rule Condition",
- "from_value": 0,
- "parentfield": "conditions",
- "shipping_amount": 50.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 0,
+ "parentfield": "conditions",
+ "shipping_amount": 50.0,
"to_value": 100
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 101,
- "parentfield": "conditions",
- "shipping_amount": 100.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 101,
+ "parentfield": "conditions",
+ "shipping_amount": 100.0,
"to_value": 200
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 201,
- "parentfield": "conditions",
+ "doctype": "Shipping Rule Condition",
+ "from_value": 201,
+ "parentfield": "conditions",
"shipping_amount": 0.0
}
- ],
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory"
- }
- ]
- },
+ ],
+ "worldwide_shipping": 1
+ },
{
- "account": "_Test Account Shipping Charges - _TC",
- "calculate_based_on": "Net Total",
- "company": "_Test Company",
- "cost_center": "_Test Cost Center - _TC",
- "doctype": "Shipping Rule",
- "label": "_Test Shipping Rule - India",
- "name": "_Test Shipping Rule - India",
+ "account": "_Test Account Shipping Charges - _TC",
+ "calculate_based_on": "Net Total",
+ "company": "_Test Company",
+ "cost_center": "_Test Cost Center - _TC",
+ "doctype": "Shipping Rule",
+ "label": "_Test Shipping Rule - India",
+ "name": "_Test Shipping Rule - India",
"conditions": [
{
- "doctype": "Shipping Rule Condition",
- "from_value": 0,
- "parentfield": "conditions",
- "shipping_amount": 50.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 0,
+ "parentfield": "conditions",
+ "shipping_amount": 50.0,
"to_value": 100
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 101,
- "parentfield": "conditions",
- "shipping_amount": 100.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 101,
+ "parentfield": "conditions",
+ "shipping_amount": 100.0,
"to_value": 200
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 201,
- "parentfield": "conditions",
+ "doctype": "Shipping Rule Condition",
+ "from_value": 201,
+ "parentfield": "conditions",
"shipping_amount": 0.0
}
- ],
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory India"
- }
+ ],
+ "countries": [
+ {"country": "India"}
]
- },
+ },
{
- "account": "_Test Account Shipping Charges - _TC",
- "calculate_based_on": "Net Total",
- "company": "_Test Company",
- "cost_center": "_Test Cost Center - _TC",
- "doctype": "Shipping Rule",
- "label": "_Test Shipping Rule - Rest of the World",
- "name": "_Test Shipping Rule - Rest of the World",
+ "account": "_Test Account Shipping Charges - _TC",
+ "calculate_based_on": "Net Total",
+ "company": "_Test Company",
+ "cost_center": "_Test Cost Center - _TC",
+ "doctype": "Shipping Rule",
+ "label": "_Test Shipping Rule - Rest of the World",
+ "name": "_Test Shipping Rule - Rest of the World",
"conditions": [
{
- "doctype": "Shipping Rule Condition",
- "from_value": 0,
- "parentfield": "conditions",
- "shipping_amount": 500.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 0,
+ "parentfield": "conditions",
+ "shipping_amount": 500.0,
"to_value": 1000
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 1001,
- "parentfield": "conditions",
- "shipping_amount": 1000.0,
+ "doctype": "Shipping Rule Condition",
+ "from_value": 1001,
+ "parentfield": "conditions",
+ "shipping_amount": 1000.0,
"to_value": 2000
- },
+ },
{
- "doctype": "Shipping Rule Condition",
- "from_value": 2001,
- "parentfield": "conditions",
+ "doctype": "Shipping Rule Condition",
+ "from_value": 2001,
+ "parentfield": "conditions",
"shipping_amount": 1500.0
}
- ],
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
+ ],
+ "worldwide_shipping": 1
}
-]
\ No newline at end of file
+]
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 0a9bb1114b..1e306e9eb7 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -5,6 +5,7 @@
from __future__ import unicode_literals
import frappe
from frappe import _
+from frappe.model import default_fields
from frappe.model.document import Document
from frappe.utils import cstr
@@ -13,6 +14,9 @@ class IncorrectSupplierType(frappe.ValidationError): pass
class ConflictingTaxRule(frappe.ValidationError): pass
class TaxRule(Document):
+ def __setup__(self):
+ self.flags.ignore_these_exceptions_in_test = [ConflictingTaxRule]
+
def validate(self):
self.validate_tax_template()
self.validate_customer_group()
@@ -25,7 +29,7 @@ class TaxRule(Document):
self.purchase_tax_template = self.supplier = self.supplier_type= None
else:
self.sales_tax_template= self.customer = self.customer_group= None
-
+
if not (self.sales_tax_template or self.purchase_tax_template):
frappe.throw(_("Tax Template is mandatory."))
@@ -34,7 +38,7 @@ class TaxRule(Document):
if not frappe.db.get_value("Customer", self.customer, "customer_group") == self.customer_group:
frappe.throw(_("Customer {0} does not belong to customer group {1}"). \
format(self.customer, self.customer_group), IncorrectCustomerGroup)
-
+
def validate_supplier_type(self):
if self.supplier and self.supplier_type:
if not frappe.db.get_value("Supplier", self.supplier, "supplier_type") == self.supplier_type:
@@ -60,28 +64,28 @@ class TaxRule(Document):
"shipping_country": self.shipping_country,
"company": self.company
}
-
+
conds=""
for d in filters:
if conds:
conds += " and "
conds += """ifnull({0}, '') = '{1}'""".format(d, frappe.db.escape(cstr(filters[d])))
-
+
if self.from_date and self.to_date:
conds += """ and ((from_date > '{from_date}' and from_date < '{to_date}') or
(to_date > '{from_date}' and to_date < '{to_date}') or
('{from_date}' > from_date and '{from_date}' < to_date) or
('{from_date}' = from_date and '{to_date}' = to_date))""".format(from_date=self.from_date, to_date=self.to_date)
-
+
elif self.from_date and not self.to_date:
conds += """ and to_date > '{from_date}'""".format(from_date = self.from_date)
elif self.to_date and not self.from_date:
conds += """ and from_date < '{to_date}'""".format(to_date = self.to_date)
-
+
tax_rule = frappe.db.sql("select name, priority \
- from `tabTax Rule` where {0} and name != '{1}'".format(conds, self.name), as_dict=1)
-
+ from `tabTax Rule` where {0} and name != '{1}'".format(conds, self.name), as_dict=1)
+
if tax_rule:
if tax_rule[0].priority == self.priority:
frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)), ConflictingTaxRule)
@@ -95,10 +99,10 @@ def get_party_details(party, party_type, args=None):
else:
billing_filters= {party_type: party, "is_primary_address": 1}
shipping_filters= {party_type:party, "is_shipping_address": 1}
-
+
billing_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= billing_filters)
shipping_address= frappe.get_all("Address", fields=["city", "state", "country"], filters= shipping_filters)
-
+
if billing_address:
out["billing_city"]= billing_address[0].city
out["billing_state"]= billing_address[0].state
@@ -108,7 +112,7 @@ def get_party_details(party, party_type, args=None):
out["shipping_city"]= shipping_address[0].city
out["shipping_state"]= shipping_address[0].state
out["shipping_country"]= shipping_address[0].country
-
+
return out
def get_tax_template(posting_date, args):
@@ -121,14 +125,14 @@ def get_tax_template(posting_date, args):
matching = frappe.db.sql("""select * from `tabTax Rule`
where {0}""".format(" and ".join(conditions)), as_dict = True)
-
+
if not matching:
return None
-
+
for rule in matching:
rule.no_of_keys_matched = 0
for key in args:
if rule.get(key): rule.no_of_keys_matched += 1
-
+
rule = sorted(matching, lambda b, a: cmp(a.no_of_keys_matched, b.no_of_keys_matched) or cmp(a.priority, b.priority))[0]
- return rule.sales_tax_template or rule.purchase_tax_template
\ No newline at end of file
+ return rule.sales_tax_template or rule.purchase_tax_template
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 68a447b601..7f69202522 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -49,18 +49,6 @@ $.extend(erpnext, {
}
},
- add_applicable_territory: function() {
- if(cur_frm.doc.__islocal && (cur_frm.doc.territories || []).length===0) {
- var default_territory = frappe.defaults.get_user_default("territory");
- if(default_territory) {
- var territory = frappe.model.add_child(cur_frm.doc, "Applicable Territory",
- "territories");
- territory.territory = default_territory;
- }
-
- }
- },
-
setup_serial_no: function() {
var grid_row = cur_frm.open_grid_row();
if(!grid_row.fields_dict.serial_no ||
@@ -131,8 +119,8 @@ $.extend(erpnext.utils, {
}
);
}
- },
-
+ },
+
copy_value_in_all_row: function(doc, dt, dn, table_fieldname, fieldname) {
var d = locals[dt][dn];
if(d[fieldname]){
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index 77ad90a0b7..a1370333ad 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -174,10 +174,7 @@ def create_price_lists(args):
"enabled": 1,
"buying": 1 if pl_type == "Buying" else 0,
"selling": 1 if pl_type == "Selling" else 0,
- "currency": args["currency"],
- "territories": [{
- "territory": get_root_of("Territory")
- }]
+ "currency": args["currency"]
}).insert()
def set_defaults(args):
@@ -304,7 +301,7 @@ def get_fy_details(fy_start_date, fy_end_date):
return fy
def create_taxes(args):
-
+
for i in xrange(1,6):
if args.get("tax_" + str(i)):
# replace % in case someone also enters the % symbol
@@ -324,7 +321,7 @@ def create_taxes(args):
raise
except RootNotEditable, e:
pass
-
+
def make_tax_head(args, i, tax_group, tax_rate):
return frappe.get_doc({
"doctype":"Account",
diff --git a/erpnext/shopping_cart/__init__.py b/erpnext/shopping_cart/__init__.py
index 1858c0d842..db44f94b52 100644
--- a/erpnext/shopping_cart/__init__.py
+++ b/erpnext/shopping_cart/__init__.py
@@ -1,103 +1,2 @@
# 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 import _
-from frappe.utils import get_fullname, flt
-from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import check_shopping_cart_enabled, get_default_territory
-
-# TODO
-# validate stock of each item in Website Warehouse or have a list of possible warehouses in Shopping Cart Settings
-# Below functions are used for test cases
-
-def get_quotation(user=None):
- if not user:
- user = frappe.session.user
- if user == "Guest":
- raise frappe.PermissionError
-
- check_shopping_cart_enabled()
- party = get_party(user)
- values = {
- "order_type": "Shopping Cart",
- party.doctype.lower(): party.name,
- "docstatus": 0,
- "contact_email": user,
- "selling_price_list": "_Test Price List Rest of the World",
- "currency": "USD"
- }
-
- try:
- quotation = frappe.get_doc("Quotation", values)
-
- except frappe.DoesNotExistError:
- quotation = frappe.new_doc("Quotation")
- quotation.update(values)
- if party.doctype == "Customer":
- quotation.contact_person = frappe.db.get_value("Contact", {"customer": party.name, "email_id": user})
- quotation.insert(ignore_permissions=True)
-
- return quotation
-
-def set_item_in_cart(item_code, qty, user=None):
- validate_item(item_code)
- quotation = get_quotation(user=user)
- qty = flt(qty)
- quotation_item = quotation.get("items", {"item_code": item_code})
- if qty==0:
- if quotation_item:
- # remove
- quotation.get("items").remove(quotation_item[0])
- else:
- # add or update
- if quotation_item:
- quotation_item[0].qty = qty
- else:
- quotation.append("items", {
- "doctype": "Quotation Item",
- "item_code": item_code,
- "qty": qty
- })
- quotation.save(ignore_permissions=True)
- return quotation
-
-def validate_item(item_code):
- item = frappe.db.get_value("Item", item_code, ["item_name", "show_in_website"], as_dict=True)
- if not item.show_in_website:
- frappe.throw(_("{0} cannot be purchased using Shopping Cart").format(item.item_name))
-
-def get_party(user):
- def _get_party(user):
- customer = frappe.db.get_value("Contact", {"email_id": user}, "customer")
- if customer:
- return frappe.get_doc("Customer", customer)
-
- lead = frappe.db.get_value("Lead", {"email_id": user})
- if lead:
- return frappe.get_doc("Lead", lead)
-
- # create a lead
- lead = frappe.new_doc("Lead")
- lead.update({
- "email_id": user,
- "lead_name": get_fullname(user),
- "territory": guess_territory()
- })
- lead.insert(ignore_permissions=True)
-
- return lead
-
- if not getattr(frappe.local, "shopping_cart_party", None):
- frappe.local.shopping_cart_party = {}
-
- if not frappe.local.shopping_cart_party.get(user):
- frappe.local.shopping_cart_party[user] = _get_party(user)
-
- return frappe.local.shopping_cart_party[user]
-
-def guess_territory():
- territory = None
- if frappe.session.get("session_country"):
- territory = frappe.db.get_value("Territory", frappe.session.get("session_country"))
- return territory or get_default_territory()
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index 74d9e64436..b6acf20d4e 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -17,19 +17,19 @@ def set_cart_count(quotation=None):
if not quotation:
quotation = _get_cart_quotation()
cart_count = cstr(len(quotation.get("items")))
- frappe.local.cookie_manager.set_cookie("cart_count", cart_count)
+
+ if hasattr(frappe.local, "cookie_manager"):
+ frappe.local.cookie_manager.set_cookie("cart_count", cart_count)
@frappe.whitelist()
def get_cart_quotation(doc=None):
- party = get_lead_or_customer()
+ party = get_customer()
if not doc:
quotation = _get_cart_quotation(party)
doc = quotation
set_cart_count(quotation)
- print get_applicable_shipping_rules(party)
-
return {
"doc": decorate_quotation_doc(doc),
"addresses": [{"name": address.name, "display": address.display}
@@ -60,7 +60,9 @@ def place_order():
sales_order.flags.ignore_permissions = True
sales_order.insert()
sales_order.submit()
- frappe.local.cookie_manager.delete_cookie("cart_count")
+
+ if hasattr(frappe.local, "cookie_manager"):
+ frappe.local.cookie_manager.delete_cookie("cart_count")
return sales_order.name
@@ -156,7 +158,7 @@ def decorate_quotation_doc(doc):
def _get_cart_quotation(party=None):
if not party:
- party = get_lead_or_customer()
+ party = get_customer()
quotation = frappe.db.get_value("Quotation",
{party.doctype.lower(): party.name, "order_type": "Shopping Cart", "docstatus": 0})
@@ -176,9 +178,9 @@ def _get_cart_quotation(party=None):
(party.doctype.lower()): party.name
})
- if party.doctype == "Customer":
- qdoc.contact_person = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
- "customer": party.name})
+ qdoc.contact_person = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
+ "customer": party.name})
+ qdoc.contact_email = frappe.session.user
qdoc.flags.ignore_permissions = True
qdoc.run_method("set_missing_values")
@@ -187,27 +189,21 @@ def _get_cart_quotation(party=None):
return qdoc
def update_party(fullname, company_name=None, mobile_no=None, phone=None):
- party = get_lead_or_customer()
+ party = get_customer()
- if party.doctype == "Lead":
- party.company_name = company_name
- party.lead_name = fullname
- party.mobile_no = mobile_no
- party.phone = phone
- else:
- party.customer_name = company_name or fullname
- party.customer_type == "Company" if company_name else "Individual"
+ party.customer_name = company_name or fullname
+ party.customer_type == "Company" if company_name else "Individual"
- contact_name = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
- "customer": party.name})
- contact = frappe.get_doc("Contact", contact_name)
- contact.first_name = fullname
- contact.last_name = None
- contact.customer_name = party.customer_name
- contact.mobile_no = mobile_no
- contact.phone = phone
- contact.flags.ignore_permissions = True
- contact.save()
+ contact_name = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
+ "customer": party.name})
+ contact = frappe.get_doc("Contact", contact_name)
+ contact.first_name = fullname
+ contact.last_name = None
+ contact.customer_name = party.customer_name
+ contact.mobile_no = mobile_no
+ contact.phone = phone
+ contact.flags.ignore_permissions = True
+ contact.save()
party_doc = frappe.get_doc(party.as_dict())
party_doc.flags.ignore_permissions = True
@@ -222,7 +218,7 @@ def update_party(fullname, company_name=None, mobile_no=None, phone=None):
def apply_cart_settings(party=None, quotation=None):
if not party:
- party = get_lead_or_customer()
+ party = get_customer()
if not quotation:
quotation = _get_cart_quotation(party)
@@ -250,8 +246,9 @@ def set_price_list_and_rate(quotation, cart_settings):
# refetch values
quotation.run_method("set_price_list_and_item_details")
- # set it in cookies for using in product page
- frappe.local.cookie_manager.set_cookie("selling_price_list", quotation.selling_price_list)
+ if hasattr(frappe.local, "cookie_manager"):
+ # set it in cookies for using in product page
+ frappe.local.cookie_manager.set_cookie("selling_price_list", quotation.selling_price_list)
def _set_price_list(quotation, cart_settings):
"""Set price list based on customer or shopping cart default"""
@@ -286,32 +283,38 @@ def set_taxes(quotation, cart_settings):
# # append taxes
quotation.append_taxes_from_master()
-def get_lead_or_customer():
- customer = frappe.db.get_value("Contact", {"email_id": frappe.session.user}, "customer")
+def get_customer(user=None):
+ if not user:
+ user = frappe.session.user
+
+ customer = frappe.db.get_value("Contact", {"email_id": user}, "customer")
if customer:
return frappe.get_doc("Customer", customer)
- lead = frappe.db.get_value("Lead", {"email_id": frappe.session.user})
- if lead:
- return frappe.get_doc("Lead", lead)
else:
- lead_doc = frappe.get_doc({
- "doctype": "Lead",
- "email_id": frappe.session.user,
- "lead_name": get_fullname(frappe.session.user),
- "territory": guess_territory(),
- "status": "Open" # TODO: set something better???
+ customer = frappe.new_doc("Customer")
+ fullname = get_fullname(user)
+ customer.update({
+ "customer_name": fullname,
+ "customer_type": "Individual",
+ "customer_group": get_shopping_cart_settings().default_customer_group,
+ "territory": get_root_of("Territory")
})
+ customer.insert(ignore_permissions=True)
- if frappe.session.user not in ("Guest", "Administrator"):
- lead_doc.flags.ignore_permissions = True
- lead_doc.insert()
+ contact = frappe.new_doc("Contact")
+ contact.update({
+ "customer": customer.name,
+ "first_name": fullname,
+ "email_id": user
+ })
+ contact.insert(ignore_permissions=True)
- return lead_doc
+ return customer
def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_page_length=20, party=None):
if not party:
- party = get_lead_or_customer()
+ party = get_customer()
address_docs = frappe.db.sql("""select * from `tabAddress`
where `{0}`=%s order by name limit {1}, {2}""".format(party.doctype.lower(),
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index 4fac3a814d..d8d00efa96 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -8,7 +8,6 @@ import frappe
from frappe import _, msgprint
from frappe.utils import comma_and
from frappe.model.document import Document
-from frappe.utils.nestedset import get_root_of
class ShoppingCartSetupError(frappe.ValidationError): pass
@@ -75,9 +74,6 @@ def get_shopping_cart_settings():
def is_cart_enabled():
return get_shopping_cart_settings().enabled
-def get_default_territory():
- return get_shopping_cart_settings().default_territory or get_root_of("Territory")
-
def check_shopping_cart_enabled():
if not get_shopping_cart_settings().enabled:
frappe.throw(_("You need to enable Shopping Cart"), ShoppingCartSetupError)
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
index 66be927bcc..10bbcfe85a 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/test_shopping_cart_settings.py
@@ -19,14 +19,14 @@ class TestShoppingCartSettings(unittest.TestCase):
def test_exchange_rate_exists(self):
frappe.db.sql("""delete from `tabCurrency Exchange`""")
- cart_settings = self.test_price_list_territory_overlap()
- controller = cart_settings
- self.assertRaises(ShoppingCartSetupError, controller.validate_exchange_rates_exist)
+ cart_settings = self.get_cart_settings()
+ cart_settings.price_list = "_Test Price List Rest of the World"
+ self.assertRaises(ShoppingCartSetupError, cart_settings.validate_exchange_rates_exist)
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records as \
currency_exchange_records
frappe.get_doc(currency_exchange_records[0]).insert()
- controller.validate_exchange_rates_exist()
+ cart_settings.validate_exchange_rates_exist()
def test_tax_rule_validation(self):
frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 0")
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index dc3b4fe2ab..61536acc87 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import unittest
import frappe
-from erpnext.shopping_cart import get_quotation, set_item_in_cart, get_party
+from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_customer
class TestShoppingCart(unittest.TestCase):
"""
@@ -23,23 +23,11 @@ class TestShoppingCart(unittest.TestCase):
self.login_as_new_user()
# test if lead is created and quotation with new lead is fetched
- quotation = get_quotation()
- self.assertEquals(quotation.quotation_to, "Lead")
- self.assertEquals(frappe.db.get_value("Lead", quotation.lead, "email_id"),
+ quotation = _get_cart_quotation()
+ self.assertEquals(quotation.quotation_to, "Customer")
+ self.assertEquals(frappe.db.get_value("Contact", {"customer": quotation.customer}, "email_id"),
"test_cart_user@example.com")
- self.assertEquals(quotation.customer, None)
- self.assertEquals(quotation.contact_email, frappe.session.user)
-
- return quotation
-
- def test_get_cart_lead(self):
- self.login_as_lead()
-
- # test if quotation with lead is fetched
- quotation = get_quotation()
- self.assertEquals(quotation.quotation_to, "Lead")
- self.assertEquals(quotation.lead, frappe.db.get_value("Lead", {"email_id": "test_cart_lead@example.com"}))
- self.assertEquals(quotation.customer, None)
+ self.assertEquals(quotation.lead, None)
self.assertEquals(quotation.contact_email, frappe.session.user)
return quotation
@@ -48,7 +36,7 @@ class TestShoppingCart(unittest.TestCase):
self.login_as_customer()
# test if quotation with customer is fetched
- quotation = get_quotation()
+ quotation = _get_cart_quotation()
self.assertEquals(quotation.quotation_to, "Customer")
self.assertEquals(quotation.customer, "_Test Customer")
self.assertEquals(quotation.lead, None)
@@ -57,21 +45,21 @@ class TestShoppingCart(unittest.TestCase):
return quotation
def test_add_to_cart(self):
- self.login_as_lead()
+ self.login_as_customer()
# remove from cart
self.remove_all_items_from_cart()
# add first item
- set_item_in_cart("_Test Item", 1)
- quotation = self.test_get_cart_lead()
+ update_cart("_Test Item", 1)
+ quotation = self.test_get_cart_customer()
self.assertEquals(quotation.get("items")[0].item_code, "_Test Item")
self.assertEquals(quotation.get("items")[0].qty, 1)
self.assertEquals(quotation.get("items")[0].amount, 10)
# add second item
- set_item_in_cart("_Test Item 2", 1)
- quotation = self.test_get_cart_lead()
+ update_cart("_Test Item 2", 1)
+ quotation = self.test_get_cart_customer()
self.assertEquals(quotation.get("items")[1].item_code, "_Test Item 2")
self.assertEquals(quotation.get("items")[1].qty, 1)
self.assertEquals(quotation.get("items")[1].amount, 20)
@@ -83,8 +71,8 @@ class TestShoppingCart(unittest.TestCase):
self.test_add_to_cart()
# update first item
- set_item_in_cart("_Test Item", 5)
- quotation = self.test_get_cart_lead()
+ update_cart("_Test Item", 5)
+ quotation = self.test_get_cart_customer()
self.assertEquals(quotation.get("items")[0].item_code, "_Test Item")
self.assertEquals(quotation.get("items")[0].qty, 5)
self.assertEquals(quotation.get("items")[0].amount, 50)
@@ -96,8 +84,8 @@ class TestShoppingCart(unittest.TestCase):
self.test_add_to_cart()
# remove first item
- set_item_in_cart("_Test Item", 0)
- quotation = self.test_get_cart_lead()
+ update_cart("_Test Item", 0)
+ quotation = self.test_get_cart_customer()
self.assertEquals(quotation.get("items")[0].item_code, "_Test Item 2")
self.assertEquals(quotation.get("items")[0].qty, 1)
self.assertEquals(quotation.get("items")[0].amount, 20)
@@ -105,11 +93,11 @@ class TestShoppingCart(unittest.TestCase):
self.assertEquals(len(quotation.get("items")), 1)
# remove second item
- set_item_in_cart("_Test Item 2", 0)
- quotation = self.test_get_cart_lead()
- self.assertEquals(quotation.net_total, 0)
- self.assertEquals(len(quotation.get("items")), 0)
+ update_cart("_Test Item 2", 0)
+ quotation = self.test_get_cart_customer()
+ self.assertEquals(len(quotation.get("items")), 0)
+ self.assertEquals(quotation.net_total, 0)
def test_tax_rule(self):
self.login_as_customer()
@@ -133,7 +121,7 @@ class TestShoppingCart(unittest.TestCase):
"doctype": "Quotation",
"quotation_to": "Customer",
"order_type": "Shopping Cart",
- "customer": get_party(frappe.session.user).name,
+ "customer": get_customer(frappe.session.user).name,
"docstatus": 0,
"contact_email": frappe.session.user,
"selling_price_list": "_Test Price List Rest of the World",
@@ -167,20 +155,10 @@ class TestShoppingCart(unittest.TestCase):
settings.update({
"enabled": 1,
"company": "_Test Company",
- "default_territory": "_Test Territory Rest Of The World",
"default_customer_group": "_Test Customer Group",
- "quotation_series": "_T-Quotation-"
+ "quotation_series": "_T-Quotation-",
+ "price_list": "_Test Price List India"
})
- settings.set("price_lists", [
- # price lists
- {"doctype": "Shopping Cart Price List", "parentfield": "price_lists",
- "selling_price_list": "_Test Price List India"},
- {"doctype": "Shopping Cart Price List", "parentfield": "price_lists",
- "selling_price_list": "_Test Price List Rest of the World"}
- ])
- settings.set("shipping_rules", {"doctype": "Shopping Cart Shipping Rule", "parentfield": "shipping_rules",
- "shipping_rule": "_Test Shipping Rule - India"})
-
settings.save()
frappe.local.shopping_cart_settings = None
@@ -194,54 +172,11 @@ class TestShoppingCart(unittest.TestCase):
def login_as_new_user(self):
frappe.set_user("test_cart_user@example.com")
- def login_as_lead(self):
- self.create_lead()
- frappe.set_user("test_cart_lead@example.com")
-
def login_as_customer(self):
frappe.set_user("test_contact_customer@example.com")
- def create_lead(self):
- if frappe.db.get_value("Lead", {"email_id": "test_cart_lead@example.com"}):
- return
-
- lead = frappe.get_doc({
- "doctype": "Lead",
- "email_id": "test_cart_lead@example.com",
- "lead_name": "_Test Website Lead",
- "status": "Open",
- "territory": "_Test Territory Rest Of The World",
- "company": "_Test Company"
- })
- lead.insert(ignore_permissions=True)
-
- frappe.get_doc({
- "doctype": "Address",
- "address_line1": "_Test Address Line 1",
- "address_title": "_Test Cart Lead Address",
- "address_type": "Office",
- "city": "_Test City",
- "country": "United States",
- "lead": lead.name,
- "lead_name": "_Test Website Lead",
- "is_primary_address": 1,
- "phone": "+91 0000000000"
- }).insert(ignore_permissions=True)
-
- frappe.get_doc({
- "doctype": "Address",
- "address_line1": "_Test Address Line 1",
- "address_title": "_Test Cart Lead Address",
- "address_type": "Personal",
- "city": "_Test City",
- "country": "India",
- "lead": lead.name,
- "lead_name": "_Test Website Lead",
- "phone": "+91 0000000000"
- }).insert(ignore_permissions=True)
-
def remove_all_items_from_cart(self):
- quotation = get_quotation()
+ quotation = _get_cart_quotation()
quotation.set("items", [])
quotation.save(ignore_permissions=True)
diff --git a/erpnext/stock/doctype/price_list/price_list.js b/erpnext/stock/doctype/price_list/price_list.js
index 54a77732a9..f109633fdd 100644
--- a/erpnext/stock/doctype/price_list/price_list.js
+++ b/erpnext/stock/doctype/price_list/price_list.js
@@ -2,10 +2,6 @@
// License: GNU General Public License v3. See license.txt
$.extend(cur_frm.cscript, {
- onload: function() {
- erpnext.add_applicable_territory();
- },
-
refresh: function() {
cur_frm.add_custom_button(__("Add / Edit Prices"), function() {
frappe.route_options = {
@@ -14,4 +10,4 @@ $.extend(cur_frm.cscript, {
frappe.set_route("Report", "Item Price");
}, "icon-money");
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/stock/doctype/price_list/test_records.json b/erpnext/stock/doctype/price_list/test_records.json
index d91f8872db..ca8a620d23 100644
--- a/erpnext/stock/doctype/price_list/test_records.json
+++ b/erpnext/stock/doctype/price_list/test_records.json
@@ -1,67 +1,34 @@
[
{
- "buying": 1,
- "currency": "INR",
- "doctype": "Price List",
- "enabled": 1,
- "price_list_name": "_Test Price List",
- "selling": 1,
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "All Territories"
- }
- ]
- },
+ "buying": 1,
+ "currency": "INR",
+ "doctype": "Price List",
+ "enabled": 1,
+ "price_list_name": "_Test Price List",
+ "selling": 1
+ },
{
- "buying": 1,
- "currency": "INR",
- "doctype": "Price List",
- "enabled": 1,
- "price_list_name": "_Test Price List 2",
- "selling": 1,
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- }
- ]
- },
+ "buying": 1,
+ "currency": "INR",
+ "doctype": "Price List",
+ "enabled": 1,
+ "price_list_name": "_Test Price List 2",
+ "selling": 1
+ },
{
- "buying": 1,
- "currency": "INR",
- "doctype": "Price List",
- "enabled": 1,
- "price_list_name": "_Test Price List India",
- "selling": 1,
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory India"
- }
- ]
- },
+ "buying": 1,
+ "currency": "INR",
+ "doctype": "Price List",
+ "enabled": 1,
+ "price_list_name": "_Test Price List India",
+ "selling": 1
+ },
{
- "buying": 1,
- "currency": "USD",
- "doctype": "Price List",
- "enabled": 1,
- "price_list_name": "_Test Price List Rest of the World",
- "selling": 1,
- "territories": [
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
- },
- {
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory United States"
- }
- ]
+ "buying": 1,
+ "currency": "USD",
+ "doctype": "Price List",
+ "enabled": 1,
+ "price_list_name": "_Test Price List Rest of the World",
+ "selling": 1
}
-]
\ No newline at end of file
+]
diff --git a/erpnext/templates/pages/user.py b/erpnext/templates/pages/user.py
index c944289661..5ab5545d87 100644
--- a/erpnext/templates/pages/user.py
+++ b/erpnext/templates/pages/user.py
@@ -5,36 +5,31 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr
-from erpnext.shopping_cart.cart import get_lead_or_customer
+from erpnext.shopping_cart.cart import get_customer
no_cache = 1
no_sitemap = 1
def get_context(context):
- party = get_lead_or_customer()
- if party.doctype == "Lead":
- mobile_no = party.mobile_no
- phone = party.phone
- else:
- mobile_no, phone = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
- "customer": party.name}, ["mobile_no", "phone"])
-
+ party = get_customer()
+ mobile_no, phone = frappe.db.get_value("Contact", {"email_id": frappe.session.user,
+ "customer": party.name}, ["mobile_no", "phone"])
+
return {
"company_name": cstr(party.customer_name if party.doctype == "Customer" else party.company_name),
"mobile_no": cstr(mobile_no),
"phone": cstr(phone)
}
-
+
@frappe.whitelist()
def update_user(fullname, password=None, company_name=None, mobile_no=None, phone=None):
from erpnext.shopping_cart.cart import update_party
update_party(fullname, company_name, mobile_no, phone)
-
+
if not fullname:
return _("Name is required")
-
+
frappe.db.set_value("User", frappe.session.user, "first_name", fullname)
frappe.local.cookie_manager.set_cookie("full_name", fullname)
-
+
return _("Updated")
-
\ No newline at end of file
From 307978fea956c9bddaf0dc01dc01f0affe7eb71b Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Wed, 23 Sep 2015 15:43:09 +0530
Subject: [PATCH 45/52] [test-fixes]
---
erpnext/accounts/doctype/tax_rule/tax_rule.py | 6 ++-
erpnext/accounts/party.py | 2 +-
erpnext/shopping_cart/cart.py | 20 +++-------
erpnext/shopping_cart/test_shopping_cart.py | 37 ++++++++++++++-----
4 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py
index 1e306e9eb7..bcbd5595d4 100644
--- a/erpnext/accounts/doctype/tax_rule/tax_rule.py
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -5,7 +5,6 @@
from __future__ import unicode_literals
import frappe
from frappe import _
-from frappe.model import default_fields
from frappe.model.document import Document
from frappe.utils import cstr
@@ -121,7 +120,10 @@ def get_tax_template(posting_date, args):
conditions = []
for key, value in args.iteritems():
- conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
+ if key in "use_for_shopping_cart":
+ conditions.append("use_for_shopping_cart = {0}".format(1 if value else 0))
+ else:
+ conditions.append("ifnull({0}, '') in ('', '{1}')".format(key, frappe.db.escape(cstr(value))))
matching = frappe.db.sql("""select * from `tabTax Rule`
where {0}""".format(" and ".join(conditions)), as_dict = True)
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 9596b44074..baa237e07d 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -280,7 +280,7 @@ def set_taxes(party, party_type, posting_date, company, customer_group=None, sup
billing_address=None, shipping_address=None, use_for_shopping_cart=None):
from erpnext.accounts.doctype.tax_rule.tax_rule import get_tax_template, get_party_details
args = {
- party_type: party,
+ party_type.lower(): party,
"customer_group": customer_group,
"supplier_type": supplier_type,
"company": company
diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py
index b6acf20d4e..c4f3db0395 100644
--- a/erpnext/shopping_cart/cart.py
+++ b/erpnext/shopping_cart/cart.py
@@ -73,10 +73,6 @@ def update_cart(item_code, qty, with_items=False):
qty = flt(qty)
if qty == 0:
quotation.set("items", quotation.get("items", {"item_code": ["!=", item_code]}))
- if not quotation.get("items") and \
- not quotation.get("__islocal"):
- quotation.__delete = True
-
else:
quotation_items = quotation.get("items", {"item_code": item_code})
if not quotation_items:
@@ -90,16 +86,11 @@ def update_cart(item_code, qty, with_items=False):
apply_cart_settings(quotation=quotation)
- if hasattr(quotation, "__delete"):
- frappe.delete_doc("Quotation", quotation.name, ignore_permissions=True)
- quotation = _get_cart_quotation()
- else:
- quotation.flags.ignore_permissions = True
- quotation.save()
+ quotation.flags.ignore_permissions = True
+ quotation.save()
set_cart_count(quotation)
-
if with_items:
context = get_cart_quotation(quotation)
return {
@@ -160,11 +151,12 @@ def _get_cart_quotation(party=None):
if not party:
party = get_customer()
- quotation = frappe.db.get_value("Quotation",
- {party.doctype.lower(): party.name, "order_type": "Shopping Cart", "docstatus": 0})
+ quotation = frappe.get_all("Quotation", fields=["name"], filters=
+ {party.doctype.lower(): party.name, "order_type": "Shopping Cart", "docstatus": 0},
+ order_by="modified desc", limit_page_length=1)
if quotation:
- qdoc = frappe.get_doc("Quotation", quotation)
+ qdoc = frappe.get_doc("Quotation", quotation[0].name)
else:
qdoc = frappe.get_doc({
"doctype": "Quotation",
diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py
index 61536acc87..41f7442b7c 100644
--- a/erpnext/shopping_cart/test_shopping_cart.py
+++ b/erpnext/shopping_cart/test_shopping_cart.py
@@ -52,11 +52,14 @@ class TestShoppingCart(unittest.TestCase):
# add first item
update_cart("_Test Item", 1)
+
quotation = self.test_get_cart_customer()
+
self.assertEquals(quotation.get("items")[0].item_code, "_Test Item")
self.assertEquals(quotation.get("items")[0].qty, 1)
self.assertEquals(quotation.get("items")[0].amount, 10)
+
# add second item
update_cart("_Test Item 2", 1)
quotation = self.test_get_cart_customer()
@@ -86,6 +89,7 @@ class TestShoppingCart(unittest.TestCase):
# remove first item
update_cart("_Test Item", 0)
quotation = self.test_get_cart_customer()
+
self.assertEquals(quotation.get("items")[0].item_code, "_Test Item 2")
self.assertEquals(quotation.get("items")[0].qty, 1)
self.assertEquals(quotation.get("items")[0].amount, 20)
@@ -149,16 +153,29 @@ class TestShoppingCart(unittest.TestCase):
def enable_shopping_cart(self):
settings = frappe.get_doc("Shopping Cart Settings", "Shopping Cart Settings")
- if settings.get("price_lists"):
- settings.enabled = 1
- else:
- settings.update({
- "enabled": 1,
- "company": "_Test Company",
- "default_customer_group": "_Test Customer Group",
- "quotation_series": "_T-Quotation-",
- "price_list": "_Test Price List India"
- })
+ settings.update({
+ "enabled": 1,
+ "company": "_Test Company",
+ "default_customer_group": "_Test Customer Group",
+ "quotation_series": "_T-Quotation-",
+ "price_list": "_Test Price List India"
+ })
+
+ # insert item price
+ if not frappe.db.get_value("Item Price", {"price_list": "_Test Price List India",
+ "item_code": "_Test Item"}):
+ frappe.get_doc({
+ "doctype": "Item Price",
+ "price_list": "_Test Price List India",
+ "item_code": "_Test Item",
+ "price_list_rate": 10
+ }).insert()
+ frappe.get_doc({
+ "doctype": "Item Price",
+ "price_list": "_Test Price List India",
+ "item_code": "_Test Item 2",
+ "price_list_rate": 20
+ }).insert()
settings.save()
frappe.local.shopping_cart_settings = None
From b07b0a9e54630b94ddf7d8a6e701861907bffff3 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Wed, 23 Sep 2015 15:52:11 +0530
Subject: [PATCH 46/52] [fix] Sales Order indicators for Maintenance
---
.../doctype/sales_order/sales_order_list.js | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.js b/erpnext/selling/doctype/sales_order/sales_order_list.js
index f51b7dc0b7..aab168eb98 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.js
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.js
@@ -1,14 +1,17 @@
frappe.listview_settings['Sales Order'] = {
add_fields: ["base_grand_total", "customer_name", "currency", "delivery_date", "per_delivered", "per_billed",
- "status"],
+ "status", "order_type"],
get_indicator: function(doc) {
if(doc.status==="Stopped") {
return [__("Stopped"), "darkgrey", "status,=,Stopped"];
- } else if(flt(doc.per_delivered, 2) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) {
+
+ } else if (doc.order_type !== "Maintenance"
+ && flt(doc.per_delivered, 2) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) {
// to bill & overdue
return [__("Overdue"), "red", "per_delivered,<,100|delivery_date,<,Today|status,!=,Stopped"];
- } else if(flt(doc.per_delivered, 2) < 100 && doc.status!=="Stopped") {
+ } else if (doc.order_type !== "Maintenance"
+ && flt(doc.per_delivered, 2) < 100 && doc.status!=="Stopped") {
// not delivered
if(flt(doc.per_billed, 2) < 100) {
@@ -23,11 +26,14 @@ frappe.listview_settings['Sales Order'] = {
"per_delivered,<,100|per_billed,=,100|status,!=,Stopped"];
}
- } else if(flt(doc.per_delivered, 2) == 100 && flt(doc.per_billed, 2) < 100 && doc.status!=="Stopped") {
+ } else if ((doc.order_type === "Maintenance" || flt(doc.per_delivered, 2) == 100)
+ && flt(doc.per_billed, 2) < 100 && doc.status!=="Stopped") {
+
// to bill
return [__("To Bill"), "orange", "per_delivered,=,100|per_billed,<,100|status,!=,Stopped"];
- } else if(flt(doc.per_delivered, 2) == 100 && flt(doc.per_billed, 2) == 100 && doc.status!=="Stopped") {
+ } else if((doc.order_type === "Maintenance" || flt(doc.per_delivered, 2) == 100)
+ && flt(doc.per_billed, 2) == 100 && doc.status!=="Stopped") {
return [__("Completed"), "green", "per_delivered,=,100|per_billed,=,100|status,!=,Stopped"];
}
From dd2f2f53219884bf14677f1bf5d2a6d628b8e498 Mon Sep 17 00:00:00 2001
From: Rushabh Mehta
Date: Wed, 23 Sep 2015 17:06:01 +0530
Subject: [PATCH 47/52] [fix] minor, remove operation naming field from
operation
---
.../doctype/operation/operation.json | 49 ++-----------------
.../doctype/operation/test_records.json | 2 +-
2 files changed, 4 insertions(+), 47 deletions(-)
diff --git a/erpnext/manufacturing/doctype/operation/operation.json b/erpnext/manufacturing/doctype/operation/operation.json
index 45b2b6b779..4145e46d15 100644
--- a/erpnext/manufacturing/doctype/operation/operation.json
+++ b/erpnext/manufacturing/doctype/operation/operation.json
@@ -2,56 +2,13 @@
"allow_copy": 0,
"allow_import": 1,
"allow_rename": 1,
- "autoname": "field:operation",
+ "autoname": "Prompt",
"creation": "2014-11-07 16:20:30.683186",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Setup",
"fields": [
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "operation",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Operation",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
{
"allow_on_submit": 0,
"bold": 0,
@@ -61,7 +18,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
- "in_list_view": 0,
+ "in_list_view": 1,
"label": "Default Workstation",
"no_copy": 0,
"options": "Workstation",
@@ -127,7 +84,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-14 02:55:58.575636",
+ "modified": "2015-09-23 07:32:29.550198",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Operation",
diff --git a/erpnext/manufacturing/doctype/operation/test_records.json b/erpnext/manufacturing/doctype/operation/test_records.json
index 56da6d33d5..5a24d44065 100644
--- a/erpnext/manufacturing/doctype/operation/test_records.json
+++ b/erpnext/manufacturing/doctype/operation/test_records.json
@@ -1,7 +1,7 @@
[
{
"doctype": "Operation",
- "operation": "_Test Operation 1",
+ "name": "_Test Operation 1",
"workstation": "_Test Workstation 1"
}
]
From e2d46d0474960a263c21b33b7ce4d19ee1a69128 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Wed, 23 Sep 2015 19:26:29 +0530
Subject: [PATCH 48/52] [fix] Allow Sales Team to be added/updated after submit
---
.../doctype/sales_invoice/sales_invoice.json | 5554 ++++++++---------
.../doctype/sales_order/sales_order.json | 4 +-
.../doctype/sales_team/sales_team.json | 12 +-
.../doctype/delivery_note/delivery_note.json | 4 +-
4 files changed, 2787 insertions(+), 2787 deletions(-)
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 08a7b24f3e..0a21510a54 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1,3047 +1,3047 @@
{
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "creation": "2013-05-24 19:29:05",
- "custom": 0,
- "default_print_format": "Standard",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:05",
+ "custom": 0,
+ "default_print_format": "Standard",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "options": "icon-user",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "options": "icon-user",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "default": "{customer_name}",
- "fieldname": "title",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Title",
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "{customer_name}",
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Title",
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SINV-\nSINV-RET-",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SINV-\nSINV-RET-",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer",
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "customer",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer Name",
- "no_copy": 0,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Name",
+ "no_copy": 0,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "is_pos",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is POS",
- "no_copy": 0,
- "oldfieldname": "is_pos",
- "oldfieldtype": "Check",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "is_pos",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is POS",
+ "no_copy": 0,
+ "oldfieldname": "is_pos",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "is_return",
- "fieldname": "is_return",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Return",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "is_return",
+ "fieldname": "is_return",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Return",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "default": "Today",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "due_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Payment Due Date",
- "no_copy": 1,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Payment Due Date",
+ "no_copy": 1,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 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": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 1,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Sales Invoice",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 1,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "is_return",
- "fieldname": "return_against",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Return Against Sales Invoice",
- "no_copy": 0,
- "options": "Sales Invoice",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "is_return",
+ "fieldname": "return_against",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Return Against Sales Invoice",
+ "no_copy": 0,
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Shipping Address Name",
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Shipping Address Name",
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "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": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "currency_and_price_list",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Currency and Price List",
- "no_copy": 0,
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "currency_and_price_list",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Currency and Price List",
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 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": "currency",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Currency",
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Currency",
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Rate at which Customer Currency is converted to customer's base currency",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Exchange Rate",
- "no_copy": 0,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "precision": "9",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Rate at which Customer Currency is converted to customer's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Exchange Rate",
+ "no_copy": 0,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "precision": "9",
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "column_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "selling_price_list",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List",
- "no_copy": 0,
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List",
+ "no_copy": 0,
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Currency",
- "no_copy": 0,
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Currency",
+ "no_copy": 0,
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Rate at which Price list currency is converted to customer's base currency",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Exchange Rate",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "9",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Rate at which Price list currency is converted to customer's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Exchange Rate",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "9",
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Ignore Pricing Rule",
- "no_copy": 1,
- "permlevel": 1,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Ignore Pricing Rule",
+ "no_copy": 1,
+ "permlevel": 1,
+ "print_hide": 1,
+ "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": "items_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "print_hide": 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": "update_stock",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Update Stock",
- "no_copy": 0,
- "oldfieldname": "update_stock",
- "oldfieldtype": "Check",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "update_stock",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Update Stock",
+ "no_copy": 0,
+ "oldfieldname": "update_stock",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Items",
- "no_copy": 0,
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Item",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Items",
+ "no_copy": 0,
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Packing List",
- "no_copy": 0,
- "options": "icon-suitcase",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Packing List",
+ "no_copy": 0,
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "packed_items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Packed Items",
- "no_copy": 0,
- "options": "Packed Item",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "packed_items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Packed Items",
+ "no_copy": 0,
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "product_bundle_help",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Product Bundle Help",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "product_bundle_help",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Product Bundle Help",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "section_break_30",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_30",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "base_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total (Company Currency)",
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total (Company Currency)",
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_net_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_net_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_32",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_32",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Total",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Total",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "taxes_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 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": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break_38",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "shipping_rule",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Rule",
- "no_copy": 0,
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Rule",
+ "no_copy": 0,
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "section_break_40",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "taxes",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "print_hide": 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": "other_charges_calculation",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges Calculation",
- "no_copy": 0,
- "oldfieldtype": "HTML",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Taxes and Charges Calculation",
+ "no_copy": 0,
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "section_break_43",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "base_total_taxes_and_charges",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Taxes and Charges (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Taxes and Charges (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_47",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_47",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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": "total_taxes_and_charges",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Taxes and Charges",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Taxes and Charges",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "discount_amount",
- "fieldname": "section_break_49",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "discount_amount",
+ "fieldname": "section_break_49",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "default": "Grand Total",
- "fieldname": "apply_discount_on",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Apply Additional Discount On",
- "no_copy": 0,
- "options": "\nGrand Total\nNet Total",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Grand Total",
+ "fieldname": "apply_discount_on",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Apply Additional Discount On",
+ "no_copy": 0,
+ "options": "\nGrand Total\nNet Total",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "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": "column_break_51",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_51",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "discount_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount Amount",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount Amount",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_discount_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount Amount (Company Currency)",
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount Amount (Company Currency)",
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_grand_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Grand Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_grand_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_rounded_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rounded Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_rounded_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rounded Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "In Words will be visible once you save the Sales Invoice.",
- "fieldname": "base_in_words",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "In Words (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "In Words will be visible once you save the Sales Invoice.",
+ "fieldname": "base_in_words",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "In Words (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break5",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rounded Total",
- "no_copy": 0,
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rounded Total",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "in_words",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "In Words",
- "no_copy": 0,
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "In Words",
+ "no_copy": 0,
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_advance",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Advance",
- "no_copy": 0,
- "oldfieldname": "total_advance",
- "oldfieldtype": "Currency",
- "options": "party_account_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_advance",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Advance",
+ "no_copy": 0,
+ "oldfieldname": "total_advance",
+ "oldfieldtype": "Currency",
+ "options": "party_account_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "outstanding_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Outstanding Amount",
- "no_copy": 1,
- "oldfieldname": "outstanding_amount",
- "oldfieldtype": "Currency",
- "options": "party_account_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "outstanding_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Outstanding Amount",
+ "no_copy": 1,
+ "oldfieldname": "outstanding_amount",
+ "oldfieldtype": "Currency",
+ "options": "party_account_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "advances",
- "fieldname": "advances_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Advance Payments",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "advances",
+ "fieldname": "advances_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Advance Payments",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "get_advances_received",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Get Advances Received",
- "no_copy": 0,
- "oldfieldtype": "Button",
- "options": "get_advances",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "get_advances_received",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Get Advances Received",
+ "no_copy": 0,
+ "oldfieldtype": "Button",
+ "options": "get_advances",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "advances",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Advances",
- "no_copy": 0,
- "oldfieldname": "advance_adjustment_details",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Advance",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "advances",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Advances",
+ "no_copy": 0,
+ "oldfieldname": "advance_adjustment_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Advance",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "paid_amount",
- "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
- "fieldname": "payments_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Payments",
- "no_copy": 0,
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "paid_amount",
+ "depends_on": "eval:doc.is_pos===1||(doc.advances && doc.advances.length>0)",
+ "fieldname": "payments_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Payments",
+ "no_copy": 0,
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 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": "mode_of_payment",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mode of Payment",
- "no_copy": 0,
- "oldfieldname": "mode_of_payment",
- "oldfieldtype": "Select",
- "options": "Mode of Payment",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "mode_of_payment",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mode of Payment",
+ "no_copy": 0,
+ "oldfieldname": "mode_of_payment",
+ "oldfieldtype": "Select",
+ "options": "Mode of Payment",
+ "permlevel": 0,
+ "print_hide": 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,
- "depends_on": "is_pos",
- "fieldname": "cash_bank_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Cash/Bank Account",
- "no_copy": 0,
- "oldfieldname": "cash_bank_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "is_pos",
+ "fieldname": "cash_bank_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Cash/Bank Account",
+ "no_copy": 0,
+ "oldfieldname": "cash_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "is_pos",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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,
+ "depends_on": "is_pos",
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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,
- "depends_on": "is_pos",
- "fieldname": "paid_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Paid Amount",
- "no_copy": 1,
- "oldfieldname": "paid_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "is_pos",
+ "fieldname": "paid_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Paid Amount",
+ "no_copy": 1,
+ "oldfieldname": "paid_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_paid_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Paid Amount (Company Currency)",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_paid_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Paid Amount (Company Currency)",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "write_off_amount",
- "depends_on": "grand_total",
- "fieldname": "column_break4",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": 1,
+ "collapsible_depends_on": "write_off_amount",
+ "depends_on": "grand_total",
+ "fieldname": "column_break4",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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,
- "depends_on": "",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Amount",
- "no_copy": 1,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "",
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Amount",
+ "no_copy": 1,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_write_off_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Amount (Company Currency)",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_write_off_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Amount (Company Currency)",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "is_pos",
- "fieldname": "write_off_outstanding_amount_automatically",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Outstanding Amount",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "is_pos",
+ "fieldname": "write_off_outstanding_amount_automatically",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Outstanding Amount",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "",
- "fieldname": "column_break_74",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "",
+ "fieldname": "column_break_74",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "depends_on": "",
- "fieldname": "write_off_account",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Account",
- "no_copy": 0,
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "",
+ "fieldname": "write_off_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Account",
+ "no_copy": 0,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "",
- "fieldname": "write_off_cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Write Off Cost Center",
- "no_copy": 0,
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "",
+ "fieldname": "write_off_cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Write Off Cost Center",
+ "no_copy": 0,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "terms",
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "",
+ "permlevel": 0,
+ "print_hide": 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": "tc_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms",
- "no_copy": 0,
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms",
+ "no_copy": 0,
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "terms",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms and Conditions Details",
- "no_copy": 0,
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms and Conditions Details",
+ "no_copy": 0,
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "print_hide": 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": 1,
- "fieldname": "edit_printing_settings",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Printing Settings",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "edit_printing_settings",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Printing Settings",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Letter Head",
- "no_copy": 0,
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Letter Head",
+ "no_copy": 0,
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break_84",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_84",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "depends_on": "customer",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "More Information",
- "no_copy": 0,
- "options": "icon-bullhorn",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "depends_on": "customer",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "no_copy": 0,
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "print_hide": 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": "project_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Project Name",
- "no_copy": 0,
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "no_copy": 0,
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Territory",
+ "no_copy": 0,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "no_copy": 0,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "col_break23",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "col_break23",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer Address",
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Address",
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Person",
- "no_copy": 0,
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "no_copy": 0,
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.source == 'Campaign'",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Campaign",
- "no_copy": 0,
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Campaign",
+ "no_copy": 0,
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "source",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Source",
- "no_copy": 0,
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Source",
+ "no_copy": 0,
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Accounting Details",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Accounting Details",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "debit_to",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Debit To",
- "no_copy": 0,
- "oldfieldname": "debit_to",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "debit_to",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Debit To",
+ "no_copy": 0,
+ "oldfieldname": "debit_to",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "party_account_currency",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Party Account Currency",
- "no_copy": 1,
- "options": "Currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "party_account_currency",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Party Account Currency",
+ "no_copy": 1,
+ "options": "Currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "No",
- "description": "",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Is Opening Entry",
- "no_copy": 0,
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "No",
+ "description": "",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Is Opening Entry",
+ "no_copy": 0,
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "c_form_applicable",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "C-Form Applicable",
- "no_copy": 1,
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "c_form_applicable",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "C-Form Applicable",
+ "no_copy": 1,
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "c_form_no",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "C-Form No",
- "no_copy": 1,
- "options": "C-Form",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "c_form_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "C-Form No",
+ "no_copy": 1,
+ "options": "C-Form",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break8",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break8",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "posting_time",
- "fieldtype": "Time",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Posting Time",
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Posting Time",
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "fiscal_year",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "sales_partner",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Commission",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "sales_partner",
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Commission",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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_partner",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Sales Partner",
- "no_copy": 0,
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Sales Partner",
+ "no_copy": 0,
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break10",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break10",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "commission_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Commission Rate (%)",
- "no_copy": 0,
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Commission Rate (%)",
+ "no_copy": 0,
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "total_commission",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Commission",
- "no_copy": 0,
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Commission",
+ "no_copy": 0,
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "sales_team",
- "fieldname": "section_break2",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Team",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "sales_team",
+ "fieldname": "section_break2",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Team",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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_team",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Team1",
- "no_copy": 0,
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Team1",
+ "no_copy": 0,
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "depends_on": "eval:doc.docstatus<2",
- "fieldname": "recurring_invoice",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring",
- "no_copy": 0,
- "options": "icon-time",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "is_recurring",
+ "depends_on": "eval:doc.docstatus<2",
+ "fieldname": "recurring_invoice",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring",
+ "no_copy": 0,
+ "options": "icon-time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break11",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break11",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Recurring",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.docstatus<2",
+ "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
+ "fieldname": "is_recurring",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Recurring",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Select the period when the invoice will be generated automatically",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Type",
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Select the period when the invoice will be generated automatically",
+ "fieldname": "recurring_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Type",
+ "no_copy": 1,
+ "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Start date of current invoice's period",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "From Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Start date of current invoice's period",
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "From Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "End date of current invoice's period",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "To Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "End date of current invoice's period",
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "To Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Repeat on Day of Month",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
+ "fieldname": "repeat_on_day_of_month",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Repeat on Day of Month",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which recurring invoice will be stop",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "End Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which recurring invoice will be stop",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "End Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break12",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.\n",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Next Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which next invoice will be generated. It is generated on submit.\n",
+ "fieldname": "next_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Next Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Id",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
+ "fieldname": "recurring_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Id",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Notification Email Address",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
+ "fieldname": "notification_email_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Notification Email Address",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.is_recurring==1",
- "fieldname": "recurring_print_format",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Print Format",
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "fieldname": "recurring_print_format",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Print Format",
+ "no_copy": 0,
+ "options": "Print Format",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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": "against_income_account",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Against Income Account",
- "no_copy": 1,
- "oldfieldname": "against_income_account",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "against_income_account",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Against Income Account",
+ "no_copy": 1,
+ "oldfieldname": "against_income_account",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-file-text",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "modified": "2015-09-11 12:21:06.545927",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Sales Invoice",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-file-text",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "modified": "2015-09-23 09:52:09.675668",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "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
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Customer",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Accounts Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 1
}
- ],
- "read_only": 0,
- "read_only_onload": 1,
- "search_fields": "posting_date, due_date, customer, fiscal_year, base_grand_total, outstanding_amount",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ],
+ "read_only": 0,
+ "read_only_onload": 1,
+ "search_fields": "posting_date, due_date, customer, fiscal_year, base_grand_total, outstanding_amount",
+ "sort_field": "modified",
+ "sort_order": "DESC",
"title_field": "title"
-}
+}
\ 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 2e85e26c74..fb46c42010 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -2245,7 +2245,7 @@
"unique": 0
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "sales_team",
@@ -2553,7 +2553,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-11 12:19:42.436344",
+ "modified": "2015-09-23 09:19:38.778717",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_team/sales_team.json b/erpnext/selling/doctype/sales_team/sales_team.json
index 1747d2ed92..8590709efc 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.json
+++ b/erpnext/selling/doctype/sales_team/sales_team.json
@@ -8,7 +8,7 @@
"doctype": "DocType",
"fields": [
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "sales_person",
@@ -34,7 +34,7 @@
"width": "200px"
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "contact_no",
@@ -79,7 +79,7 @@
"unique": 0
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "allocated_percentage",
@@ -104,7 +104,7 @@
"width": "100px"
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "allocated_amount",
@@ -130,7 +130,7 @@
"width": "120px"
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "incentives",
@@ -185,7 +185,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2015-08-13 16:30:24.146848",
+ "modified": "2015-09-23 09:50:26.923187",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Team",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index f65e74a83e..b2a893e033 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -2405,7 +2405,7 @@
"unique": 0
},
{
- "allow_on_submit": 0,
+ "allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"fieldname": "sales_team",
@@ -2438,7 +2438,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
- "modified": "2015-09-11 12:20:00.264753",
+ "modified": "2015-09-23 09:54:33.751001",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
From c6e4b5978d15aa066d0499e934551885dd12a5cd Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 24 Sep 2015 11:32:31 +0530
Subject: [PATCH 49/52] [fix] Sales Order - get_query fix
---
erpnext/projects/doctype/project/project.js | 12 +-
.../doctype/sales_order/sales_order.json | 4938 ++++++++---------
2 files changed, 2478 insertions(+), 2472 deletions(-)
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 8999f85cdb..8c143478d3 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -59,9 +59,15 @@ cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
}
cur_frm.fields_dict['sales_order'].get_query = function(doc) {
+ var filters = {
+ 'project_name': ["in", doc.__islocal ? [""] : [doc.name, ""]]
+ };
+
+ if (doc.customer) {
+ filters["customer"] = doc.customer;
+ }
+
return {
- filters:{
- 'project_name': doc.name
- }
+ filters: filters
}
}
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index fb46c42010..1baf140c6a 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1,2709 +1,2709 @@
{
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "creation": "2013-06-18 12:39:59",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Document",
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2013-06-18 12:39:59",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Document",
"fields": [
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "options": "icon-user",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "options": "icon-user",
+ "permlevel": 0,
+ "print_hide": 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": "column_break0",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 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": "column_break0",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "default": "{customer_name}",
- "fieldname": "title",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Title",
- "no_copy": 1,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "{customer_name}",
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Title",
+ "no_copy": 1,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SO-",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SO-",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 1,
- "collapsible": 0,
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer",
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 1,
+ "collapsible": 0,
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer Name",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer Name",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Address",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Address",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Mobile No",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Mobile No",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Email",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Email",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Sales",
- "fieldname": "order_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Order Type",
- "no_copy": 0,
- "oldfieldname": "order_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance\nShopping Cart",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Sales",
+ "fieldname": "order_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Order Type",
+ "no_copy": 0,
+ "oldfieldname": "order_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance\nShopping Cart",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 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": "column_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "amended_from",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 1,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "options": "Sales Order",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 1,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "default": "Today",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Date",
+ "no_copy": 1,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "160px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.order_type == 'Sales'",
- "fieldname": "delivery_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Delivery Date",
- "no_copy": 0,
- "oldfieldname": "delivery_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.order_type == 'Sales'",
+ "fieldname": "delivery_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Delivery Date",
+ "no_copy": 1,
+ "oldfieldname": "delivery_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "160px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "po_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer's Purchase Order",
- "no_copy": 0,
- "oldfieldname": "po_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "po_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer's Purchase Order",
+ "no_copy": 0,
+ "oldfieldname": "po_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.po_no",
- "description": "",
- "fieldname": "po_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Customer's Purchase Order Date",
- "no_copy": 0,
- "oldfieldname": "po_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 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,
+ "depends_on": "eval:doc.po_no",
+ "description": "",
+ "fieldname": "po_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Customer's Purchase Order Date",
+ "no_copy": 0,
+ "oldfieldname": "po_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Shipping Address Name",
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Shipping Address Name",
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Address",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Address",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "currency_and_price_list",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Currency and Price List",
- "no_copy": 0,
- "options": "icon-tag",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "currency_and_price_list",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Currency and Price List",
+ "no_copy": 0,
+ "options": "icon-tag",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "currency",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Currency",
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Currency",
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Rate at which customer's currency is converted to company's base currency",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Exchange Rate",
- "no_copy": 0,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "precision": "9",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Rate at which customer's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Exchange Rate",
+ "no_copy": 0,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "precision": "9",
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "column_break2",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "selling_price_list",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List",
- "no_copy": 0,
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List",
+ "no_copy": 0,
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Currency",
- "no_copy": 0,
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Currency",
+ "no_copy": 0,
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Rate at which Price list currency is converted to company's base currency",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Price List Exchange Rate",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "9",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Rate at which Price list currency is converted to company's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Price List Exchange Rate",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "9",
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Ignore Pricing Rule",
- "no_copy": 1,
- "permlevel": 1,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Ignore Pricing Rule",
+ "no_copy": 1,
+ "permlevel": 1,
+ "print_hide": 1,
+ "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": "items_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Items",
- "no_copy": 0,
- "oldfieldname": "sales_order_details",
- "oldfieldtype": "Table",
- "options": "Sales Order Item",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Items",
+ "no_copy": 0,
+ "oldfieldname": "sales_order_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Order Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "section_break_31",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_31",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "column_break_33a",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_33a",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "base_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total (Company Currency)",
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total (Company Currency)",
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_net_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_net_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_33",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Net Total",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Net Total",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "taxes_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 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": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Template",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Template",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break_38",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "shipping_rule",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Shipping Rule",
- "no_copy": 0,
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Shipping Rule",
+ "no_copy": 0,
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "section_break_40",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "taxes",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "taxes",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "print_hide": 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": "other_charges_calculation",
- "fieldtype": "HTML",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Taxes and Charges Calculation",
- "no_copy": 0,
- "oldfieldtype": "HTML",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Taxes and Charges Calculation",
+ "no_copy": 0,
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "section_break_43",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "base_total_taxes_and_charges",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Taxes and Charges (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Taxes and Charges (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_46",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_46",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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": "total_taxes_and_charges",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Taxes and Charges",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Taxes and Charges",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "discount_amount",
- "fieldname": "section_break_48",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "discount_amount",
+ "fieldname": "section_break_48",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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,
- "default": "Grand Total",
- "fieldname": "apply_discount_on",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Apply Additional Discount On",
- "no_copy": 0,
- "options": "\nGrand Total\nNet Total",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Grand Total",
+ "fieldname": "apply_discount_on",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Apply Additional Discount On",
+ "no_copy": 0,
+ "options": "\nGrand Total\nNet Total",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "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": "column_break_50",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_50",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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": "discount_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount Amount",
- "no_copy": 0,
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount Amount",
+ "no_copy": 0,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_discount_amount",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Additional Discount Amount (Company Currency)",
- "no_copy": 0,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Additional Discount Amount (Company Currency)",
+ "no_copy": 0,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "base_grand_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Grand Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_grand_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "base_rounded_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rounded Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "base_rounded_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rounded Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "In Words will be visible once you save the Sales Order.",
- "fieldname": "base_in_words",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "In Words (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "In Words will be visible once you save the Sales Order.",
+ "fieldname": "base_in_words",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "In Words (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "200px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "grand_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rounded Total",
- "no_copy": 0,
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rounded Total",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "in_words",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "In Words",
- "no_copy": 0,
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "In Words",
+ "no_copy": 0,
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "200px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "advance_paid",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Advance Paid",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "advance_paid",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Advance Paid",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "packed_items",
- "description": "",
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Packing List",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-suitcase",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "packed_items",
+ "description": "",
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Packing List",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "packed_items",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Packed Items",
- "no_copy": 0,
- "oldfieldname": "packing_details",
- "oldfieldtype": "Table",
- "options": "Packed Item",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "packed_items",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Packed Items",
+ "no_copy": 0,
+ "oldfieldname": "packing_details",
+ "oldfieldtype": "Table",
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "terms",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms and Conditions",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "terms",
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms and Conditions",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "print_hide": 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": "tc_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms",
- "no_copy": 0,
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms",
+ "no_copy": 0,
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "terms",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Terms and Conditions Details",
- "no_copy": 0,
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Terms and Conditions Details",
+ "no_copy": 0,
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "print_hide": 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": 1,
- "depends_on": "customer",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Contact Details",
- "no_copy": 0,
- "options": "icon-bullhorn",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "depends_on": "customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Contact Details",
+ "no_copy": 0,
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "print_hide": 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": "col_break45",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "col_break45",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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,
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Territory",
- "no_copy": 0,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Territory",
+ "no_copy": 0,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Group",
- "no_copy": 0,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Group",
+ "no_copy": 0,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "col_break46",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 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": "col_break46",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "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": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Address",
- "no_copy": 0,
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Address",
+ "no_copy": 0,
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Contact Person",
- "no_copy": 0,
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Contact Person",
+ "no_copy": 0,
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "project_name",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "More Information",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "project_name",
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "More Information",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "description": "Track this Sales Order against any Project",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Project Name",
- "no_copy": 0,
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "description": "Track this Sales Order against any Project",
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "no_copy": 0,
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_77",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_77",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 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": "source",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Source",
- "no_copy": 0,
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Source",
+ "no_copy": 0,
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.source == 'Campaign'",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Campaign",
- "no_copy": 0,
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Campaign",
+ "no_copy": 0,
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "printing_details",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Printing Details",
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "printing_details",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Printing Details",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Letter Head",
- "no_copy": 0,
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Letter Head",
+ "no_copy": 0,
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break4",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "fieldname": "section_break_78",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Billing and Delivery Status",
- "no_copy": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "fieldname": "section_break_78",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing and Delivery Status",
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "default": "Draft",
- "fieldname": "status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nCancelled",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "delivery_status",
- "fieldtype": "Select",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivery Status",
- "no_copy": 1,
- "options": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "delivery_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivery Status",
+ "no_copy": 1,
+ "options": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials delivered against this Sales Order",
- "fieldname": "per_delivered",
- "fieldtype": "Percent",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "% Delivered",
- "no_copy": 1,
- "oldfieldname": "per_delivered",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials delivered against this Sales Order",
+ "fieldname": "per_delivered",
+ "fieldtype": "Percent",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "% Delivered",
+ "no_copy": 1,
+ "oldfieldname": "per_delivered",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break_81",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break_81",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 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,
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials billed against this Sales Order",
- "fieldname": "per_billed",
- "fieldtype": "Percent",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "% Amount Billed",
- "no_copy": 1,
- "oldfieldname": "per_billed",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials billed against this Sales Order",
+ "fieldname": "per_billed",
+ "fieldtype": "Percent",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "% Amount Billed",
+ "no_copy": 1,
+ "oldfieldname": "per_billed",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "billing_status",
- "fieldtype": "Select",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Billing Status",
- "no_copy": 1,
- "options": "Not Billed\nFully Billed\nPartly Billed\nClosed",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "billing_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Billing Status",
+ "no_copy": 1,
+ "options": "Not Billed\nFully Billed\nPartly Billed\nClosed",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "commission_rate",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Commission",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "commission_rate",
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Commission",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "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_partner",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Sales Partner",
- "no_copy": 0,
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1,
- "set_only_once": 0,
- "unique": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Sales Partner",
+ "no_copy": 0,
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1,
+ "set_only_once": 0,
+ "unique": 0,
"width": "150px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "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": "column_break7",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "commission_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Commission Rate",
- "no_copy": 0,
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "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": "commission_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Commission Rate",
+ "no_copy": 0,
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0,
"width": "100px"
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "total_commission",
- "fieldtype": "Currency",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Total Commission",
- "no_copy": 0,
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Total Commission",
+ "no_copy": 0,
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "sales_team",
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Team",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "sales_team",
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Team",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Team1",
- "no_copy": 0,
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Team1",
+ "no_copy": 0,
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 1,
- "collapsible_depends_on": "is_recurring",
- "fieldname": "recurring_order",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Order",
- "no_copy": 0,
- "options": "icon-time",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 1,
+ "collapsible_depends_on": "is_recurring",
+ "fieldname": "recurring_order",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Order",
+ "no_copy": 0,
+ "options": "icon-time",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.docstatus<2",
- "description": "Check if recurring order, uncheck to stop recurring or put proper End Date",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Is Recurring",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.docstatus<2",
+ "description": "Check if recurring order, uncheck to stop recurring or put proper End Date",
+ "fieldname": "is_recurring",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Is Recurring",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Select the period when the invoice will be generated automatically",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Type",
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Select the period when the invoice will be generated automatically",
+ "fieldname": "recurring_type",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Type",
+ "no_copy": 1,
+ "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Start date of current order's period",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "From Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Start date of current order's period",
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "From Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "End date of current order's period",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "To Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "End date of current order's period",
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "To Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc ",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Repeat on Day of Month",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The day of the month on which auto order will be generated e.g. 05, 28 etc ",
+ "fieldname": "repeat_on_day_of_month",
+ "fieldtype": "Int",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Repeat on Day of Month",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which recurring order will be stop",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "End Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which recurring order will be stop",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "End Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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": "column_break83",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "",
- "no_copy": 0,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "column_break83",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Next Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which next invoice will be generated. It is generated on submit.",
+ "fieldname": "next_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Next Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Id",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "fieldname": "recurring_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Id",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
- },
+ },
{
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Enter email id separated by commas, order will be mailed automatically on particular date",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Notification Email Address",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Enter email id separated by commas, order will be mailed automatically on particular date",
+ "fieldname": "notification_email_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Notification Email Address",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "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,
- "depends_on": "eval:doc.is_recurring==1",
- "fieldname": "recurring_print_format",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Recurring Print Format",
- "no_copy": 0,
- "options": "Print Format",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.is_recurring==1",
+ "fieldname": "recurring_print_format",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Recurring Print Format",
+ "no_copy": 0,
+ "options": "Print Format",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
"unique": 0
}
- ],
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-file-text",
- "idx": 1,
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "modified": "2015-09-23 09:19:38.778717",
- "modified_by": "Administrator",
- "module": "Selling",
- "name": "Sales Order",
- "owner": "Administrator",
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-file-text",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "modified": "2015-09-23 10:19:38.778717",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "set_user_permissions": 1,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "if_owner": 0,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "set_user_permissions": 1,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "set_user_permissions": 0,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "Accounts User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "Customer",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Customer",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 1,
- "role": "Stock User",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Stock User",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 1,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Sales Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
+ "amend": 0,
+ "apply_user_permissions": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 0,
+ "export": 0,
+ "if_owner": 0,
+ "import": 0,
+ "permlevel": 1,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Sales Manager",
+ "set_user_permissions": 0,
+ "share": 0,
+ "submit": 0,
"write": 1
}
- ],
- "read_only": 0,
- "read_only_onload": 1,
- "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ],
+ "read_only": 0,
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company",
+ "sort_field": "modified",
+ "sort_order": "DESC",
"title_field": "title"
-}
\ No newline at end of file
+}
From b126ba0132ff8f0a36b7c639b6e5eb075b4a5da1 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 24 Sep 2015 13:05:40 +0530
Subject: [PATCH 50/52] [change-log]
---
erpnext/change_log/v6/v6_3_0.md | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 erpnext/change_log/v6/v6_3_0.md
diff --git a/erpnext/change_log/v6/v6_3_0.md b/erpnext/change_log/v6/v6_3_0.md
new file mode 100644
index 0000000000..8d7849c42e
--- /dev/null
+++ b/erpnext/change_log/v6/v6_3_0.md
@@ -0,0 +1,8 @@
+- **Tax Rule:** Define rules to automatically select a Tax Template based on Customer, Supplier, Billing Address or Shipping Address
+- Changes to **Shopping Cart:**
+ - The prices will be based on only a single Price List defined in Shopping Cart Settings. Essentially, it means that your Shopping Cart will be available only in a single currency.
+ - Shipping Rule will be defined per Country, instead of Territory.
+ - Taxes will be applied based on the new Tax Rule system, instead of Territory.
+ - **Important Note:** Your Shopping Cart Settings have been disabled. The new changes require you to review your Price List, Tax Rules and Shipping Rule, update the settings, and then enable Shopping Cart again.
+- Enhancements in Customer Portal user interface
+- Sales Team is now editable after submission of Sales Order, Sales Invoice and Delivery Note
From c020e42d20ed4e9ee1e7c01d726d589c59e47562 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 24 Sep 2015 13:08:35 +0530
Subject: [PATCH 51/52] [fix] [patch] convert applicable territory
---
erpnext/patches/v6_3/convert_applicable_territory.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/erpnext/patches/v6_3/convert_applicable_territory.py b/erpnext/patches/v6_3/convert_applicable_territory.py
index 3054ecc879..483bf8a595 100644
--- a/erpnext/patches/v6_3/convert_applicable_territory.py
+++ b/erpnext/patches/v6_3/convert_applicable_territory.py
@@ -5,6 +5,8 @@ def execute():
countries = frappe.db.sql_list("select name from tabCountry")
for doctype in ("Price List", "Shipping Rule"):
+ frappe.reload_doctype(doctype)
+
for at in frappe.db.sql("""select name, parent, territory from `tabApplicable Territory` where
parenttype = %s """, doctype, as_dict=True):
if at.territory in countries:
From ab57e52cbdcdc267cc0508aac8710a6ed36f42b2 Mon Sep 17 00:00:00 2001
From: Anand Doshi
Date: Thu, 24 Sep 2015 15:05:35 +0600
Subject: [PATCH 52/52] bumped to version 6.3.0
---
erpnext/__version__.py | 2 +-
erpnext/hooks.py | 2 +-
setup.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index 4c76240945..3a54c17e0f 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '6.2.0'
+__version__ = '6.3.0'
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 96f70a866f..f6daf77072 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -29,7 +29,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "6.2.0"
+app_version = "6.3.0"
github_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"
diff --git a/setup.py b/setup.py
index 4fdee0555a..0b523227c7 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = "6.2.0"
+version = "6.3.0"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()