diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json index 0807f07d8d9..7d0b80c8283 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.json +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json @@ -16,6 +16,7 @@ "invoicing_features_section", "check_supplier_invoice_uniqueness", "automatically_fetch_payment_terms", + "enable_subscription", "column_break_17", "enable_common_party_accounting", "allow_multi_currency_invoices_against_single_party_account", diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 693d0918d20..fa36f1de183 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -77,6 +77,7 @@ class AccountsSettings(Document): enable_immutable_ledger: DF.Check enable_loyalty_point_program: DF.Check enable_party_matching: DF.Check + enable_subscription: DF.Check exchange_gain_loss_posting_date: DF.Literal["Invoice", "Payment", "Reconciliation Date"] fetch_payment_schedule_in_payment_request: DF.Check fetch_valuation_rate_for_internal_transaction: DF.Check @@ -142,6 +143,10 @@ class AccountsSettings(Document): toggle_loyalty_point_program_section(not self.enable_loyalty_point_program) clear_cache = True + if old_doc.enable_subscription != self.enable_subscription: + toggle_subscription_sections(not self.enable_subscription) + clear_cache = True + if clear_cache: frappe.clear_cache() @@ -234,6 +239,12 @@ def toggle_loyalty_point_program_section(hide): create_property_setter_for_hiding_field(doctype, "loyalty_points_redemption", hide) +def toggle_subscription_sections(hide): + subscription_doctypes = frappe.get_hooks("subscription_doctypes") + for doctype in subscription_doctypes: + create_property_setter_for_hiding_field(doctype, "subscription_section", hide) + + def create_property_setter_for_hiding_field(doctype, field_name, hide): make_property_setter( doctype, diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 0eaefb5f618..00831ce7711 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -39,7 +39,7 @@ "clearance_date", "column_break_oizh", "user_remark", - "subscription_section", + "auto_repeat_section", "auto_repeat", "tax_withholding_tab", "section_tax_withholding_entry", @@ -477,11 +477,6 @@ "options": "Stock Entry", "read_only": 1 }, - { - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Subscription" - }, { "allow_on_submit": 1, "fieldname": "auto_repeat", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index afa508781d8..5500e1b3e07 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -89,6 +89,7 @@ "remarks", "base_in_words", "is_opening", + "title", "column_break_16", "letter_head", "print_heading", @@ -96,10 +97,9 @@ "bank_account_no", "payment_order", "in_words", - "subscription_section", - "auto_repeat", "amended_from", - "title" + "auto_repeat_section", + "auto_repeat" ], "fields": [ { @@ -503,11 +503,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Subscription Section" - }, { "allow_on_submit": 1, "fieldname": "auto_repeat", @@ -781,6 +776,11 @@ "fieldname": "override_tax_withholding_entries", "fieldtype": "Check", "label": "Edit Tax Withholding Entries" + }, + { + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "grid_page_length": 50, diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json index 8fcf1f2f41f..17d8b74aa14 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.json +++ b/erpnext/accounts/doctype/payment_request/payment_request.json @@ -183,7 +183,7 @@ "depends_on": "eval:doc.is_a_subscription", "fieldname": "subscription_section", "fieldtype": "Section Break", - "label": "Subscription Section" + "label": "Subscription" }, { "fieldname": "subscription_plans", @@ -478,7 +478,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-01-13 12:53:00.963274", + "modified": "2026-02-27 19:11:03.308896", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Request", diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index ff57c811c58..c8fc266b012 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -187,7 +187,7 @@ "subscription_section", "from_date", "to_date", - "column_break_140", + "auto_repeat_section", "auto_repeat", "update_auto_repeat_reference", "against_income_account" @@ -1462,7 +1462,7 @@ { "fieldname": "subscription_section", "fieldtype": "Section Break", - "label": "Subscription Section" + "label": "Subscription" }, { "allow_on_submit": 1, @@ -1480,10 +1480,6 @@ "no_copy": 1, "print_hide": 1 }, - { - "fieldname": "column_break_140", - "fieldtype": "Column Break" - }, { "allow_on_submit": 1, "fieldname": "auto_repeat", @@ -1619,12 +1615,17 @@ { "fieldname": "column_break_bhao", "fieldtype": "Column Break" + }, + { + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "icon": "fa fa-file-text", "is_submittable": 1, "links": [], - "modified": "2026-02-10 14:23:07.181782", + "modified": "2026-03-02 07:32:47.667810", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index adb7dad6726..f7f8d8b8ffc 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -180,11 +180,12 @@ "unrealized_profit_loss_account", "subscription_section", "subscription", - "auto_repeat", - "update_auto_repeat_reference", "column_break_114", "from_date", "to_date", + "automation_section", + "auto_repeat", + "update_auto_repeat_reference", "printing_settings", "letter_head", "group_same_items", @@ -1675,6 +1676,12 @@ "fieldname": "totals_section", "fieldtype": "Section Break", "label": "Totals" + }, + { + "collapsible": 1, + "fieldname": "automation_section", + "fieldtype": "Section Break", + "label": "Automation" } ], "grid_page_length": 50, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 50734582dad..267b161bee5 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -91,9 +91,9 @@ "column_break_xjag", "base_rounding_adjustment", "base_rounded_total", - "section_break_vacb", + "section_break_pxwz", "total_advance", - "column_break_rdks", + "column_break_iaso", "outstanding_amount", "section_tax_withholding_entry", "tax_withholding_group", @@ -199,6 +199,7 @@ "unrealized_profit_loss_account", "against_income_account", "commission_section", + "column_break_rdiw", "sales_partner", "amount_eligible_for_commission", "column_break10", @@ -214,12 +215,14 @@ "language", "subscription_section", "subscription", - "from_date", - "auto_repeat", "column_break_140", + "from_date", "to_date", + "automation_section", + "auto_repeat", "update_auto_repeat_reference", "utm_analytics_section", + "column_break_rdke", "utm_source", "utm_medium", "column_break_ixxw", @@ -2304,14 +2307,6 @@ "options": "fa fa-group", "print_hide": 1 }, - { - "fieldname": "section_break_vacb", - "fieldtype": "Section Break" - }, - { - "fieldname": "column_break_rdks", - "fieldtype": "Column Break" - }, { "fieldname": "column_break_ixxw", "fieldtype": "Column Break" @@ -2321,6 +2316,28 @@ "fieldname": "utm_analytics_section", "fieldtype": "Section Break", "label": "UTM Analytics" + }, + { + "collapsible": 1, + "fieldname": "automation_section", + "fieldtype": "Section Break", + "label": "Automation" + }, + { + "fieldname": "section_break_pxwz", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_rdke", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_rdiw", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_iaso", + "fieldtype": "Column Break" } ], "grid_page_length": 50, @@ -2334,7 +2351,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2026-03-09 17:15:30.931929", + "modified": "2026-04-28 12:39:53.267755", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 260dc52ceac..6d59d0b9884 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -147,7 +147,7 @@ "column_break_86", "select_print_heading", "language", - "subscription_section", + "auto_repeat_section", "from_date", "to_date", "column_break_97", @@ -1013,12 +1013,6 @@ "label": "Print Language", "print_hide": 1 }, - { - "collapsible": 1, - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Auto Repeat" - }, { "allow_on_submit": 1, "fieldname": "from_date", @@ -1309,6 +1303,12 @@ "fieldtype": "Time", "label": "Time", "mandatory_depends_on": "is_internal_supplier" + }, + { + "collapsible": 1, + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "grid_page_length": 50, diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index 1328d8aebdc..bb1c048301e 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -111,7 +111,7 @@ "column_break_85", "select_print_heading", "language", - "subscription_section", + "auto_repeat_section", "auto_repeat", "update_auto_repeat_reference", "more_info", @@ -736,11 +736,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Auto Repeat" - }, { "fieldname": "auto_repeat", "fieldtype": "Link", @@ -940,6 +935,11 @@ "no_copy": 1, "options": "Item Wise Tax Detail", "print_hide": 1 + }, + { + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "grid_page_length": 50, @@ -948,7 +948,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-01-29 21:23:13.778468", + "modified": "2026-02-27 18:05:50.121391", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 2fd4be3a510..a32c033c9ec 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -581,6 +581,8 @@ accounting_dimension_doctypes = [ "Advance Taxes and Charges", ] +subscription_doctypes = ["Sales Invoice", "Purchase Invoice", "Payment Request", "POS Invoice"] + get_matching_queries = ( "erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.get_matching_queries" ) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index f5e867964e5..71d977638e8 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -109,7 +109,7 @@ "tc_name", "terms", "more_info_tab", - "subscription_section", + "auto_repeat_section", "auto_repeat", "update_auto_repeat_reference", "print_settings", @@ -832,11 +832,6 @@ "print_hide": 1, "read_only": 1 }, - { - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Auto Repeat" - }, { "fieldname": "auto_repeat", "fieldtype": "Link", @@ -1122,6 +1117,11 @@ "fieldname": "utm_analytics_section", "fieldtype": "Section Break", "label": "UTM Analytics" + }, + { + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "icon": "fa fa-shopping-cart", diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 87816741728..3109fd0e36e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -151,7 +151,7 @@ "loyalty_points", "column_break_116", "loyalty_amount", - "subscription_section", + "auto_repeat_section", "from_date", "to_date", "column_break_108", @@ -1372,18 +1372,6 @@ "options": "Sales Team", "print_hide": 1 }, - { - "allow_on_submit": 1, - "collapsible": 1, - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "hide_days": 1, - "hide_seconds": 1, - "label": "Auto Repeat", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, { "allow_on_submit": 1, "fieldname": "from_date", @@ -1742,6 +1730,18 @@ "hidden": 1, "label": "Ignore Default Payment Terms Template", "read_only": 1 + }, + { + "allow_on_submit": 1, + "collapsible": 1, + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "hide_days": 1, + "hide_seconds": 1, + "label": "Auto Repeat", + "no_copy": 1, + "print_hide": 1, + "read_only": 1 } ], "grid_page_length": 50, diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 479786a122a..e8871227c60 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -147,7 +147,7 @@ "total_commission", "section_break1", "sales_team", - "subscription_section", + "auto_repeat_section", "auto_repeat", "printing_details", "letter_head", @@ -1115,11 +1115,6 @@ "oldfieldname": "instructions", "oldfieldtype": "Text" }, - { - "fieldname": "subscription_section", - "fieldtype": "Section Break", - "label": "Subscription Section" - }, { "fieldname": "auto_repeat", "fieldtype": "Link", @@ -1446,6 +1441,11 @@ { "fieldname": "column_break_neoj", "fieldtype": "Column Break" + }, + { + "fieldname": "auto_repeat_section", + "fieldtype": "Section Break", + "label": "Auto Repeat" } ], "icon": "fa fa-truck",