-
{{ _("Item Details") }}
{{ _("Qty, Amount") }}
-
-
{{ _("Shipping Address") }}
- - -Billing Address
- - --
{{ _("Cart is Empty") }}
+ {% endif %} +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/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..bfdb041867 100644
--- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
+++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
@@ -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",
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_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);
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/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/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/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/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/sales_taxes_and_charges_template/test_records.json b/erpnext/accounts/doctype/sales_taxes_and_charges_template/test_records.json
index 656d29c461..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,13 +126,76 @@
"rate": 4
}
],
- "title": "_Test Sales Taxes and Charges Template - Rest of the World",
- "territories": [
+ "title": "_Test Sales Taxes and Charges Template - Rest of the World"
+ },
+ {
+ "company": "_Test Company",
+ "doctype": "Sales Taxes and Charges Template",
+ "taxes": [
{
- "doctype": "Applicable Territory",
- "parentfield": "territories",
- "territory": "_Test Territory Rest Of The World"
+ "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"
+ },
+ {
+ "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"
+ },
+ {
+ "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
+ }]
+ },
+ {
+ "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
+ }]
}
]
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 97828d6f1b..1c5d979dd4 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json
@@ -1,388 +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": "column_break_2",
- "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": "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,
- "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,
- "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,
+ "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,
- "description": "Specify a list of Territories, for which, this Shipping Rule 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,
+ "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,
- "fieldname": "column_break_8",
- "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,
+ "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,
- "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,
+ "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": "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,
+ "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": "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": "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": "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": "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-07 15:51:26",
- "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": 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": "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": 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": "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 dbd121a45e..80e4fb7415 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
@@ -22,6 +22,12 @@ class ShippingRule(Document):
self.sort_shipping_rule_conditions()
self.validate_overlapping_shipping_rule_conditions()
+ 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/setup/doctype/applicable_territory/__init__.py b/erpnext/accounts/doctype/shipping_rule_country/__init__.py
similarity index 100%
rename from erpnext/setup/doctype/applicable_territory/__init__.py
rename to erpnext/accounts/doctype/shipping_rule_country/__init__.py
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
similarity index 66%
rename from erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json
rename to erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
index e15dcab5af..90fe3d3dd3 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_taxes_and_charges_master/shopping_cart_taxes_and_charges_master.json
+++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.json
@@ -2,25 +2,27 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
- "creation": "2013-06-20 16:57:03",
+ "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": "sales_taxes_and_charges_master",
+ "fieldname": "country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
- "label": "Tax Master",
+ "label": "Country",
"no_copy": 0,
- "options": "Sales Taxes and Charges Template",
+ "options": "Country",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -32,18 +34,20 @@
],
"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": "2015-09-17 06:43:22.767534",
"modified_by": "Administrator",
- "module": "Shopping Cart",
- "name": "Shopping Cart Taxes and Charges Master",
+ "module": "Accounts",
+ "name": "Shipping Rule Country",
+ "name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 0
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.py b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
similarity index 52%
rename from erpnext/setup/doctype/applicable_territory/applicable_territory.py
rename to erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
index 5e0ab4092a..b9646cfc29 100644
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.py
+++ b/erpnext/accounts/doctype/shipping_rule_country/shipping_rule_country.py
@@ -1,12 +1,10 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# MIT License. See license.txt
-
+# -*- 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 ApplicableTerritory(Document):
- pass
\ No newline at end of file
+class ShippingRuleCountry(Document):
+ pass
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_price_list/__init__.py b/erpnext/accounts/doctype/tax_rule/__init__.py
similarity index 100%
rename from erpnext/shopping_cart/doctype/shopping_cart_price_list/__init__.py
rename to erpnext/accounts/doctype/tax_rule/__init__.py
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..4b059dc564
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.js
@@ -0,0 +1,60 @@
+// 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" );
+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",
+ 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
new file mode 100644
index 0000000000..60011dd9a3
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.json
@@ -0,0 +1,615 @@
+{
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "TR.####",
+ "creation": "2015-08-07 02:33:52.670866",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Setup",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 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,
+ "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,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 0,
+ "depends_on": "eval:doc.tax_type==\"Sales\"",
+ "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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "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,
+ "collapsible": 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,
+ "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,
+ "collapsible": 0,
+ "depends_on": "eval:doc.tax_type==\"Sales\"",
+ "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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "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,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "bold": 0,
+ "collapsible": 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,
+ "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,
+ "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": "1",
+ "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,
+ "bold": 0,
+ "collapsible": 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,
+ "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,
+ "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-09-15 12:29:34.435839",
+ "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..bcbd5595d4
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py
@@ -0,0 +1,140 @@
+# -*- 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 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 __setup__(self):
+ self.flags.ignore_these_exceptions_in_test = [ConflictingTaxRule]
+
+ 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."))
+
+ 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_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
+ }
+
+ 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)
+
+ if tax_rule:
+ if tax_rule[0].priority == self.priority:
+ frappe.throw(_("Tax Rule Conflicts with {0}".format(tax_rule[0].name)), ConflictingTaxRule)
+
+@frappe.whitelist()
+def get_party_details(party, party_type, args=None):
+ out = {}
+ 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", "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):
+ """Get matching tax rule"""
+ args = frappe._dict(args)
+ conditions = []
+
+ for key, value in args.iteritems():
+ 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)
+
+ 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
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..0913fba4fb
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/test_records.json
@@ -0,0 +1,28 @@
+[
+ {
+ "doctype": "Tax Rule",
+ "tax_type" : "Sales",
+ "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",
+ "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_state": "Test State",
+ "shipping_country": "India",
+ "priority": 2,
+ "company": "_Test Company"
+ }
+]
\ 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
new file mode 100644
index 0000000000..3e175fabf7
--- /dev/null
+++ b/erpnext/accounts/doctype/tax_rule/test_tax_rule.py
@@ -0,0 +1,141 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+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')
+
+class TestTaxRule(unittest.TestCase):
+ def setUp(self):
+ 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",
+ sales_tax_template = "_Test Sales Taxes and Charges Template")
+ self.assertRaises(IncorrectCustomerGroup, tax_rule.save)
+
+ def test_supplier_type(self):
+ 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)
+
+ 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()
+
+ 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", billing_state = "Test State",
+ sales_tax_template = "_Test Sales Taxes and Charges Template", save=1)
+
+ 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", "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):
+ 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")
+
+ 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..baa237e07d 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()]
@@ -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.customer_group, out.supplier_type)
if not out.get("currency"):
out["currency"] = currency
@@ -50,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
@@ -99,11 +98,24 @@ 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)
+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", []))
@@ -111,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
@@ -144,20 +152,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:
@@ -165,8 +164,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:
@@ -174,31 +173,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`.
@@ -240,7 +239,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):
@@ -248,21 +247,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"))
@@ -274,4 +273,31 @@ 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)))
+
+@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.lower(): party,
+ "customer_group": customer_group,
+ "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)
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/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
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",
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"):
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
index 9282be286f..51fb0a5889 100644
--- a/erpnext/controllers/website_list_for_contact.py
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -21,37 +21,57 @@ 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))
+
+ 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)
return result
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 54f81b89d5..f6daf77072 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."
@@ -27,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"
@@ -62,11 +64,26 @@ website_context = {
website_route_rules = [
{"from_route": "/orders", "to_route": "Sales Order"},
- {"from_route": "/orders/
\n")
return address_docs
@@ -326,38 +332,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/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 818550e75f..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,112 +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": "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
- },
- {
- "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 +168,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-02-05 05:11:46.714019",
+ "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 8fbf4a430e..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,8 +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_ancestors_of, get_root_of
-from erpnext.utilities.doctype.address.address import get_territory_from_address
class ShoppingCartSetupError(frappe.ValidationError): pass
@@ -19,65 +17,8 @@ class ShoppingCartSettings(Document):
def validate(self):
if self.enabled:
- self.validate_price_lists()
- self.validate_tax_masters()
self.validate_exchange_rates_exist()
- 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 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
- 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)"""
company_currency = frappe.db.get_value("Company", self.company, "default_currency")
@@ -86,7 +27,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
@@ -109,28 +50,9 @@ 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]):
- 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)
def get_tax_master(self, billing_territory):
tax_master = self.get_name_from_territory(billing_territory, "sales_taxes_and_charges_masters",
@@ -140,15 +62,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")
@@ -161,58 +74,7 @@ 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)
-def apply_shopping_cart_settings(quotation, method):
- """Called via a validate hook on Quotation"""
- 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 46cbfdf9ed..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
@@ -11,69 +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 Taxes and Charges Master`""")
- 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_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`""")
-
- 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")
+ 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"):
+ self.assertRaises(ShoppingCartSetupError, cart_settings.validate_tax_rule)
+
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 1873b813be..41f7442b7c 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
+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,24 @@ 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 +74,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 +87,9 @@ 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,41 +97,85 @@ 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)
+ 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()
+ 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.0)
+
+ self.remove_test_quotation(quotation)
+
+ def create_quotation(self):
+ quotation = frappe.new_doc("Quotation")
+
+ values = {
+ "doctype": "Quotation",
+ "quotation_to": "Customer",
+ "order_type": "Shopping Cart",
+ "customer": get_customer(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,
+ "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()
# helper functions
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_territory": "_Test Territory Rest Of The World",
- "default_customer_group": "_Test Customer Group",
- "quotation_series": "_T-Quotation-"
- })
- 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("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"})
+ 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
@@ -153,57 +189,13 @@ 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)
-
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"]
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",
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/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") {
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/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/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/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/setup/doctype/applicable_territory/applicable_territory.json b/erpnext/stock/doctype/price_list_country/price_list_country.json
similarity index 67%
rename from erpnext/setup/doctype/applicable_territory/applicable_territory.json
rename to erpnext/stock/doctype/price_list_country/price_list_country.json
index 6fc549faa6..be02c202cc 100644
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.json
+++ b/erpnext/stock/doctype/price_list_country/price_list_country.json
@@ -2,26 +2,27 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
- "creation": "2013-06-20 12:48:38",
+ "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,
- "description": "",
- "fieldname": "territory",
+ "fieldname": "country",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
- "label": "Territory",
+ "label": "Country",
"no_copy": 0,
- "options": "Territory",
+ "options": "Country",
"permlevel": 0,
+ "precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
@@ -33,18 +34,20 @@
],
"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": "2015-09-17 06:49:51.810318",
"modified_by": "Administrator",
- "module": "Setup",
- "name": "Applicable Territory",
+ "module": "Stock",
+ "name": "Price List Country",
+ "name_case": "",
"owner": "Administrator",
"permissions": [],
"read_only": 0,
- "read_only_onload": 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/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
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 %}
{% } %}
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 }}
+ {{ frappe.get_doc(doc).get_display() }}
%(description)s
\ -at %(formatted_rate)s
\ - = %(formatted_amount)s\ -+ {{ _("Rate") + ': ' + d.get_formatted("rate") }} +
+{{ d.description }}
+