diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 5081c450151..367fe4f4fd2 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -178,7 +178,12 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_ # to display item as Item Code: Item Name columns[0] = "Sales Invoice:Link/Item:300" # removing Item Code and Item Name columns - del columns[4:6] + supplier_master_name = frappe.db.get_single_value("Buying Settings", "supp_master_name") + customer_master_name = frappe.db.get_single_value("Selling Settings", "cust_master_name") + if supplier_master_name == "Supplier Name" and customer_master_name == "Customer Name": + del columns[4:6] + else: + del columns[5:7] total_base_amount = 0 total_buying_amount = 0 @@ -275,7 +280,7 @@ def get_columns(group_wise_columns, filters): "label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", - "width": 100, + "width": 120, }, "posting_time": { "label": _("Posting Time"),