diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index f03f4d8800c0..65d348511d2c 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -96,6 +96,7 @@ "sales_order", "so_detail", "sales_invoice_item", + "subscription_plan", "column_break_74", "delivery_note", "dn_detail", @@ -222,12 +223,12 @@ "collapsible": 1, "fieldname": "comisi\u00f3n_section", "fieldtype": "Section Break", - "label": "ComisiĆ³n Vendedores por Producto" + "label": "Comisi\u00f3n Vendedores por Producto" }, { "fieldname": "porcentaje_comision", "fieldtype": "Percent", - "label": "ComisiĆ³n %" + "label": "Comisi\u00f3n %" }, { "fieldname": "column_break_53", @@ -861,18 +862,25 @@ "fieldtype": "Check", "label": "Grant Commission", "read_only": 1 + }, + { + "fieldname": "subscription_plan", + "fieldtype": "Link", + "label": "Subscription Plan", + "options": "Subscription Plan", + "read_only": 1 } ], "idx": 1, "istable": 1, "links": [], - "modified": "2021-08-20 16:42:53.435827", + "modified": "2024-10-03 16:39:41.672280", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", - "naming_rule": "Random", "owner": "Administrator", "permissions": [], + "route": "app/doctype/Sales%20Invoice%20Item", "sort_field": "modified", "sort_order": "DESC" -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index 4a3be7f68854..347069d62698 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -489,13 +489,14 @@ def get_items_from_plans(self, plans, prorate=0): item = {'item_code': item_code, 'qty': plan.qty, 'rate': get_plan_rate(plan.plan, plan.qty, party, self.current_invoice_start, self.current_invoice_end, prorate_factor, doctype, company), 'cost_center': plan_doc.cost_center} - + if doctype == "Sales Invoice": + item["subscription_plan"] = plan_doc.name if deferred: item.update({ deferred_field: deferred, 'service_start_date': self.current_invoice_start, - 'service_end_date': self.current_invoice_end + 'service_end_date': self.current_invoice_end, }) accounting_dimensions = get_accounting_dimensions()