Skip to content

Commit

Permalink
Desarrollo Serviplaga COT-2024-00013-1 (#879)
Browse files Browse the repository at this point in the history
* feat: subscription plan in sales invoice item

* feat: subscription plan in sales invoice item
  • Loading branch information
fproldan committed Oct 4, 2024
1 parent 7a82c80 commit b9aaae5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"sales_order",
"so_detail",
"sales_invoice_item",
"subscription_plan",
"column_break_74",
"delivery_note",
"dn_detail",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
5 changes: 3 additions & 2 deletions erpnext/accounts/doctype/subscription/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b9aaae5

Please sign in to comment.