diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 6990c5b0dd..25e7891a49 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -666,6 +666,7 @@ class GrossProfitGenerator(object): def get_buying_amount_from_so_dn(self, sales_order, so_detail, item_code): from frappe.query_builder.functions import Sum + delivery_note = frappe.qb.DocType("Delivery Note") delivery_note_item = frappe.qb.DocType("Delivery Note Item") @@ -673,9 +674,7 @@ class GrossProfitGenerator(object): frappe.qb.from_(delivery_note) .inner_join(delivery_note_item) .on(delivery_note.name == delivery_note_item.parent) - .select( - Sum(delivery_note_item.incoming_rate * delivery_note_item.stock_qty) - ) + .select(Sum(delivery_note_item.incoming_rate * delivery_note_item.stock_qty)) .where(delivery_note.docstatus == 1) .where(delivery_note_item.item_code == item_code) .where(delivery_note_item.against_sales_order == sales_order)