Merge branch 'develop' into mergify/bp/develop/pr-30385
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index a3bf78b..6e5ffed 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -364,3 +364,4 @@
 erpnext.patches.v13_0.set_return_against_in_pos_invoice_references
 erpnext.patches.v13_0.remove_unknown_links_to_prod_plan_items # 24-03-2022
 erpnext.patches.v13_0.update_expense_claim_status_for_paid_advances
+erpnext.patches.v13_0.create_gst_custom_fields_in_quotation
\ No newline at end of file
diff --git a/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py b/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py
new file mode 100644
index 0000000..3217eab
--- /dev/null
+++ b/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py
@@ -0,0 +1,53 @@
+import frappe
+from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
+
+
+def execute():
+	company = frappe.get_all("Company", filters={"country": "India"}, fields=["name"])
+	if not company:
+		return
+
+	sales_invoice_gst_fields = [
+		dict(
+			fieldname="billing_address_gstin",
+			label="Billing Address GSTIN",
+			fieldtype="Data",
+			insert_after="customer_address",
+			read_only=1,
+			fetch_from="customer_address.gstin",
+			print_hide=1,
+			length=15,
+		),
+		dict(
+			fieldname="customer_gstin",
+			label="Customer GSTIN",
+			fieldtype="Data",
+			insert_after="shipping_address_name",
+			fetch_from="shipping_address_name.gstin",
+			print_hide=1,
+			length=15,
+		),
+		dict(
+			fieldname="place_of_supply",
+			label="Place of Supply",
+			fieldtype="Data",
+			insert_after="customer_gstin",
+			print_hide=1,
+			read_only=1,
+			length=50,
+		),
+		dict(
+			fieldname="company_gstin",
+			label="Company GSTIN",
+			fieldtype="Data",
+			insert_after="company_address",
+			fetch_from="company_address.gstin",
+			print_hide=1,
+			read_only=1,
+			length=15,
+		),
+	]
+
+	custom_fields = {"Quotation": sales_invoice_gst_fields}
+
+	create_custom_fields(custom_fields, update=True)
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index 40fa6cd..446faaa 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -930,6 +930,7 @@
 		"Journal Entry": journal_entry_fields,
 		"Sales Order": sales_invoice_gst_fields,
 		"Tax Category": inter_state_gst_field,
+		"Quotation": sales_invoice_gst_fields,
 		"Item": [
 			dict(
 				fieldname="gst_hsn_code",
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 249c1b7..bcc08e0 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -225,7 +225,7 @@
 	if not frappe.get_meta("Address").has_field("gst_state"):
 		return
 
-	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
+	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order", "Quotation"):
 		address_name = party_details.customer_address or party_details.shipping_address_name
 	elif doctype in ("Purchase Invoice", "Purchase Order", "Purchase Receipt"):
 		address_name = party_details.shipping_address or party_details.supplier_address
@@ -254,7 +254,7 @@
 		party_details.taxes = []
 		return party_details
 
-	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
+	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order", "Quotation"):
 		master_doctype = "Sales Taxes and Charges Template"
 		tax_template_by_category = get_tax_template_based_on_category(
 			master_doctype, company, party_details
@@ -311,7 +311,7 @@
 
 
 def is_internal_transfer(party_details, doctype):
-	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
+	if doctype in ("Sales Invoice", "Delivery Note", "Sales Order", "Quotation"):
 		destination_gstin = party_details.company_gstin
 	elif doctype in ("Purchase Invoice", "Purchase Order", "Purchase Receipt"):
 		destination_gstin = party_details.supplier_gstin
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 0318b70..75443ab 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -31,6 +31,8 @@
   "col_break98",
   "shipping_address_name",
   "shipping_address",
+  "company_address",
+  "company_address_display",
   "customer_group",
   "territory",
   "currency_and_price_list",
@@ -955,7 +957,18 @@
    "fieldname": "competitors",
    "fieldtype": "Table MultiSelect",
    "label": "Competitors",
-   "options": "Competitor Detail",
+   "options": "Competitor Detail"
+  },
+  {
+   "fieldname": "company_address",
+   "fieldtype": "Link",
+   "label": "Company Address Name",
+   "options": "Address"
+  },
+  {
+   "fieldname": "company_address_display",
+   "fieldtype": "Small Text",
+   "label": "Company Address",
    "read_only": 1
   },
   {
diff --git a/erpnext/selling/doctype/quotation/regional/india.js b/erpnext/selling/doctype/quotation/regional/india.js
new file mode 100644
index 0000000..9550835
--- /dev/null
+++ b/erpnext/selling/doctype/quotation/regional/india.js
@@ -0,0 +1,3 @@
+{% include "erpnext/regional/india/taxes.js" %}
+
+erpnext.setup_auto_gst_taxation('Quotation');