Merge branch 'v5.0' of https://github.com/frappe/erpnext into foreign_currency_calc
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 95bfad5..6f16dcd 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -94,7 +94,7 @@
},
allocated_amount: function() {
- this.calculate_total_advance("Purchase Invoice", "advances");
+ this.calculate_total_advance();
this.frm.refresh_fields();
},
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 4054dd5..98a1a69 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -265,7 +265,7 @@
},
{
"description": "Will be calculated automatically when you enter the details",
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
@@ -281,7 +281,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_import",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"oldfieldname": "net_total_import",
@@ -340,7 +340,7 @@
"read_only": 0
},
{
- "fieldname": "other_charges_added",
+ "fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Company Currency)",
"oldfieldname": "other_charges_added",
@@ -351,7 +351,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted",
+ "fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Company Currency)",
"oldfieldname": "other_charges_deducted",
@@ -362,7 +362,18 @@
"read_only": 1
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges (Company Currency)",
+ "oldfieldname": "total_tax",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"oldfieldname": "grand_total",
@@ -374,7 +385,7 @@
},
{
"description": "In Words will be visible once you save the Purchase Invoice.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -393,7 +404,7 @@
"width": "50%"
},
{
- "fieldname": "other_charges_added_import",
+ "fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"oldfieldname": "other_charges_added_import",
@@ -404,7 +415,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted_import",
+ "fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"oldfieldname": "other_charges_deducted_import",
@@ -415,7 +426,15 @@
"read_only": 1
},
{
- "fieldname": "grand_total_import",
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -427,7 +446,7 @@
"read_only": 1
},
{
- "fieldname": "in_words_import",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_import",
@@ -462,17 +481,6 @@
"read_only": 1
},
{
- "fieldname": "total_tax",
- "fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
- "oldfieldname": "total_tax",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1
- },
- {
"fieldname": "outstanding_amount",
"fieldtype": "Currency",
"in_filter": 1,
@@ -880,7 +888,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:43.312905",
+ "modified": "2015-02-11 16:56:27.871736",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index fac9442..5a1e258 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -167,7 +167,7 @@
},
allocated_amount: function() {
- this.calculate_total_advance("Sales Invoice", "advances");
+ this.calculate_total_advance();
this.frm.refresh_fields();
},
@@ -176,8 +176,7 @@
frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]);
// this will make outstanding amount 0
this.frm.set_value("write_off_amount",
- flt(this.frm.doc.grand_total - this.frm.doc.paid_amount,
- precision("write_off_amount"))
+ flt(this.frm.doc.grand_total - this.frm.doc.paid_amount, precision("write_off_amount"))
);
}
@@ -249,7 +248,7 @@
if(doc.is_pos) {
return cur_frm.call({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account",
- args: {
+ args: {
"mode_of_payment": doc.mode_of_payment,
"company": doc.company
},
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 7ceab70..1fbc772 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -332,7 +332,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
@@ -349,7 +349,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_export",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"options": "currency",
@@ -423,7 +423,7 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_total_export",
+ "fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges",
"options": "currency",
@@ -432,7 +432,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_total",
+ "fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
"label": "Total Taxes and Charges (Company Currency)",
"oldfieldname": "other_charges_total",
@@ -476,7 +476,7 @@
"read_only": 0
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"in_filter": 1,
"label": "Grand Total (Company Currency)",
@@ -490,7 +490,7 @@
"search_index": 0
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
@@ -502,7 +502,7 @@
},
{
"description": "In Words will be visible once you save the Sales Invoice.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -545,7 +545,7 @@
"width": "50%"
},
{
- "fieldname": "grand_total_export",
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -558,7 +558,7 @@
"reqd": 1
},
{
- "fieldname": "rounded_total_export",
+ "fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"oldfieldname": "rounded_total_export",
@@ -569,7 +569,7 @@
"read_only": 1
},
{
- "fieldname": "in_words_export",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_export",
@@ -1202,7 +1202,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:45.330358",
+ "modified": "2015-02-11 15:57:57.399512",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 67c11a7..ff1d4f5 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -2,8 +2,9 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.buying");
-frappe.require("assets/erpnext/js/transaction.js");
-{% include "public/js/controllers/accounts.js" %}
+frappe.require("assets/erpnext/js/controllers/transaction.js");
+
+{% include "public/js/controllers/accounts.js" %};
cur_frm.email_field = "contact_email";
@@ -171,27 +172,6 @@
}
},
- calculate_taxes_and_totals: function() {
- this._super();
- this.calculate_total_advance("Purchase Invoice", "advances");
- this.frm.refresh_fields();
- },
-
- calculate_item_values: function() {
- var me = this;
-
- $.each(this.frm.doc["items"] || [], function(i, item) {
- frappe.model.round_floats_in(item);
- item.amount = flt(item.rate * item.qty, precision("amount", item));
- item.item_tax_amount = 0.0;
-
- me._set_in_company_currency(item, "price_list_rate", "base_price_list_rate");
- me._set_in_company_currency(item, "rate", "base_rate");
- me._set_in_company_currency(item, "amount", "base_amount");
- });
-
- },
-
calculate_net_total: function() {
var me = this;
@@ -250,27 +230,6 @@
this.frm.doc.conversion_rate, precision("other_charges_deducted_import"));
},
- _cleanup: function() {
- this._super();
- this.frm.doc.in_words = this.frm.doc.in_words_import = "";
-
- if(this.frm.doc["items"].length) {
- if(!frappe.meta.get_docfield(this.frm.doc["items"][0].doctype, "item_tax_amount", this.frm.doctype)) {
- $.each(this.frm.doc["items"] || [], function(i, item) {
- delete item["item_tax_amount"];
- });
- }
- }
-
- if(this.frm.doc["taxes"].length) {
- if(!frappe.meta.get_docfield(this.frm.doc["taxes"][0].doctype, "tax_amount_after_discount_amount", this.frm.doctype)) {
- $.each(this.frm.doc["taxes"] || [], function(i, tax) {
- delete tax["tax_amount_after_discount_amount"];
- });
- }
- }
- },
-
calculate_outstanding_amount: function() {
if(this.frm.doc.doctype == "Purchase Invoice" && this.frm.doc.docstatus < 2) {
frappe.model.round_floats_in(this.frm.doc, ["grand_total", "total_advance", "write_off_amount"]);
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 4fb74ad..28c8693 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -230,7 +230,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"no_copy": 1,
@@ -248,7 +248,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_import",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"no_copy": 0,
@@ -316,7 +316,7 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_added",
+ "fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Company Currency)",
"no_copy": 0,
@@ -328,7 +328,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted",
+ "fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Company Currency)",
"no_copy": 0,
@@ -340,9 +340,9 @@
"read_only": 1
},
{
- "fieldname": "total_tax",
+ "fieldname": "base_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
+ "label": "Total Taxes and Charges (Company Currency)",
"no_copy": 1,
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
@@ -352,7 +352,7 @@
"read_only": 1
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"no_copy": 1,
@@ -365,7 +365,7 @@
},
{
"description": "In Words will be visible once you save the Purchase Order.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -375,7 +375,7 @@
"read_only": 1
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
@@ -401,7 +401,7 @@
"print_hide": 0
},
{
- "fieldname": "other_charges_added_import",
+ "fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"no_copy": 0,
@@ -414,7 +414,7 @@
"report_hide": 0
},
{
- "fieldname": "other_charges_deducted_import",
+ "fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"no_copy": 0,
@@ -427,7 +427,15 @@
"report_hide": 0
},
{
- "fieldname": "grand_total_import",
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -441,7 +449,7 @@
"report_hide": 0
},
{
- "fieldname": "in_words_import",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_import",
@@ -775,7 +783,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:43.673323",
+ "modified": "2015-02-11 16:13:52.294735",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index ff365cc..b1f0749 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -229,7 +229,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"no_copy": 1,
@@ -247,7 +247,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_import",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"no_copy": 0,
@@ -306,7 +306,7 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_added",
+ "fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Company Currency)",
"no_copy": 0,
@@ -318,7 +318,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted",
+ "fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Company Currency)",
"no_copy": 0,
@@ -330,9 +330,9 @@
"read_only": 1
},
{
- "fieldname": "total_tax",
+ "fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
+ "label": "Total Taxes and Charges (Company Currency)",
"no_copy": 1,
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
@@ -342,7 +342,7 @@
"read_only": 1
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"no_copy": 1,
@@ -354,7 +354,7 @@
"read_only": 1
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
@@ -366,7 +366,7 @@
},
{
"description": "In Words will be visible once you save the Purchase Order.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -383,7 +383,7 @@
"print_hide": 0
},
{
- "fieldname": "other_charges_added_import",
+ "fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"no_copy": 0,
@@ -396,7 +396,7 @@
"report_hide": 0
},
{
- "fieldname": "other_charges_deducted_import",
+ "fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"no_copy": 0,
@@ -409,7 +409,15 @@
"report_hide": 0
},
{
- "fieldname": "grand_total_import",
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -423,7 +431,7 @@
"report_hide": 0
},
{
- "fieldname": "in_words_import",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_import",
@@ -575,7 +583,7 @@
"icon": "icon-shopping-cart",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:47.602292",
+ "modified": "2015-02-11 16:08:30.374140",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/patches/v5_0/rename_total_fields.py b/erpnext/patches/v5_0/rename_total_fields.py
new file mode 100644
index 0000000..946ad21
--- /dev/null
+++ b/erpnext/patches/v5_0/rename_total_fields.py
@@ -0,0 +1,50 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model import rename_field
+from frappe.modules import scrub, get_doctype_module
+
+selling_doctypes = ("Quotation", "Sales Order", "Delivery Note", "Sales Invoice")
+
+selling_doctypes = ("Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice")
+
+selling_renamed_fields = (
+ ("net_total", "base_net_total"),
+ ("net_total_export", "net_total"),
+ ("other_charges_total", "base_total_taxes_and_charges"),
+ ("other_charges_total_export", "total_taxes_and_charges"),
+ ("grand_total", "base_grand_total"),
+ ("grand_total_export", "grand_total"),
+ ("rounded_total", "base_rounded_total"),
+ ("rounded_total_export", "rounded_total"),
+ ("in_words", "base_in_words"),
+ ("in_words_export", "in_words")
+)
+
+buying_renamed_fields = (
+ ("net_total", "base_net_total"),
+ ("net_total_import", "net_total"),
+ ("grand_total", "base_grand_total"),
+ ("grand_total_import", "grand_total"),
+ ("rounded_total", "base_rounded_total"),
+ ("rounded_total_import", "rounded_total"),
+ ("in_words", "base_in_words"),
+ ("in_words_import", "in_words"),
+ ("other_charges_added", "base_taxes_and_charges_added"),
+ ("other_charges_added_import", "taxes_and_charges_added"),
+ ("other_charges_deducted", "base_taxes_and_charges_deducted"),
+ ("other_charges_deducted_import", "taxes_and_charges_deducted"),
+ ("total_tax", "base_total_taxes_and_charges")
+)
+
+def execute():
+ for dt in selling_doctypes:
+ frappe.reload_doc(get_doctype_module(dt), "doctype", scrub(dt))
+
+ for f in selling_renamed_fields:
+ rename_field(dt, f[0], f[1])
+
+ # Added new field "total_taxes_and_charges" in buying cycle, updating value
+ frappe.db.sql("update `tab{0}` set total_taxes_and_charges=round(base_total_taxes_and_charges/conversion_rate), 2")
diff --git a/erpnext/patches/v5_0/replace_renamed_fields_in_custom_script_and_print_formats.py b/erpnext/patches/v5_0/replace_renamed_fields_in_custom_script_and_print_formats.py
new file mode 100644
index 0000000..46bb221
--- /dev/null
+++ b/erpnext/patches/v5_0/replace_renamed_fields_in_custom_script_and_print_formats.py
@@ -0,0 +1,54 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+import re
+
+def execute():
+ # NOTE: sequence is important
+ renamed_fields = get_all_renamed_fields()
+
+ for dt, script_field in (("Custom Script", "script"), ("Print Format", "html")):
+
+ cond1 = " or ".join("""{0} like "%%{1}%%" """.format(script_field, d[0].replace("_", "\\_")) for d in renamed_fields)
+ cond2 = " and standard = 'No'" if dt == "Print Format" else ""
+
+ for name, script in frappe.db.sql("select name, {0} as script from `tab{1}` where ({2}) {3}".format(script_field, dt, cond1, cond2)):
+ update_script(dt, name, script_field, script, renamed_fields)
+
+def get_all_renamed_fields():
+ from erpnext.patches.v5_0.rename_table_fieldnames import rename_map
+
+ renamed_fields = (
+ ("net_total", "base_net_total"),
+ ("net_total_export", "net_total"),
+ ("net_total_import", "net_total"),
+ ("other_charges_total", "base_total_taxes_and_charges"),
+ ("other_charges_total_export", "total_taxes_and_charges"),
+ ("other_charges_added", "base_taxes_and_charges_added"),
+ ("other_charges_added_import", "taxes_and_charges_added"),
+ ("other_charges_deducted", "base_taxes_and_charges_deducted"),
+ ("other_charges_deducted_import", "taxes_and_charges_deducted"),
+ ("total_tax", "base_total_taxes_and_charges"),
+ ("grand_total", "base_grand_total"),
+ ("grand_total_export", "grand_total"),
+ ("grand_total_import", "grand_total"),
+ ("rounded_total", "base_rounded_total"),
+ ("rounded_total_export", "rounded_total"),
+ ("rounded_total_import", "rounded_total"),
+ ("in_words", "base_in_words"),
+ ("in_words_export", "in_words"),
+ ("in_words_import", "in_words")
+ )
+
+ for fields in rename_map.values():
+ renamed_fields += fields
+
+ return renamed_fields
+
+def update_script(dt, name, script_field, script, renamed_fields):
+ for from_field, to_field in renamed_fields:
+ script = re.sub(r"\b{}\b".format(from_field), to_field, script)
+
+ frappe.db.set_value(dt, name, script_field, script)
diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js
new file mode 100644
index 0000000..07d6841
--- /dev/null
+++ b/erpnext/public/js/controllers/taxes_and_totals.js
@@ -0,0 +1,353 @@
+// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+frappe.provide("erpnext");
+frappe.require("assets/erpnext/js/controllers/stock_controller.js");
+
+erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
+ calculate_taxes_and_totals: function(update_paid_amount) {
+ this.discount_amount_applied = false;
+ this._calculate_taxes_and_totals();
+
+ if (frappe.meta.get_docfield(this.frm.doc.doctype, "discount_amount"))
+ this.apply_discount_amount();
+
+ // Advance calculation applicable to Sales /Purchase Invoice
+ if(in_list(["Sales Invoice", "Purchase Invoice"], this.frm.doc.doctype) && this.frm.doc.docstatus < 2) {
+ this.calculate_total_advance(update_paid_amount);
+ }
+
+ // Sales person's commission
+ if(in_list(["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"])) {
+ this.calculate_commission();
+ this.calculate_contribution();
+ }
+
+ this.frm.refresh_fields();
+ },
+
+ _calculate_taxes_and_totals: function() {
+ this.validate_conversion_rate();
+ this.calculate_item_values();
+ this.initialize_taxes();
+ this.determine_exclusive_rate();
+ this.calculate_net_total();
+ this.calculate_taxes();
+ this.calculate_totals();
+ this._cleanup();
+ this.show_item_wise_taxes();
+ },
+
+ calculate_item_values: function() {
+ var me = this;
+
+ if (!this.discount_amount_applied) {
+ $.each(this.frm.doc["items"] || [], function(i, item) {
+ frappe.model.round_floats_in(item);
+ item.amount = flt(item.rate * item.qty, precision("amount", item));
+ item.item_tax_amount = 0.0;
+
+ $.each(["price_list_rate", "rate", "amount"], function(i, f) {
+ item["base_" + f] = flt(item[f] * me.frm.doc.conversion_rate, precision("base_" + f, item));
+ })
+ });
+ }
+ },
+
+ initialize_taxes: function() {
+ var me = this;
+
+ $.each(this.frm.doc["taxes"] || [], function(i, tax) {
+ tax.item_wise_tax_detail = {};
+ tax_fields = ["total", "tax_amount_after_discount_amount",
+ "tax_amount_for_current_item", "grand_total_for_current_item",
+ "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"]
+
+ if (!me.discount_amount_applied)
+ tax_fields.push("tax_amount");
+
+ $.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0 });
+
+ me.validate_on_previous_row(tax);
+ me.validate_inclusive_tax(tax);
+ frappe.model.round_floats_in(tax);
+ });
+ },
+
+ determine_exclusive_rate: function() {
+ if(!in_list(["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"], this.frm.doc.doctype)) return;
+
+ var me = this;
+ $.each(me.frm.doc["items"] || [], function(n, item) {
+ var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
+ var cumulated_tax_fraction = 0.0;
+
+ $.each(me.frm.doc["taxes"] || [], function(i, tax) {
+ tax.tax_fraction_for_current_item = me.get_current_tax_fraction(tax, item_tax_map);
+
+ if(i==0) {
+ tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item;
+ } else {
+ tax.grand_total_fraction_for_current_item =
+ me.frm.doc["taxes"][i-1].grand_total_fraction_for_current_item +
+ tax.tax_fraction_for_current_item;
+ }
+
+ cumulated_tax_fraction += tax.tax_fraction_for_current_item;
+ });
+
+ if(cumulated_tax_fraction && !me.discount_amount_applied) {
+ item.base_amount = flt(
+ (item.amount * me.frm.doc.conversion_rate) / (1 + cumulated_tax_fraction),
+ precision("base_amount", item));
+
+ item.base_rate = flt(item.base_amount / item.qty, precision("base_rate", item));
+
+ if(item.discount_percentage == 100) {
+ item.base_price_list_rate = item.base_rate;
+ item.base_rate = 0.0;
+ } else {
+ item.base_price_list_rate = flt(item.base_rate / (1 - item.discount_percentage / 100.0),
+ precision("base_price_list_rate", item));
+ }
+ }
+ });
+ },
+
+ get_current_tax_fraction: function(tax, item_tax_map) {
+ // Get tax fraction for calculating tax exclusive amount
+ // from tax inclusive amount
+ var current_tax_fraction = 0.0;
+
+ if(cint(tax.included_in_print_rate)) {
+ var tax_rate = this._get_tax_rate(tax, item_tax_map);
+
+ if(tax.charge_type == "On Net Total") {
+ current_tax_fraction = (tax_rate / 100.0);
+
+ } else if(tax.charge_type == "On Previous Row Amount") {
+ current_tax_fraction = (tax_rate / 100.0) *
+ this.frm.doc["taxes"][cint(tax.row_id) - 1].tax_fraction_for_current_item;
+
+ } else if(tax.charge_type == "On Previous Row Total") {
+ current_tax_fraction = (tax_rate / 100.0) *
+ this.frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_fraction_for_current_item;
+ }
+ }
+
+ return current_tax_fraction;
+ },
+
+ _get_tax_rate: function(tax, item_tax_map) {
+ return (keys(item_tax_map).indexOf(tax.account_head) != -1) ?
+ flt(item_tax_map[tax.account_head], precision("rate", tax)) :
+ tax.rate;
+ },
+
+ calculate_taxes: function() {
+ var me = this;
+ var actual_tax_dict = {};
+
+ // maintain actual tax rate based on idx
+ $.each(this.frm.doc["taxes"] || [], function(i, tax) {
+ if (tax.charge_type == "Actual") {
+ actual_tax_dict[tax.idx] = flt(tax.rate, precision("tax_amount", tax));
+ }
+ });
+
+ $.each(this.frm.doc["items"] || [], function(n, item) {
+ var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
+
+ $.each(me.frm.doc["taxes"] || [], function(i, tax) {
+ // tax_amount represents the amount of tax for the current step
+ var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map);
+
+ // Adjust divisional loss to the last item
+ if (tax.charge_type == "Actual") {
+ actual_tax_dict[tax.idx] -= current_tax_amount;
+ if (n == me.frm.doc["items"].length - 1) {
+ current_tax_amount += actual_tax_dict[tax.idx]
+ }
+ }
+
+ // store tax_amount for current item as it will be used for
+ // charge type = 'On Previous Row Amount'
+ tax.tax_amount_for_current_item = current_tax_amount;
+
+ // accumulate tax amount into tax.tax_amount
+ if (!me.discount_amount_applied)
+ tax.tax_amount += current_tax_amount;
+
+ tax.tax_amount_after_discount_amount += current_tax_amount;
+
+ // for buying
+ if(tax.category) {
+ // if just for valuation, do not add the tax amount in total
+ // hence, setting it as 0 for further steps
+ current_tax_amount = (tax.category == "Valuation") ? 0.0 : current_tax_amount;
+
+ current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
+ }
+
+ // Calculate tax.total viz. grand total till that step
+ // note: grand_total_for_current_item contains the contribution of
+ // item's amount, previously applied tax and the current tax on that item
+ if(i==0) {
+ tax.grand_total_for_current_item = flt(item.base_amount + current_tax_amount,
+ precision("total", tax));
+ } else {
+ tax.grand_total_for_current_item =
+ flt(me.frm.doc["taxes"][i-1].grand_total_for_current_item + current_tax_amount,
+ precision("total", tax));
+ }
+
+ // in tax.total, accumulate grand total for each item
+ tax.total += tax.grand_total_for_current_item;
+
+ // set precision in the last item iteration
+ if (n == me.frm.doc["items"].length - 1) {
+ me.round_off_totals(tax);
+
+ // adjust Discount Amount loss in last tax iteration
+ if ((i == me.frm.doc["taxes"].length - 1) && me.discount_amount_applied)
+ me.adjust_discount_amount_loss(tax);
+ }
+ });
+ });
+ },
+
+ _load_item_tax_rate: function(item_tax_rate) {
+ return item_tax_rate ? JSON.parse(item_tax_rate) : {};
+ },
+
+ get_current_tax_amount: function(item, tax, item_tax_map) {
+ var tax_rate = this._get_tax_rate(tax, item_tax_map);
+ var current_tax_amount = 0.0;
+
+ if(tax.charge_type == "Actual") {
+ // distribute the tax amount proportionally to each item row
+ var actual = flt(tax.rate, precision("tax_amount", tax));
+ current_tax_amount = this.frm.doc.net_total ?
+ ((item.base_amount / this.frm.doc.net_total) * actual) : 0.0;
+
+ } else if(tax.charge_type == "On Net Total") {
+ current_tax_amount = (tax_rate / 100.0) * item.base_amount;
+
+ } else if(tax.charge_type == "On Previous Row Amount") {
+ current_tax_amount = (tax_rate / 100.0) *
+ this.frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount_for_current_item;
+
+ } else if(tax.charge_type == "On Previous Row Total") {
+ current_tax_amount = (tax_rate / 100.0) *
+ this.frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_for_current_item;
+ }
+
+ current_tax_amount = flt(current_tax_amount, precision("tax_amount", tax));
+
+ // store tax breakup for each item
+ tax.item_wise_tax_detail[item.item_code || item.item_name] = [tax_rate, current_tax_amount];
+
+ return current_tax_amount;
+ },
+
+ round_off_totals: function(tax) {
+ tax.total = flt(tax.total, precision("total", tax));
+ tax.tax_amount = flt(tax.tax_amount, precision("tax_amount", tax));
+ tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount,
+ precision("tax_amount", tax));
+ },
+
+ adjust_discount_amount_loss: function(tax) {
+ var discount_amount_loss = this.frm.doc.grand_total - flt(this.frm.doc.base_discount_amount) - tax.total;
+ tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
+ discount_amount_loss, precision("tax_amount", tax));
+ tax.total = flt(tax.total + discount_amount_loss, precision("total", tax));
+ },
+
+
+ _cleanup: function() {
+ this.frm.doc.in_words = this.frm.doc.in_words_import = this.frm.doc.in_words_export = "";
+
+ if(this.frm.doc["items"] && this.frm.doc["items"].length) {
+ if(!frappe.meta.get_docfield(this.frm.doc["items"][0].doctype, "item_tax_amount", this.frm.doctype)) {
+ $.each(this.frm.doc["items"] || [], function(i, item) {
+ delete item["item_tax_amount"];
+ });
+ }
+ }
+
+
+ if(this.frm.doc["taxes"] && this.frm.doc["taxes"].length) {
+ var temporary_fields = ["tax_amount_for_current_item", "grand_total_for_current_item",
+ "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"]
+
+ if(!frappe.meta.get_docfield(this.frm.doc["taxes"][0].doctype, "tax_amount_after_discount_amount", this.frm.doctype)) {
+ temporary_fields.push("tax_amount_after_discount_amount");
+ }
+
+ $.each(this.frm.doc["taxes"] || [], function(i, tax) {
+ $.each(temporary_fields, function(i, fieldname) {
+ delete tax[fieldname];
+ });
+
+ tax.item_wise_tax_detail = JSON.stringify(tax.item_wise_tax_detail);
+ });
+ }
+ },
+
+ apply_discount_amount: function() {
+ var me = this;
+ var distributed_amount = 0.0;
+
+ if (this.frm.doc.discount_amount) {
+ this.frm.set_value("base_discount_amount",
+ flt(this.frm.doc.discount_amount * this.frm.doc.conversion_rate, precision("base_discount_amount")))
+
+ var grand_total_for_discount_amount = this.get_grand_total_for_discount_amount();
+ // calculate item amount after Discount Amount
+ if (grand_total_for_discount_amount) {
+ $.each(this.frm.doc["items"] || [], function(i, item) {
+ distributed_amount = flt(me.frm.doc.base_discount_amount) * item.base_amount / grand_total_for_discount_amount;
+ item.base_amount = flt(item.base_amount - distributed_amount, precision("base_amount", item));
+ });
+
+ this.discount_amount_applied = true;
+ this._calculate_taxes_and_totals();
+ }
+ } else {
+ this.frm.set_value("base_discount_amount", 0);
+ }
+ },
+
+ get_grand_total_for_discount_amount: function() {
+ var me = this;
+ var total_actual_tax = 0.0;
+ var actual_taxes_dict = {};
+
+ $.each(this.frm.doc["taxes"] || [], function(i, tax) {
+ if (tax.charge_type == "Actual")
+ actual_taxes_dict[tax.idx] = tax.tax_amount;
+ else if (actual_taxes_dict[tax.row_id] !== null) {
+ actual_tax_amount = flt(actual_taxes_dict[tax.row_id]) * flt(tax.rate) / 100;
+ actual_taxes_dict[tax.idx] = actual_tax_amount;
+ }
+ });
+
+ $.each(actual_taxes_dict, function(key, value) {
+ if (value)
+ total_actual_tax += value;
+ });
+
+ grand_total_for_discount_amount = flt(this.frm.doc.grand_total - total_actual_tax,
+ precision("grand_total"));
+ return grand_total_for_discount_amount;
+ },
+
+ calculate_total_advance: function(update_paid_amount) {
+ this.frm.doc.total_advance = flt(frappe.utils.sum(
+ $.map(this.frm.doc["advances"] || [], function(adv) { return adv.allocated_amount })
+ ), precision("total_advance"));
+
+ this.calculate_outstanding_amount(update_paid_amount);
+ }
+})
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/controllers/transaction.js
similarity index 73%
rename from erpnext/public/js/transaction.js
rename to erpnext/public/js/controllers/transaction.js
index 897fea4..bc72d13 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -2,14 +2,12 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext");
-frappe.require("assets/erpnext/js/controllers/stock_controller.js");
+frappe.require("assets/erpnext/js/controllers/taxes_and_totals.js");
frappe.require("assets/erpnext/js/utils.js");
-
-erpnext.TransactionController = erpnext.stock.StockController.extend({
+erpnext.TransactionController = erpnext.taxes_and_totals.extend({
onload: function() {
var me = this;
- this._super();
if(this.frm.doc.__islocal) {
var today = get_today(),
@@ -471,16 +469,6 @@
}
},
- _load_item_tax_rate: function(item_tax_rate) {
- return item_tax_rate ? JSON.parse(item_tax_rate) : {};
- },
-
- _get_tax_rate: function(tax, item_tax_map) {
- return (keys(item_tax_map).indexOf(tax.account_head) != -1) ?
- flt(item_tax_map[tax.account_head], precision("rate", tax)) :
- tax.rate;
- },
-
get_item_wise_taxes_html: function() {
var item_tax = {};
var tax_accounts = [];
@@ -578,188 +566,6 @@
}
},
- calculate_taxes_and_totals: function() {
- this.discount_amount_applied = false;
- this._calculate_taxes_and_totals();
- if (frappe.meta.get_docfield(this.frm.doc.doctype, "discount_amount"))
- this.apply_discount_amount();
- },
-
- _calculate_taxes_and_totals: function() {
- this.validate_conversion_rate();
- this.calculate_item_values();
- this.initialize_taxes();
- this.determine_exclusive_rate && this.determine_exclusive_rate();
- this.calculate_net_total();
- this.calculate_taxes();
- this.calculate_totals();
- this._cleanup();
- this.show_item_wise_taxes();
- },
-
- initialize_taxes: function() {
- var me = this;
-
- $.each(this.frm.doc["taxes"] || [], function(i, tax) {
- tax.item_wise_tax_detail = {};
- tax_fields = ["total", "tax_amount_after_discount_amount",
- "tax_amount_for_current_item", "grand_total_for_current_item",
- "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"]
-
- if (!me.discount_amount_applied)
- tax_fields.push("tax_amount");
-
- $.each(tax_fields, function(i, fieldname) { tax[fieldname] = 0.0 });
-
- me.validate_on_previous_row(tax);
- me.validate_inclusive_tax(tax);
- frappe.model.round_floats_in(tax);
- });
- },
-
- calculate_taxes: function() {
- var me = this;
- var actual_tax_dict = {};
-
- // maintain actual tax rate based on idx
- $.each(this.frm.doc["taxes"] || [], function(i, tax) {
- if (tax.charge_type == "Actual") {
- actual_tax_dict[tax.idx] = flt(tax.rate, precision("tax_amount", tax));
- }
- });
-
- $.each(this.frm.doc["items"] || [], function(n, item) {
- var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
-
- $.each(me.frm.doc["taxes"] || [], function(i, tax) {
- // tax_amount represents the amount of tax for the current step
- var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map);
-
- // Adjust divisional loss to the last item
- if (tax.charge_type == "Actual") {
- actual_tax_dict[tax.idx] -= current_tax_amount;
- if (n == me.frm.doc["items"].length - 1) {
- current_tax_amount += actual_tax_dict[tax.idx]
- }
- }
-
- // store tax_amount for current item as it will be used for
- // charge type = 'On Previous Row Amount'
- tax.tax_amount_for_current_item = current_tax_amount;
-
- // accumulate tax amount into tax.tax_amount
- if (!me.discount_amount_applied)
- tax.tax_amount += current_tax_amount;
-
- tax.tax_amount_after_discount_amount += current_tax_amount;
-
- // for buying
- if(tax.category) {
- // if just for valuation, do not add the tax amount in total
- // hence, setting it as 0 for further steps
- current_tax_amount = (tax.category == "Valuation") ? 0.0 : current_tax_amount;
-
- current_tax_amount *= (tax.add_deduct_tax == "Deduct") ? -1.0 : 1.0;
- }
-
- // Calculate tax.total viz. grand total till that step
- // note: grand_total_for_current_item contains the contribution of
- // item's amount, previously applied tax and the current tax on that item
- if(i==0) {
- tax.grand_total_for_current_item = flt(item.base_amount + current_tax_amount,
- precision("total", tax));
- } else {
- tax.grand_total_for_current_item =
- flt(me.frm.doc["taxes"][i-1].grand_total_for_current_item + current_tax_amount,
- precision("total", tax));
- }
-
- // in tax.total, accumulate grand total for each item
- tax.total += tax.grand_total_for_current_item;
-
- // set precision in the last item iteration
- if (n == me.frm.doc["items"].length - 1) {
- me.round_off_totals(tax);
-
- // adjust Discount Amount loss in last tax iteration
- if ((i == me.frm.doc["taxes"].length - 1) && me.discount_amount_applied)
- me.adjust_discount_amount_loss(tax);
- }
- });
- });
- },
-
- round_off_totals: function(tax) {
- tax.total = flt(tax.total, precision("total", tax));
- tax.tax_amount = flt(tax.tax_amount, precision("tax_amount", tax));
- tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount,
- precision("tax_amount", tax));
- },
-
- adjust_discount_amount_loss: function(tax) {
- var discount_amount_loss = this.frm.doc.grand_total - flt(this.frm.doc.base_discount_amount) - tax.total;
- tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount +
- discount_amount_loss, precision("tax_amount", tax));
- tax.total = flt(tax.total + discount_amount_loss, precision("total", tax));
- },
-
- get_current_tax_amount: function(item, tax, item_tax_map) {
- var tax_rate = this._get_tax_rate(tax, item_tax_map);
- var current_tax_amount = 0.0;
-
- if(tax.charge_type == "Actual") {
- // distribute the tax amount proportionally to each item row
- var actual = flt(tax.rate, precision("tax_amount", tax));
- current_tax_amount = this.frm.doc.net_total ?
- ((item.base_amount / this.frm.doc.net_total) * actual) : 0.0;
-
- } else if(tax.charge_type == "On Net Total") {
- current_tax_amount = (tax_rate / 100.0) * item.base_amount;
-
- } else if(tax.charge_type == "On Previous Row Amount") {
- current_tax_amount = (tax_rate / 100.0) *
- this.frm.doc["taxes"][cint(tax.row_id) - 1].tax_amount_for_current_item;
-
- } else if(tax.charge_type == "On Previous Row Total") {
- current_tax_amount = (tax_rate / 100.0) *
- this.frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_for_current_item;
- }
-
- current_tax_amount = flt(current_tax_amount, precision("tax_amount", tax));
-
- // store tax breakup for each item
- tax.item_wise_tax_detail[item.item_code || item.item_name] = [tax_rate, current_tax_amount];
-
- return current_tax_amount;
- },
-
- _cleanup: function() {
- $.each(this.frm.doc["taxes"] || [], function(i, tax) {
- $.each(["tax_amount_for_current_item", "grand_total_for_current_item",
- "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"],
- function(i, fieldname) { delete tax[fieldname]; });
-
- tax.item_wise_tax_detail = JSON.stringify(tax.item_wise_tax_detail);
- });
- },
-
- calculate_total_advance: function(parenttype, advance_parentfield, update_paid_amount) {
- if(this.frm.doc.doctype == parenttype && this.frm.doc.docstatus < 2) {
- var advance_doclist = this.frm.doc[advance_parentfield] || [];
- this.frm.doc.total_advance = flt(frappe.utils.sum(
- $.map(advance_doclist, function(adv) { return adv.allocated_amount })
- ), precision("total_advance"));
-
- this.calculate_outstanding_amount(update_paid_amount);
- }
- },
-
- _set_in_company_currency: function(item, print_field, base_field) {
- // set values in base currency
- item[base_field] = flt(item[print_field] * this.frm.doc.conversion_rate,
- precision(base_field, item));
- },
-
get_terms: function() {
var me = this;
if(this.frm.doc.tc_name) {
diff --git a/erpnext/selling/doctype/opportunity/opportunity.json b/erpnext/selling/doctype/opportunity/opportunity.json
index 980de56..0ff4060 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.json
+++ b/erpnext/selling/doctype/opportunity/opportunity.json
@@ -391,7 +391,7 @@
"icon": "icon-info-sign",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:41.732687",
+ "modified": "2015-02-11 14:45:30.174431",
"modified_by": "Administrator",
"module": "Selling",
"name": "Opportunity",
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index deb578d..9c8ddaa 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -1,946 +1,946 @@
{
- "allow_import": 1,
- "autoname": "naming_series:",
- "creation": "2013-05-24 19:29:08",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Transaction",
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:08",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
"fields": [
{
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user",
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
"permlevel": 0
- },
+ },
{
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "QTN-",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "QTN-",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "default": "Customer",
- "fieldname": "quotation_to",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Quotation To",
- "oldfieldname": "quotation_to",
- "oldfieldtype": "Select",
- "options": "\nLead\nCustomer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
+ "default": "Customer",
+ "fieldname": "quotation_to",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Quotation To",
+ "oldfieldname": "quotation_to",
+ "oldfieldtype": "Select",
+ "options": "\nLead\nCustomer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
"reqd": 1
- },
+ },
{
- "depends_on": "eval:doc.quotation_to == \"Customer\"",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "depends_on": "eval:doc.quotation_to == \"Customer\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"search_index": 1
- },
+ },
{
- "depends_on": "eval:doc.quotation_to == \"Lead\"",
- "fieldname": "lead",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Lead",
- "oldfieldname": "lead",
- "oldfieldtype": "Link",
- "options": "Lead",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.quotation_to == \"Lead\"",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Lead",
+ "oldfieldname": "lead",
+ "oldfieldtype": "Link",
+ "options": "Lead",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Customer / Lead Name",
- "permlevel": 0,
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Customer / Lead Name",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Address",
- "oldfieldname": "customer_address",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Address",
+ "oldfieldname": "customer_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
"search_index": 0
- },
+ },
{
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Contact",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Contact",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Mobile No",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact Email",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "options": "Quotation",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "options": "Quotation",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"width": "150px"
- },
+ },
{
- "description": "",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
+ "description": "",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
"width": "150px"
- },
+ },
{
- "default": "Today",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Date",
+ "no_copy": 1,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
"width": "100px"
- },
+ },
{
- "default": "Sales",
- "fieldname": "order_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Order Type",
- "oldfieldname": "order_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance\nShopping Cart",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "default": "Sales",
+ "fieldname": "order_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Order Type",
+ "oldfieldname": "order_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance\nShopping Cart",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "fieldname": "currency_and_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "permlevel": 0,
+ "fieldname": "currency_and_price_list",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "currency",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
"width": "100px"
- },
+ },
{
- "description": "Rate at which customer's currency is converted to company's base currency",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "description": "Rate at which customer's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"width": "100px"
- },
+ },
{
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
"width": "100px"
- },
+ },
{
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"reqd": 1
- },
+ },
{
- "description": "Rate at which Price list currency is converted to company's base currency",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "description": "Rate at which Price list currency is converted to company's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "ignore_pricing_rule",
- "fieldtype": "Check",
- "label": "Ignore Pricing Rule",
- "no_copy": 1,
- "permlevel": 1,
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
+ "label": "Ignore Pricing Rule",
+ "no_copy": 1,
+ "permlevel": 1,
"print_hide": 1
- },
+ },
{
- "fieldname": "items_section",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
"search_index": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "items",
- "fieldtype": "Table",
- "label": "Items",
- "oldfieldname": "quotation_details",
- "oldfieldtype": "Table",
- "options": "Quotation Item",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 0,
+ "allow_on_submit": 1,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "label": "Items",
+ "oldfieldname": "quotation_details",
+ "oldfieldtype": "Table",
+ "options": "Quotation Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0,
"width": "40px"
- },
+ },
{
- "fieldname": "sec_break23",
- "fieldtype": "Section Break",
- "permlevel": 0,
+ "fieldname": "sec_break23",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "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,
- "reqd": 0,
+ "fieldname": "base_net_total",
+ "fieldtype": "Currency",
+ "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,
+ "reqd": 0,
"width": "100px"
- },
+ },
{
- "fieldname": "column_break_28",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_28",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "permlevel": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "taxes_section",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
+ "fieldname": "taxes_section",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break_34",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_34",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "section_break_36",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_36",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "taxes",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "permlevel": 0,
+ "fieldname": "taxes",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "section_break_39",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_39",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "base_total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break_42",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_42",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "currency",
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "currency",
"permlevel": 0
- },
+ },
{
- "fieldname": "base_discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount (Company Currency)",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
+ "fieldname": "base_discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "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,
- "reqd": 0,
+ "fieldname": "base_grand_total",
+ "fieldtype": "Currency",
+ "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,
+ "reqd": 0,
"width": "200px"
- },
+ },
{
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "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,
+ "fieldname": "base_rounded_total",
+ "fieldtype": "Currency",
+ "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,
"width": "200px"
- },
+ },
{
- "description": "In Words will be visible once you save the Quotation.",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "description": "In Words will be visible once you save the Quotation.",
+ "fieldname": "base_in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"width": "200px"
- },
+ },
{
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "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,
- "reqd": 0,
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "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,
+ "reqd": 0,
"width": "200px"
- },
+ },
{
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "no_copy": 0,
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
"width": "200px"
- },
+ },
{
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "no_copy": 0,
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "no_copy": 0,
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
"width": "200px"
- },
+ },
{
- "fieldname": "fold",
- "fieldtype": "Fold",
- "label": "Fold",
+ "fieldname": "fold",
+ "fieldtype": "Fold",
+ "label": "Fold",
"permlevel": 0
- },
+ },
{
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "permlevel": 0,
- "print_hide": 0,
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"report_hide": 1
- },
+ },
{
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Term Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "permlevel": 0,
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Term Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "permlevel": 0,
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "depends_on": "customer",
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "oldfieldname": "customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
+ "depends_on": "customer",
+ "description": "",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "oldfieldname": "customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
"search_index": 0
- },
+ },
{
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Shipping Address",
- "options": "Address",
- "permlevel": 0,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Shipping Address",
+ "options": "Address",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Shipping Address",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "depends_on": "customer",
- "fieldname": "col_break98",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "depends_on": "customer",
+ "fieldname": "col_break98",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer Address",
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "eval:doc.customer",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Contact Person",
- "oldfieldname": "contact_person",
- "oldfieldtype": "Link",
- "options": "Contact",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "depends_on": "eval:doc.customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Contact Person",
+ "oldfieldname": "contact_person",
+ "oldfieldtype": "Link",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"reqd": 0
- },
+ },
{
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "campaign",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Campaign",
- "no_copy": 0,
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Campaign",
+ "no_copy": 0,
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"report_hide": 0
- },
+ },
{
- "fieldname": "source",
- "fieldtype": "Select",
- "hidden": 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,
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "hidden": 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
- },
+ },
{
- "allow_on_submit": 0,
- "default": "Draft",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled\nOpen\nReplied",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
+ "allow_on_submit": 0,
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled\nOpen\nReplied",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "order_lost_reason",
- "fieldtype": "Small Text",
- "label": "Quotation Lost Reason",
- "no_copy": 1,
- "oldfieldname": "order_lost_reason",
- "oldfieldtype": "Small Text",
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "fieldname": "order_lost_reason",
+ "fieldtype": "Small Text",
+ "label": "Quotation Lost Reason",
+ "no_copy": 1,
+ "oldfieldname": "order_lost_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "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
- },
+ },
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
"search_index": 0
- },
+ },
{
- "fieldname": "enq_det",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Opportunity Item",
- "no_copy": 0,
- "oldfieldname": "enq_det",
- "oldfieldtype": "Text",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "fieldname": "enq_det",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Opportunity Item",
+ "no_copy": 0,
+ "oldfieldname": "enq_det",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"report_hide": 0
}
- ],
- "hide_toolbar": 0,
- "icon": "icon-shopping-cart",
- "idx": 1,
- "is_submittable": 1,
- "max_attachments": 1,
- "modified": "2015-02-05 05:11:44.426544",
- "modified_by": "Administrator",
- "module": "Selling",
- "name": "Quotation",
- "owner": "Administrator",
+ ],
+ "hide_toolbar": 0,
+ "icon": "icon-shopping-cart",
+ "idx": 1,
+ "is_submittable": 1,
+ "max_attachments": 1,
+ "modified": "2015-02-11 15:15:29.475837",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "match": "",
- "permlevel": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "match": "",
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
"write": 0
- },
+ },
{
- "cancel": 0,
- "delete": 0,
- "email": 1,
- "match": "",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "match": "",
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
"role": "Customer"
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "match": "",
- "permlevel": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "match": "",
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance Manager",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance Manager",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "match": "",
- "permlevel": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance Manager",
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "match": "",
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance Manager",
"submit": 0
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "match": "",
- "permlevel": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "match": "",
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
"submit": 0
}
- ],
- "read_only_onload": 1,
- "search_fields": "status,transaction_date,customer,lead,order_type",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date,customer,lead,order_type",
+ "sort_field": "modified",
+ "sort_order": "DESC",
"title_field": "customer_name"
-}
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 16a9bb7..c94004c 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -326,7 +326,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
@@ -344,7 +344,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_export",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"options": "currency",
@@ -412,18 +412,18 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_total_export",
+ "fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Taxes and Charges Total",
+ "label": "Total Taxes and Charges",
"options": "currency",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
},
{
- "fieldname": "other_charges_total",
+ "fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
+ "label": "Total Taxes and Charges (Company Currency)",
"oldfieldname": "other_charges_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -465,7 +465,7 @@
"print_hide": 1
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"oldfieldname": "grand_total",
@@ -478,7 +478,7 @@
"width": "150px"
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
@@ -491,7 +491,7 @@
},
{
"description": "In Words will be visible once you save the Sales Order.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -510,7 +510,7 @@
"width": "50%"
},
{
- "fieldname": "grand_total_export",
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -524,7 +524,7 @@
"width": "150px"
},
{
- "fieldname": "rounded_total_export",
+ "fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"oldfieldname": "rounded_total_export",
@@ -536,7 +536,7 @@
"width": "150px"
},
{
- "fieldname": "in_words_export",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_export",
@@ -1034,7 +1034,7 @@
"idx": 1,
"is_submittable": 1,
"issingle": 0,
- "modified": "2015-02-05 05:11:45.731715",
+ "modified": "2015-02-11 15:42:09.174504",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index c906c48..73eb9a6 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -177,6 +177,15 @@
"width": "100px"
},
{
+ "fieldname": "net_amount",
+ "fieldtype": "Currency",
+ "label": "Net Amount",
+ "options": "currency",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
+ },
+ {
"fieldname": "col_break3",
"fieldtype": "Column Break",
"permlevel": 0
@@ -211,6 +220,15 @@
"width": "100px"
},
{
+ "fieldname": "base_net_amount",
+ "fieldtype": "Currency",
+ "label": "Net Amount (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
+ },
+ {
"fieldname": "pricing_rule",
"fieldtype": "Link",
"label": "Pricing Rule",
@@ -415,7 +433,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2015-01-01 14:29:59.458236",
+ "modified": "2015-01-22 13:52:44.959126",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index dbea723..50fadc8 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -3,9 +3,9 @@
frappe.provide("erpnext.selling");
-frappe.require("assets/erpnext/js/transaction.js");
+frappe.require("assets/erpnext/js/controllers/transaction.js");
-{% include "public/js/controllers/accounts.js" %}
+{% include "public/js/controllers/accounts.js" %};
cur_frm.email_field = "contact_email";
@@ -233,94 +233,6 @@
}
},
- calculate_taxes_and_totals: function(update_paid_amount) {
- this._super();
- this.calculate_total_advance("Sales Invoice", "advances", update_paid_amount);
- this.calculate_commission();
- this.calculate_contribution();
-
- // TODO check for custom_recalc in custom scripts of server
-
- this.frm.refresh_fields();
- },
-
- calculate_item_values: function() {
- var me = this;
-
- if (!this.discount_amount_applied) {
- $.each(this.frm.doc["items"] || [], function(i, item) {
- frappe.model.round_floats_in(item);
- item.amount = flt(item.rate * item.qty, precision("amount", item));
-
- me._set_in_company_currency(item, "price_list_rate", "base_price_list_rate");
- me._set_in_company_currency(item, "rate", "base_rate");
- me._set_in_company_currency(item, "amount", "base_amount");
- });
- }
- },
-
- determine_exclusive_rate: function() {
- var me = this;
- $.each(me.frm.doc["items"] || [], function(n, item) {
- var item_tax_map = me._load_item_tax_rate(item.item_tax_rate);
- var cumulated_tax_fraction = 0.0;
-
- $.each(me.frm.doc["taxes"] || [], function(i, tax) {
- tax.tax_fraction_for_current_item = me.get_current_tax_fraction(tax, item_tax_map);
-
- if(i==0) {
- tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item;
- } else {
- tax.grand_total_fraction_for_current_item =
- me.frm.doc["taxes"][i-1].grand_total_fraction_for_current_item +
- tax.tax_fraction_for_current_item;
- }
-
- cumulated_tax_fraction += tax.tax_fraction_for_current_item;
- });
-
- if(cumulated_tax_fraction && !me.discount_amount_applied) {
- item.base_amount = flt(
- (item.amount * me.frm.doc.conversion_rate) / (1 + cumulated_tax_fraction),
- precision("base_amount", item));
-
- item.base_rate = flt(item.base_amount / item.qty, precision("base_rate", item));
-
- if(item.discount_percentage == 100) {
- item.base_price_list_rate = item.base_rate;
- item.base_rate = 0.0;
- } else {
- item.base_price_list_rate = flt(item.base_rate / (1 - item.discount_percentage / 100.0),
- precision("base_price_list_rate", item));
- }
- }
- });
- },
-
- get_current_tax_fraction: function(tax, item_tax_map) {
- // Get tax fraction for calculating tax exclusive amount
- // from tax inclusive amount
- var current_tax_fraction = 0.0;
-
- if(cint(tax.included_in_print_rate)) {
- var tax_rate = this._get_tax_rate(tax, item_tax_map);
-
- if(tax.charge_type == "On Net Total") {
- current_tax_fraction = (tax_rate / 100.0);
-
- } else if(tax.charge_type == "On Previous Row Amount") {
- current_tax_fraction = (tax_rate / 100.0) *
- this.frm.doc["taxes"][cint(tax.row_id) - 1].tax_fraction_for_current_item;
-
- } else if(tax.charge_type == "On Previous Row Total") {
- current_tax_fraction = (tax_rate / 100.0) *
- this.frm.doc["taxes"][cint(tax.row_id) - 1].grand_total_fraction_for_current_item;
- }
- }
-
- return current_tax_fraction;
- },
-
calculate_net_total: function() {
var me = this;
this.frm.doc.net_total = this.frm.doc.net_total_export = 0.0;
@@ -356,54 +268,6 @@
this.frm.doc.rounded_total_export = Math.round(this.frm.doc.grand_total_export);
},
- apply_discount_amount: function() {
- var me = this;
- var distributed_amount = 0.0;
-
- if (this.frm.doc.discount_amount) {
- this.frm.set_value("base_discount_amount",
- flt(this.frm.doc.discount_amount * this.frm.doc.conversion_rate, precision("base_discount_amount")))
-
- var grand_total_for_discount_amount = this.get_grand_total_for_discount_amount();
- // calculate item amount after Discount Amount
- if (grand_total_for_discount_amount) {
- $.each(this.frm.doc["items"] || [], function(i, item) {
- distributed_amount = flt(me.frm.doc.base_discount_amount) * item.base_amount / grand_total_for_discount_amount;
- item.base_amount = flt(item.base_amount - distributed_amount, precision("base_amount", item));
- });
-
- this.discount_amount_applied = true;
- this._calculate_taxes_and_totals();
- }
- } else {
- this.frm.set_value("base_discount_amount", 0);
- }
- },
-
- get_grand_total_for_discount_amount: function() {
- var me = this;
- var total_actual_tax = 0.0;
- var actual_taxes_dict = {};
-
- $.each(this.frm.doc["taxes"] || [], function(i, tax) {
- if (tax.charge_type == "Actual")
- actual_taxes_dict[tax.idx] = tax.tax_amount;
- else if (actual_taxes_dict[tax.row_id] !== null) {
- actual_tax_amount = flt(actual_taxes_dict[tax.row_id]) * flt(tax.rate) / 100;
- actual_taxes_dict[tax.idx] = actual_tax_amount;
- }
- });
-
- $.each(actual_taxes_dict, function(key, value) {
- if (value)
- total_actual_tax += value;
- });
-
- grand_total_for_discount_amount = flt(this.frm.doc.grand_total - total_actual_tax,
- precision("grand_total"));
- return grand_total_for_discount_amount;
- },
-
calculate_outstanding_amount: function(update_paid_amount) {
// NOTE:
// paid_amount and write_off_amount is only for POS Invoice
@@ -454,11 +318,6 @@
});
},
- _cleanup: function() {
- this._super();
- this.frm.doc.in_words = this.frm.doc.in_words_export = "";
- },
-
shipping_rule: function() {
var me = this;
if(this.frm.doc.shipping_rule) {
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index 4eb9357..cbbc400 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -341,7 +341,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"no_copy": 0,
@@ -361,7 +361,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_export",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"options": "currency",
@@ -435,18 +435,18 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_total_export",
+ "fieldname": "total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Taxes and Charges Total",
- "options": "Company:company:default_currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
},
{
- "fieldname": "other_charges_total",
+ "fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
+ "label": "Total Taxes and Charges (Company Currency)",
"oldfieldname": "other_charges_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -489,7 +489,7 @@
"read_only": 0
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"no_copy": 0,
@@ -504,7 +504,7 @@
"width": "150px"
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"no_copy": 0,
@@ -519,7 +519,7 @@
},
{
"description": "In Words will be visible once you save the Delivery Note.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"no_copy": 0,
@@ -539,7 +539,7 @@
"read_only": 0
},
{
- "fieldname": "grand_total_export",
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -555,7 +555,7 @@
"width": "150px"
},
{
- "fieldname": "rounded_total_export",
+ "fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"no_copy": 0,
@@ -570,7 +570,7 @@
},
{
"description": "In Words (Export) will be visible once you save the Delivery Note.",
- "fieldname": "in_words_export",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"no_copy": 0,
@@ -1024,7 +1024,7 @@
"idx": 1,
"in_create": 0,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:37.151596",
+ "modified": "2015-02-11 15:45:06.803707",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index dc35407..4d4ad70 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -229,7 +229,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total",
+ "fieldname": "base_net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
@@ -257,7 +257,7 @@
"permlevel": 0
},
{
- "fieldname": "net_total_import",
+ "fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total",
"oldfieldname": "net_total_import",
@@ -314,7 +314,7 @@
"permlevel": 0
},
{
- "fieldname": "other_charges_added",
+ "fieldname": "base_taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Company Currency)",
"oldfieldname": "other_charges_added",
@@ -325,7 +325,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted",
+ "fieldname": "base_taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Company Currency)",
"oldfieldname": "other_charges_deducted",
@@ -336,9 +336,9 @@
"read_only": 1
},
{
- "fieldname": "total_tax",
+ "fieldname": "base_total_taxes_and_charges",
"fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
+ "label": "Total Taxes and Charges (Company Currency)",
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -347,7 +347,7 @@
"read_only": 1
},
{
- "fieldname": "grand_total",
+ "fieldname": "base_grand_total",
"fieldtype": "Currency",
"label": "Grand Total (Company Currency)",
"oldfieldname": "grand_total",
@@ -358,7 +358,7 @@
"read_only": 1
},
{
- "fieldname": "rounded_total",
+ "fieldname": "base_rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
@@ -370,7 +370,7 @@
},
{
"description": "In Words will be visible once you save the Purchase Receipt.",
- "fieldname": "in_words",
+ "fieldname": "base_in_words",
"fieldtype": "Data",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
@@ -387,7 +387,7 @@
"width": "50%"
},
{
- "fieldname": "other_charges_added_import",
+ "fieldname": "taxes_and_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"oldfieldname": "other_charges_added_import",
@@ -398,7 +398,7 @@
"read_only": 1
},
{
- "fieldname": "other_charges_deducted_import",
+ "fieldname": "taxes_and_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"oldfieldname": "other_charges_deducted_import",
@@ -409,7 +409,15 @@
"read_only": 1
},
{
- "fieldname": "grand_total_import",
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "grand_total",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total",
@@ -421,7 +429,7 @@
"read_only": 1
},
{
- "fieldname": "in_words_import",
+ "fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"oldfieldname": "in_words_import",
@@ -767,7 +775,7 @@
"icon": "icon-truck",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:43.969108",
+ "modified": "2015-02-11 16:13:02.294088",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",