Skip to content

Commit

Permalink
feat(gp): group by cost center
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdany10 committed Jun 3, 2024
1 parent d165638 commit e26bc17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion erpnext/accounts/report/gross_profit/gross_profit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ frappe.query_reports["Gross Profit"] = {
label: __("Group By"),
fieldtype: "Select",
options:
"Invoice\nItem Code\nItem Group\nBrand\nWarehouse\nCustomer\nCustomer Group\nTerritory\nSales Person\nProject\nMonthly\nPayment Term",
"Invoice\nItem Code\nItem Group\nBrand\nWarehouse\nCustomer\nCustomer Group\nTerritory\nSales Person\nProject\nCost Center\nMonthly\nPayment Term",
default: "Invoice",
},
{
Expand Down
16 changes: 15 additions & 1 deletion erpnext/accounts/report/gross_profit/gross_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ def execute(filters=None):
"gross_profit_percent",
],
"project": ["project", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"],
"cost_center": [
"cost_center",
"base_amount",
"buying_amount",
"gross_profit",
"gross_profit_percent",
],
"territory": [
"territory",
"base_amount",
Expand Down Expand Up @@ -304,7 +311,14 @@ def get_columns(group_wise_columns, filters):
"fieldname": "project",
"fieldtype": "Link",
"options": "Project",
"width": 100,
"width": 140,
},
"cost_center": {
"label": _("Cost Center"),
"fieldname": "cost_center",
"fieldtype": "Link",
"options": "Cost Center",
"width": 140,
},
"sales_person": {
"label": _("Sales Person"),
Expand Down

0 comments on commit e26bc17

Please sign in to comment.