From 03952f8819b61c9842f865623f162a96222422d2 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 23 Mar 2022 18:47:58 +0530 Subject: [PATCH 1/4] fix(India): Auto tax fetching based on GSTIN (cherry picked from commit 7cae669e814a958310ca1b8ee408450569c32d10) # Conflicts: # erpnext/patches.txt # erpnext/regional/india/setup.py # erpnext/selling/doctype/quotation/quotation.json --- erpnext/patches.txt | 7 + .../create_gst_custom_fields_in_quotation.py | 29 ++ erpnext/regional/india/setup.py | 21 + erpnext/regional/india/utils.py | 6 +- .../selling/doctype/quotation/quotation.json | 392 ++++++++++++++---- .../doctype/quotation/regional/india.js | 3 + 6 files changed, 372 insertions(+), 86 deletions(-) create mode 100644 erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py create mode 100644 erpnext/selling/doctype/quotation/regional/india.js diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 028834a0ec..83464aec31 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -356,6 +356,7 @@ erpnext.patches.v13_0.update_exchange_rate_settings erpnext.patches.v14_0.delete_amazon_mws_doctype erpnext.patches.v13_0.set_work_order_qty_in_so_from_mr erpnext.patches.v13_0.update_accounts_in_loan_docs +<<<<<<< HEAD erpnext.patches.v14_0.update_batch_valuation_flag erpnext.patches.v14_0.delete_non_profit_doctypes erpnext.patches.v14_0.update_employee_advance_status @@ -363,3 +364,9 @@ erpnext.patches.v13_0.add_cost_center_in_loans 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.remove_unknown_links_to_prod_plan_items +erpnext.patches.v13_0.rename_non_profit_fields +erpnext.patches.v13_0.enable_ksa_vat_docs #1 +erpnext.patches.v13_0.create_gst_custom_fields_in_quotation +>>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) 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 0000000000..840b8fd830 --- /dev/null +++ b/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py @@ -0,0 +1,29 @@ +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) \ No newline at end of file diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index 40fa6cd097..a7938e093c 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -909,6 +909,7 @@ def get_custom_fields(): read_only=1, ), ], +<<<<<<< HEAD "Purchase Invoice": purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields @@ -947,6 +948,26 @@ def get_custom_fields(): dict( fieldname="is_non_gst", label="Is Non GST ", fieldtype="Check", insert_after="is_nil_exempt" ), +======= + 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields, + 'Purchase Order': purchase_invoice_gst_fields, + 'Purchase Receipt': purchase_invoice_gst_fields, + 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields + si_ewaybill_fields + si_einvoice_fields, + 'POS Invoice': sales_invoice_gst_fields, + 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields + sales_invoice_shipping_fields + delivery_note_gst_category, + 'Payment Entry': payment_entry_fields, + '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', label='HSN/SAC', + fieldtype='Link', options='GST HSN Code', insert_after='item_group'), + dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted', + fieldtype='Check', insert_after='gst_hsn_code'), + dict(fieldname='is_non_gst', label='Is Non GST ', + fieldtype='Check', insert_after='is_nil_exempt') +>>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) ], "Quotation Item": [hsn_sac_field, nil_rated_exempt, is_non_gst], "Supplier Quotation Item": [hsn_sac_field, nil_rated_exempt, is_non_gst], diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py index 47e6ae67f4..1920b37321 100644 --- a/erpnext/regional/india/utils.py +++ b/erpnext/regional/india/utils.py @@ -225,7 +225,7 @@ def get_place_of_supply(party_details, doctype): 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 @@ def get_regional_address_details(party_details, doctype, company): 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 @@ -310,7 +310,7 @@ def update_party_details(party_details, doctype): 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 ee5b0ea760..018682ff80 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", @@ -117,7 +119,9 @@ { "fieldname": "customer_section", "fieldtype": "Section Break", - "options": "fa fa-user" + "options": "fa fa-user", + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -127,7 +131,9 @@ "hidden": 1, "label": "Title", "no_copy": 1, - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "naming_series", @@ -139,7 +145,9 @@ "options": "SAL-QTN-.YYYY.-", "print_hide": 1, "reqd": 1, - "set_only_once": 1 + "set_only_once": 1, + "show_days": 1, + "show_seconds": 1 }, { "default": "Customer", @@ -151,7 +159,9 @@ "oldfieldtype": "Select", "options": "DocType", "print_hide": 1, - "reqd": 1 + "reqd": 1, + "show_days": 1, + "show_seconds": 1 }, { "bold": 1, @@ -164,7 +174,9 @@ "oldfieldtype": "Link", "options": "quotation_to", "print_hide": 1, - "search_index": 1 + "search_index": 1, + "show_days": 1, + "show_seconds": 1 }, { "bold": 1, @@ -173,12 +185,16 @@ "hidden": 1, "in_global_search": 1, "label": "Customer Name", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break1", "fieldtype": "Column Break", "oldfieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1, "width": "50%" }, { @@ -192,6 +208,8 @@ "options": "Quotation", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "150px" }, { @@ -204,6 +222,8 @@ "print_hide": 1, "remember_last_selected_value": 1, "reqd": 1, + "show_days": 1, + "show_seconds": 1, "width": "150px" }, { @@ -218,12 +238,16 @@ "oldfieldtype": "Date", "reqd": 1, "search_index": 1, + "show_days": 1, + "show_seconds": 1, "width": "100px" }, { "fieldname": "valid_till", "fieldtype": "Date", - "label": "Valid Till" + "label": "Valid Till", + "show_days": 1, + "show_seconds": 1 }, { "default": "Sales", @@ -235,7 +259,9 @@ "oldfieldtype": "Select", "options": "\nSales\nMaintenance\nShopping Cart", "print_hide": 1, - "reqd": 1 + "reqd": 1, + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, @@ -243,14 +269,18 @@ "fieldname": "contact_section", "fieldtype": "Section Break", "label": "Address and Contact", - "options": "fa fa-bullhorn" + "options": "fa fa-bullhorn", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "customer_address", "fieldtype": "Link", "label": "Customer Address", "options": "Address", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "address_display", @@ -258,7 +288,9 @@ "label": "Address", "oldfieldname": "customer_address", "oldfieldtype": "Small Text", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "contact_person", @@ -267,20 +299,26 @@ "oldfieldname": "contact_person", "oldfieldtype": "Link", "options": "Contact", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "contact_display", "fieldtype": "Small Text", "in_global_search": 1, "label": "Contact", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "contact_mobile", "fieldtype": "Small Text", "label": "Mobile No", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "contact_email", @@ -289,12 +327,16 @@ "label": "Contact Email", "options": "Email", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "depends_on": "eval:doc.quotaion_to=='Customer' && doc.party_name", "fieldname": "col_break98", "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1, "width": "50%" }, { @@ -302,14 +344,18 @@ "fieldtype": "Link", "label": "Shipping Address", "options": "Address", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "shipping_address", "fieldtype": "Small Text", "label": "Shipping Address", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "depends_on": "eval:doc.quotaion_to=='Customer' && doc.party_name", @@ -320,21 +366,27 @@ "oldfieldname": "customer_group", "oldfieldtype": "Link", "options": "Customer Group", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "territory", "fieldtype": "Link", "label": "Territory", "options": "Territory", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, "fieldname": "currency_and_price_list", "fieldtype": "Section Break", "label": "Currency and Price List", - "options": "fa fa-tag" + "options": "fa fa-tag", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "currency", @@ -345,6 +397,8 @@ "options": "Currency", "print_hide": 1, "reqd": 1, + "show_days": 1, + "show_seconds": 1, "width": "100px" }, { @@ -357,11 +411,15 @@ "precision": "9", "print_hide": 1, "reqd": 1, + "show_days": 1, + "show_seconds": 1, "width": "100px" }, { "fieldname": "column_break2", "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1, "width": "50%" }, { @@ -373,6 +431,8 @@ "options": "Price List", "print_hide": 1, "reqd": 1, + "show_days": 1, + "show_seconds": 1, "width": "100px" }, { @@ -382,7 +442,9 @@ "options": "Currency", "print_hide": 1, "read_only": 1, - "reqd": 1 + "reqd": 1, + "show_days": 1, + "show_seconds": 1 }, { "description": "Rate at which Price list currency is converted to company's base currency", @@ -391,7 +453,9 @@ "label": "Price List Exchange Rate", "precision": "9", "print_hide": 1, - "reqd": 1 + "reqd": 1, + "show_days": 1, + "show_seconds": 1 }, { "default": "0", @@ -400,13 +464,17 @@ "label": "Ignore Pricing Rule", "no_copy": 1, "permlevel": 1, - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "items_section", "fieldtype": "Section Break", "oldfieldtype": "Section Break", - "options": "fa fa-shopping-cart" + "options": "fa fa-shopping-cart", + "show_days": 1, + "show_seconds": 1 }, { "allow_bulk_edit": 1, @@ -417,29 +485,39 @@ "oldfieldtype": "Table", "options": "Quotation Item", "reqd": 1, + "show_days": 1, + "show_seconds": 1, "width": "40px" }, { "fieldname": "pricing_rule_details", "fieldtype": "Section Break", - "label": "Pricing Rules" + "label": "Pricing Rules", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "pricing_rules", "fieldtype": "Table", "label": "Pricing Rule Detail", "options": "Pricing Rule Detail", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "sec_break23", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "total_qty", "fieldtype": "Float", "label": "Total Quantity", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "base_total", @@ -447,7 +525,9 @@ "label": "Total (Company Currency)", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "base_net_total", @@ -458,18 +538,24 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "100px" }, { "fieldname": "column_break_28", - "fieldtype": "Column Break" + "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "total", "fieldtype": "Currency", "label": "Total", "options": "currency", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "net_total", @@ -477,32 +563,42 @@ "label": "Net Total", "options": "currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "total_net_weight", "fieldtype": "Float", "label": "Total Net Weight", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "taxes_section", "fieldtype": "Section Break", "label": "Taxes and Charges", "oldfieldtype": "Section Break", - "options": "fa fa-money" + "options": "fa fa-money", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "tax_category", "fieldtype": "Link", "label": "Tax Category", "options": "Tax Category", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break_34", - "fieldtype": "Column Break" + "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "shipping_rule", @@ -510,11 +606,15 @@ "label": "Shipping Rule", "oldfieldtype": "Button", "options": "Shipping Rule", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "section_break_36", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "taxes_and_charges", @@ -523,7 +623,9 @@ "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Template", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "taxes", @@ -531,13 +633,17 @@ "label": "Sales Taxes and Charges", "oldfieldname": "other_charges", "oldfieldtype": "Table", - "options": "Sales Taxes and Charges" + "options": "Sales Taxes and Charges", + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, "fieldname": "sec_tax_breakup", "fieldtype": "Section Break", - "label": "Tax Breakup" + "label": "Tax Breakup", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "other_charges_calculation", @@ -546,11 +652,15 @@ "no_copy": 1, "oldfieldtype": "HTML", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "section_break_39", - "fieldtype": "Section Break" + "fieldtype": "Section Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "base_total_taxes_and_charges", @@ -560,11 +670,15 @@ "oldfieldtype": "Currency", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break_42", - "fieldtype": "Column Break" + "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "total_taxes_and_charges", @@ -572,26 +686,34 @@ "label": "Total Taxes and Charges", "options": "currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, "collapsible_depends_on": "discount_amount", "fieldname": "section_break_44", "fieldtype": "Section Break", - "label": "Additional Discount and Coupon Code" + "label": "Additional Discount and Coupon Code", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "coupon_code", "fieldtype": "Link", "label": "Coupon Code", - "options": "Coupon Code" + "options": "Coupon Code", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "referral_sales_partner", "fieldtype": "Link", "label": "Referral Sales Partner", - "options": "Sales Partner" + "options": "Sales Partner", + "show_days": 1, + "show_seconds": 1 }, { "default": "Grand Total", @@ -599,7 +721,9 @@ "fieldtype": "Select", "label": "Apply Additional Discount On", "options": "\nGrand Total\nNet Total", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "base_discount_amount", @@ -607,31 +731,41 @@ "label": "Additional Discount Amount (Company Currency)", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break_46", - "fieldtype": "Column Break" + "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "additional_discount_percentage", "fieldtype": "Float", "label": "Additional Discount Percentage", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "discount_amount", "fieldtype": "Currency", "label": "Additional Discount Amount", "options": "currency", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "totals", "fieldtype": "Section Break", "oldfieldtype": "Section Break", "options": "fa fa-money", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "base_grand_total", @@ -642,6 +776,8 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { @@ -651,7 +787,9 @@ "no_copy": 1, "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "description": "In Words will be visible once you save the Quotation.", @@ -663,6 +801,8 @@ "oldfieldtype": "Data", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { @@ -674,6 +814,8 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { @@ -681,6 +823,8 @@ "fieldtype": "Column Break", "oldfieldtype": "Column Break", "print_hide": 1, + "show_days": 1, + "show_seconds": 1, "width": "50%" }, { @@ -692,6 +836,8 @@ "oldfieldtype": "Currency", "options": "currency", "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { @@ -701,7 +847,9 @@ "no_copy": 1, "options": "currency", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "bold": 1, @@ -712,6 +860,8 @@ "oldfieldtype": "Currency", "options": "currency", "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { @@ -723,19 +873,25 @@ "oldfieldtype": "Data", "print_hide": 1, "read_only": 1, + "show_days": 1, + "show_seconds": 1, "width": "200px" }, { "fieldname": "payment_schedule_section", "fieldtype": "Section Break", - "label": "Payment Terms" + "label": "Payment Terms", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "payment_terms_template", "fieldtype": "Link", "label": "Payment Terms Template", "options": "Payment Terms Template", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "payment_schedule", @@ -743,7 +899,9 @@ "label": "Payment Schedule", "no_copy": 1, "options": "Payment Schedule", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, @@ -752,7 +910,9 @@ "fieldtype": "Section Break", "label": "Terms and Conditions", "oldfieldtype": "Section Break", - "options": "fa fa-legal" + "options": "fa fa-legal", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "tc_name", @@ -762,20 +922,26 @@ "oldfieldtype": "Link", "options": "Terms and Conditions", "print_hide": 1, - "report_hide": 1 + "report_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "terms", "fieldtype": "Text Editor", "label": "Term Details", "oldfieldname": "terms", - "oldfieldtype": "Text Editor" + "oldfieldtype": "Text Editor", + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, "fieldname": "print_settings", "fieldtype": "Section Break", - "label": "Print Settings" + "label": "Print Settings", + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -785,7 +951,9 @@ "oldfieldname": "letter_head", "oldfieldtype": "Select", "options": "Letter Head", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -793,11 +961,15 @@ "fieldname": "group_same_items", "fieldtype": "Check", "label": "Group same items", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break_73", - "fieldtype": "Column Break" + "fieldtype": "Column Break", + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -809,19 +981,25 @@ "oldfieldtype": "Link", "options": "Print Heading", "print_hide": 1, - "report_hide": 1 + "report_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "language", "fieldtype": "Data", "label": "Print Language", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "subscription_section", "fieldtype": "Section Break", - "label": "Auto Repeat Section" + "label": "Auto Repeat Section", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "auto_repeat", @@ -830,14 +1008,18 @@ "no_copy": 1, "options": "Auto Repeat", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, "depends_on": "eval: doc.auto_repeat", "fieldname": "update_auto_repeat_reference", "fieldtype": "Button", - "label": "Update Auto Repeat Reference" + "label": "Update Auto Repeat Reference", + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, @@ -846,7 +1028,9 @@ "label": "More Information", "oldfieldtype": "Section Break", "options": "fa fa-file-text", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "campaign", @@ -855,7 +1039,9 @@ "oldfieldname": "campaign", "oldfieldtype": "Link", "options": "Campaign", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "source", @@ -864,7 +1050,9 @@ "oldfieldname": "source", "oldfieldtype": "Select", "options": "Lead Source", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -875,13 +1063,17 @@ "no_copy": 1, "oldfieldname": "order_lost_reason", "oldfieldtype": "Small Text", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "column_break4", "fieldtype": "Column Break", "oldfieldtype": "Column Break", "print_hide": 1, + "show_days": 1, + "show_seconds": 1, "width": "50%" }, { @@ -896,7 +1088,9 @@ "options": "Draft\nOpen\nReplied\nOrdered\nLost\nCancelled\nExpired", "print_hide": 1, "read_only": 1, - "reqd": 1 + "reqd": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "enq_det", @@ -906,13 +1100,17 @@ "oldfieldname": "enq_det", "oldfieldtype": "Text", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "supplier_quotation", "fieldtype": "Link", "label": "Supplier Quotation", - "options": "Supplier Quotation" + "options": "Supplier Quotation", + "show_days": 1, + "show_seconds": 1 }, { "fieldname": "opportunity", @@ -920,7 +1118,9 @@ "label": "Opportunity", "options": "Opportunity", "print_hide": 1, - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "allow_on_submit": 1, @@ -928,7 +1128,9 @@ "fieldtype": "Table MultiSelect", "label": "Lost Reasons", "options": "Quotation Lost Reason Detail", - "read_only": 1 + "read_only": 1, + "show_days": 1, + "show_seconds": 1 }, { "depends_on": "packed_items", @@ -936,7 +1138,9 @@ "fieldtype": "Table", "label": "Bundle Items", "options": "Packed Item", - "print_hide": 1 + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 }, { "collapsible": 1, @@ -946,6 +1150,7 @@ "fieldtype": "Section Break", "label": "Bundle Items", "options": "fa fa-suitcase", +<<<<<<< HEAD "print_hide": 1 }, { @@ -955,13 +1160,34 @@ "label": "Competitors", "options": "Competitor Detail", "read_only": 1 +======= + "print_hide": 1, + "show_days": 1, + "show_seconds": 1 + }, + { + "fieldname": "company_address", + "fieldtype": "Link", + "label": "Company Address Name", + "options": "Address", + "show_days": 1, + "show_seconds": 1 + }, + { + "fieldname": "company_address_display", + "fieldtype": "Small Text", + "label": "Company Address", + "read_only": 1, + "show_days": 1, + "show_seconds": 1 +>>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) } ], "icon": "fa fa-shopping-cart", "idx": 82, "is_submittable": 1, "links": [], - "modified": "2021-11-30 01:33:21.106073", + "modified": "2022-03-23 16:49:36.297403", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/regional/india.js b/erpnext/selling/doctype/quotation/regional/india.js new file mode 100644 index 0000000000..955083565b --- /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'); From 485f5cfdfedfe935efbf2be1c089b4a13defd586 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 2 Apr 2022 17:25:29 +0530 Subject: [PATCH 2/4] fix: Resolve conflicts --- erpnext/patches.txt | 8 +- erpnext/regional/india/setup.py | 22 +- .../selling/doctype/quotation/quotation.json | 394 ++++-------------- 3 files changed, 89 insertions(+), 335 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 83464aec31..a64a72e1a6 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -356,7 +356,6 @@ erpnext.patches.v13_0.update_exchange_rate_settings erpnext.patches.v14_0.delete_amazon_mws_doctype erpnext.patches.v13_0.set_work_order_qty_in_so_from_mr erpnext.patches.v13_0.update_accounts_in_loan_docs -<<<<<<< HEAD erpnext.patches.v14_0.update_batch_valuation_flag erpnext.patches.v14_0.delete_non_profit_doctypes erpnext.patches.v14_0.update_employee_advance_status @@ -364,9 +363,4 @@ erpnext.patches.v13_0.add_cost_center_in_loans 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.remove_unknown_links_to_prod_plan_items -erpnext.patches.v13_0.rename_non_profit_fields -erpnext.patches.v13_0.enable_ksa_vat_docs #1 -erpnext.patches.v13_0.create_gst_custom_fields_in_quotation ->>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) +erpnext.patches.v13_0.create_gst_custom_fields_in_quotation \ No newline at end of file diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index a7938e093c..446faaa708 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -909,7 +909,6 @@ def get_custom_fields(): read_only=1, ), ], -<<<<<<< HEAD "Purchase Invoice": purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields @@ -931,6 +930,7 @@ def get_custom_fields(): "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", @@ -948,26 +948,6 @@ def get_custom_fields(): dict( fieldname="is_non_gst", label="Is Non GST ", fieldtype="Check", insert_after="is_nil_exempt" ), -======= - 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields, - 'Purchase Order': purchase_invoice_gst_fields, - 'Purchase Receipt': purchase_invoice_gst_fields, - 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields + si_ewaybill_fields + si_einvoice_fields, - 'POS Invoice': sales_invoice_gst_fields, - 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields + sales_invoice_shipping_fields + delivery_note_gst_category, - 'Payment Entry': payment_entry_fields, - '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', label='HSN/SAC', - fieldtype='Link', options='GST HSN Code', insert_after='item_group'), - dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted', - fieldtype='Check', insert_after='gst_hsn_code'), - dict(fieldname='is_non_gst', label='Is Non GST ', - fieldtype='Check', insert_after='is_nil_exempt') ->>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) ], "Quotation Item": [hsn_sac_field, nil_rated_exempt, is_non_gst], "Supplier Quotation Item": [hsn_sac_field, nil_rated_exempt, is_non_gst], diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 018682ff80..b069e62274 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -112,16 +112,13 @@ "enq_det", "supplier_quotation", "opportunity", - "lost_reasons", - "competitors" + "lost_reasons" ], "fields": [ { "fieldname": "customer_section", "fieldtype": "Section Break", - "options": "fa fa-user", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-user" }, { "allow_on_submit": 1, @@ -131,9 +128,7 @@ "hidden": 1, "label": "Title", "no_copy": 1, - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "naming_series", @@ -145,9 +140,7 @@ "options": "SAL-QTN-.YYYY.-", "print_hide": 1, "reqd": 1, - "set_only_once": 1, - "show_days": 1, - "show_seconds": 1 + "set_only_once": 1 }, { "default": "Customer", @@ -159,9 +152,7 @@ "oldfieldtype": "Select", "options": "DocType", "print_hide": 1, - "reqd": 1, - "show_days": 1, - "show_seconds": 1 + "reqd": 1 }, { "bold": 1, @@ -174,9 +165,7 @@ "oldfieldtype": "Link", "options": "quotation_to", "print_hide": 1, - "search_index": 1, - "show_days": 1, - "show_seconds": 1 + "search_index": 1 }, { "bold": 1, @@ -185,16 +174,12 @@ "hidden": 1, "in_global_search": 1, "label": "Customer Name", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "column_break1", "fieldtype": "Column Break", "oldfieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1, "width": "50%" }, { @@ -208,8 +193,6 @@ "options": "Quotation", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "150px" }, { @@ -222,8 +205,6 @@ "print_hide": 1, "remember_last_selected_value": 1, "reqd": 1, - "show_days": 1, - "show_seconds": 1, "width": "150px" }, { @@ -238,16 +219,12 @@ "oldfieldtype": "Date", "reqd": 1, "search_index": 1, - "show_days": 1, - "show_seconds": 1, "width": "100px" }, { "fieldname": "valid_till", "fieldtype": "Date", - "label": "Valid Till", - "show_days": 1, - "show_seconds": 1 + "label": "Valid Till" }, { "default": "Sales", @@ -259,9 +236,7 @@ "oldfieldtype": "Select", "options": "\nSales\nMaintenance\nShopping Cart", "print_hide": 1, - "reqd": 1, - "show_days": 1, - "show_seconds": 1 + "reqd": 1 }, { "collapsible": 1, @@ -269,18 +244,14 @@ "fieldname": "contact_section", "fieldtype": "Section Break", "label": "Address and Contact", - "options": "fa fa-bullhorn", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-bullhorn" }, { "fieldname": "customer_address", "fieldtype": "Link", "label": "Customer Address", "options": "Address", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "address_display", @@ -288,9 +259,7 @@ "label": "Address", "oldfieldname": "customer_address", "oldfieldtype": "Small Text", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "contact_person", @@ -299,26 +268,20 @@ "oldfieldname": "contact_person", "oldfieldtype": "Link", "options": "Contact", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "contact_display", "fieldtype": "Small Text", "in_global_search": 1, "label": "Contact", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "contact_mobile", "fieldtype": "Small Text", "label": "Mobile No", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "contact_email", @@ -327,16 +290,12 @@ "label": "Contact Email", "options": "Email", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "depends_on": "eval:doc.quotaion_to=='Customer' && doc.party_name", "fieldname": "col_break98", "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1, "width": "50%" }, { @@ -344,18 +303,14 @@ "fieldtype": "Link", "label": "Shipping Address", "options": "Address", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "shipping_address", "fieldtype": "Small Text", "label": "Shipping Address", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "depends_on": "eval:doc.quotaion_to=='Customer' && doc.party_name", @@ -366,27 +321,21 @@ "oldfieldname": "customer_group", "oldfieldtype": "Link", "options": "Customer Group", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "territory", "fieldtype": "Link", "label": "Territory", "options": "Territory", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "collapsible": 1, "fieldname": "currency_and_price_list", "fieldtype": "Section Break", "label": "Currency and Price List", - "options": "fa fa-tag", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-tag" }, { "fieldname": "currency", @@ -397,8 +346,6 @@ "options": "Currency", "print_hide": 1, "reqd": 1, - "show_days": 1, - "show_seconds": 1, "width": "100px" }, { @@ -411,15 +358,11 @@ "precision": "9", "print_hide": 1, "reqd": 1, - "show_days": 1, - "show_seconds": 1, "width": "100px" }, { "fieldname": "column_break2", "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1, "width": "50%" }, { @@ -431,8 +374,6 @@ "options": "Price List", "print_hide": 1, "reqd": 1, - "show_days": 1, - "show_seconds": 1, "width": "100px" }, { @@ -442,9 +383,7 @@ "options": "Currency", "print_hide": 1, "read_only": 1, - "reqd": 1, - "show_days": 1, - "show_seconds": 1 + "reqd": 1 }, { "description": "Rate at which Price list currency is converted to company's base currency", @@ -453,9 +392,7 @@ "label": "Price List Exchange Rate", "precision": "9", "print_hide": 1, - "reqd": 1, - "show_days": 1, - "show_seconds": 1 + "reqd": 1 }, { "default": "0", @@ -464,17 +401,13 @@ "label": "Ignore Pricing Rule", "no_copy": 1, "permlevel": 1, - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "items_section", "fieldtype": "Section Break", "oldfieldtype": "Section Break", - "options": "fa fa-shopping-cart", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-shopping-cart" }, { "allow_bulk_edit": 1, @@ -485,39 +418,29 @@ "oldfieldtype": "Table", "options": "Quotation Item", "reqd": 1, - "show_days": 1, - "show_seconds": 1, "width": "40px" }, { "fieldname": "pricing_rule_details", "fieldtype": "Section Break", - "label": "Pricing Rules", - "show_days": 1, - "show_seconds": 1 + "label": "Pricing Rules" }, { "fieldname": "pricing_rules", "fieldtype": "Table", "label": "Pricing Rule Detail", "options": "Pricing Rule Detail", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "sec_break23", - "fieldtype": "Section Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Section Break" }, { "fieldname": "total_qty", "fieldtype": "Float", "label": "Total Quantity", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "base_total", @@ -525,9 +448,7 @@ "label": "Total (Company Currency)", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "base_net_total", @@ -538,24 +459,18 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "100px" }, { "fieldname": "column_break_28", - "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Column Break" }, { "fieldname": "total", "fieldtype": "Currency", "label": "Total", "options": "currency", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "net_total", @@ -563,42 +478,32 @@ "label": "Net Total", "options": "currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "total_net_weight", "fieldtype": "Float", "label": "Total Net Weight", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "taxes_section", "fieldtype": "Section Break", "label": "Taxes and Charges", "oldfieldtype": "Section Break", - "options": "fa fa-money", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-money" }, { "fieldname": "tax_category", "fieldtype": "Link", "label": "Tax Category", "options": "Tax Category", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "column_break_34", - "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Column Break" }, { "fieldname": "shipping_rule", @@ -606,15 +511,11 @@ "label": "Shipping Rule", "oldfieldtype": "Button", "options": "Shipping Rule", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "section_break_36", - "fieldtype": "Section Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Section Break" }, { "fieldname": "taxes_and_charges", @@ -623,9 +524,7 @@ "oldfieldname": "charge", "oldfieldtype": "Link", "options": "Sales Taxes and Charges Template", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "taxes", @@ -633,17 +532,13 @@ "label": "Sales Taxes and Charges", "oldfieldname": "other_charges", "oldfieldtype": "Table", - "options": "Sales Taxes and Charges", - "show_days": 1, - "show_seconds": 1 + "options": "Sales Taxes and Charges" }, { "collapsible": 1, "fieldname": "sec_tax_breakup", "fieldtype": "Section Break", - "label": "Tax Breakup", - "show_days": 1, - "show_seconds": 1 + "label": "Tax Breakup" }, { "fieldname": "other_charges_calculation", @@ -652,15 +547,11 @@ "no_copy": 1, "oldfieldtype": "HTML", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "section_break_39", - "fieldtype": "Section Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Section Break" }, { "fieldname": "base_total_taxes_and_charges", @@ -670,15 +561,11 @@ "oldfieldtype": "Currency", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "column_break_42", - "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Column Break" }, { "fieldname": "total_taxes_and_charges", @@ -686,34 +573,26 @@ "label": "Total Taxes and Charges", "options": "currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "collapsible": 1, "collapsible_depends_on": "discount_amount", "fieldname": "section_break_44", "fieldtype": "Section Break", - "label": "Additional Discount and Coupon Code", - "show_days": 1, - "show_seconds": 1 + "label": "Additional Discount and Coupon Code" }, { "fieldname": "coupon_code", "fieldtype": "Link", "label": "Coupon Code", - "options": "Coupon Code", - "show_days": 1, - "show_seconds": 1 + "options": "Coupon Code" }, { "fieldname": "referral_sales_partner", "fieldtype": "Link", "label": "Referral Sales Partner", - "options": "Sales Partner", - "show_days": 1, - "show_seconds": 1 + "options": "Sales Partner" }, { "default": "Grand Total", @@ -721,9 +600,7 @@ "fieldtype": "Select", "label": "Apply Additional Discount On", "options": "\nGrand Total\nNet Total", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "base_discount_amount", @@ -731,41 +608,31 @@ "label": "Additional Discount Amount (Company Currency)", "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "column_break_46", - "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Column Break" }, { "fieldname": "additional_discount_percentage", "fieldtype": "Float", "label": "Additional Discount Percentage", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "discount_amount", "fieldtype": "Currency", "label": "Additional Discount Amount", "options": "currency", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "totals", "fieldtype": "Section Break", "oldfieldtype": "Section Break", "options": "fa fa-money", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "base_grand_total", @@ -776,8 +643,6 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { @@ -787,9 +652,7 @@ "no_copy": 1, "options": "Company:company:default_currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "description": "In Words will be visible once you save the Quotation.", @@ -801,8 +664,6 @@ "oldfieldtype": "Data", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { @@ -814,8 +675,6 @@ "options": "Company:company:default_currency", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { @@ -823,8 +682,6 @@ "fieldtype": "Column Break", "oldfieldtype": "Column Break", "print_hide": 1, - "show_days": 1, - "show_seconds": 1, "width": "50%" }, { @@ -836,8 +693,6 @@ "oldfieldtype": "Currency", "options": "currency", "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { @@ -847,9 +702,7 @@ "no_copy": 1, "options": "currency", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "bold": 1, @@ -860,8 +713,6 @@ "oldfieldtype": "Currency", "options": "currency", "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { @@ -873,25 +724,19 @@ "oldfieldtype": "Data", "print_hide": 1, "read_only": 1, - "show_days": 1, - "show_seconds": 1, "width": "200px" }, { "fieldname": "payment_schedule_section", "fieldtype": "Section Break", - "label": "Payment Terms", - "show_days": 1, - "show_seconds": 1 + "label": "Payment Terms" }, { "fieldname": "payment_terms_template", "fieldtype": "Link", "label": "Payment Terms Template", "options": "Payment Terms Template", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "payment_schedule", @@ -899,9 +744,7 @@ "label": "Payment Schedule", "no_copy": 1, "options": "Payment Schedule", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "collapsible": 1, @@ -910,9 +753,7 @@ "fieldtype": "Section Break", "label": "Terms and Conditions", "oldfieldtype": "Section Break", - "options": "fa fa-legal", - "show_days": 1, - "show_seconds": 1 + "options": "fa fa-legal" }, { "fieldname": "tc_name", @@ -922,26 +763,20 @@ "oldfieldtype": "Link", "options": "Terms and Conditions", "print_hide": 1, - "report_hide": 1, - "show_days": 1, - "show_seconds": 1 + "report_hide": 1 }, { "fieldname": "terms", "fieldtype": "Text Editor", "label": "Term Details", "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "show_days": 1, - "show_seconds": 1 + "oldfieldtype": "Text Editor" }, { "collapsible": 1, "fieldname": "print_settings", "fieldtype": "Section Break", - "label": "Print Settings", - "show_days": 1, - "show_seconds": 1 + "label": "Print Settings" }, { "allow_on_submit": 1, @@ -951,9 +786,7 @@ "oldfieldname": "letter_head", "oldfieldtype": "Select", "options": "Letter Head", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "allow_on_submit": 1, @@ -961,15 +794,11 @@ "fieldname": "group_same_items", "fieldtype": "Check", "label": "Group same items", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "column_break_73", - "fieldtype": "Column Break", - "show_days": 1, - "show_seconds": 1 + "fieldtype": "Column Break" }, { "allow_on_submit": 1, @@ -981,25 +810,19 @@ "oldfieldtype": "Link", "options": "Print Heading", "print_hide": 1, - "report_hide": 1, - "show_days": 1, - "show_seconds": 1 + "report_hide": 1 }, { "fieldname": "language", "fieldtype": "Data", "label": "Print Language", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "subscription_section", "fieldtype": "Section Break", - "label": "Auto Repeat Section", - "show_days": 1, - "show_seconds": 1 + "label": "Auto Repeat Section" }, { "fieldname": "auto_repeat", @@ -1008,18 +831,14 @@ "no_copy": 1, "options": "Auto Repeat", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "allow_on_submit": 1, "depends_on": "eval: doc.auto_repeat", "fieldname": "update_auto_repeat_reference", "fieldtype": "Button", - "label": "Update Auto Repeat Reference", - "show_days": 1, - "show_seconds": 1 + "label": "Update Auto Repeat Reference" }, { "collapsible": 1, @@ -1028,9 +847,7 @@ "label": "More Information", "oldfieldtype": "Section Break", "options": "fa fa-file-text", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "campaign", @@ -1039,9 +856,7 @@ "oldfieldname": "campaign", "oldfieldtype": "Link", "options": "Campaign", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "source", @@ -1050,9 +865,7 @@ "oldfieldname": "source", "oldfieldtype": "Select", "options": "Lead Source", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "allow_on_submit": 1, @@ -1063,17 +876,13 @@ "no_copy": 1, "oldfieldname": "order_lost_reason", "oldfieldtype": "Small Text", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "fieldname": "column_break4", "fieldtype": "Column Break", "oldfieldtype": "Column Break", "print_hide": 1, - "show_days": 1, - "show_seconds": 1, "width": "50%" }, { @@ -1088,9 +897,7 @@ "options": "Draft\nOpen\nReplied\nOrdered\nLost\nCancelled\nExpired", "print_hide": 1, "read_only": 1, - "reqd": 1, - "show_days": 1, - "show_seconds": 1 + "reqd": 1 }, { "fieldname": "enq_det", @@ -1100,17 +907,13 @@ "oldfieldname": "enq_det", "oldfieldtype": "Text", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "fieldname": "supplier_quotation", "fieldtype": "Link", "label": "Supplier Quotation", - "options": "Supplier Quotation", - "show_days": 1, - "show_seconds": 1 + "options": "Supplier Quotation" }, { "fieldname": "opportunity", @@ -1118,9 +921,7 @@ "label": "Opportunity", "options": "Opportunity", "print_hide": 1, - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "allow_on_submit": 1, @@ -1128,9 +929,7 @@ "fieldtype": "Table MultiSelect", "label": "Lost Reasons", "options": "Quotation Lost Reason Detail", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 + "read_only": 1 }, { "depends_on": "packed_items", @@ -1138,9 +937,7 @@ "fieldtype": "Table", "label": "Bundle Items", "options": "Packed Item", - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 + "print_hide": 1 }, { "collapsible": 1, @@ -1150,44 +947,26 @@ "fieldtype": "Section Break", "label": "Bundle Items", "options": "fa fa-suitcase", -<<<<<<< HEAD "print_hide": 1 }, - { - "allow_on_submit": 1, - "fieldname": "competitors", - "fieldtype": "Table MultiSelect", - "label": "Competitors", - "options": "Competitor Detail", - "read_only": 1 -======= - "print_hide": 1, - "show_days": 1, - "show_seconds": 1 - }, { "fieldname": "company_address", "fieldtype": "Link", "label": "Company Address Name", - "options": "Address", - "show_days": 1, - "show_seconds": 1 + "options": "Address" }, { "fieldname": "company_address_display", "fieldtype": "Small Text", "label": "Company Address", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 ->>>>>>> 7cae669e81 (fix(India): Auto tax fetching based on GSTIN) + "read_only": 1 } ], "icon": "fa fa-shopping-cart", "idx": 82, "is_submittable": 1, "links": [], - "modified": "2022-03-23 16:49:36.297403", + "modified": "2022-04-02 17:21:48.578719", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", @@ -1282,6 +1061,7 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", + "states": [], "timeline_field": "party_name", "title_field": "title" } \ No newline at end of file From c58fde2fb262bf2fa15eea72cecc7616e3943ca6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 2 Apr 2022 20:03:46 +0530 Subject: [PATCH 3/4] fix: Add competitor field back --- erpnext/selling/doctype/quotation/quotation.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index b069e62274..b597654221 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -112,7 +112,8 @@ "enq_det", "supplier_quotation", "opportunity", - "lost_reasons" + "lost_reasons", + "competitors" ], "fields": [ { @@ -949,6 +950,13 @@ "options": "fa fa-suitcase", "print_hide": 1 }, + { + "allow_on_submit": 1, + "fieldname": "competitors", + "fieldtype": "Table MultiSelect", + "label": "Competitors", + "options": "Competitor Detail" + }, { "fieldname": "company_address", "fieldtype": "Link", @@ -966,7 +974,7 @@ "idx": 82, "is_submittable": 1, "links": [], - "modified": "2022-04-02 17:21:48.578719", + "modified": "2022-04-03 17:21:48.578719", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", From a7e125a54083be62ba8f80dee0542360140888f8 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sat, 2 Apr 2022 20:36:36 +0530 Subject: [PATCH 4/4] chore: format patch file --- .../create_gst_custom_fields_in_quotation.py | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) 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 index 840b8fd830..3217eab43d 100644 --- a/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py +++ b/erpnext/patches/v13_0/create_gst_custom_fields_in_quotation.py @@ -3,27 +3,51 @@ from frappe.custom.doctype.custom_field.custom_field import create_custom_fields def execute(): - company = frappe.get_all('Company', filters = {'country': 'India'}, fields=['name']) + 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), - ] + 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 - } + custom_fields = {"Quotation": sales_invoice_gst_fields} - create_custom_fields(custom_fields, update=True) \ No newline at end of file + create_custom_fields(custom_fields, update=True)