Itemised tax breakup fix in docs other than invoice (#9961)

* Itemised tax breakup fix in docs other than invoice

* Set itemised tax breakup and hsn code in existing docs
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 8015fb7..8ea48f6 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -1520,10 +1520,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1533,12 +1563,12 @@
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "oldfieldtype": "HTML", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -3767,7 +3797,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-29 10:48:09.707735", 
+ "modified": "2017-07-19 13:53:48.673757", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Purchase Invoice", 
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 3816049..09c987f 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -1550,10 +1550,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1568,7 +1598,7 @@
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -3305,7 +3335,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-13 14:29:21.066814", 
+ "modified": "2017-07-19 14:03:51.838328", 
  "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 4c4603f..ea3ae74 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -1124,10 +1124,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1142,7 +1172,7 @@
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -2217,7 +2247,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-13 14:28:54.466450", 
+ "modified": "2017-07-19 13:51:18.929697", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier Quotation", 
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index f1e95ec..b6f8b7d 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -509,28 +509,31 @@
 		return rate_with_margin
 
 	def set_item_wise_tax_breakup(self):
-		if not self.doc.taxes:
-			return
-		frappe.flags.company = self.doc.company
+		self.doc.other_charges_calculation = get_itemised_tax_breakup_html(self.doc)
 		
-		# get headers
-		tax_accounts = list(set([d.description for d in self.doc.taxes]))
-		headers = get_itemised_tax_breakup_header(self.doc.doctype + " Item", tax_accounts)
-		
-		# get tax breakup data
-		itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(self.doc)
-		
-		frappe.flags.company = None
-		
-		self.doc.other_charges_calculation = frappe.render_template(
-			"templates/includes/itemised_tax_breakup.html", dict(
-				headers=headers,
-				itemised_tax=itemised_tax,
-				itemised_taxable_amount=itemised_taxable_amount,
-				tax_accounts=tax_accounts,
-				company_currency=erpnext.get_company_currency(self.doc.company)
-			)
+def get_itemised_tax_breakup_html(doc):
+	if not doc.taxes:
+		return
+	frappe.flags.company = doc.company
+	
+	# get headers
+	tax_accounts = list(set([d.description for d in doc.taxes]))
+	headers = get_itemised_tax_breakup_header(doc.doctype + " Item", tax_accounts)
+	
+	# get tax breakup data
+	itemised_tax, itemised_taxable_amount = get_itemised_tax_breakup_data(doc)
+	
+	frappe.flags.company = None
+	
+	return frappe.render_template(
+		"templates/includes/itemised_tax_breakup.html", dict(
+			headers=headers,
+			itemised_tax=itemised_tax,
+			itemised_taxable_amount=itemised_taxable_amount,
+			tax_accounts=tax_accounts,
+			company_currency=erpnext.get_company_currency(doc.company)
 		)
+	)
 
 @erpnext.allow_regional
 def get_itemised_tax_breakup_header(item_doctype, tax_accounts):
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 5b45cb4..48e3a35 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -421,4 +421,5 @@
 erpnext.patches.v8_1.add_indexes_in_transaction_doctypes
 erpnext.patches.v8_3.set_restrict_to_domain_for_module_def
 erpnext.patches.v8_1.update_expense_claim_status
-erpnext.patches.v8_3.update_company_total_sales
\ No newline at end of file
+erpnext.patches.v8_3.update_company_total_sales
+erpnext.patches.v8_5.fix_tax_breakup_for_non_invoice_docs
\ No newline at end of file
diff --git a/erpnext/patches/v8_5/__init__.py b/erpnext/patches/v8_5/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/patches/v8_5/__init__.py
diff --git a/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py b/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py
new file mode 100644
index 0000000..fe9befe
--- /dev/null
+++ b/erpnext/patches/v8_5/fix_tax_breakup_for_non_invoice_docs.py
@@ -0,0 +1,47 @@
+import frappe
+from erpnext.regional.india.setup import make_custom_fields
+from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_html
+
+def execute():
+	companies = [d.name for d in frappe.get_all('Company', filters = {'country': 'India'})]
+	if not companies:
+		return
+
+	make_custom_fields()
+
+	# update invoice copy value
+	values = ["Original for Recipient", "Duplicate for Transporter",
+		"Duplicate for Supplier", "Triplicate for Supplier"]
+	for d in values:
+		frappe.db.sql("update `tabSales Invoice` set invoice_copy=%s where invoice_copy=%s", (d, d))
+
+	# update tax breakup in transactions made after 1st July 2017
+	doctypes = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice", 
+		"Supplier Quotation", "Purchase Order", "Purchase Receipt", "Purchase Invoice"]
+
+	for doctype in doctypes:
+		frappe.reload_doctype(doctype)
+
+		date_field = "posting_date"
+		if doctype in ["Quotation", "Sales Order", "Supplier Quotation", "Purchase Order"]:
+			date_field = "transaction_date"
+
+		records = [d.name for d in frappe.get_all(doctype, filters={
+			"docstatus": ["!=", 2],
+			date_field: [">=", "2017-07-01"],
+			"company": ["in", companies],
+			"total_taxes_and_charges": [">", 0],
+			"other_charges_calculation": ""
+		})]
+		if records:
+			frappe.db.sql("""
+				update `tab%s Item` dt_item
+				set gst_hsn_code = (select gst_hsn_code from tabItem where name=dt_item.item_code)
+				where parent in (%s)
+					and (gst_hsn_code is null or gst_hsn_code = '')
+			""" % (doctype, ', '.join(['%s']*len(records))), tuple(records))
+
+			for record in records:
+				doc = frappe.get_doc(doctype, record)
+				html = get_itemised_tax_breakup_html(doc)
+				doc.db_set("other_charges_calculation", html, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index d46e9da..92ef725 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -228,6 +228,8 @@
 				items: my_items
 			},
 			callback: function(r) {
+				if(r.exc) return;
+
 				var i = 0;
 				var item_length = cur_frm.doc.items.length;
 				while (i < item_length) {
@@ -244,35 +246,26 @@
 							cur_frm.doc.items[i].qty = my_qty;
 
 							frappe.msgprint("Assigning " + d.mr_name + " to " + d.item_code + " (row " + cur_frm.doc.items[i].idx + ")");
-							if (qty > 0)
-							{
+							if (qty > 0) {
 								frappe.msgprint("Splitting " + qty + " units of " + d.item_code);
 								var newrow = frappe.model.add_child(cur_frm.doc, cur_frm.doc.items[i].doctype, "items");
 								item_length++;
 
-								for (var key in cur_frm.doc.items[i])
-								{
+								for (var key in cur_frm.doc.items[i]) {
 									newrow[key] = cur_frm.doc.items[i][key];
 								}
 
 								newrow.idx = item_length;
 								newrow["stock_qty"] = newrow.conversion_factor*qty;
 								newrow["qty"] = qty;
-
 								newrow["material_request"] = "";
 								newrow["material_request_item"] = "";
-
 							}
-
-
-
 						}
-
 					});
 					i++;
 				}
 				refresh_field("items");
-				//cur_frm.save();
 			}
 		});
 	}
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index 0369487..7a7e937 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -107,13 +107,15 @@
 				fieldtype='Data', insert_after='company_address',
 				options='company_address.gstin', print_hide=1),
 			dict(fieldname='invoice_copy', label='Invoice Copy',
-				fieldtype='Select', insert_after='project', print_hide=1, allow_on_submit=1,
-				options='ORIGINAL FOR RECIPIENT\nDUPLICATE FOR TRANSPORTER\nDUPLICATE FOR SUPPLIER\nTRIPLICATE FOR SUPPLIER')
+				fieldtype='Select', insert_after='select_print_heading', print_hide=1, allow_on_submit=1,
+				options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier')
 		],
 		'Item': [
 			dict(fieldname='gst_hsn_code', label='HSN/SAC',
 				fieldtype='Link', options='GST HSN Code', insert_after='item_group'),
 		],
+		'Quotation Item': [hsn_sac_field],
+		'Supplier Quotation Item': [hsn_sac_field],
 		'Sales Order Item': [hsn_sac_field],
 		'Delivery Note Item': [hsn_sac_field],
 		'Sales Invoice Item': [hsn_sac_field],
@@ -131,7 +133,7 @@
 				custom_field = frappe.get_doc("Custom Field", field)
 				custom_field.update(df)
 				custom_field.save()
-			
+
 def make_fixtures():
 	docs = [
 		{'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'},
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index b1ddb0a..2109023 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -1444,10 +1444,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1457,12 +1487,12 @@
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "oldfieldtype": "HTML", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -2542,7 +2572,7 @@
  "istable": 0, 
  "max_attachments": 1, 
  "menu_index": 0, 
- "modified": "2017-06-13 14:29:18.553722", 
+ "modified": "2017-07-19 13:49:33.388736", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Quotation", 
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 7c995f2..c7c5ea2 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1559,10 +1559,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1572,12 +1602,12 @@
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "oldfieldtype": "HTML", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -3632,7 +3662,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-19 13:06:31.736384", 
+ "modified": "2017-07-19 13:45:02.965353", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Sales Order", 
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index b8e7079..345750f 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -1686,10 +1686,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1699,12 +1729,12 @@
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "oldfieldtype": "HTML", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -3396,7 +3426,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-13 14:29:05.182585", 
+ "modified": "2017-07-19 13:48:09.630820", 
  "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 bb0f96f..1872519 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -1355,10 +1355,40 @@
    "allow_bulk_edit": 0, 
    "allow_on_submit": 0, 
    "bold": 0, 
+   "collapsible": 1, 
+   "columns": 0, 
+   "fieldname": "sec_tax_breakup", 
+   "fieldtype": "Section Break", 
+   "hidden": 0, 
+   "ignore_user_permissions": 0, 
+   "ignore_xss_filter": 0, 
+   "in_filter": 0, 
+   "in_global_search": 0, 
+   "in_list_view": 0, 
+   "in_standard_filter": 0, 
+   "label": "Tax Breakup", 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
+   "print_hide": 0, 
+   "print_hide_if_no_value": 0, 
+   "read_only": 0, 
+   "remember_last_selected_value": 0, 
+   "report_hide": 0, 
+   "reqd": 0, 
+   "search_index": 0, 
+   "set_only_once": 0, 
+   "unique": 0
+  }, 
+  {
+   "allow_bulk_edit": 0, 
+   "allow_on_submit": 0, 
+   "bold": 0, 
    "collapsible": 0, 
    "columns": 0, 
    "fieldname": "other_charges_calculation", 
-   "fieldtype": "HTML", 
+   "fieldtype": "Text", 
    "hidden": 0, 
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
@@ -1368,12 +1398,12 @@
    "in_standard_filter": 0, 
    "label": "Taxes and Charges Calculation", 
    "length": 0, 
-   "no_copy": 0, 
+   "no_copy": 1, 
    "oldfieldtype": "HTML", 
    "permlevel": 0, 
    "print_hide": 1, 
    "print_hide_if_no_value": 0, 
-   "read_only": 0, 
+   "read_only": 1, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
    "reqd": 0, 
@@ -2939,7 +2969,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-13 14:29:08.605354", 
+ "modified": "2017-07-19 13:52:37.058861", 
  "modified_by": "Administrator", 
  "module": "Stock", 
  "name": "Purchase Receipt",